- 13 Apr, 2014 10 commits
-
-
Damien George authored
Must use mp_obj_get_type to get the type of an object. Can't assume mp_obj_t is castable to mp_obj_base_t.
-
Damien George authored
Should fix issue #463.
-
Damien George authored
-
Damien George authored
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.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
We're not going to implement all the plethora of types in there in C. Funnily, CPython implements defaultdict in C, and namedtuple in Python.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
These largely duplicate str() & bytes() constructors' functionality, but can be used to achieve Python2 compatibility.
-
- 12 Apr, 2014 8 commits
-
-
Damien George authored
Improved the Thumb assembler back end. Added many more Thumb instructions to the inline assembler. Improved parsing of assembler instructions and arguments. Assembler functions can now be passed the address of any object that supports the buffer protocol (to get the address of the buffer). Added an example of how to sum numbers from an array in assembler.
-
Damien George authored
This is necessary to catch all cases where locals are referenced before assignment. We still keep the _0, _1, _2 versions of LOAD_FAST to help reduced the byte code size in RAM. Addresses issue #457.
-
Damien George authored
-
Damien George authored
Small fixes to get it compiling with ARMCC. I have no idea why category_t was in the enum definition for qstrs...
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Damien George authored
-
Paul Sokolovsky authored
-
- 11 Apr, 2014 22 commits
-
-
Paul Sokolovsky authored
This helps with handling "recursive" imports in sane manner, for example when foo/__init__.py has something like "from foo import submod".
-
Paul Sokolovsky authored
-
Damien George authored
I'm pretty sure these are never reached, since NOT_EQUAL is always converted into EQUAL in mp_binary_op. No one should call type.binary_op directly, they should always go through mp_binary_op (or mp_obj_is_equal).
-
Damien George authored
-
Damien George authored
With new order of evaluation of defaults, creating the tuple was done in the wrong spot.
-
Damien George authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Per https://docs.python.org/3.3/reference/import.html , this is the way to tell module from package: "Specifically, any module that contains a __path__ attribute is considered a package." And it for sure will be needed to implement relative imports.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
This is alternative implementation of supporting conditionals in qstrdefs.h, hard to say if it's much cleaner than munging #ifdef's in Python code...
-
Paul Sokolovsky authored
This reverts commit acb133d1. Conditionals will be suported using C preprocessor.
-
Damien George authored
-
Damien George authored
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.
-
Damien George authored
-
Damien George authored
-
Damien George authored
Also convert mp_obj_is_integer to an inline function. Overall this decreased code size (at least on 32-bit x86 machine).
-
Damien George authored
It regressed a bit after implementing float/complex equality. Now it should be improved, and support more equality tests.
-
Damien George authored
It has (again) a fast path for ints, and a simplified "slow" path for everything else. Also simplify the way str indexing is done (now matches tuple and list).
-
Damien George authored
Addresses issue #462.
-
Damien George authored
-