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
94658e2e
Commit
94658e2e
authored
Nov 09, 2013
by
Damien
Browse files
Add JUMP_IF_x_OR_POP opcodes to VM.
parent
f3822fc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/vm.c
View file @
94658e2e
...
...
@@ -228,6 +228,24 @@ bool py_execute_byte_code_2(const byte **ip_in_out, py_obj_t *fastn, py_obj_t **
}
break
;
case
PYBC_JUMP_IF_TRUE_OR_POP
:
DECODE_SLABEL
;
if
(
rt_is_true
(
*
sp
))
{
ip
+=
unum
;
}
else
{
sp
++
;
}
break
;
case
PYBC_JUMP_IF_FALSE_OR_POP
:
DECODE_SLABEL
;
if
(
rt_is_true
(
*
sp
))
{
sp
++
;
}
else
{
ip
+=
unum
;
}
break
;
/* we are trying to get away without using this opcode
case PYBC_SETUP_LOOP:
DECODE_UINT;
...
...
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