Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't re-link already compiled blocks.

This loses lexical chain information they are carrying. A test for
traits/wrapping/multi interaction (yes, we have one :-)) seems to have
been somehow magically working before, for mysterious reasons. This
change makes it work for a better understood reason, and with the NQP
based multi-dispatcher. Fixes the remaining regression in this branch,
and introduces no more spectest regressions.
  • Loading branch information...
commit c57f0d5d043d0e292b2f4b433f618a48598e9b01 1 parent fdc0c2f
@jnthn jnthn authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 src/Perl6/World.pm
View
14 src/Perl6/World.pm
@@ -190,6 +190,11 @@ class Perl6::World is HLL::World {
# Mapping of sub IDs to SC indexes of code stubs.
has %!sub_id_to_sc_idx;
+ # Mapping of QAST::Stmts node containing fixups, keyed by sub ID. If
+ # we do dynamic compilation then we do the fixups immediately and
+ # then clear this list.
+ has %!code_object_fixup_list;
+
# Array of stubs to check and the end of compilation.
has @!stub_check;
@@ -212,6 +217,7 @@ class Perl6::World is HLL::World {
%!sub_id_to_code_object := {};
%!sub_id_to_static_lexpad := {};
%!sub_id_to_sc_idx := {};
+ %!code_object_fixup_list := {};
%!const_cache := {};
}
@@ -984,6 +990,10 @@ class Perl6::World is HLL::World {
QAST::WVal.new( :value($clone) )
)));
});
+
+ # Also stash fixups so we can know not to do them if we
+ # do dynamic compilation.
+ %!code_object_fixup_list{$code_past.cuid} := $fixups;
}
# Attach the QAST block to the stub.
@@ -1247,6 +1257,10 @@ class Perl6::World is HLL::World {
nqp::markcodestatic($precomp[$i]);
self.update_root_code_ref(%!sub_id_to_sc_idx{$subid}, $precomp[$i]);
}
+ if nqp::existskey(%!code_object_fixup_list, $subid) {
+ my $fixups := %!code_object_fixup_list{$subid};
+ $fixups.pop() while $fixups.list;
+ }
$i := $i + 1;
}
Please sign in to comment.
Something went wrong with that request. Please try again.