summaryrefslogtreecommitdiff
path: root/py/emit.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-06-30 05:17:25 +0100
committerDamien George <damien.p.george@gmail.com>2014-06-30 05:17:25 +0100
commitb601d9574ad03a18d3eb476d631f547c7ea28243 (patch)
tree9fceb779e8109b1c147f6c30fe9a24e9d2b19d22 /py/emit.h
parent5813efd634a282caea3cca6e8448bda253f21c35 (diff)
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.
Diffstat (limited to 'py/emit.h')
-rw-r--r--py/emit.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/py/emit.h b/py/emit.h
index 874ec8819..03834cb21 100644
--- a/py/emit.h
+++ b/py/emit.h
@@ -134,6 +134,11 @@ typedef struct _emit_method_table_t {
void (*yield_value)(emit_t *emit);
void (*yield_from)(emit_t *emit);
+ // these methods are used to control entry to/exit from an exception handler
+ // they may or may not emit code
+ void (*start_except_handler)(emit_t *emit);
+ void (*end_except_handler)(emit_t *emit);
+
#if MICROPY_EMIT_CPYTHON
// these methods are only needed for emitcpy
void (*load_const_verbatim_str)(emit_t *emit, const char *str);