summaryrefslogtreecommitdiffstatshomepage
path: root/py/emitcpy.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/emitcpy.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/emitcpy.c')
-rw-r--r--py/emitcpy.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/py/emitcpy.c b/py/emitcpy.c
index 09a0e006f2..355ed10517 100644
--- a/py/emitcpy.c
+++ b/py/emitcpy.c
@@ -171,20 +171,6 @@ STATIC void emit_cpy_load_const_small_int(emit_t *emit, mp_int_t arg) {
}
}
-STATIC void emit_cpy_load_const_int(emit_t *emit, qstr qst) {
- emit_pre(emit, 1, 3);
- if (emit->pass == MP_PASS_EMIT) {
- printf("LOAD_CONST %s\n", qstr_str(qst));
- }
-}
-
-STATIC void emit_cpy_load_const_dec(emit_t *emit, qstr qst) {
- emit_pre(emit, 1, 3);
- if (emit->pass == MP_PASS_EMIT) {
- printf("LOAD_CONST %s\n", qstr_str(qst));
- }
-}
-
STATIC void print_quoted_str(qstr qst, bool bytes) {
const char *str = qstr_str(qst);
int len = strlen(str);
@@ -839,8 +825,6 @@ const emit_method_table_t emit_cpython_method_table = {
emit_cpy_import_star,
emit_cpy_load_const_tok,
emit_cpy_load_const_small_int,
- emit_cpy_load_const_int,
- emit_cpy_load_const_dec,
emit_cpy_load_const_str,
emit_cpy_load_const_obj,
emit_cpy_load_null,