- Oct 06, 2015
-
-
Paul Sokolovsky authored
-
- May 04, 2015
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Refactored from "stm" module, provides mem8, mem16, mem32 objects with array subscript syntax.
-
- Apr 16, 2015
-
-
Damien George authored
-
Damien George authored
Previous to this patch the printing mechanism was a bit of a tangled mess. This patch attempts to consolidate printing into one interface. All (non-debug) printing now uses the mp_print* family of functions, mainly mp_printf. All these functions take an mp_print_t structure as their first argument, and this structure defines the printing backend through the "print_strn" function of said structure. Printing from the uPy core can reach the platform-defined print code via two paths: either through mp_sys_stdout_obj (defined pert port) in conjunction with mp_stream_write; or through the mp_plat_print structure which uses the MP_PLAT_PRINT_STRN macro to define how string are printed on the platform. The former is only used when MICROPY_PY_IO is defined. With this new scheme printing is generally more efficient (less layers to go through, less arguments to pass), and, given an mp_print_t* structure, one can call mp_print_str for efficiency instead of mp_printf("%s", ...). Code size is also reduced by around 200 bytes on Thumb2 archs.
-
- Apr 11, 2015
-
-
Damien George authored
This simplifies the API for objects and reduces code size (by around 400 bytes on Thumb2, and around 2k on x86). Performance impact was measured with Pystone score, but change was barely noticeable.
-
- Mar 20, 2015
-
-
Paul Sokolovsky authored
Given that there's already support for "fixed table" maps, which are essentially ordered maps, the implementation of OrderedDict just extends "fixed table" maps by adding an "is ordered" flag and add/remove operations, and reuses 95% of objdict code, just making methods tolerant to both dict and OrderedDict. Some things are missing so far, like CPython-compatible repr and comparison. OrderedDict is Disabled by default; enabled on unix and stmhal ports.
-
- Jan 20, 2015
-
-
Damien George authored
See issue #699.
-
Damien George authored
See issue #699.
-
- Jan 07, 2015
-
-
Damien George authored
This patch consolidates all global variables in py/ core into one place, in a global structure. Root pointers are all located together to make GC tracing easier and more efficient.
-
- Jan 01, 2015
-
-
Damien George authored
Addresses issue #1022.
-
- Dec 09, 2014
-
-
Damien George authored
This patch adds a configuration option (MICROPY_CAN_OVERRIDE_BUILTINS) which, when enabled, allows to override all names within the builtins module. A builtins override dict is created the first time the user assigns to a name in the builtins model, and then that dict is searched first on subsequent lookups. Note that this implementation doesn't allow deleting of names. This patch also does some refactoring of builtins code, creating the modbuiltins.c file. Addresses issue #959.
-
- Nov 04, 2014
-
-
Paul Sokolovsky authored
For this, introduce MICROPY_MODULE_DICT_SIZE config setting.
-
- Sep 08, 2014
-
-
Damien George authored
-
- May 03, 2014
-
-
Damien George authored
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/.
-
- May 02, 2014
-
-
Paul Sokolovsky authored
Specifically, nlr.h does.
-
- Apr 08, 2014
-
-
Damien George authored
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.
-
- Apr 05, 2014
-
-
Damien George authored
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.
-
Damien George authored
Towards addressing issue #424. Had a small increase to ROM usage (order 60 bytes).
-
- Mar 30, 2014
-
-
Damien George authored
Pretty much everyone needs to include map.h, since it's such an integral part of the Micro Python object implementation. Thus, the definitions are now in obj.h instead. map.h is removed.
-
- Mar 25, 2014
-
-
Damien George authored
Comes with some refactoring of code and renaming of files. All modules are now named mod*.[ch].
-
- Mar 24, 2014
-
-
mux authored
* Add function to load static modules. * Use module_register to pyb module.
-
- Mar 17, 2014
-
-
xbe authored
Remove unnecessary includes. Add includes that improve portability.
-
- Mar 08, 2014
-
-
Damien George authored
mp_module_obj_t can now be put in ROM. Configuration of float type is now similar to longint: can now choose none, float or double as the implementation. math module has basic math functions. For STM port, these are not yet implemented (they are just stub functions).
-
- Feb 15, 2014
-
-
Damien George authored
Each built-in exception is now a type, with base type BaseException. C exceptions are created by passing a pointer to the exception type to make an instance of. When raising an exception from the VM, an instance is created automatically if an exception type is raised (as opposed to an exception instance). Exception matching (RT_BINARY_OP_EXCEPTION_MATCH) is now proper. Handling of parse error changed to match new exceptions. mp_const_type renamed to mp_type_type for consistency.
-
Damien George authored
Ultimately all static strings should be qstr. This entry in the type structure is only used for printing error messages (to tell the type of the bad argument), and printing objects that don't supply a .print method.
-
- Feb 12, 2014
-
-
Paul Sokolovsky authored
Some tools do not support local/static symbols (one example is GNU ld map file). Exposing all functions will allow to do detailed size comparisons, etc. Also, added bunch of statics where they were missing, and replaced few identity functions with global mp_identity().
-
- Feb 05, 2014
-
-
Damien George authored
-
- Jan 22, 2014
-
-
Damien George authored
STM port crashes without this re-init. There should not be any state in the core py/ code that relies on pre-initialised data.
-
Damien George authored
-
- Jan 21, 2014
-
-
Damien George authored
Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h
-
- Jan 19, 2014
-
-
Paul Sokolovsky authored
In Python, importing module several times returns same underlying module object. This also fixes import statement handling for builtin modules. There're still issues: 1. CPython exposes set of loaded modules as sys.modules, we may want to do that either. 2. Builtin modules are implicitly imported, which is not really correct. We should separate registering a (builtin) module and importing a module. CPython keeps builtin module names in sys.builtin_module_names .
-
- Jan 18, 2014
-
-
Damien George authored
Change state layout in VM so the stack starts at state[0] and grows upwards. Locals are at the top end of the state and number downwards. This cleans up a lot of the interface connecting the VM to C: now all functions that take an array of Micro Python objects are in order (ie no longer in reverse). Also clean up C API with keyword arguments (call_n and call_n_kw replaced with single call method that takes keyword arguments). And now make_new takes keyword arguments. emitnative.c has not yet been changed to comply with the new order of stack layout.
-
- Jan 15, 2014
-
-
Paul Sokolovsky authored
-
- Jan 09, 2014
-
-
Damien George authored
Creating of classes (types) and instances is much more like CPython now. You can use "type('name', (), {...})" to create classes.
-
- Jan 08, 2014
-
-
Damien George authored
-
- Jan 07, 2014
-
-
John R. Lenton authored
-
John R. Lenton authored
It's not really about that, though; it's about me figuring out a sane way forward for keyword-argument functions (and function metadata). But it's useful as is, and shouldn't break any existing code, so here you have it; I'm going to park it in my mind for a bit while sorting out the rest of the dict branch.
-
Damien George authored
-
- Jan 06, 2014
-
-
ian-v authored
-