Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use new nqp:: ops in HLL::Compiler.
With this, it should now be fairly generic, with all VM-specifics in
either the backend object or behind nqp:: ops.
  • Loading branch information
jnthn committed Feb 27, 2013
1 parent f5648cd commit 0968572
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/HLL/Compiler.pm
Expand Up @@ -267,7 +267,7 @@ class HLL::Compiler does HLL::Backend::Default {
if $!backend.is_compunit($output) && %adverbs<target> eq '' {
my $outer_ctx := %adverbs<outer_ctx>;
if nqp::defined($outer_ctx) {
$!backend.compunit_mainline($output).set_outer_ctx($outer_ctx);
nqp::forceouterctx($!backend.compunit_mainline($output), $outer_ctx);
}

if (%adverbs<profile>) {
Expand Down
34 changes: 11 additions & 23 deletions src/NQP/World.pm
Expand Up @@ -80,29 +80,17 @@ class NQP::World is HLL::World {


# Emit fixup or loading code.
my $set_outer := QAST::VM.new(
:parrot(QAST::Op.new(
:op('callmethod'), :name('set_outer_ctx'),
QAST::BVal.new( :value($*UNIT) ),
QAST::Op.new(
:op('callmethod'), :name('load_setting'),
QAST::Op.new(
:op('getcurhllsym'),
QAST::SVal.new( :value('ModuleLoader') )
),
QAST::SVal.new( :value($setting_name) )
))),
:jvm(QAST::Op.new(
:op('forceouterctx'),
QAST::BVal.new( :value($*UNIT) ),
my $set_outer := QAST::Op.new(
:op('forceouterctx'),
QAST::BVal.new( :value($*UNIT) ),
QAST::Op.new(
:op('callmethod'), :name('load_setting'),
QAST::Op.new(
:op('callmethod'), :name('load_setting'),
QAST::Op.new(
:op('getcurhllsym'),
QAST::SVal.new( :value('ModuleLoader') )
),
QAST::SVal.new( :value($setting_name) )
))));
:op('getcurhllsym'),
QAST::SVal.new( :value('ModuleLoader') )
),
QAST::SVal.new( :value($setting_name) )
));
if self.is_precompilation_mode() {
self.add_load_dependency_task(:deserialize_past(QAST::Stmts.new(
QAST::Op.new(
Expand Down Expand Up @@ -240,7 +228,7 @@ class NQP::World is HLL::World {
my $c := nqp::elems(@allcodes);
my $i := 0;
while $i < $c {
my $subid := @allcodes[$i].get_subid();
my $subid := nqp::getcodecuid(@allcodes[$i]);
if nqp::existskey(%!code_objects_to_fix_up, $subid) {
# First, go over the code objects. Update the $!do, and the
# entry in the SC. Make sure the newly compiled code is marked
Expand Down

0 comments on commit 0968572

Please sign in to comment.