summaryrefslogtreecommitdiffstatshomepage
path: root/py/mpconfig.h
Commit message (Collapse)AuthorAge
...
* stmhal: Implement sys.std{in,out,err}.buffer, for raw byte mode.Damien George2015-05-24
| | | | It's configurable and only enabled for stmhal port.
* modbuiltins: Add NotImplemented builtin constant.Paul Sokolovsky2015-05-04
| | | | | | | | | | | | From https://docs.python.org/3/library/constants.html#NotImplemented : "Special value which should be returned by the binary special methods (e.g. __eq__(), __lt__(), __add__(), __rsub__(), etc.) to indicate that the operation is not implemented with respect to the other type; may be returned by the in-place binary special methods (e.g. __imul__(), __iand__(), etc.) for the same purpose. Its truth value is true." Some people however appear to abuse it to mean "no value" when None is a legitimate value (don't do that).
* modmachine: Add new module to access hardware, starting with physical memory.Paul Sokolovsky2015-05-04
| | | | | Refactored from "stm" module, provides mem8, mem16, mem32 objects with array subscript syntax.
* modsys: Add basic sys.exc_info() implementation.Paul Sokolovsky2015-04-25
| | | | | | The implementation is very basic and non-compliant and provided solely for CPython compatibility. The function itself is bad Python2 heritage, its usage is discouraged.
* py: Add attrtuple object, for space-efficient tuples with attr access.Damien George2015-04-21
| | | | | If you need the functionality of a namedtuple but will only make 1 or a few instances, then use an attrtuple instead.
* py/inlinethumb: Support for core floating point instructions.=2015-04-19
| | | | | | | | | | | | | | | | | | | Adds support for the following Thumb2 VFP instructions, via the option MICROPY_EMIT_INLINE_THUMB_FLOAT: vcmp vsqrt vneg vcvt_f32_to_s32 vcvt_s32_to_f32 vmrs vmov vldr vstr vadd vsub vmul vdiv
* py: Overhaul and simplify printf/pfenv mechanism.Damien George2015-04-16
| | | | | | | | | | | | | | | | | | | | | | 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.
* py: Adjust some spaces in code style/format, purely for consistency.Damien George2015-04-09
|
* py: Add MICROPY_PY_BUILTINS_REVERSED, disable for minimal ports.Paul Sokolovsky2015-04-07
|
* py: Add MICROPY_PY_BUILTINS_ENUMERATE, disable for minimal ports.Paul Sokolovsky2015-04-06
|
* objstr: Add .splitlines() method.Paul Sokolovsky2015-04-04
| | | | | | | | | splitlines() occurs ~179 times in CPython3 standard library, so was deemed worthy to implement. The method has subtle semantic differences from just .split("\n"). It is also defined as working for any end-of-line combination, but this is currently not implemented - it works only with LF line-endings (which should be OK for text strings on any platforms, but not OK for bytes).
* py: Allow configurable object representation, with 2 different options.Damien George2015-04-03
|
* vm: Support strict stackless mode, with proper exception reporting.Paul Sokolovsky2015-04-03
| | | | | | I.e. in this mode, C stack will never be used to call a Python function, but if there's no free heap for a call, it will be reported as RuntimeError (as expected), not MemoryError.
* vm: Initial support for calling bytecode functions w/o C stack ("stackless").Paul Sokolovsky2015-04-03
|
* py: Add optional support for descriptors' __get__ and __set__ methods.stijn2015-03-26
| | | | Disabled by default. Enabled on unix and windows ports.
* py: Allow retrieving a function's __name__.stijn2015-03-20
| | | | Disabled by default. Enabled on unix and stmhal ports.
* py: Implement core of OrderedDict type.Paul Sokolovsky2015-03-20
| | | | | | | | | | | | 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.
* py: Add MICROPY_COMP_{DOUBLE,TRIPLE}_TUPLE_ASSIGN config options.Damien George2015-03-14
| | | | | | These allow to fine-tune the compiler to select whether it optimises tuple assignments of the form a, b = c, d and a, b, c = d, e, f. Sensible defaults are provided.
* py: Add support for start/stop/step attributes of builtin range object.Peter D. Gray2015-03-11
|
* py: Add MICROPY_MALLOC_USES_ALLOCATED_SIZE to allow simpler malloc API.Damien George2015-03-03
|
* objarray: Implement array slice assignment.Paul Sokolovsky2015-02-27
| | | | | | | | | | | | | | | | This is rarely used feature which takes enough code to implement, so is controlled by MICROPY_PY_ARRAY_SLICE_ASSIGN config setting, default off. But otherwise it may be useful, as allows to update arbitrary-sized data buffers in-place. Slice is yet to implement, and actually, slice assignment implemented in such a way that RHS of assignment should be array of the exact same item typecode as LHS. CPython has it more relaxed, where RHS can be any sequence of compatible types (e.g. it's possible to assign list of int's to a bytearray slice). Overall, when all "slice write" features are implemented, it may cost ~1KB of code.
* py: Update parse.c&mpconfig.h to reflect rename of mp_lexer_show_token.nhtshot2015-02-23
| | | | | This function is only used when DEBUG_PRINTERS and USE_RULE_NAME are enabled.
* py: Make math special functions configurable and disabled by default.Damien George2015-02-22
| | | | | | | The implementation of these functions is very large (order 4k) and they are rarely used, so we don't enable them by default. They are however enabled in stmhal and unix, since we have the room.
* py: Add MICROPY_OBJ_BASE_ALIGNMENT to help with 16-bit ports.Damien George2015-02-08
|
* py: Add MICROPY_PY_ALL_SPECIAL_METHODS and __iadd__ special method under it.Paul Sokolovsky2015-01-31
|
* py: Implement very simple frozen modules support.Paul Sokolovsky2015-01-20
| | | | | Only modules (not packages) supported now. Source modules can be converted to frozen module structures using tools/make-frozen.py script.
* pyexec: Add event-driven variant pyexec_friendly_repl().Paul Sokolovsky2015-01-16
| | | | | | | | | | pyexec_friendly_repl_process_char() and friends, useful for ports which integrate into existing cooperative multitasking system. Unlike readline() refactor before, this was implemented in less formal, trial&error process, minor functionality regressions are still known (like soft&hard reset support). So, original loop-based pyexec_friendly_repl() is left intact, specific implementation selectable by config setting.
* py, unix: Trace root pointers with native emitter under unix port.Damien George2015-01-14
| | | | | | Native code has GC-heap pointers in it so it must be scanned. But on unix port memory for native functions is mmap'd, and so it must have explicit code to scan it for root pointers.
* py: Add MICROPY_QSTR_BYTES_IN_LEN config option, defaulting to 1.Damien George2015-01-11
| | | | | | | | | | | | | | | | | | This new config option sets how many fixed-number-of-bytes to use to store the length of each qstr. Previously this was hard coded to 2, but, as per issue #1056, this is considered overkill since no-one needs identifiers longer than 255 bytes. With this patch the number of bytes for the length is configurable, and defaults to 1 byte. The configuration option filters through to the makeqstrdata.py script. Code size savings going from 2 to 1 byte: - unix x64 down by 592 bytes - stmhal down by 1148 bytes - bare-arm down by 284 bytes Also has RAM savings, and will be slightly more efficient in execution.
* py: Add config option MICROPY_COMP_MODULE_CONST for module consts.Damien George2015-01-10
| | | | | | Compiler optimises lookup of module.CONST when enabled (an existing feature). Disabled by default; enabled for unix, windows, stmhal. Costs about 100 bytes ROM on stmhal.
* py: Add MICROPY_PY_MICROPYTHON_MEM_INFO to enable mem-info funcs.Damien George2015-01-09
| | | | | | This allows to enable mem-info functions in micropython module, even if MICROPY_MEM_STATS is not enabled. In this case, you get mem_info and qstr_info but not mem_{total,current,peak}.
* py: Disable stack checking by default; enable on most ports.Damien George2015-01-09
|
* py: Add option to cache map lookup results in bytecode.Damien George2015-01-07
| | | | | | | | | | | | | | | This is a simple optimisation inspired by JITing technology: we cache in the bytecode (using 1 byte) the offset of the last successful lookup in a map. This allows us next time round to check in that location in the hash table (mp_map_t) for the desired entry, and if it's there use that entry straight away. Otherwise fallback to a normal map lookup. Works for LOAD_NAME, LOAD_GLOBAL, LOAD_ATTR and STORE_ATTR opcodes. On a few tests it gives >90% cache hit and greatly improves speed of code. Disabled by default. Enabled for unix and stmhal ports.
* py: Put all global state together in state structures.Damien George2015-01-07
| | | | | | 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.
* py: Make GC's STACK_SIZE definition a proper MICROPY_ config variable.Damien George2015-01-01
|
* py: Add basic framework for issuing compile/runtime warnings.Paul Sokolovsky2015-01-01
|
* py: Add include guards to mpconfig,misc,qstr,obj,runtime,parsehelper.Damien George2014-12-29
|
* py: Add MP_LIKELY(), MP_UNLIKELY() macros to help branch prediction.v1.3.8Paul Sokolovsky2014-12-29
|
* py: Add execfile function (from Python 2); enable in stmhal port.Damien George2014-12-19
| | | | Adds just 60 bytes to stmhal binary. Addresses issue #362.
* py: Allow builtins to be overridden.Damien George2014-12-09
| | | | | | | | | | | | | | 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.
* modubinascii: Add, with hexlify() implementation.Paul Sokolovsky2014-11-29
|
* moduhashlib: Initial module skeleton.Paul Sokolovsky2014-11-22
|
* py: Use shorter, static error msgs when ERROR_REPORTING_TERSE enabled.Damien George2014-11-06
| | | | | | | | Going from MICROPY_ERROR_REPORTING_NORMAL to MICROPY_ERROR_REPORTING_TERSE now saves 2020 bytes ROM for ARM Thumb2, and 2200 bytes ROM for 32-bit x86. This is about a 2.5% code size reduction for bare-arm.
* py: Fix some macros defines; cleanup some includes.Damien George2014-11-05
|
* unix: fast: Set initial module dict size big to have high pystone score.Paul Sokolovsky2014-11-05
| | | | For this, introduce MICROPY_MODULE_DICT_SIZE config setting.
* py: Allow to override port config file and thus have >1 configs per port.Paul Sokolovsky2014-10-29
| | | | | | Use it like: make CFLAGS_EXTRA='-DMP_CONFIGFILE="<mpconfigport_my.h>"'
* py: Implement compile builtin, enabled only on unix port.Damien George2014-10-25
| | | | | | | This should be pretty compliant with CPython, except perhaps for some corner cases to do with globals/locals context. Addresses issue #879.
* py: Add builtin memoryview object (mostly using array code).Damien George2014-10-23
|
* extmod: Add uheapq module.Damien George2014-10-22
|
* py: Fix dummy definition of BEGIN/END_ATOMIC_SECTION.Damien George2014-10-15
|