aboutsummaryrefslogtreecommitdiff
path: root/py/vmentrytable.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-06-25 14:42:13 +0000
committerDamien George <damien.p.george@gmail.com>2015-06-25 14:42:13 +0000
commit59fba2d6ea31c134c9c0b88dc73cd25b236f167c (patch)
tree58038f6437d92ea5bf7b5395175c8e844e169556 /py/vmentrytable.h
parented570e4b2a0a68e43b191fb0d5b45fb2ec83aca4 (diff)
py: Remove mp_load_const_bytes and instead load precreated bytes object.
Previous to this patch each time a bytes object was referenced a new instance (with the same data) was created. With this patch a single bytes object is created in the compiler and is loaded directly at execute time as a true constant (similar to loading bignum and float objects). This saves on allocating RAM and means that bytes objects can now be used when the memory manager is locked (eg in interrupts). The MP_BC_LOAD_CONST_BYTES bytecode was removed as part of this. Generated bytecode is slightly larger due to storing a pointer to the bytes object instead of the qstr identifier. Code size is reduced by about 60 bytes on Thumb2 architectures.
Diffstat (limited to 'py/vmentrytable.h')
-rw-r--r--py/vmentrytable.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/py/vmentrytable.h b/py/vmentrytable.h
index 413914b6e..d71a8d4f6 100644
--- a/py/vmentrytable.h
+++ b/py/vmentrytable.h
@@ -35,7 +35,6 @@ static void* entry_table[256] = {
[MP_BC_LOAD_CONST_NONE] = &&entry_MP_BC_LOAD_CONST_NONE,
[MP_BC_LOAD_CONST_TRUE] = &&entry_MP_BC_LOAD_CONST_TRUE,
[MP_BC_LOAD_CONST_SMALL_INT] = &&entry_MP_BC_LOAD_CONST_SMALL_INT,
- [MP_BC_LOAD_CONST_BYTES] = &&entry_MP_BC_LOAD_CONST_BYTES,
[MP_BC_LOAD_CONST_STRING] = &&entry_MP_BC_LOAD_CONST_STRING,
[MP_BC_LOAD_CONST_OBJ] = &&entry_MP_BC_LOAD_CONST_OBJ,
[MP_BC_LOAD_NULL] = &&entry_MP_BC_LOAD_NULL,