Damien George
3056509e00
py: Rename and reorder parameters in emit_make_function/closure.
In preparation for implementing default keyword arguments.
11 years ago
Damien George
d17926db71
Rename rt_* to mp_*.
Mostly just a global search and replace. Except rt_is_true which
becomes mp_obj_is_true.
Still would like to tidy up some of the names, but this will do for now.
11 years ago
Damien George
2326d52d20
py: Factor out code from runtime.c to emitglue.c.
11 years ago
Damien George
35e2a4e6bb
py: Add built-in super.
11 years ago
Damien George
cbddb279bb
py: Implement break/continue from an exception with finally.
Still todo: break/continue from within the finally block itself.
11 years ago
Damien George
08d075592f
py: Fix bug with LOAD_METHOD; fix int->machine_int_t for small int.
LOAD_METHOD bug was: emitbc did not correctly calculate the amount of
stack usage for a LOAD_METHOD operation.
small int bug was: int was being used to pass small ints, when it should
have been machine_int_t.
11 years ago
Damien George
41d02b654e
py: Improve freeing of emitters in mp_compile.
There can be multiple emitters allocated during compile (eg byte code
and native).
11 years ago
Paul Sokolovsky
f46d87a30d
Add support for freeing code emitter objects at the end of compilation.
11 years ago
Damien George
cbd2f7482c
py: Add module/function/class name to exceptions.
Exceptions know source file, line and block name.
Also tidy up some debug printing functions and provide a global
flag to enable/disable them.
11 years ago
Damien George
08335004cf
Add source file name and line number to error messages.
Byte code has a map from byte-code offset to source-code line number,
used to give better error messages.
11 years ago
John R. Lenton
b8698fca75
unified the bops
11 years ago
Paul Sokolovsky
24507aff7d
Typo fix in comment.
11 years ago
ian-v
5fd8fd2c16
Revert MP_BOOL, etc. and use <stdbool.h> instead
11 years ago
ian-v
7a16fadbf8
Co-exist with C++ (issue #85 )
11 years ago
Paul Sokolovsky
fe039b4f4f
Typo fix in comment.
11 years ago
Damien
d99b05282d
Change object representation from 1 big union to individual structs.
A big change. Micro Python objects are allocated as individual structs
with the first element being a pointer to the type information (which
is itself an object). This scheme follows CPython. Much more flexible,
not necessarily slower, uses same heap memory, and can allocate objects
statically.
Also change name prefix, from py_ to mp_ (mp for Micro Python).
11 years ago
Damien
a1b2693161
py: remove further unnecessary emit_verbatim code.
11 years ago
Damien
9ecbcfff99
py: work towards working closures.
11 years ago
Damien
27fb45eb1c
Add local_num skeleton framework to deref/closure emit calls.
11 years ago
Damien
a397776d6b
Implement basic class/object functionality in runtime.
11 years ago
Damien
13ed3a658d
Native Python and Viper support for x64 and thumb all together.
11 years ago
Damien
7af3d19a3c
Implement crude viper emit stage.
11 years ago
Damien
a2f2f7db1f
Almost supports arguments for inline asm functions.
11 years ago
Damien
826005c60b
Add support for inline thumb assembly.
11 years ago
Damien
6cdd3af601
Implement built-in decorators to select emit type.
11 years ago
Damien
4b03e77d4a
Factorise EMIT_COMMON calls, mostly into emit_pass1.
11 years ago
Damien
054848a1b8
Compiler computes labels and max_num_labels.
11 years ago
Damien
b05d707b23
Further factorise PASS_1 out of specific emit code.
11 years ago
Damien
415eb6f850
Restructure emit so it goes through a method table.
11 years ago
Damien
429d71943d
Initial commit.
11 years ago