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
8519342c
Commit
8519342c
authored
Jan 31, 2014
by
Paul Sokolovsky
Browse files
Update VM stacks comments.
parent
c7a0b14d
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/vm.c
View file @
8519342c
...
...
@@ -13,6 +13,13 @@
#include
"bc0.h"
#include
"bc.h"
// Value stack grows up (this makes it incompatible with native C stack, but
// makes sure that arguments to functions are in natural order arg1..argN
// (Python semantics mandates left-to-right evaluation order, including for
// function arguments). Stack pointer is pre-incremented and points at the
// top element.
// Exception stack also grows up, top element is also pointed at.
// Exception stack entry
typedef
struct
_mp_exc_stack
{
const
byte
*
handler
;
...
...
@@ -23,9 +30,6 @@ typedef struct _mp_exc_stack {
byte
opcode
;
}
mp_exc_stack
;
// (value) stack grows down (to be compatible with native code when passing pointers to the stack), top element is pointed to
// exception stack grows up, top element is pointed to
#define DECODE_UINT do { unum = *ip++; if (unum > 127) { unum = ((unum & 0x3f) << 8) | (*ip++); } } while (0)
#define DECODE_ULABEL do { unum = (ip[0] | (ip[1] << 8)); ip += 2; } while (0)
#define DECODE_SLABEL do { unum = (ip[0] | (ip[1] << 8)) - 0x8000; ip += 2; } while (0)
...
...
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