summaryrefslogtreecommitdiffstatshomepage
path: root/py
Commit message (Collapse)AuthorAge
* py/builtinimport: Remove unreachable code and change obj-import comment.Damien George2017-01-16
|
* py/builtinimport: Raise ValueError for bad relative import, per CPython.Damien George2017-01-16
|
* py/builtinimport: Fix bug when importing names from frozen packages.Damien George2017-01-08
| | | | | | | | The commit d9047d3c8a99603884db25076c37778f50633ca6 introduced a bug whereby "from a.b import c" stopped working for frozen packages. This is because the path was not properly truncated and became "a//b". Such a path resolves correctly for a "real" filesystem, but not for a search in the list of frozen modules.
* py/mkrules.mk: Add MPY_CROSS_FLAGS option to pass flags to mpy-cross.Damien George2017-01-05
| | | | So that ports can pass their own custom options to mpy-cross.
* py/asmarm: Fix assembler's PASS_EMIT constant name.Damien George2017-01-03
|
* py/unicode: Comment-out unused function unichar_isprint.Damien George2016-12-28
|
* py/objint: Simplify mp_int_format_size and remove unreachable code.Damien George2016-12-28
| | | | | One never needs to format integers with a base larger than 16 (but code can be easily extended beyond this value if needed in the future).
* py/mpprint: Add assertion for, and comment about, valid base values.Damien George2016-12-28
|
* py/parsenum: Fix warning for signed/unsigned comparison.Damien George2016-12-28
|
* py/mpz: Fix assertion in mpz_set_from_str which checks value of base.Damien George2016-12-28
|
* py/parsenum: Simplify and generalise decoding of digit values.Damien George2016-12-28
| | | | | This function should be able to parse integers with any value for the base, because it is called by int('xxx', base).
* cc3200: Re-add support for UART REPL (MICROPY_STDIO_UART setting).Paul Sokolovsky2016-12-27
| | | | | | | | UART REPL support was lost in os.dupterm() refactorings, etc. As os.dupterm() is there, implement UART REPL support at the high level - if MICROPY_STDIO_UART is set, make default boot.py contain os.dupterm() call for a UART. This means that changing MICROPY_STDIO_UART value will also require erasing flash on a module to force boot.py re-creation.
* py/misc.h: Typo fix in comment.Paul Sokolovsky2016-12-27
|
* py/lexer: Permanently disable the mp_lexer_show_token function.Damien George2016-12-22
| | | | | The lexer is very mature and this debug function is no longer used. If it's really needed one can uncomment it and recompile.
* py/lexer: Remove unnecessary check for EOF in lexer's next_char func.Damien George2016-12-22
| | | | | | | | This check always fails (ie chr0 is never EOF) because the callers of this function never call it past the end of the input stream. And even if they did it would be harmless because 1) reader.readbyte must continue to return an EOF char if the stream is exhausted; 2) next_char would just count the subsequent EOF's as characters worth 1 column.
* py/lexer: Remove unreachable code in string tokeniser.Damien George2016-12-22
|
* tests/basics/lexer: Add a test for newline-escaping within a string.Damien George2016-12-22
|
* extmod/modutimeq: Refactor into optimized class.Paul Sokolovsky2016-12-22
| | | | | | | | | | import utimeq, utime # Max queue size, the queue allocated statically on creation q = utimeq.utimeq(10) q.push(utime.ticks_ms(), data1, data2) res = [0, 0, 0] # Items in res are filled up with results q.pop(res)
* py/emitglue: Refactor to remove assert(0), to improve coverage.Damien George2016-12-21
|
* py/objint: Rename mp_obj_int_as_float to mp_obj_int_as_float_impl.Damien George2016-12-21
| | | | | | And also simplify it to remove the check for small int. This can be done because this function is only ever called if the argument is not a small int.
* py/modbuiltins: Remove unreachable code.Damien George2016-12-20
|
* py/compile: Add an extra pass for Xtensa inline assembler.Damien George2016-12-19
| | | | | It needs an extra pass to compute the size of the constant table for the l32r instructions.
* py: Add MICROPY_KBD_EXCEPTION config option to provide mp_kbd_exception.Damien George2016-12-15
| | | | | | | | Defining and initialising mp_kbd_exception is boiler-plate code and so the core runtime can provide it, instead of each port needing to do it themselves. The exception object is placed in the VM state rather than on the heap.
* py/mpconfig.h: Enable MICROPY_PY_SYS_EXIT by default.Paul Sokolovsky2016-12-14
| | | | | | sys.exit() is an important function to terminate a program. In particular, the testsuite relies on it to skip tests (i.e. any other functionality may be disabled, but sys.exit() is required to at least report that properly).
* py/runtime: Zero out fs_user_mount array in mp_init.Damien George2016-12-14
| | | | | There's no need to force ports to copy-and-paste this initialisation code. If FSUSERMOUNT is enabled then this zeroing out must be done.
* py/mpz: Remove unreachable code in mpn_or_neg functions.Damien George2016-12-14
|
* py/builtinimport: Support importing packages from compiled .mpy files.Damien George2016-12-13
| | | | | This patch ensures that __init__.mpy files are imported if their containing directory is imported as a package.
* py/binary: Do zero extension when storing a value larger than word size.Damien George2016-12-12
|
* py/objint: from_bytes, to_bytes: Require byteorder arg, require "little".Paul Sokolovsky2016-12-09
| | | | | CPython requires byteorder arg, make uPy compatible. As we support only "little", error out on anything else.
* py/asm: Fix x86 and ARM assemblers due to recent code refactoring.Damien George2016-12-09
|
* py/asm: Remove need for dummy_data when doing initial assembler passes.Damien George2016-12-09
| | | | | | | | For all but the last pass the assembler only needs to count how much space is needed for the machine code, it doesn't actually need to emit anything. The dummy_data just uses unnecessary RAM and without it the code is not any more complex (and code size does not increase for Thumb and Xtensa archs).
* py/emitinline: Move common code for end of final pass to compiler.Damien George2016-12-09
| | | | | | This patch moves some common code from the individual inline assemblers to the compiler, the code that calls the emit-glue to assign the machine code to the functions scope.
* py/emitinline: Move inline-asm align and data methods to compiler.Damien George2016-12-09
| | | | | These are generic methods that don't depend on the architecture and so can be handled directly by the compiler.
* py/emitinline: Embed entire asm struct instead of a pointer to it.Damien George2016-12-09
| | | | | | This reduces fragmentation, and memory use by 1 word. But more importantly it means the emit_inline_asm_t struct now "derives" from mp_asm_base.
* py: Add inline Xtensa assembler.Damien George2016-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the MICROPY_EMIT_INLINE_XTENSA option, which, when enabled, allows the @micropython.asm_xtensa decorator to be used. The following opcodes are currently supported (ax is a register, a0-a15): ret_n() callx0(ax) j(label) jx(ax) beqz(ax, label) bnez(ax, label) mov(ax, ay) movi(ax, imm) # imm can be full 32-bit, uses l32r if needed and_(ax, ay, az) or_(ax, ay, az) xor(ax, ay, az) add(ax, ay, az) sub(ax, ay, az) mull(ax, ay, az) l8ui(ax, ay, imm) l16ui(ax, ay, imm) l32i(ax, ay, imm) s8i(ax, ay, imm) s16i(ax, ay, imm) s32i(ax, ay, imm) l16si(ax, ay, imm) addi(ax, ay, imm) ball(ax, ay, label) bany(ax, ay, label) bbc(ax, ay, label) bbs(ax, ay, label) beq(ax, ay, label) bge(ax, ay, label) bgeu(ax, ay, label) blt(ax, ay, label) bnall(ax, ay, label) bne(ax, ay, label) bnone(ax, ay, label) Upon entry to the assembly function the registers a0, a12, a13, a14 are pushed to the stack and the stack pointer (a1) decreased by 16. Upon exit, these registers and the stack pointer are restored, and ret.n is executed to return to the caller (caller address is in a0). Note that the ABI for the Xtensa emitters is non-windowing.
* py: Allow inline-assembler emitter to be generic.Damien George2016-12-09
| | | | | This patch refactors some code so that it is easier to integrate new inline assemblers for different architectures other than ARM Thumb.
* py: Integrate Xtensa assembler into native emitter.Damien George2016-12-09
| | | | | | The config option MICROPY_EMIT_XTENSA can now be enabled to target the Xtensa architecture with @micropython.native and @micropython.viper decorators.
* py/asmxtensa: Add low-level Xtensa assembler.Damien George2016-12-09
|
* py/asmbase: Add MP_PLAT_COMMIT_EXEC option for handling exec code.Damien George2016-12-09
| | | | | | | If a port defines MP_PLAT_COMMIT_EXEC then this function is used to turn RAM data into executable code. For example a port may want to write the data to flash for execution. The function must return a pointer to the executable data.
* py: Move arch-specific assembler macros from emitnative to asmXXX.h.Damien George2016-12-09
|
* py/emit.h: Remove long-obsolete declarations for cpython emitter.Damien George2016-12-09
|
* py/compile: Simplify configuration of native emitter.Damien George2016-12-07
|
* py/stream: Move ad-hoc ioctl constants to stream.h and rename them.Damien George2016-12-02
| | | | | | | | The constants MP_IOCTL_POLL_xxx, which were stmhal-specific, are moved from stmhal/pybioctl.h (now deleted) to py/stream.h. And they are renamed to MP_STREAM_POLL_xxx to be consistent with other such constants. All uses of these constants have been updated.
* py/asmthumb: Fix build for F7 MCUs after recent code refactoring.Damien George2016-11-30
|
* py: Factor out common code from assemblers into asmbase.[ch].Damien George2016-11-28
| | | | All assemblers should "derive" from mp_asm_base_t.
* py/compile: Remove comment about TODO for short circuiting for if-stmt.Damien George2016-11-26
| | | | | Short circuiting is handled correctly by c_if_cond, and constants within short-circuit expressions are optimised by the parser.
* py/objtype: Implement __call__ handling for an instance w/o heap alloc.Paul Sokolovsky2016-11-22
| | | | By refactoring and reusing code from objboundmeth.
* stmhal/moduselect: Move to extmod/ for reuse by other ports.Paul Sokolovsky2016-11-21
|
* py/lexer: Make lexer use an mp_reader as its source.Damien George2016-11-16
|
* py/lexer: Rewrite mp_lexer_new_from_fd in terms of mp_reader.Damien George2016-11-16
|