diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-18 14:10:48 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-18 14:10:48 +0000 |
commit | 20006dbba9d2d84ead036fdfab7190e88b2337ce (patch) | |
tree | a83dc966464cbbee17a397bda96360e9d238f8cf /py/emitnative.c | |
parent | 8655065f8cec8b978d075adae1f65ffdfa9b51d8 (diff) | |
download | micropython-20006dbba9d2d84ead036fdfab7190e88b2337ce.tar.gz micropython-20006dbba9d2d84ead036fdfab7190e88b2337ce.zip |
Make VM stack grow upwards, and so no reversed args arrays.
Change state layout in VM so the stack starts at state[0] and grows
upwards. Locals are at the top end of the state and number downwards.
This cleans up a lot of the interface connecting the VM to C: now all
functions that take an array of Micro Python objects are in order (ie no
longer in reverse).
Also clean up C API with keyword arguments (call_n and call_n_kw
replaced with single call method that takes keyword arguments). And now
make_new takes keyword arguments.
emitnative.c has not yet been changed to comply with the new order of
stack layout.
Diffstat (limited to 'py/emitnative.c')
-rw-r--r-- | py/emitnative.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/py/emitnative.c b/py/emitnative.c index 7ba4d07599..aea25ac36d 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -1156,7 +1156,8 @@ static void emit_native_call_function(emit_t *emit, int n_positional, int n_keyw vtype_kind_t vtype_fun; emit_pre_pop_reg(emit, &vtype_fun, REG_ARG_1); // the function assert(vtype_fun == VTYPE_PYOBJ); - emit_call_with_imm_arg(emit, RT_F_CALL_FUNCTION_N, rt_call_function_n, n_positional, REG_ARG_2); + // XXX rt_call_function_n now merged with rt_call_function_n_kw + //emit_call_with_imm_arg(emit, RT_F_CALL_FUNCTION_N, rt_call_function_n, n_positional, REG_ARG_2); //} emit_post_push_reg(emit, VTYPE_PYOBJ, REG_RET); } @@ -1181,7 +1182,8 @@ static void emit_native_call_method(emit_t *emit, int n_positional, int n_keywor */ emit_pre(emit); emit_get_stack_pointer_to_reg_for_pop(emit, REG_ARG_2, n_positional + 2); // pointer to items in reverse order, including meth and self - emit_call_with_imm_arg(emit, RT_F_CALL_METHOD_N, rt_call_method_n, n_positional, REG_ARG_1); + // XXX rt_call_method_n now merged with rt_call_method_n_kw + //emit_call_with_imm_arg(emit, RT_F_CALL_METHOD_N, rt_call_method_n, n_positional, REG_ARG_1); //} emit_post_push_reg(emit, VTYPE_PYOBJ, REG_RET); } |