Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Push/pop SC to the compiling stack.
  • Loading branch information
jnthn committed Feb 28, 2012
1 parent c11251c commit 10d5a9c
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/HLL/World.pm
Expand Up @@ -55,15 +55,19 @@ class HLL::World {
}

method BUILD(:$handle!, :$description!) {
$!sc := pir::nqp_create_sc__PS($handle);
$!handle := $handle;
%!addr_to_slot := nqp::hash();
@!fixup_tasks := nqp::list();
# Initialize attributes.
$!sc := pir::nqp_create_sc__PS($handle);
$!handle := $handle;
%!addr_to_slot := nqp::hash();
@!fixup_tasks := nqp::list();
@!load_dependency_tasks := nqp::list();
$!sc.set_description($description);
$!precomp_mode := %*COMPILING<%?OPTIONS><target> eq 'pir';
$!num_code_refs := 0;
$!precomp_mode := %*COMPILING<%?OPTIONS><target> eq 'pir';
$!num_code_refs := 0;
$!code_ref_blocks := [];
$!sc.set_description($description);

# Add to currently compiling SC stack.
pir::nqp_push_compiling_sc__vP($!sc);
}

# Gets the slot for a given object. Dies if it is not in the context.
Expand Down Expand Up @@ -224,6 +228,9 @@ class HLL::World {
say(nqp::chars($serialized) ~ " bytes of serialized data produced");
say(nqp::elems($sh) ~ " strings in heap");

# Now it's serialized, pop this SC off the compiling SC stack.
pir::nqp_pop_compiling_sc__v();

# String heap PAST.
my $sh_past := PAST::Stmts.new(
PAST::Op.new(
Expand Down

0 comments on commit 10d5a9c

Please sign in to comment.