aboutsummaryrefslogtreecommitdiff
path: root/py/emitnx86.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-09-14 17:40:59 +1000
committerDamien George <damien.p.george@gmail.com>2018-09-15 22:39:27 +1000
commit43f1848bfa81aa3cb0acd1e34eece0a11aa130d0 (patch)
tree525de05e2d2fffaa8700ff010204a888d0838b07 /py/emitnx86.c
parent460954734e12074d29056b446d1406a27e2aed9f (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/emitnx86.c')
-rw-r--r--py/emitnx86.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/py/emitnx86.c b/py/emitnx86.c
index a536b9851..597a0fd4a 100644
--- a/py/emitnx86.c
+++ b/py/emitnx86.c
@@ -62,6 +62,7 @@ STATIC byte mp_f_n_args[MP_F_NUMBER_OF] = {
[MP_F_DELETE_GLOBAL] = 1,
[MP_F_NEW_CELL] = 1,
[MP_F_MAKE_CLOSURE_FROM_RAW_CODE] = 3,
+ [MP_F_ARG_CHECK_NUM_SIG] = 3,
[MP_F_SETUP_CODE_STATE] = 4,
[MP_F_SMALL_INT_FLOOR_DIVIDE] = 2,
[MP_F_SMALL_INT_MODULO] = 2,