summaryrefslogtreecommitdiffstatshomepage
path: root/py
Commit message (Collapse)AuthorAge
* unix/mpconfigport: Move log2() definition to modmath.c.Paul Sokolovsky2015-11-13
| | | | | It's safer to define it where it's used, defining it for all source files may lead to hard to diagnose conflicts in corner cases.
* py: Allow to import compiled bytecode files.Damien George2015-11-13
|
* py: Add MICROPY_PERSISTENT_CODE_LOAD/SAVE to load/save bytecode.Damien George2015-11-13
| | | | | | MICROPY_PERSISTENT_CODE must be enabled, and then enabling MICROPY_PERSISTENT_CODE_LOAD/SAVE (either or both) will allow loading and/or saving of code (at the moment just bytecode) from/to a .mpy file.
* py: Add MICROPY_PERSISTENT_CODE so code can persist beyond the runtime.Damien George2015-11-13
| | | | | | | | | | | Main changes when MICROPY_PERSISTENT_CODE is enabled are: - qstrs are encoded as 2-byte fixed width in the bytecode - all pointers are removed from bytecode and put in const_table (this includes const objects and raw code pointers) Ultimately this option will enable persistence for not just bytecode but also native code.
* py: Add constant table to bytecode.Damien George2015-11-13
| | | | | Contains just argument names at the moment but makes it easy to add arbitrary constants.
* py: Put all bytecode state (arg count, etc) in bytecode.Damien George2015-11-13
|
* py: Reorganise bytecode layout so it's more structured, easier to edit.Damien George2015-11-13
|
* py/emitinlinethumb: Allow to compile with -Wsign-compare.Damien George2015-11-09
|
* py/asmthumb: Allow to compile with -Wsign-compare and -Wunused-parameter.Damien George2015-11-09
|
* py/objint_longlong: Instead of assert, throw OverflowError.Paul Sokolovsky2015-11-09
|
* py: Clear finalizer flag when calling gc_free.Dave Hylands2015-11-07
| | | | | | | | | | | Currently, the only place that clears the bit is in gc_collect. So if a block with a finalizer is allocated, and subsequently freed, and then the block is reallocated with no finalizer then the bit remains set. This could also be fixed by having gc_alloc clear the bit, but I'm pretty sure that free is called way less than alloc, so doing it in free is more efficient.
* py: Adjust object repr C (30-bit stuffed float) to reduce code size.Damien George2015-11-06
| | | | | | | | | | This patch adds/subtracts a constant from the 30-bit float representation so that str/qstr representations are favoured: they now have all the high bits set to zero. This makes encoding/decoding qstr strings more efficient (and they are used more often than floats, which are now slightly less efficient to encode/decode). Saves about 300 bytes of code space on Thumb 2 arch.
* all: Add py/mphal.h and use it in all ports.Damien George2015-10-31
| | | | | | py/mphal.h contains declarations for generic mp_hal_XXX functions, such as stdio and delay/ticks, which ports should provide definitions for. A port will also provide mphalport.h with further HAL declarations.
* py/modstruct: Support repetition counters for all types, not just string.Paul Sokolovsky2015-10-31
| | | | | | | This makes format specifiers ~ fully compatible with CPython. Adds 24 bytes for stmhal port (because previosuly we had to catch and report it's unsupported to user).
* py: In inline asm, vldr and vstr offsets now in bytes not words.adminpete2015-10-31
| | | | As per ARM convention.
* py/makeversionhdr.py: Work with backslashes in paths.omtinez2015-10-30
| | | | | This script may be called by Windows IDEs (e.g. Visual Studio) and be passed paths with backslashes.
* extmod/modlwip: slip: Use stream protocol and be port-independent.Paul Sokolovsky2015-10-27
| | | | | Based on the original patch by Galen Hazelwood: https://github.com/micropython/micropython/pull/1517 .
* Makefiles: Remove duplicate object files when linking.Paul Sokolovsky2015-10-24
| | | | | | | | | | | Scenario: module1 depends on some common file from lib/, so specifies it in its SRC_MOD, and the same situation with module2, then common file from lib/ eventually ends up listed twice in $(OBJ), which leads to link errors. Make is equipped to deal with such situation easily, quoting the manual: "The value of $^ omits duplicate prerequisites, while $+ retains them and preserves their order." So, just use $^ consistently in all link targets.
* py/nlrthumb: Make compatible with Cortex-M0 (ARMv6M instr set).Damien George2015-10-20
|
* py: With obj repr "C", change raw str accessor from macro to function.Damien George2015-10-20
| | | | | | This saves around 1000 bytes (Thumb2 arch) because in repr "C" it is costly to check and extract a qstr. So making such check/extract a function instead of a macro saves lots of code space.
* py: Add object repr "C", where 30-bit floats are stuffed in obj word.Damien George2015-10-20
| | | | | | This new object representation puts floats into the object word instead of on the heap, at the expense of reducing their precision to 30 bits. It only makes sense when the word size is 32-bits.
* py: Make float representation configurable with object representation.Damien George2015-10-20
|
* py: Move float e/pi consts to objfloat and make mp_obj_float_t private.Damien George2015-10-20
|
* py: Add mp_obj_is_float function (macro) and use it where appropriate.Damien George2015-10-20
|
* all: Make netutils.h available to all ports by default.Paul Sokolovsky2015-10-19
| | | | | Generally, ports should inherit INC from py.mk, append to it, not overwrite it. TODO: Likely should do the same for other vars too.
* unix/modtime: Implement ticks_ms(), ticks_us() and ticks_diff().Paul Sokolovsky2015-10-19
| | | | | All of these functions return positive small int, thus range is 2 bits less than word size (30 bit on 32-bit systems, 62 bit on 64-bit systems).
* py: Add lsl/lsr/asr opcode support to inline Thumb2 assembler.Damien George2015-10-19
|
* py/stream: Allow to reuse is_nonblocking_error().Paul Sokolovsky2015-10-18
|
* py: Add support for _ in REPL to hold last computed value.Damien George2015-10-17
| | | | Only available when MICROPY_CAN_OVERRIDE_BUILTINS is enabled.
* py: Add option for inline assembler to support ARMv7-M instructions.Damien George2015-10-16
| | | | | | Cortex-M0, M0+ and M1 only have ARMv6-M Thumb/Thumb2 instructions. M3, M4 and M7 have a superset of these, named ARMv7-M. This patch adds a config option to enable support of the superset of instructions.
* py: Fix with+for+return bug by popping for-iter when unwinding exc stack.Damien George2015-10-15
| | | | Addresses issue #1182.
* py: Remove dependency on printf/fwrite in mp_plat_print.Damien George2015-10-15
| | | | See issue #1500.
* py/compile: Remove unnecessary label in compilation of for statement.Damien George2015-10-14
|
* py: Fix build of ARM native emitter due to recent viper changes.Damien George2015-10-14
| | | | Addresses #1510.
* py/qstr: Fix calc of qstr memory usage, due to new qstr chunk allocation.Damien George2015-10-13
|
* py: Implement ptr32 load and store in viper emitter.Damien George2015-10-13
|
* py: Add support to call __init__ from a builtin module on first import.Damien George2015-10-12
|
* py: Allow to to build MicroPython as a static library.Paul Sokolovsky2015-10-12
| | | | | | The whole current port gets slurped into a static lib named "libmicropython.a". Maybe that's not ideal, but at least something to start with.
* py/parse: Make parser error handling cleaner, less spaghetti-like.Damien George2015-10-12
|
* py: Move constant folding from compiler to parser.Damien George2015-10-12
| | | | | | | | | | It makes much more sense to do constant folding in the parser while the parse tree is being built. This eliminates the need to create parse nodes that will just be folded away. The code is slightly simpler and a bit smaller as well. Constant folding now has a configuration option, MICROPY_COMP_CONST_FOLDING, which is enabled by default.
* py/objarray: Allow to create array of void pointers, as extension to CPython.Paul Sokolovsky2015-10-12
| | | | | Using 'P' format specifier (matches struct module). This is another shortcut for FFI, just as previously introduced "array of objects" ('O').
* py: Rename MP_BOOL() to mp_obj_new_bool() for consistency in naming.Paul Sokolovsky2015-10-11
|
* py/makeqstrdata.py: Catch and report case of empty input file.Paul Sokolovsky2015-10-11
| | | | The usual cause would be that a cross-compiler for a port is not in PATH.
* py/parse: Factor logic when creating parse node from and-rule.Damien George2015-10-08
|
* py: Don't generate unnecessary parse nodes for assignment or kwargs.Damien George2015-10-08
| | | | | This patch eliminates the need for a nested parse node for assignments and keyword arguments. It saves a little bit of RAM when parsing.
* py/emitnative: Raise ViperTypeError for unsupported unary ops.Damien George2015-10-08
|
* py/compile: Fix edge case when constant-folding negation of integer.Damien George2015-10-08
| | | | Also adds tests specifically for testing constant folding.
* modussl: SSL socket wrapper module based on axTLS.Paul Sokolovsky2015-10-06
|
* py: Allow to enable inline assembler without native emitter.Damien George2015-10-03
|
* py: Allocate parse nodes in chunks to reduce fragmentation and RAM use.Damien George2015-10-02
| | | | | | | | 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.