Skip to content

Commit

Permalink
Detect whether we're in pre-compilation or run-right-away mode and on…
Browse files Browse the repository at this point in the history
…ly code-gen the things we need. Quite a notable speedup for NQP tests; can always put it back if we need to debug it, but problems with this have been pretty rare.
  • Loading branch information
jnthn committed Jun 12, 2011
1 parent c0d2879 commit c7bf530
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/HLL/SerializationContextBuilder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,17 @@ class HLL::Compiler::SerializationContextBuilder {
}

# Add an event that may have an action to deserialize or fix up.
# Note that we can determine which one we need and just save the
# needed one.
method add_event(:$deserialize_past, :$fixup_past) {
@!event_stream.push(Event.new(
:deserialize_past($deserialize_past), :fixup_past($fixup_past)
));
if %*COMPILING<%?OPTIONS><target> eq 'pir' {
# Pre-compilation; only need deserialization PAST.
@!event_stream.push(Event.new(:deserialize_past($deserialize_past)));
}
else {
# Presumably, going all the way to running, so just fixups.
@!event_stream.push(Event.new(:fixup_past($fixup_past)));
}
}

# Gets PAST for referencing an object in a serialization context,
Expand Down

0 comments on commit c7bf530

Please sign in to comment.