summaryrefslogtreecommitdiffstatshomepage
path: root/py
Commit message (Collapse)AuthorAge
* py: Add option to cache map lookup results in bytecode.Damien George2015-01-07
| | | | | | | | | | | | | | | This is a simple optimisation inspired by JITing technology: we cache in the bytecode (using 1 byte) the offset of the last successful lookup in a map. This allows us next time round to check in that location in the hash table (mp_map_t) for the desired entry, and if it's there use that entry straight away. Otherwise fallback to a normal map lookup. Works for LOAD_NAME, LOAD_GLOBAL, LOAD_ATTR and STORE_ATTR opcodes. On a few tests it gives >90% cache hit and greatly improves speed of code. Disabled by default. Enabled for unix and stmhal ports.
* py: Put all global state together in state structures.Damien George2015-01-07
| | | | | | This patch consolidates all global variables in py/ core into one place, in a global structure. Root pointers are all located together to make GC tracing easier and more efficient.
* py: Temporary fix for conversion of float to int when fits in small int.Damien George2015-01-07
| | | | Addresses issue #1044 (see also #1040). Could do with a better fix.
* showbc: Show conditional jump destination as unsigned value.Paul Sokolovsky2015-01-07
| | | | | | | | This is consistent with how BC_JUMP was handled before. We never show jumps destinations relative to jump instrucion itself, only relative to beginning of function. Another useful way to show them as absolute (real memory address), and this change makes result expected and consistent with how BC_JUMP is shown.
* objarray: Make sure that longint works as bytearray size.Paul Sokolovsky2015-01-04
|
* modbuiltins.c: Fix NULL vs MP_OBJ_NULL usage.Paul Sokolovsky2015-01-04
|
* objstr: Common subexpression elimination for vstr_str(field_name).Paul Sokolovsky2015-01-04
|
* objstr: Implement kwargs support for str.format().Paul Sokolovsky2015-01-04
|
* py: Raise exception if trying to convert inf/nan to int.Damien George2015-01-02
|
* py: Fix float to int conversion for large exponents.David Steinberg2015-01-02
|
* msvc: Fix unresolved mp_arg_error_terse_mismatch since 7f23384stijn2015-01-02
| | | | | | | | The compiler treats `if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE)` as a normal statement and generates assembly for it in degug mode as if MICROPY_ERROR_REPORTING is an actual symbol instead of a preprocessor definition. As such linking fails because mp_arg_error_terse_mismatch is not defined when MICROPY_ERROR_REPORTING_TERSE is detailed or normal.
* py: Make GC's STACK_SIZE definition a proper MICROPY_ config variable.Damien George2015-01-01
|
* py: Fix windows external name error for nlr_top.Damien George2015-01-01
|
* py: Move global variable nlr_top to one place, in a .c file.Damien George2015-01-01
| | | | | This reduces dependency on assembler, and allows to consolidate global variables in the future.
* py: Move to guarded includes, everywhere in py/ core.Damien George2015-01-01
| | | | Addresses issue #1022.
* emitnative: Disable warning in delete_fast for now (breaks test).Paul Sokolovsky2015-01-01
|
* py: Add basic framework for issuing compile/runtime warnings.Paul Sokolovsky2015-01-01
|
* py: Add guarded includes for asm-based headers.Damien George2015-01-01
|
* py: Change namedtuple error messages to reduce code size.Damien George2015-01-01
| | | | | | We are not word-for-word compatible with CPython exceptions, so we are free to make them short but informative in order to reduce code size. Also, try to make messages the same as existing ones where possible.
* py: Make terse_arg_mismatch a global function and use it elsewhere.Damien George2015-01-01
| | | | Reduces code size when MICROPY_ERROR_REPORTING_TERSE is selected.
* objnamedtuple: Make sure to initialize type structure completely.Paul Sokolovsky2015-01-01
|
* py: Allow keyword arguments for namedtuplestijn2015-01-01
|
* py: Use sequence of strings for named tuple initializationstijn2015-01-01
| | | | | | - remove single string initialization style - take list of strings instead - store list in the type for fast lookup
* py: Fix rshift and not of zero/one edge cases in mpz.Damien George2014-12-31
| | | | Addresses issue #1027.
* objstr: Fix %d-formatting of floats.Paul Sokolovsky2014-12-31
|
* py: mp_obj_new_int_from_float() supported only for MICROPY_PY_BUILTINS_FLOAT.Paul Sokolovsky2014-12-30
|
* py: Implement mp_obj_new_int_from_float() for MICROPY_LONGINT_IMPL_NONE.Paul Sokolovsky2014-12-30
|
* py: Partially fix float to int conversion.Paul Sokolovsky2014-12-30
| | | | | | | This fixes conversion when float type has more mantissa bits than small int, and float value has small exponent. This is for example the case of 32-bit platform using doubles, and converting value of time.time(). Conversion of floats with larg exponnet is still not handled correctly.
* py: Add include guards to mpconfig,misc,qstr,obj,runtime,parsehelper.Damien George2014-12-29
|
* py: In VM, for selective ip saving, store 1 byte past last opcode.Damien George2014-12-29
| | | | | | This is for efficiency, so we don't need to subtract 1 from the ip before storing it to code_state->ip. It saves a lot of ROM bytes on unix and stmhal.
* py: Add note about -fno-crossjumping when compiling vm.c.Paul Sokolovsky2014-12-29
|
* py: Add MP_LIKELY(), MP_UNLIKELY() macros to help branch prediction.v1.3.8Paul Sokolovsky2014-12-29
|
* showbc: Print operation mnemonic in BINARY_OP.Paul Sokolovsky2014-12-28
|
* showbc: Make code object start pointer semi-public.Paul Sokolovsky2014-12-28
| | | | | This allows to pring either absolute addresses or relative offsets in jumps and code references.
* vm: Record exception ip only for instructions where exceptions may happen.Paul Sokolovsky2014-12-28
| | | | | | | Mirroring ip to a volatile memory variable for each opcode is an expensive operation. For quite a lot of often executed opcodes like stack manipulation or jumps, exceptions cannot actually happen. So, record ip only for opcode where that's possible.
* py: Allow to properly disable builtin slice operation.Damien George2014-12-27
| | | | | | | This patch makes the MICROPY_PY_BUILTINS_SLICE compile-time option fully disable the builtin slice operation (when set to 0). This includes removing the slice sytanx from the grammar. Now, enabling slice costs 4228 bytes on unix x64, and 1816 bytes on stmhal.
* py: Allow to properly disable builtin "set" object.Damien George2014-12-27
| | | | | | | | This patch makes MICROPY_PY_BUILTINS_SET compile-time option fully disable the builtin set object (when set to 0). This includes removing set constructor/comprehension from the grammar, the compiler and the emitters. Now, enabling set costs 8168 bytes on unix x64, and 3576 bytes on stmhal.
* py: Move to guarded includes for compile.h and related headers.Paul Sokolovsky2014-12-27
|
* showbc: Refactor to allow inline instruction printing.Paul Sokolovsky2014-12-27
|
* py: Make bytes objs work with more str methods; add tests.Damien George2014-12-24
|
* py: Reduce size of VM exception stack element by 1 machine word.Damien George2014-12-22
| | | | | | | | | | | This optimisation reduces the VM exception stack element (mp_exc_stack_t) by 1 word, by using bit 1 of a pointer to store whether the opcode was a FINALLY or WITH opcode. This optimisation was pending, waiting for maturity of the exception handling code, which has now proven itself. Saves 1 machine word RAM for each exception (4->3 words per exception). Increases stmhal code by 4 bytes, and decreases unix x64 code by 32 bytes.
* py: Use str_to_int function in more places to reduce code size.Damien George2014-12-21
|
* py: Remove last uses of printf from compile; use proper SyntaxError.Damien George2014-12-21
|
* py: Move global/nonlocal decl code to compiler for proper SyntaxError.Damien George2014-12-21
| | | | | | This patch gives proper SyntaxError exceptions for bad global/nonlocal declarations. It also reduces code size: 304 bytes on unix x64, 132 bytes on stmhal.
* py: Fix iteration over map in 2 places.Damien George2014-12-21
|
* py: Remove unnecessary RULE_none and PN_none from parser.Damien George2014-12-20
|
* py: Add blank and ident flags to grammar rules to simplify parser.Damien George2014-12-20
| | | | This saves around 100 bytes code space on stmhal, more on unix.
* py: Save a few code bytes in parser; make vars local where possible.Damien George2014-12-20
|
* py: Add execfile function (from Python 2); enable in stmhal port.Damien George2014-12-19
| | | | Adds just 60 bytes to stmhal binary. Addresses issue #362.
* asmarm: Fix bug with encoding small negative ints using MVN instruction.Paul Sokolovsky2014-12-14
|