| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
qstr_init is always called exactly before mp_init, so makes sense to
just have mp_init call it. Similarly with
mp_init_emergency_exception_buf. Doing this makes the ports simpler and
less error prone (ie they can no longer forget to call these).
|
|
See discussion in issue #50.
|
|
|
|
As stack checking is enabled by default, ports which don't call
stack_ctrl_init() are broken now (report RuntimeError on startup). Save
them trouble and just init stack control framework in interpreter init.
|
|
One thing is wanting to do 1 / 2 and get something else but 0, and quite
another - doing rocket science ;-).
|
|
|
|
Benefits: won't crash baremetal targets, will provide Python source location
when not implemented feature used (it will no longer provide C source
location, but just grep for error message).
|
|
- Move the includes for alloca() intp mpconfigport.h
|
|
|
|
This saves 4 words of stack space per Python call.
|
|
This allows to have multiple "optimization" levels (CPython has two
(-OO removes docstrings), we can have more).
|
|
|
|
|
|
This renames:
MICROPY_PY_FROZENSET -> MICROPY_PY_BUILTINS_FROZENSET
MICROPY_PY_PROPERTY -> MICROPY_PY_BUILTINS_PROPERTY
MICROPY_PY_SLICE -> MICROPY_PY_BUILTINS_SLICE
MICROPY_ENABLE_FLOAT -> MICROPY_PY_BUILTINS_FLOAT
See issue #35 for discussion.
|
|
Also unifies use of SMALL_INT_FITS macro across parser and runtime.
|
|
Addresses issue #627.
|
|
See issue #608 for justification.
|
|
Debugging output for emit_glue now simplified so that the init and
deinit functions are no longer needed.
|
|
__debug__ now resolves to True or False. Its value needs to be set by
mp_set_debug().
TODO: call mp_set_debug in unix/ port.
TODO: optimise away "if False:" statements in compiler.
|
|
This is better than forcing each getiter() implementation to raise exception.
|
|
This was hit when trying to make urlparse.py from stdlib run. Took
quite some time to debug.
TODO: Reconsile bound method creation process better, maybe callable is
to generic type to bind at all?
|
|
|
|
|
|
Extend the windows port so it compiles with the toolchain from Visual Studio 2013
|
|
|
|
|
|
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/.
|
|
By default mingw outputs 3 digits instead of the standard 2 so all float
tests using printf fail. Using setenv at the start of the program fixes this.
To accomodate calling platform specific initialization a
MICROPY_MAIN_INIT_FUNC macro is used which is called in mp_init()
|
|
Specifically, nlr.h does.
|
|
|
|
I skipped implementing this initially, but then it causes __name__
of current module be overwritten and relative imports fail.
|
|
Also make consistent use of MP_OBJ_NOT_SUPPORTED and MP_OBJ_NULL.
This helps a lot in debugging and understanding of function API.
|
|
mp_obj_t->subscr now does load/store/delete.
|
|
|
|
Convert sys module to static allocation
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This makes the runtime and object APIs more consistent. mp_store_subscr
functionality now moved into objects (ie list and dict store_item).
|
|
At this point, all opcodes are now implemented!
Some del opcodes have been combined with store opcodes, with the value
to store being MP_OBJ_NULL.
|
|
|
|
On x64, native emitter now passes 70 of the tests.
|
|
Based on the discussion in #433. mp_load_attr() is critical-path function,
so any extra check will slowdown any script. As supporting default val
required only for getattr() builtin, move correspending implementation
there (still as a separate function due to concerns of maintainability
of such almost-duplicated code instances).
|