- Jul 31, 2017
-
-
Alexander Steffen authored
There were several different spellings of MicroPython present in comments, when there should be only one.
-
- Jul 18, 2017
-
-
Alexander Steffen authored
The code conventions suggest using header guards, but do not define how those should look like and instead point to existing files. However, not all existing files follow the same scheme, sometimes omitting header guards altogether, sometimes using non-standard names, making it easy to accidentally pick a "wrong" example. This commit ensures that all header files of the MicroPython project (that were not simply copied from somewhere else) follow the same pattern, that was already present in the majority of files, especially in the py folder. The rules are as follows. Naming convention: * start with the words MICROPY_INCLUDED * contain the full path to the file * replace special characters with _ In addition, there are no empty lines before #ifndef, between #ifndef and one empty line before #endif. #endif is followed by a comment containing the name of the guard macro. py/grammar.h cannot use header guards by design, since it has to be included multiple times in a single C file. Several other files also do not need header guards as they are only used internally and guaranteed to be included only once: * MICROPY_MPHALPORT_H * mpconfigboard.h * mpconfigport.h * mpthreadport.h * pin_defs_*.h * qstrdefs*.h
-
- Nov 15, 2016
-
-
Damien George authored
It is split into 2 functions, one to make small ints and the other to make a non-small-int leaf node. This reduces code size by 32 bytes on bare-arm, 64 bytes on unix (x64-64) and 144 bytes on stmhal.
-
Damien George authored
-
- Jan 07, 2016
-
-
Damien George authored
Constant folding in the parser can now operate on big ints, whatever their representation. This is now possible because the parser can create parse nodes holding arbitrary objects. For the case of small ints the folding is still efficient in RAM because the folded small int is stored inplace in the parse node. Adds 48 bytes to code size on Thumb2 architecture. Helps reduce heap usage because more constants can be computed at compile time, leading to a smaller parse tree, and most importantly means that the constants don't have to be computed at runtime (perhaps more than once). Parser will now be a little slower when folding due to calls to runtime to do the arithmetic.
-
- Dec 17, 2015
-
-
Damien George authored
-
Damien George authored
-
- 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.
-
- Oct 01, 2015
-
-
Damien George authored
With this patch parse nodes are allocated sequentially in chunks. This reduces fragmentation of the heap and prevents waste at the end of individually allocated parse nodes. Saves roughly 20% of RAM during parse stage.
-
- Feb 13, 2015
-
-
Damien George authored
-
- Feb 08, 2015
-
-
Damien George authored
Previous to this patch, a big-int, float or imag constant was interned (made into a qstr) and then parsed at runtime to create an object each time it was needed. This is wasteful in RAM and not efficient. Now, these constants are parsed straight away in the parser and turned into objects. This allows constants with large numbers of digits (so addresses issue #1103) and takes us a step closer to #722.
-
- Feb 07, 2015
-
-
Damien George authored
To enable parsing constants more efficiently, mp_parse should be allowed to raise an exception, and mp_compile can already raise a MemoryError. So these functions need to be protected by an nlr push/pop block. This patch adds that feature in all places. This allows to simplify how mp_parse and mp_compile are called: they now raise an exception if they have an error and so explicit checking is not needed anymore.
-
- Jan 01, 2015
-
-
Damien George authored
Addresses issue #1022.
-
- Dec 27, 2014
-
-
Paul Sokolovsky authored
-
- Oct 03, 2014
-
-
Damien George authored
Addressing issue #50.
-
- Jul 03, 2014
-
-
Damien George authored
-
Damien George authored
See discussion in issue #50.
-
- May 28, 2014
-
-
Damien George authored
Also unifies use of SMALL_INT_FITS macro across parser and runtime.
-
- May 25, 2014
-
-
Damien George authored
This completes non-automatic interning of strings in the parser, so that doc strings don't take up RAM. It complicates the parser and compiler, and bloats stmhal by about 300 bytes. It's complicated because now there are 2 kinds of parse-nodes that can be strings: interned leaves and non-interned structs.
-
- May 08, 2014
-
-
Paul Sokolovsky authored
Draft approach towards resolving https://github.com/micropython/micropython/issues/560#issuecomment-42213955
-
- 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/.
-
- Apr 10, 2014
-
-
Damien George authored
Previously, a failed malloc/realloc would throw an exception, which was not caught. I think it's better to keep the parser free from NLR (exception throwing), hence this patch.
-
- Feb 22, 2014
-
-
Damien George authored
-
Paul Sokolovsky authored
Based on suggestion by @dpgeorge at https://github.com/micropython/micropython/pull/313
-
- Feb 21, 2014
-
-
Paul Sokolovsky authored
Specifically, VM's small ints are 31 bit, while parser's only 28. There's already MP_OBJ_FITS_SMALL_INT(), so, for clarity, rename MP_FIT_SMALL_INT() to MP_PARSE_FITS_SMALL_INT().
-
- 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.
-
- Jan 25, 2014
-
-
Damien George authored
-
Paul Sokolovsky authored
TODO: Check lexer/parse/compile error path for leaks too.
-
- Jan 19, 2014
-
-
Damien George authored
Exceptions know source file, line and block name. Also tidy up some debug printing functions and provide a global flag to enable/disable them.
-
- 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
Parser no longer prints an error, but instead returns an exception ID and message.
-
- Dec 21, 2013
-
-
Damien authored
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).
-
- Oct 18, 2013
-
-
Damien authored
-
- Oct 12, 2013
-
-
Damien authored
-
- Oct 04, 2013
-
-
Damien authored
-