4646
4747struct _emit_t {
4848 int pass ;
49- int byte_code_offset ;
49+ int bytecode_offset ;
5050 int stack_size ;
5151 bool last_emit_was_return_value ;
5252
@@ -68,7 +68,7 @@ STATIC void emit_cpy_set_native_types(emit_t *emit, bool do_native_types) {
6868
6969STATIC void emit_cpy_start_pass (emit_t * emit , pass_kind_t pass , scope_t * scope ) {
7070 emit -> pass = pass ;
71- emit -> byte_code_offset = 0 ;
71+ emit -> bytecode_offset = 0 ;
7272 emit -> stack_size = 0 ;
7373 emit -> last_emit_was_return_value = false;
7474 emit -> scope = scope ;
@@ -108,20 +108,20 @@ STATIC void emit_cpy_delete_id(emit_t *emit, qstr qstr) {
108108}
109109
110110// TODO: module-polymorphic function (read: name clash if made global)
111- static void emit_pre (emit_t * emit , int stack_size_delta , int byte_code_size ) {
111+ static void emit_pre (emit_t * emit , int stack_size_delta , int bytecode_size ) {
112112 emit -> stack_size += stack_size_delta ;
113113 if (emit -> stack_size > emit -> scope -> stack_size ) {
114114 emit -> scope -> stack_size = emit -> stack_size ;
115115 }
116116 emit -> last_emit_was_return_value = false;
117- if (emit -> pass == MP_PASS_EMIT && byte_code_size > 0 ) {
118- if (emit -> byte_code_offset >= 1000 ) {
119- printf ("%d " , emit -> byte_code_offset );
117+ if (emit -> pass == MP_PASS_EMIT && bytecode_size > 0 ) {
118+ if (emit -> bytecode_offset >= 1000 ) {
119+ printf ("%d " , emit -> bytecode_offset );
120120 } else {
121- printf ("% 4d " , emit -> byte_code_offset );
121+ printf ("% 4d " , emit -> bytecode_offset );
122122 }
123123 }
124- emit -> byte_code_offset += byte_code_size ;
124+ emit -> bytecode_offset += bytecode_size ;
125125}
126126
127127STATIC void emit_cpy_label_assign (emit_t * emit , uint l ) {
@@ -130,11 +130,11 @@ STATIC void emit_cpy_label_assign(emit_t *emit, uint l) {
130130 if (emit -> pass < MP_PASS_EMIT ) {
131131 // assign label offset
132132 assert (emit -> label_offsets [l ] == -1 );
133- emit -> label_offsets [l ] = emit -> byte_code_offset ;
133+ emit -> label_offsets [l ] = emit -> bytecode_offset ;
134134 } else {
135135 // ensure label offset has not changed from MP_PASS_CODE_SIZE to MP_PASS_EMIT
136- assert (emit -> label_offsets [l ] == emit -> byte_code_offset );
137- //printf("l%d: (at %d)\n", l, emit->byte_code_offset );
136+ assert (emit -> label_offsets [l ] == emit -> bytecode_offset );
137+ //printf("l%d: (at %d)\n", l, emit->bytecode_offset );
138138 }
139139}
140140
@@ -421,7 +421,7 @@ STATIC void emit_cpy_jump(emit_t *emit, uint label) {
421421 emit_pre (emit , 0 , 3 );
422422 if (emit -> pass == MP_PASS_EMIT ) {
423423 int dest = emit -> label_offsets [label ];
424- if (dest < emit -> byte_code_offset ) {
424+ if (dest < emit -> bytecode_offset ) {
425425 printf ("JUMP_ABSOLUTE %d\n" , emit -> label_offsets [label ]);
426426 } else {
427427 printf ("JUMP_FORWARD %d\n" , emit -> label_offsets [label ]);
0 commit comments