py/scope: Shrink scope_t struct by 1 machine word.

On 32-bit archs this makes the scope_t struct 48 bytes in size, which fits
in 3 GC blocks (previously it used 4 GC blocks).  This will lead to some
savings when compiling scripts because there are usually quite a few scopes,
one for each function and class.

Note that qstrs will fit in 16 bits, this assumption is made in a few other
places.
This commit is contained in:
Damien George 2016-09-30 12:45:00 +10:00
parent 3dea8c9e92
commit d5495966ce
1 changed files with 2 additions and 2 deletions

View File

@ -71,8 +71,8 @@ typedef struct _scope_t {
struct _scope_t *parent;
struct _scope_t *next;
mp_parse_node_t pn;
qstr source_file;
qstr simple_name;
uint16_t source_file; // a qstr
uint16_t simple_name; // a qstr
mp_raw_code_t *raw_code;
uint8_t scope_flags; // see runtime0.h
uint8_t emit_options; // see compile.h