summaryrefslogtreecommitdiffstatshomepage
path: root/py/emitcpy.c
Commit message (Collapse)AuthorAge
* py: Rename byte_code to bytecode everywhere.Damien George2014-05-10
| | | | bytecode is the more widely used. See issue #590.
* py: Fix emitcpy, to work with latest changes to PASS variables.Damien George2014-05-07
|
* py, compiler: Improve passes; add an extra pass for native emitter.Damien George2014-05-07
|
* Add license header to (almost) all files.Damien George2014-05-03
| | | | | | | Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
* py: Remove unnecessary LOAD_CONST_ID bytecode.Damien George2014-04-27
| | | | It's the same as LOAD_CONST_STR.
* py: Wrap #if's around emitter functions that are used only by emitcpy.Damien George2014-04-20
| | | | | | | 3 emitter functions are needed only for emitcpy, and so we can #if them out when compiling with emitcpy support. Also remove unused SETUP_LOOP bytecode.
* py: Making closures now passes pointer to stack, not a tuple for vars.Damien George2014-04-20
| | | | | | | Closed over variables are now passed on the stack, instead of creating a tuple and passing that. This way memory for the closed over variables can be allocated within the closure object itself. See issue #510 for background.
* py: Merge BINARY_OP_SUBSCR and store_subscr (w/ delete) into subscr.Damien George2014-04-17
| | | | mp_obj_t->subscr now does load/store/delete.
* py: Remove unique_codes from emitglue.c. Replace with pointers.Damien George2014-04-13
| | | | | | | | | | | | | | | | Attempt to address issue #386. unique_code_id's have been removed and replaced with a pointer to the "raw code" information. This pointer is stored in the actual byte code (aligned, so the GC can trace it), so that raw code (ie byte code, native code and inline assembler) is kept only for as long as it is needed. In memory it's now like a tree: the outer module's byte code points directly to its children's raw code. So when the outer code gets freed, if there are no remaining functions that need the raw code, then the children's code gets freed as well. This is pretty much like CPython does it, except that CPython stores indexes in the byte code rather than machine pointers. These indices index the per-function constant table in order to find the relevant code.
* py: Simplify stack get/set to become stack adjust in emitters.Damien George2014-04-10
| | | | Can do this now that the stack size calculation is improved.
* py, compiler: Improve stack depth counting.Damien George2014-04-10
| | | | Much less of a hack now. Hopefully it's correct!
* py: Make labels unsigned ints (converted from int).Damien George2014-04-10
| | | | | Labels should never be negative, and this modified type signature reflects that.
* py: Oops, fix emitcpy to compile with latest changes.Damien George2014-04-09
|
* py, compile: Combine have_star_arg, have_dbl_star_arg into star_flags.Damien George2014-04-09
| | | | Small reduction in ROM, heap and stack usage.
* py: Move to Python 3.4.0 compatibility.Damien George2014-04-02
| | | | | | | | | | | | | Very little has changed. In Python 3.4 they removed the opcode STORE_LOCALS, but in Micro Python we only ever used this for CPython compatibility, so it was a trivial thing to remove. It also allowed to clean up some dead code (eg the 0xdeadbeef in class construction), and now class builders use 1 less stack word. Python 3.4.0 introduced the LOAD_CLASSDEREF opcode, which I have not yet understood. Still, all tests (apart from bytecode test) still pass. Bytecode tests needs some more attention, but they are not that important anymore.
* py: Rename and reorder parameters in emit_make_function/closure.Damien George2014-03-31
| | | | In preparation for implementing default keyword arguments.
* Rename rt_* to mp_*.Damien George2014-03-30
| | | | | | | Mostly just a global search and replace. Except rt_is_true which becomes mp_obj_is_true. Still would like to tidy up some of the names, but this will do for now.
* py: Clean up includes.xbe2014-03-17
| | | | Remove unnecessary includes. Add includes that improve portability.
* Propagate scope flags refactor to emitcpy.c.Paul Sokolovsky2014-02-16
|
* Replace global "static" -> "STATIC", to allow "analysis builds". Part 2.Paul Sokolovsky2014-02-12
|
* py: Tidy up BINARY_OPs; negation done by special NOT bytecode.Damien George2014-02-01
| | | | | IS_NOT and NOT_IN are now compiled to IS + NOT and IN + NOT, with a new special NOT bytecode.
* py: Fix emitcpy so continue is compatible with CPython.Damien George2014-02-01
|
* py: Fix bug with LOAD_METHOD; fix int->machine_int_t for small int.Damien George2014-01-29
| | | | | | | | LOAD_METHOD bug was: emitbc did not correctly calculate the amount of stack usage for a LOAD_METHOD operation. small int bug was: int was being used to pass small ints, when it should have been machine_int_t.
* Implement mp_parse_node_free; print properly repr(string).Damien George2014-01-25
|
* py: Improve freeing of emitters in mp_compile.Damien George2014-01-24
| | | | | There can be multiple emitters allocated during compile (eg byte code and native).
* Add support for freeing code emitter objects at the end of compilation.Paul Sokolovsky2014-01-24
|
* Revamp qstrs: they now include length and hash.Damien George2014-01-21
| | | | | Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h
* Add source file name and line number to error messages.Damien George2014-01-18
| | | | | Byte code has a map from byte-code offset to source-code line number, used to give better error messages.
* py: Fix emitcpy and emitnative's binary_op.Damien George2014-01-11
|
* unified the bopsJohn R. Lenton2014-01-11
|
* Improve configurability for native x64/thumb emitter.Damien George2014-01-04
| | | | | | With MICROPY_EMIT_X64 and MICROPY_EMIT_THUMB disabled, the respective emitters and assemblers will not be included in the code. This can significantly reduce binary size for unix version.
* Change mp_compile so that it returns a function object for the module.Damien George2014-01-03
|
* Add unix-cpy, used to test Micro Python byte code against CPython.Damien2013-12-29
|
* Change object representation from 1 big union to individual structs.Damien2013-12-21
| | | | | | | | | | A big change. Micro Python objects are allocated as individual structs with the first element being a pointer to the type information (which is itself an object). This scheme follows CPython. Much more flexible, not necessarily slower, uses same heap memory, and can allocate objects statically. Also change name prefix, from py_ to mp_ (mp for Micro Python).
* py: remove further unnecessary emit_verbatim code.Damien2013-12-12
|
* py: work towards working closures.Damien2013-12-11
|
* Add local_num skeleton framework to deref/closure emit calls.Damien2013-10-20
|
* Abstract out back-end stream functionality from lexer.Damien2013-10-20
|
* Change ifdef/if defined to simple if's.Damien2013-10-12
|
* Separate out mpy core and unix version.Damien2013-10-12
|
* Implement basic class/object functionality in runtime.Damien2013-10-09
|
* Add support for inline thumb assembly.Damien2013-10-05
|
* Implement built-in decorators to select emit type.Damien2013-10-05
|
* Factorise EMIT_COMMON calls, mostly into emit_pass1.Damien2013-10-05
|
* Compiler computes labels and max_num_labels.Damien2013-10-05
|
* Further factorise PASS_1 out of specific emit code.Damien2013-10-05
|
* Restructure emit so it goes through a method table.Damien2013-10-05
|
* Initial commit.Damien2013-10-04