| Age | Commit message (Collapse) | Author |
|
Labels should never be negative, and this modified type signature
reflects that.
|
|
Needed to reinstate 2 delete opcodes, to specifically check that a local
is not deleted twice.
|
|
Small reduction in ROM, heap and stack usage.
|
|
Convert int types to uint where sensible, and then to uint8_t or
uint16_t where possible to reduce RAM usage.
|
|
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.
|
|
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.
|
|
These are default arguments after a bare *.
|
|
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.
|
|
In preparation for implementing default keyword arguments.
|
|
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.
|
|
|
|
|
|
Rationale: setting up the stack (state for locals and exceptions) is
really part of the "code", it's the prelude of the function. For
example, native code adjusts the stack pointer on entry to the function.
Native code doesn't need to know n_state for any other reason. So
putting the state size in the bytecode prelude is sensible.
It reduced ROM usage on STM by about 30 bytes :) And makes it easier to
pass information about the bytecode between functions.
|
|
|
|
|
|
Remove unnecessary includes. Add includes that improve portability.
|
|
Assuming we have truncating (floor) division, way to do ceiling division
by N is to use formula (x + (N-1)) / N. Specifically, 63 bits, if stored
7 bits per byte, require exactly 9 bytes. 64 bits overflow that and require
10 bytes.
|
|
|
|
|
|
For this, record argument names along with each bytecode function. The code
still includes extensive debug logging support so far.
|
|
|
|
|
|
IS_NOT and NOT_IN are now compiled to IS + NOT and IN + NOT, with a new
special NOT bytecode.
|
|
Still todo: break/continue from within the finally block itself.
|
|
|
|
TODO: Decide if we really need separate bytecode for creating functions
with default arguments - we would need same for closures, then there're
keywords arguments too. Having all combinations is a small exponential
explosion, likely we need just 2 cases - simplest (no defaults, no kw),
and full - defaults & kw.
|
|
|
|
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.
|
|
|
|
There can be multiple emitters allocated during compile (eg byte code
and native).
|
|
|
|
Can now have null bytes in strings. Can define ROM qstrs per port using
qstrdefsport.h
|
|
Exceptions know source file, line and block name.
Also tidy up some debug printing functions and provide a global
flag to enable/disable them.
|
|
Byte code has a map from byte-code offset to source-code line number,
used to give better error messages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|