Damien George
fa5950eb00
py: Fix bug in native emitter when closing over an argument.
10 years ago
Damien George
99957384ea
py: Get native emitter working again with x86 (now supports closures).
10 years ago
Damien George
4cd9ced8dc
py: Implement closures in native code generator.
Currently supports only x64 and Thumb2 archs.
10 years ago
Damien George
2cc5473021
py: Implement (non-compliant) support for delete_fast in native emitter.
This implementation is smaller (in code size) than #1024 .
10 years ago
Damien George
2686f9b3e8
py: Fix emitnative's creation of small ints so it uses the macro.
10 years ago
Damien George
51229afbde
py: Increase fixed size of stack-info in native emitter.
This is a temporary fix.
10 years ago
Damien George
542bd6b4a1
py, compiler: Refactor load/store/delete_id logic to reduce code size.
Saves around 230 bytes on Thumb2 and 750 bytes on x86.
10 years ago
Damien George
63f3832e81
py: Combine emit functions for jump true/false to reduce code size.
Saves 116 bytes for stmhal and 56 bytes for cc3200 port.
10 years ago
Damien George
1a6721fefd
py: Remove obsolete MP_F_LOAD_CONST_{INT,DEC} from emitnative.c.
10 years ago
Damien George
7d414a1b52
py: Parse big-int/float/imag constants directly in parser.
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 .
10 years ago
Damien George
3da677e658
py: Implement Ellipsis object in native emitter.
10 years ago
Damien George
32444b759a
py: Don't use anonymous unions, name them instead.
This makes the code (more) compatible with the C99 standard.
10 years ago
Damien George
b6e6b5277f
py: Implement proper re-raising in native codegen's finally handler.
This allows an exception to propagate correctly through a finally
handler.
10 years ago
Damien George
ff8dd3f486
py, unix: Allow to compile with -Wunused-parameter.
See issue #699 .
10 years ago
Damien George
0abb5609b0
py: Remove unnecessary id_flags argument from emitter's load_fast.
Saves 24 bytes in bare-arm.
10 years ago
Damien George
2127e9a844
py, unix: Trace root pointers with native emitter under unix port.
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.
10 years ago
Damien George
dab1385177
py: Add load_const_obj to emitter, add LOAD_CONST_OBJ to bytecode.
This allows to directly load a Python object to the Python stack. See
issue #722 for background.
10 years ago
Damien George
51dfcb4bb7
py: Move to guarded includes, everywhere in py/ core.
Addresses issue #1022 .
10 years ago
Paul Sokolovsky
db1ac360c3
emitnative: Disable warning in delete_fast for now (breaks test).
10 years ago
Paul Sokolovsky
8a8c1fc82f
py: Add basic framework for issuing compile/runtime warnings.
10 years ago
Damien George
83204f3406
py: Allow to properly disable builtin slice operation.
This patch makes the MICROPY_PY_BUILTINS_SLICE compile-time option
fully disable the builtin slice operation (when set to 0). This
includes removing the slice sytanx from the grammar. Now, enabling
slice costs 4228 bytes on unix x64, and 1816 bytes on stmhal.
10 years ago
Damien George
e37dcaafb4
py: Allow to properly disable builtin "set" object.
This patch makes MICROPY_PY_BUILTINS_SET compile-time option fully
disable the builtin set object (when set to 0). This includes removing
set constructor/comprehension from the grammar, the compiler and the
emitters. Now, enabling set costs 8168 bytes on unix x64, and 3576
bytes on stmhal.
10 years ago
Damien George
21ca2d76a2
py: Partially fix viper multi-comparison; add test for it.
10 years ago
Damien George
3c34d4140d
py: Fix x86 viper code generation, mem8 <-> mem16 for load.
10 years ago
Damien George
91cfd414c0
py: Implement native load for viper.
Viper can now do: ptr8(buf)[0], which loads a byte from a buffer using
machine instructions.
10 years ago
Damien George
1ef2348df0
py: Implement and,or,xor native ops for viper.
10 years ago
Fabian Vogt
e5268963c6
Implement missing ARM emitter functions for viper
10 years ago
Damien George
39dc145478
py: Change [u]int to mp_[u]int_t in qstr.[ch], and some other places.
This should pretty much resolve issue #50 .
10 years ago
Damien George
dfef4249eb
py: Fix viper store on x86; add tests for viper ptr16.
10 years ago
Damien George
e9dac3b4d0
py: Add casting to viper; add native mem stores to viper.
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.
10 years ago
Damien George
3112cde900
py: Implement more binary ops for viper emitter.
This included a bit of restructuring of the assembler backends. Note
that the ARM backend is missing a few functions and won't compile.
10 years ago
Damien George
6f81348fa2
py: Allow viper to use ints as direct conditionals in jumps.
Allows things like: if 1: ...
10 years ago
Damien George
0b610de017
py: Make macro names in assemblers consistent, and tidy up a bit.
10 years ago
Damien George
851f15f34c
py: In asmthumb, clean up unit/int types and ite ops.
10 years ago
Damien George
d6230f62c7
py: Make native emitter handle multi-compare and not/is not/not in ops.
10 years ago
Damien George
d4a799f152
py: Make asm_arm_less_op take destination register as first arg.
This gets ARM native emitter working againg and addresses issue #858 .
10 years ago
Damien George
bb29546868
py: Load strings as objects when compiling viper.
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 .
10 years ago
Damien George
6eae861685
py: Put define of x86 argument registers in asmx86.h.
10 years ago
Damien George
7ff996c237
py: Convert [u]int to mp_[u]int_t in emit.h and associated .c files.
Towards resolving issue #50 .
10 years ago
Damien George
8105736982
py: Clean up x86-64 native assembler; allow use of extended regs.
Native x86-64 now has 3 locals in registers.
10 years ago
Damien George
25d904105c
py: Adjust regs for x86 so that 1 more local can live in a reg.
10 years ago
Damien George
03281b3850
py: Allow x86 native functions to take arguments.
Fix some bugs with x86 stack and saving registers correctly.
10 years ago
Damien George
c90f59ec3a
py: Add support for emitting native x86 machine code.
10 years ago
Damien George
e6ce10a3e7
py: Native emitter now supports delete name & global, and end finally.
10 years ago
Damien George
dda46460ff
Code style/whitespace cleanup; remove obsolete headers.
And move the MAP_ANON redefinition from py/asmx64.c to unix/alloc.c.
10 years ago
Damien George
02d95d7ce9
py: Fix 2 bugs in native emitter: jump_or_pop and stack settling.
Addresses issue #838 .
10 years ago
Fabian Vogt
fe3d16e8c2
Basic native ARM emitter
10 years ago
Damien George
7fe2191c9b
py: Code clean-up in native emitter; improve thumb native calls.
10 years ago
Damien George
86de21b810
py: Viper can call functions with native types, and raise exceptions.
10 years ago
Damien George
e6c0dff967
py: Viper can now store to global.
10 years ago