diff options
| author | Damien George <damien.p.george@gmail.com> | 2015-02-08 01:57:40 +0000 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2015-02-08 01:57:40 +0000 |
| commit | 7d414a1b52d193bab2c94cf56932e1eba23ba542 (patch) | |
| tree | 69f6840e4f825ffc1047fe7cb0f52eba27b20d86 /py/bc0.h | |
| parent | 5f97aaeca4dc607a2d32e758c3ef6131ffb168a6 (diff) | |
py: Parse big-int/float/imag constants directly in parser.
Previous to this patch, a big-int, float or imag constant was interned
(made into a qstr) and then parsed at runtime to create an object each
time it was needed. This is wasteful in RAM and not efficient. Now,
these constants are parsed straight away in the parser and turned into
objects. This allows constants with large numbers of digits (so
addresses issue #1103) and takes us a step closer to #722.
Diffstat (limited to 'py/bc0.h')
| -rw-r--r-- | py/bc0.h | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -34,12 +34,10 @@ #define MP_BC_LOAD_CONST_TRUE (0x12) #define MP_BC_LOAD_CONST_ELLIPSIS (0x13) #define MP_BC_LOAD_CONST_SMALL_INT (0x14) // signed var-int -#define MP_BC_LOAD_CONST_INT (0x15) // qstr -#define MP_BC_LOAD_CONST_DEC (0x16) // qstr -#define MP_BC_LOAD_CONST_BYTES (0x17) // qstr -#define MP_BC_LOAD_CONST_STRING (0x18) // qstr -#define MP_BC_LOAD_CONST_OBJ (0x09) // ptr; TODO renumber to be in order -#define MP_BC_LOAD_NULL (0x19) +#define MP_BC_LOAD_CONST_BYTES (0x15) // qstr +#define MP_BC_LOAD_CONST_STRING (0x16) // qstr +#define MP_BC_LOAD_CONST_OBJ (0x17) // ptr +#define MP_BC_LOAD_NULL (0x18) #define MP_BC_LOAD_FAST_N (0x1a) // uint #define MP_BC_LOAD_DEREF (0x1b) // uint |
