summaryrefslogtreecommitdiff
path: root/py
AgeCommit message (Collapse)Author
2014-10-09py: Add further checks for failed malloc in lexer init functions.Damien George
2014-10-09Merge branch 'lexer-crash' of https://github.com/dhylands/micropython into ↵Damien George
dhylands-lexer-crash
2014-10-09py: Add #if guard around gc-specific code.Damien George
2014-10-08Make lexer fail gracefully when memory can't be allocated.Dave Hylands
2014-10-07Allow real memory errors (from locked gc) to be reported with traceback.Dave Hylands
2014-10-06py: Extra autodetect for little endianness using __LITTLE_ENDIAN__.Damien George
2014-10-06py: Make mp_binary_set_val work on big endian machine.Damien George
2014-10-06py: Make int.to_bytes work on big endian machine.Damien George
Partly addresses issue #856.
2014-10-06py: Try to autodetect machine endianness when not defined by port.Damien George
2014-10-05py: Implement proper context save/restore for eval/exec; factor code.Damien George
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.
2014-10-05py: Make compiler return a proper exception on SyntaxError.Damien George
2014-10-04Implement missing ARM emitter functions for viperFabian Vogt
2014-10-03py: Fix unix-cpy to compile with uint->mp_uint_t changes.Damien George
2014-10-03py: Change [u]int to mp_[u]int_t in qstr.[ch], and some other places.Damien George
This should pretty much resolve issue #50.
2014-10-03py: Use UINT_FMT instead of %d.Damien George
2014-10-03py: Convert [u]int to mp_[u]int_t where appropriate.Damien George
Addressing issue #50.
2014-09-30py: Remove IOError since it's deprecated; use OSError instead.Damien George
In CPython IOError (and EnvironmentError) is deprecated and aliased to OSError. All modules that used to raise IOError now raise OSError (or a derived exception). In Micro Python we never used IOError (except 1 place, incorrectly) and so don't need to keep it. See http://legacy.python.org/dev/peps/pep-3151/ for background.
2014-09-29py: Allow x86-64 to mov r16 to rm16 with extended src reg.Damien George
Fixes bug with x86-64 viper ptr16.
2014-09-29py: Fix viper store on x86; add tests for viper ptr16.Damien George
2014-09-29py: Add casting to viper; add native mem stores to viper.Damien George
Viper can now do the following: def store(p:ptr8, c:int): p[0] = c This does a store of c to the memory pointed to by p using a machine instructions inline in the code.
2014-09-29py: Implement more binary ops for viper emitter.Damien George
This included a bit of restructuring of the assembler backends. Note that the ARM backend is missing a few functions and won't compile.
2014-09-29py: Allow viper to use ints as direct conditionals in jumps.Damien George
Allows things like: if 1: ...
2014-09-29py: Fix types, uint -> mp_uint_t.Damien George
2014-09-29py: Make macro names in assemblers consistent, and tidy up a bit.Damien George
2014-09-29py: Add store r8 and store r16 ops to asm_x86 and asm_x64.Damien George
2014-09-29py: In asmthumb, clean up unit/int types and ite ops.Damien George
2014-09-28Fix error: unknown type name 'size_t'bvernoux
2014-09-26py: Clean up nlr*.S to make it easier to read; fix clang .bss error.Damien George
It seems that newer versions of clang don't like the .bss directive, so we don't use it for OSX. Addressing issues #865 and #875.
2014-09-25py: Simplify JSON str printing (while still conforming to JSON spec).Damien George
The JSON specs are relatively flexible and allow us to use one function to print strings, be they ascii, bytes or utf-8 encoded.
2014-09-25py: Tidy up exception matching; allow matching of tuple of exceptions.Damien George
Addresses issue #864.
2014-09-25py: For malloc and vstr functions, use size_t exclusively for int type.Damien George
It seems most sensible to use size_t for measuring "number of bytes" in malloc and vstr functions (since that's what size_t is for). We don't use mp_uint_t because malloc and vstr are not Micro Python specific.
2014-09-23py: Free non-interned strings in the parser when not needed.Damien George
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.
2014-09-23py: Make native emitter handle multi-compare and not/is not/not in ops.Damien George
2014-09-23stmhal: Initialise stack pointer correctly.Damien George
Stack is full descending and must be 8-byte aligned. It must start off pointing to just above the last byte of RAM. Previously, stack started pointed to last byte of RAM (eg 0x2001ffff) and so was not 8-byte aligned. This caused a bug in combination with alloca. This patch also updates some debug printing code. Addresses issue #872 (among many other undiscovered issues).
2014-09-21extmod: Add loads to ujson module.Damien George
2014-09-17py: Add 'builtins' module.Damien George
2014-09-17py: Add native json printing using existing print framework.Damien George
Also add start of ujson module with dumps implemented. Enabled in unix and stmhal ports. Test passes on both.
2014-09-17py: Make dict use a bit less RAM when iterating; properly del values.Damien George
Heap RAM was being allocated to print dicts and do some other types of iterating. Now these iterations use 1 word of state on the stack. Deleting elements from a dict was not allowing the value to be reclaimed by the GC. This is now fixed.
2014-09-15py: Make asm_arm_less_op take destination register as first arg.Damien George
This gets ARM native emitter working againg and addresses issue #858.
2014-09-15py: Move definition of mp_sys_exit to core.Damien George
sys.exit always raises SystemExit so doesn't need a special implementation for each port. If C exit() is really needed, use the standard os._exit function. Also initialise mp_sys_path and mp_sys_argv in teensy port.
2014-09-13py: Fix build error when float disabled; add test for divmod.Damien George
2014-09-13py: Implement divmod, % and proper // for floating point.Damien George
Tested and working on unix and pyboard.
2014-09-12py: Load strings as objects when compiling viper.Damien George
Eventually, viper wants to be able to use raw pointers to strings and arrays for efficient access. But for now, let's just load strings as a Python object so they can be used as normal. This will anyway be compatible with eventual intended viper behaviour. Addresses issue #857.
2014-09-11py and libm: Add asinf,acosf; print higher precision for float.Damien George
Also use less stack space when printing single precision float. Addition of asinf and acosf addresses issue #851.
2014-09-10py: Enable struct/binary-helper to parse q and Q sized ints.Damien George
Addresses issue #848.
2014-09-08py: Put define of x86 argument registers in asmx86.h.Damien George
2014-09-08py: Convert [u]int to mp_[u]int_t in emit.h and associated .c files.Damien George
Towards resolving issue #50.
2014-09-08py: Print imported module's location (__file__) if available.Damien George
2014-09-07Remove skeletal modselect from extmod and just put it in stmhal.Damien George
2014-09-07py: Rename mp_builtin_id to mp_obj_id and make it public.Damien George