| Age | Commit message (Collapse) | Author |
|
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).
|
|
Finishes addressing issue #424.
In the end this was a very neat refactor that now makes things a lot
more consistent across the py code base. It allowed some
simplifications in certain places, now that everything is a dict object.
Also converted builtins tables to dictionaries. This will be useful
when we need to turn builtins into a proper module.
|
|
Towards addressing issue #424.
Had a small increase to ROM usage (order 60 bytes).
|
|
This does not affect code size or performance when debugging turned off.
To address issue #420.
|
|
py: Support 3-arg getattr() builtin (with default value).
|
|
|
|
|
|
That's how CPython has it, in particular, "import __main__" should work.
|
|
|
|
Previous overflow test was inadequate.
|
|
A malloc/realloc fail now throws MemoryError.
|
|
|
|
|
|
It's not completely satisfactory, because a failed call to __getattr__
should not raise an exception.
__setattr__ could be implemented, but it would slow down all stores to a
user created object. Need to implement some caching system.
|
|
Because it's superfluos in the presence of type(), a remenant from Python's
"old classes".
|
|
|
|
|
|
There was thinkos that either send_value or throw_value is specified, but
there were cases with both. Note that send_value is pushed onto generator's
stack - but that's probably only good, because if we throw exception into
gen, it should not ever use send_value, and that will be just extra "assert".
|
|
In this case, the exception is just re-thrown - the ideas is that object
doesn't handle this exception specially, so it will propagated per Python
semantics.
|
|
|
|
Adding this bytecode allows to remove 4 others related to
function/method calls with * and ** support. Will also help with
bytecodes that make functions/closures with default positional and
keyword args.
|
|
"1/0" is sacred idiom, the shortest way to break program execution
(sys.exit() is too long).
|
|
Iterators and ducktype objects can now be arguments of yield from.
|
|
Extends previous implementation with * for function calls to * and **
for both function and method calls.
|