diff options
author | Damien George <damien.p.george@gmail.com> | 2018-09-14 17:40:59 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-09-15 22:39:27 +1000 |
commit | 43f1848bfa81aa3cb0acd1e34eece0a11aa130d0 (patch) | |
tree | 525de05e2d2fffaa8700ff010204a888d0838b07 /py/compile.c | |
parent | 460954734e12074d29056b446d1406a27e2aed9f (diff) |
py: Make viper functions have the same entry signature as native.
This commit makes viper functions have the same signature as native
functions, at the level of the emitter/assembler. This means that viper
functions can now be wrapped in the same uPy object as native functions.
Viper functions are now responsible for parsing their arguments (before it
was done by the runtime), and this makes calling them more efficient (in
most cases) because the viper entry code can be custom generated to suit
the signature of the function.
This change also opens the way forward for viper functions to take
arbitrary numbers of arguments, and for them to handle globals correctly,
among other things.
Diffstat (limited to 'py/compile.c')
-rw-r--r-- | py/compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/compile.c b/py/compile.c index 30355a11c..ec6b463c0 100644 --- a/py/compile.c +++ b/py/compile.c @@ -2938,7 +2938,7 @@ STATIC void compile_scope(compiler_t *comp, scope_t *scope, pass_kind_t pass) { comp->scope_cur = scope; comp->next_label = 0; EMIT_ARG(start_pass, pass, scope); - reserve_labels_for_native(comp, 4); // used by native's start_pass + reserve_labels_for_native(comp, 6); // used by native's start_pass if (comp->pass == MP_PASS_SCOPE) { // reset maximum stack sizes in scope |