Skip to content

Commit

Permalink
Require explicit marking of calls which need CPS conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Jul 25, 2010
1 parent a6f61b0 commit e9aee8f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Body.pm
Expand Up @@ -152,7 +152,7 @@ use CgOp ();
}

for my $c (@components) {
$pkgcg = CgOp::rawscall('Kernel.PackageLookup', CgOp::fetch($pkgcg),
$pkgcg = CgOp::rawsccall('Kernel.PackageLookup', CgOp::fetch($pkgcg),
CgOp::clr_string($c));
}

Expand Down
24 changes: 18 additions & 6 deletions CgOp.pm
Expand Up @@ -197,11 +197,11 @@ use warnings;
}

sub fetch {
rawscall("Kernel.Fetch", $_[0]);
rawsccall("Kernel.Fetch", $_[0]);
}

sub how {
rawcall($_[0], "HOW");
rawccall($_[0], "HOW");
}

sub getfield {
Expand Down Expand Up @@ -275,12 +275,12 @@ use warnings;
}

sub bind {
rawscall('Kernel.Bind', $_[1], getfield('lv', $_[2]),
rawsccall('Kernel.Bind', $_[1], getfield('lv', $_[2]),
bool($_[0]), bool(0));
}

sub assign {
rawscall('Kernel.Assign', getfield('lv', $_[0]),
rawsccall('Kernel.Assign', getfield('lv', $_[0]),
getfield('lv', $_[1]));
}

Expand Down Expand Up @@ -368,13 +368,25 @@ use warnings;
sub rawscall {
my ($name, @args) = @_;
CgOp::Primitive->new(op => [ 'clr_call_direct', $name, scalar @args ],
zyg => [ @args ], is_cps_call => 1); #XXX
zyg => [ @args ]);
}

sub rawcall {
my ($inv, $name, @args) = @_;
CgOp::Primitive->new(op => [ 'clr_call_virt', $name, scalar @args ],
zyg => [ $inv, @args ], is_cps_call => 1); #XXX
zyg => [ $inv, @args ]);
}

sub rawsccall {
my ($name, @args) = @_;
CgOp::Primitive->new(op => [ 'clr_call_direct', $name, scalar @args ],
zyg => [ @args ], is_cps_call => 1);
}

sub rawccall {
my ($inv, $name, @args) = @_;
CgOp::Primitive->new(op => [ 'clr_call_virt', $name, scalar @args ],
zyg => [ $inv, @args ], is_cps_call => 1);
}

sub rawsget {
Expand Down
2 changes: 1 addition & 1 deletion Decl.pm
Expand Up @@ -481,7 +481,7 @@ use CgOp;
my $first = CgOp::cast('Variable',
CgOp::getindex(shift(@path), $lex));
for (@path) {
$first = CgOp::rawscall('Kernel.PackageLookup',
$first = CgOp::rawsccall('Kernel.PackageLookup',
CgOp::fetch($first), CgOp::clr_string($_));
}

Expand Down
2 changes: 1 addition & 1 deletion Sig.pm
Expand Up @@ -57,7 +57,7 @@ use 5.010;
CgOp::box('LLArray', CgOp::rawnew('List<Variable>'))),
CgOp::setindex('rest', CgOp::getfield('slots', $do),
CgOp::box('LLArray',
CgOp::rawscall('Kernel.SlurpyHelper',
CgOp::rawsccall('Kernel.SlurpyHelper',
CgOp::int($$ixp)))),
CgOp::newscalar($do))}));
} else {
Expand Down

0 comments on commit e9aee8f

Please sign in to comment.