summaryrefslogtreecommitdiffstatshomepage
path: root/py/nativeglue.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-04-06 22:38:53 +0100
committerDamien George <damien.p.george@gmail.com>2015-04-07 22:43:28 +0100
commit9988618e0e0f5c319e31b135d993e22efb593093 (patch)
treed89d8df392ce2669c9e516a05b11742e72dc8cf2 /py/nativeglue.c
parent18bd51707c218137005cd73cb5a35ebfe2bccd6e (diff)
downloadmicropython-9988618e0e0f5c319e31b135d993e22efb593093.tar.gz
micropython-9988618e0e0f5c319e31b135d993e22efb593093.zip
py: Implement full func arg passing for native emitter.
This patch gets full function argument passing working with native emitter. Includes named args, keyword args, default args, var args and var keyword args. Fully Python compliant. It reuses the bytecode mp_setup_code_state function to do all the hard work. This function is slightly adjusted to accommodate native calls, and the native emitter is forced a bit to emit similar prelude and code-info as bytecode.
Diffstat (limited to 'py/nativeglue.c')
-rw-r--r--py/nativeglue.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/py/nativeglue.c b/py/nativeglue.c
index ab4063014c..d0896eedd3 100644
--- a/py/nativeglue.c
+++ b/py/nativeglue.c
@@ -32,6 +32,7 @@
#include "py/runtime0.h"
#include "py/runtime.h"
#include "py/emitglue.h"
+#include "py/bc.h"
#if MICROPY_EMIT_NATIVE
@@ -135,6 +136,7 @@ void *const mp_fun_table[MP_F_NUMBER_OF] = {
mp_delete_global,
mp_obj_new_cell,
mp_make_closure_from_raw_code,
+ mp_setup_code_state,
};
/*