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
Damien George
a5190a7dac
py: Fix typing of viper locals; allow default types in annotation.
10 years ago
Damien George
2ac4af6946
py: Allow viper to have type annotations.
Viper functions can now be annotated with the type of their arguments
and return value. Eg:
@micropython.viper
def f(x:int) -> int:
return x + 1
10 years ago
Damien George
40f3c02682
Rename machine_(u)int_t to mp_(u)int_t.
See discussion in issue #50 .
11 years ago
Damien George
b601d9574a
py: Improvements to native emitter.
Native emitter can now compile try/except blocks using nlr_push/nlr_pop.
It probably only works for 1 level of exception handling. It doesn't
work on Thumb (only x64).
Native emitter can also handle some additional op codes.
With this patch, 198 tests now pass using "-X emit=native" option to
micropython.
11 years ago
Damien George
780e54cdc3
py: Implement delete_attr in native emitter.
11 years ago
Paul Sokolovsky
59c675a64c
py: Include mpconfig.h before all other includes.
It defines types used by all other headers.
Fixes #691 .
11 years ago
Damien George
25c84643b6
py: Fix break from within a for loop.
Needed to pop the iterator object when breaking out of a for loop. Need
also to be careful to unwind exception handler before popping iterator.
Addresses issue #635 .
11 years ago
Damien George
503d611033
py: Implement long int parsing in int(...).
Addresses issue #627 .
11 years ago
Damien George
ccc85ea0da
py: Combine native emitters to 1 glue function; distinguish viper.
This patch simplifies the glue between native emitter and runtime,
and handles viper code like inline assember: return values are
converted to Python objects.
Fixes issue #531 .
11 years ago
Damien George
d509ac25f9
py: Fix stack access in thumb native emitter.
11 years ago
Damien George
a32c1e41cc
py: Improve native emitter; now supports more opcodes.
11 years ago