- Feb 12, 2019
-
-
Damien George authored
These macros could in principle be (inline) functions so it makes sense to have them lower case, to match the other C API functions. The remaining macros that are upper case are: - MP_OBJ_TO_PTR, MP_OBJ_FROM_PTR - MP_OBJ_NEW_SMALL_INT, MP_OBJ_SMALL_INT_VALUE - MP_OBJ_NEW_QSTR, MP_OBJ_QSTR_VALUE - MP_OBJ_FUN_MAKE_SIG - MP_DECLARE_CONST_xxx - MP_DEFINE_CONST_xxx These must remain macros because they are used when defining const data (at least, MP_OBJ_NEW_SMALL_INT is so it makes sense to have MP_OBJ_SMALL_INT_VALUE also a macro). For those macros that have been made lower case, compatibility macros are provided for the old names so that users do not need to change their code immediately.
-
- Oct 04, 2017
-
-
Damien George authored
Header files that are considered internal to the py core and should not normally be included directly are: py/nlr.h - internal nlr configuration and declarations py/bc0.h - contains bytecode macro definitions py/runtime0.h - contains basic runtime enums Instead, the top-level header files to include are one of: py/obj.h - includes runtime0.h and defines everything to use the mp_obj_t type py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h, and defines everything to use the general runtime support functions Additional, specific headers (eg py/objlist.h) can be included if needed.
-
- Jul 31, 2017
-
-
Alexander Steffen authored
There were several different spellings of MicroPython present in comments, when there should be only one.
-
- Jul 21, 2017
-
-
Tom Collins authored
-
- Mar 29, 2017
-
-
Damien George authored
-
- Mar 28, 2017
-
-
Damien George authored
Saves 168 bytes on bare-arm.
-
- Mar 14, 2017
-
-
Damien George authored
This patch refactors the error handling in the lexer, to simplify it (ie reduce code size). A long time ago, when the lexer/parser/compiler were first written, the lexer and parser were designed so they didn't use exceptions (ie nlr) to report errors but rather returned an error code. Over time that has gradually changed, the parser in particular has more and more ways of raising exceptions. Also, the lexer never really handled all errors without raising, eg there were some memory errors which could raise an exception (and in these rare cases one would get a fatal nlr-not-handled fault). This patch accepts the fact that the lexer can raise exceptions in some cases and allows it to raise exceptions to handle all its errors, which are for the most part just out-of-memory errors during construction of the lexer. This makes the lexer a bit simpler, and also the persistent code stuff is simplified. What this means for users of the lexer is that calls to it must be wrapped in a nlr handler. But all uses of the lexer already have such an nlr handler for the parser (and compiler) so that doesn't put any extra burden on the callers.
-
- Oct 17, 2016
-
-
Damien George authored
Saves the following number of bytes of code space: 176 for bare-arm, 352 for minimal, 272 for unix x86-64, 140 for stmhal, 120 for esp8266.
-
- Jan 11, 2016
-
-
Damien George authored
With this patch the n_args parameter is changed type from mp_uint_t to size_t.
-
- Dec 18, 2015
-
-
Damien George authored
MICROPY_ENABLE_COMPILER can be used to enable/disable the entire compiler, which is useful when only loading of pre-compiled bytecode is supported. It is enabled by default. MICROPY_PY_BUILTINS_EVAL_EXEC controls support of eval and exec builtin functions. By default they are only included if MICROPY_ENABLE_COMPILER is enabled. Disabling both options saves about 40k of code size on 32-bit x86.
-
- Nov 29, 2015
-
-
Damien George authored
This allows the mp_obj_t type to be configured to something other than a pointer-sized primitive type. This patch also includes additional changes to allow the code to compile when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of mp_uint_t, and various casts.
-
- Feb 15, 2015
-
-
Damien George authored
Addresses issue #1119.
-
- Jan 20, 2015
-
-
Damien George authored
See issue #699.
-
- Jan 01, 2015
-
-
Damien George authored
Addresses issue #1022.
-
- Dec 19, 2014
-
-
Damien George authored
Adds just 60 bytes to stmhal binary. Addresses issue #362.
-
- Oct 25, 2014
-
-
Damien George authored
This should be pretty compliant with CPython, except perhaps for some corner cases to do with globals/locals context. Addresses issue #879.
-
- Oct 05, 2014
-
-
Damien George authored
This has benefits all round: code factoring for parse/compile/execute, proper context save/restore for exec, allow to sepcify globals/locals for eval, and reduced ROM usage by >100 bytes on stmhal and unix. Also, the call to mp_parse_compile_execute is tail call optimised for the import code, so it doesn't increase stack memory usage.
-
Damien George authored
-
- Sep 23, 2014
-
-
Damien George authored
mp_parse_node_free now frees the memory associated with non-interned strings. And the parser calls mp_parse_node_free when discarding a non-used node (such as a doc string). Also, the compiler now frees the parse tree explicitly just before it exits (as opposed to relying on the caller to do this). Addresses issue #708 as best we can.
-
- Aug 30, 2014
-
-
Damien George authored
Part of code cleanup, working towards resolving issue #50.
-
- 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 13, 2014
-
-
Damien George authored
Should fix issue #463.
-
- Apr 06, 2014
-
-
Damien George authored
Also add command line option to unix port to select emitter.
-
- 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
This does not affect code size or performance when debugging turned off. To address issue #420.
-
- 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.
-
Damien George authored
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.
-
- Mar 17, 2014
-
-
xbe authored
Remove unnecessary includes. Add includes that improve portability.
-
- 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.
-
- Feb 12, 2014
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
- Feb 08, 2014
-
-
Damien George authored
Can't decide which is better for string type, char or byte pointer. Changing to char removes a few casts. Really need to do proper unicode.
-
- Feb 03, 2014
-
-
Damien George authored
-
- Jan 25, 2014
-
-
Damien George authored
-
- Jan 22, 2014
-
-
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 18, 2014
-
-
Damien George authored
Byte code has a map from byte-code offset to source-code line number, used to give better error messages.
-
- Jan 15, 2014
-
-
Damien George authored
-