summaryrefslogtreecommitdiffstatshomepage
path: root/py/emitbc.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-02-08 01:57:40 +0000
committerDamien George <damien.p.george@gmail.com>2015-02-08 01:57:40 +0000
commit7d414a1b52d193bab2c94cf56932e1eba23ba542 (patch)
tree69f6840e4f825ffc1047fe7cb0f52eba27b20d86 /py/emitbc.c
parent5f97aaeca4dc607a2d32e758c3ef6131ffb168a6 (diff)
downloadmicropython-7d414a1b52d193bab2c94cf56932e1eba23ba542.tar.gz
micropython-7d414a1b52d193bab2c94cf56932e1eba23ba542.zip
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/emitbc.c')
-rw-r--r--py/emitbc.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/py/emitbc.c b/py/emitbc.c
index f7f2b8d194..53cae59ee2 100644
--- a/py/emitbc.c
+++ b/py/emitbc.c
@@ -473,16 +473,6 @@ STATIC void emit_bc_load_const_small_int(emit_t *emit, mp_int_t arg) {
}
}
-STATIC void emit_bc_load_const_int(emit_t *emit, qstr qst) {
- emit_bc_pre(emit, 1);
- emit_write_bytecode_byte_qstr(emit, MP_BC_LOAD_CONST_INT, qst);
-}
-
-STATIC void emit_bc_load_const_dec(emit_t *emit, qstr qst) {
- emit_bc_pre(emit, 1);
- emit_write_bytecode_byte_qstr(emit, MP_BC_LOAD_CONST_DEC, qst);
-}
-
STATIC void emit_bc_load_const_str(emit_t *emit, qstr qst, bool bytes) {
emit_bc_pre(emit, 1);
if (bytes) {
@@ -932,8 +922,6 @@ const emit_method_table_t emit_bc_method_table = {
emit_bc_import_star,
emit_bc_load_const_tok,
emit_bc_load_const_small_int,
- emit_bc_load_const_int,
- emit_bc_load_const_dec,
emit_bc_load_const_str,
emit_bc_load_const_obj,
emit_bc_load_null,