@@ -90,7 +90,7 @@ class NQP::World is HLL::World {
90
90
($ target . WHO ){$ name } := $ obj ;
91
91
92
92
# Add deserialization installation of the symbol.
93
- if self . is_precompilation_mode() {
93
+ if self . is_precompilation_mode() && ! $ NEW_SER {
94
94
my $ path := self . get_slot_past_for_object($ package );
95
95
for @ sym {
96
96
$ path := PAST::Op. new (: pirop(' nqp_get_package_through_who PPs' ), $ path , ~ $ _ );
@@ -161,7 +161,7 @@ class NQP::World is HLL::World {
161
161
162
162
# Add an event. There's no fixup to do, just a type object to create
163
163
# on deserialization.
164
- if self . is_precompilation_mode() {
164
+ if self . is_precompilation_mode() && ! $ NEW_SER {
165
165
my @ how_ns := pir:: split (' ::' , $ how . HOW . name ($ how ));
166
166
my $ how_name := @ how_ns . pop ();
167
167
my $ setup_call := PAST::Op. new (
@@ -193,7 +193,7 @@ class NQP::World is HLL::World {
193
193
$ obj . HOW . add_attribute($ obj , $ attr );
194
194
195
195
# Emit code to create and add it when deserializing.
196
- if self . is_precompilation_mode() {
196
+ if self . is_precompilation_mode() && ! $ NEW_SER {
197
197
my $ create_call := PAST::Op. new (
198
198
: pasttype(' callmethod' ), : name(' new' ),
199
199
self . get_ref($ meta_attr )
@@ -233,6 +233,7 @@ class NQP::World is HLL::World {
233
233
# See if we already have our compile-time dummy. If not, create it.
234
234
my $ fixups := PAST::Stmts. new ();
235
235
my $ dummy ;
236
+ my $ code_ref_idx ;
236
237
if pir:: defined ($ method_past <compile_time_dummy >) {
237
238
$ dummy := $ method_past <compile_time_dummy >;
238
239
}
@@ -261,7 +262,7 @@ class NQP::World is HLL::World {
261
262
pir::assign__vPS($ dummy , $ name );
262
263
if $ NEW_SER {
263
264
pir::setprop__vPsP($ dummy , ' STATIC_CODE_REF' , $ dummy );
264
- self . add_root_code_ref($ dummy , $ method_past );
265
+ $ code_ref_idx := self . add_root_code_ref($ dummy , $ method_past );
265
266
}
266
267
else {
267
268
self . add_code_LEGACY($ dummy );
@@ -278,7 +279,13 @@ class NQP::World is HLL::World {
278
279
# For fixup, need to assign the method body we actually compiled
279
280
# onto the one that went into the SC. Deserializing is easier -
280
281
# just the straight meta-method call.
281
- unless $ NEW_SER {
282
+ if $ NEW_SER {
283
+ $ fixups . push (PAST::Op. new (
284
+ : pirop(' assign vPP' ),
285
+ self . get_slot_past_for_code_ref_at($ code_ref_idx ),
286
+ PAST::Val. new ( : value($ method_past ) )
287
+ ));
288
+ } else {
282
289
# XXX need to re-do the following for the new serialization
283
290
$ fixups . push (PAST::Op. new (
284
291
: pirop(' assign vPP' ),
@@ -382,7 +389,7 @@ class NQP::World is HLL::World {
382
389
$ obj . HOW . " $ meta_method_name" ($ obj , $ to_add );
383
390
384
391
# Emit code to add it when deserializing.
385
- if self . is_precompilation_mode() {
392
+ if self . is_precompilation_mode() && ! $ NEW_SER {
386
393
my $ slot_past := self . get_slot_past_for_object($ obj );
387
394
self . add_event(: deserialize_past(PAST::Op. new (
388
395
: pasttype(' callmethod' ), : name($ meta_method_name ),
@@ -415,7 +422,7 @@ class NQP::World is HLL::World {
415
422
$ obj . HOW . compose($ obj );
416
423
417
424
# Emit code to do the composition when deserializing.
418
- if self . is_precompilation_mode() {
425
+ if self . is_precompilation_mode() && ! $ NEW_SER {
419
426
my $ slot_past := self . get_slot_past_for_object($ obj );
420
427
self . add_event(: deserialize_past(PAST::Op. new (
421
428
: pasttype(' callmethod' ), : name(' compose' ),
0 commit comments