Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
6f3e7fc5
Commit
6f3e7fc5
authored
Nov 26, 2013
by
Damien
Browse files
py: add UNPACK_SEQUENCE and keyword methods to VM.
parent
ff099f36
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/vm.c
View file @
6f3e7fc5
...
...
@@ -369,6 +369,12 @@ bool py_execute_byte_code_2(const byte **ip_in_out, py_obj_t *fastn, py_obj_t **
sp
++
;
break
;
case
PYBC_UNPACK_SEQUENCE
:
DECODE_UINT
;
rt_unpack_sequence
(
sp
[
0
],
unum
,
sp
-
unum
+
1
);
sp
-=
unum
-
1
;
break
;
case
PYBC_MAKE_FUNCTION
:
DECODE_UINT
;
PUSH
(
rt_make_function_from_id
(
unum
));
...
...
@@ -384,10 +390,16 @@ bool py_execute_byte_code_2(const byte **ip_in_out, py_obj_t *fastn, py_obj_t **
case
PYBC_CALL_METHOD
:
DECODE_UINT
;
assert
((
unum
&
0xff00
)
==
0
);
// n_keyword
unum
&=
0xff
;
obj1
=
rt_call_method_n
(
unum
,
sp
);
sp
+=
unum
+
1
;
if
((
unum
&
0xff00
)
==
0
)
{
// no keywords
unum
&=
0xff
;
obj1
=
rt_call_method_n
(
unum
,
sp
);
sp
+=
unum
+
1
;
}
else
{
// keywords
obj1
=
rt_call_method_n_kw
(
unum
&
0xff
,
(
unum
>>
8
)
&
0xff
,
sp
);
sp
+=
(
unum
&
0xff
)
+
((
unum
>>
7
)
&
0x1fe
)
+
1
;
}
*
sp
=
obj1
;
break
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment