@@ -12,6 +12,9 @@ class NQP::World is HLL::World {
12
12
# compilation unit ID to a list of code objects.
13
13
has % ! code_objects_to_fix_up ;
14
14
15
+ # The types of those code objects.
16
+ has % ! code_object_types ;
17
+
15
18
# Mapping of QAST::Stmts node containing fixups, keyed by sub ID. If
16
19
# we do dynamic compilation then we do the fixups immediately and
17
20
# then clear this list.
@@ -23,6 +26,7 @@ class NQP::World is HLL::World {
23
26
method BUILD (* % opts ) {
24
27
@ ! BLOCKS := nqp ::list();
25
28
% ! code_objects_to_fix_up := nqp ::hash();
29
+ % ! code_object_types := nqp ::hash();
26
30
% ! code_object_fixup_list := nqp ::hash();
27
31
% ! code_stub_sc_idx := nqp ::hash();
28
32
}
@@ -235,9 +239,9 @@ class NQP::World is HLL::World {
235
239
# entry in the SC. Make sure the newly compiled code is marked
236
240
# as a static code ref.
237
241
my $ static := % ! code_objects_to_fix_up {$ subid }. shift ();
238
- nqp ::bindattr($ static , $ code_type , ' $!do' , $ compiled [$ i ]);
242
+ nqp ::bindattr($ static , % ! code_object_types { $ subid } , ' $!do' , $ compiled [$ i ]);
239
243
for % ! code_objects_to_fix_up {$ subid } {
240
- nqp ::bindattr($ _ , $ code_type , ' $!do' , nqp :: clone ($ compiled [$ i ]));
244
+ nqp ::bindattr($ _ , % ! code_object_types { $ subid } , ' $!do' , nqp :: clone ($ compiled [$ i ]));
241
245
}
242
246
pir::setprop__vPsP($ compiled [$ i ], ' STATIC_CODE_REF' , $ compiled [$ i ]);
243
247
self . update_root_code_ref(% ! code_stub_sc_idx {$ subid }, $ compiled [$ i ]);
@@ -340,6 +344,7 @@ class NQP::World is HLL::World {
340
344
341
345
# Add it to the dynamic compilation fixup todo list.
342
346
% ! code_objects_to_fix_up {$ past . cuid()} := [$ code_obj ];
347
+ % ! code_object_types {$ past . cuid()} := $ code_type ;
343
348
344
349
$ code_obj
345
350
}
0 commit comments