summaryrefslogtreecommitdiffstatshomepage
path: root/py
Commit message (Collapse)AuthorAge
* py/formatfloat.c: Fix format of floating point numbers near 1.0.Dave Hylands2015-04-12
| | | | | | | | | | | In particular, numbers which are less than 1.0 but which round up to 1.0. This also makes those numbers which round up to 1.0 to print with e+00 rather than e-00 for those formats which print exponents. Addresses issue #1178.
* objstr: split(None): Fix whitespace properly.Paul Sokolovsky2015-04-12
|
* py: In emitinlinethumb, use qstr_data instead of qstr_str and strlen.Damien George2015-04-11
|
* py: Remove old debugging printf's in compile.c.Damien George2015-04-11
|
* py: Combine load_attr and store_attr type methods into one (attr).Damien George2015-04-11
| | | | | | This simplifies the API for objects and reduces code size (by around 400 bytes on Thumb2, and around 2k on x86). Performance impact was measured with Pystone score, but change was barely noticeable.
* py: Provide typedefs for function types instead of writing them inline.Damien George2015-04-09
|
* py: Adjust some spaces in code style/format, purely for consistency.Damien George2015-04-09
|
* py: Use a dummy type for referring to extern structsstijn2015-04-09
| | | | | Fixes msvc linker warnings about mismatching sizes between the mp_obj_fdfile_t struct defined in file.c and the mp_uint_t declarations found in modsys.c and modbuiltins.c
* py: Fix msvc warning '*/ found outside of comment'stijn2015-04-09
| | | | | Also prevents some of the weaker syntax parsers out there treating the whole '*/*const*/' part as a comment
* py: Implement full func arg passing for native emitter.Damien George2015-04-07
| | | | | | | | | | | This patch gets full function argument passing working with native emitter. Includes named args, keyword args, default args, var args and var keyword args. Fully Python compliant. It reuses the bytecode mp_setup_code_state function to do all the hard work. This function is slightly adjusted to accommodate native calls, and the native emitter is forced a bit to emit similar prelude and code-info as bytecode.
* py: Simplify bytecode prelude when encoding closed over variables.Damien George2015-04-07
|
* py: Implement calling functions with *args in native emitter.Damien George2015-04-06
|
* py: Add MICROPY_PY_BUILTINS_REVERSED, disable for minimal ports.Paul Sokolovsky2015-04-07
|
* py: Add MICROPY_PY_BUILTINS_ENUMERATE, disable for minimal ports.Paul Sokolovsky2015-04-06
|
* py: Implement delete for property and descriptors.Damien George2015-04-04
| | | | | Without this patch deleting a property, or class with descriptor, will call the setter with a NULL value and lead to a crash.
* py: In str unicode, str_subscr will never be passed a bytes object.Damien George2015-04-04
|
* py: Some trivial cosmetic changes, for code style consistency.Damien George2015-04-04
|
* objstr: Fix bugs introduced by inability to have shadow variables.Paul Sokolovsky2015-04-04
| | | | Warnings lead to programming errors - as expected.
* objstr: Avoid variable shadowing.Paul Sokolovsky2015-04-04
|
* objstr: Add .splitlines() method.Paul Sokolovsky2015-04-04
| | | | | | | | | splitlines() occurs ~179 times in CPython3 standard library, so was deemed worthy to implement. The method has subtle semantic differences from just .split("\n"). It is also defined as working for any end-of-line combination, but this is currently not implemented - it works only with LF line-endings (which should be OK for text strings on any platforms, but not OK for bytes).
* py: Fix bug in native emitter when closing over an argument.Damien George2015-04-03
|
* py: Get native emitter working again with x86 (now supports closures).Damien George2015-04-03
|
* py: Implement closures in native code generator.Damien George2015-04-03
| | | | Currently supports only x64 and Thumb2 archs.
* py: Implement (non-compliant) support for delete_fast in native emitter.Damien George2015-04-03
| | | | This implementation is smaller (in code size) than #1024.
* py: Make heap printing compatible with 16-bit word size.Damien George2015-04-03
|
* py: Allow MPZ_DIG_SIZE to be optionally configured by a port.Damien George2015-04-03
|
* py: Allow configurable object representation, with 2 different options.Damien George2015-04-03
|
* py: Add finer configuration of static funcs when not in stackless mode.Damien George2015-04-02
| | | | Also rename call_args_t to mp_call_args_t.
* vm: Support strict stackless mode, with proper exception reporting.Paul Sokolovsky2015-04-03
| | | | | | I.e. in this mode, C stack will never be used to call a Python function, but if there's no free heap for a call, it will be reported as RuntimeError (as expected), not MemoryError.
* vm: Implement stackless for CALL_FUNCTION_VAR_KW & CALL_METHOD_VAR_KW.Paul Sokolovsky2015-04-03
|
* runtime: Split mp_call_prepare_args_n_kw_var() from mp_call_method_n_kw_var().Paul Sokolovsky2015-04-03
| | | | | Allow for reuse for stackless design, where preparing args is separate from calling.
* vm: Stackless support for MP_BC_CALL_METHOD.Paul Sokolovsky2015-04-03
|
* vm: If there's no heap to call function in stackless manner, call via C stack.Paul Sokolovsky2015-04-03
|
* vm: Initial support for calling bytecode functions w/o C stack ("stackless").Paul Sokolovsky2015-04-03
|
* makeqstrdata.py: Add support for strings with backslash escapes.Paul Sokolovsky2015-04-02
|
* py: Fix emitnative's creation of small ints so it uses the macro.Damien George2015-04-01
|
* objtype: Add special unary methods __pos__, __neg__, __invert__.Paul Sokolovsky2015-03-31
| | | | Conditional on MICROPY_PY_ALL_SPECIAL_METHODS.
* modbuiltins: round(): Accept second arg, and at least support it to be 0.Paul Sokolovsky2015-03-31
| | | | | Per https://docs.python.org/3/library/functions.html#round, 2-args format guaranteedly returns float.
* py: Add optional support for descriptors' __get__ and __set__ methods.stijn2015-03-26
| | | | Disabled by default. Enabled on unix and windows ports.
* py: Increase fixed size of stack-info in native emitter.Damien George2015-03-26
| | | | This is a temporary fix.
* py, compiler: When just bytecode, make explicit calls instead of table.Damien George2015-03-26
| | | | | | | | | | | | | | | | | | When just the bytecode emitter is needed there is no need to have a dynamic method table for the emitter back-end, and we can instead directly call the mp_emit_bc_XXX functions. This gives a significant reduction in code size and a very slight performance boost for the compiler. This patch saves 1160 bytes code on Thumb2 and 972 bytes on x86, when native emitters are disabled. Overall savings in code over the last 3 commits are: bare-arm: 1664 bytes. minimal: 2136 bytes. stmhal: 584 bytes (it has native emitter enabled). cc3200: 1736 bytes.
* py, compiler: Remove emit_pass1 code, using emit_bc to do its job.Damien George2015-03-26
| | | | | | | | | | | | | | | First pass for the compiler is computing the scope (eg if an identifier is local or not) and originally had an entire table of methods dedicated to this, most of which did nothing. With changes from previous commit, this set of methods can be removed and the methods from the bytecode emitter used instead, with very little modification -- this is what is done in this commit. This factoring has little to no impact on the speed of the compiler (tested by compiling 3763 Python scripts and timing it). This factoring reduces code size by about 270-300 bytes on Thumb2 archs, and 400 bytes on x86.
* py, compiler: Refactor load/store/delete_id logic to reduce code size.Damien George2015-03-26
| | | | Saves around 230 bytes on Thumb2 and 750 bytes on x86.
* objdict: Cast mp_obj_t to concrete types explicitly.Paul Sokolovsky2015-03-26
| | | | Continuation of refactoring applied previously to objlist.
* py: Fix bug in compiler which allowed through illegal augmented assign.Damien George2015-03-25
| | | | It allowed such things as (a, b) += c.
* py: Clean up some logic in VM to remove assert(0)'s.Damien George2015-03-25
| | | | Saves around 30 bytes code on Thumb2 archs.
* py: Simplify some logic in compiler; add comments about CPython compat.Damien George2015-03-25
|
* py: Cast mp_obj_t to concrete types explicitly.Paul Sokolovsky2015-03-25
| | | | | | | | | | | mp_obj_t internal representation doesn't have to be a pointer to object, it can be anything. There's also a support for back-conversion in the form of MP_OBJ_UNCAST. This is kind of optimization/status quo preserver to minimize patching the existing code and avoid doing potentially expensive MP_OBJ_CAST over and over. But then one may imagine implementations where MP_OBJ_UNCAST is very expensive. But such implementations are unlikely interesting in practice.
* objnamedtuple: Accept field list as a string.Paul Sokolovsky2015-03-23
| | | | | This change is required to unbreak some CPython stdlib modules (as included into micropython-lib).
* objstr: Expose mp_obj_str_split() for reuse in other modules.Paul Sokolovsky2015-03-23
|