summaryrefslogtreecommitdiff
path: root/py/emitglue.c
AgeCommit message (Collapse)Author
2014-06-03showbc: Make micropython -v also dump bytecode in hex form.Paul Sokolovsky
2014-06-03showbc: Make sure it's possible to trace MAKE_FUNCTION arg to actual bytecode.Paul Sokolovsky
2014-05-12py: Remove emit_glue init and deinit. Needed only for debugging.Damien George
Debugging output for emit_glue now simplified so that the init and deinit functions are no longer needed.
2014-05-10py: Combine native emitters to 1 glue function; distinguish viper.Damien George
This patch simplifies the glue between native emitter and runtime, and handles viper code like inline assember: return values are converted to Python objects. Fixes issue #531.
2014-05-10py: Rename byte_code to bytecode everywhere.Damien George
bytecode is the more widely used. See issue #590.
2014-05-05py, unix: Add -v option, print bytecode dump if used.Paul Sokolovsky
This will work if MICROPY_DEBUG_PRINTERS is defined, which is only for unix/windows ports. This makes it convenient to user uPy normally, but easily get bytecode dump on the spot if needed, without constant recompiles back and forth. TODO: Add more useful debug output, adjust verbosity level on which specifically bytecode dump happens.
2014-05-03Add license header to (almost) all files.Damien George
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/.
2014-04-27py: Implement keyword-only args.Damien George
Implements 'def f(*, a)' and 'def f(*a, b)', but not default keyword-only args, eg 'def f(*, a=1)'. Partially addresses issue #524.
2014-04-23emitglue: Typo fix in var name.Paul Sokolovsky
2014-04-20py: Making closures now passes pointer to stack, not a tuple for vars.Damien George
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.
2014-04-13py: Remove unique_codes from emitglue.c. Replace with pointers.Damien George
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.
2014-04-12py: Improve inline assembler; improve compiler constant folding.Damien George
2014-04-11py: Change compile order for default positional and keyword args.Damien George
This simplifies the compiler a little, since now it can do 1 pass over a function declaration, to determine default arguments. I would have done this originally, but CPython 3.3 somehow had the default keyword args compiled before the default position args (even though they appear in the other order in the text of the script), and I thought it was important to have the same order of execution when evaluating default arguments. CPython 3.4 has changed the order to the more obvious one, so we can also change.
2014-04-06py: Implement more features in native emitter.Damien George
On x64, native emitter now passes 70 of the tests.
2014-03-31py: Towards default keyword arguments.Damien George
These are default arguments after a bare *.
2014-03-30Rename rt_* to mp_*.Damien George
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.
2014-03-29py: Free unique_code slot for outer module.Damien George
Partly (very partly!) addresses issue #386. Most importantly, at the REPL command line, each invocation does not now lead to increased memory usage (unless you define a function/lambda).
2014-03-28py: Fix bugs with debugging output.Damien George
show_bc now decodes the prelude correctly. Moved WRITE_FILE stuff from runtime.c to emitglue.c. Addresses issue #385.
2014-03-27py: Factor out code from runtime.c to emitglue.c.Damien George