Skip to content

Commit 0968572

Browse files
committed
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.
1 parent f5648cd commit 0968572

File tree

2 files changed

+12
-24
lines changed

2 files changed

+12
-24
lines changed

src/HLL/Compiler.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ class HLL::Compiler does HLL::Backend::Default {
267267
if $!backend.is_compunit($output) && %adverbs<target> eq '' {
268268
my $outer_ctx := %adverbs<outer_ctx>;
269269
if nqp::defined($outer_ctx) {
270-
$!backend.compunit_mainline($output).set_outer_ctx($outer_ctx);
270+
nqp::forceouterctx($!backend.compunit_mainline($output), $outer_ctx);
271271
}
272272

273273
if (%adverbs<profile>) {

src/NQP/World.pm

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -80,29 +80,17 @@ class NQP::World is HLL::World {
8080

8181

8282
# Emit fixup or loading code.
83-
my $set_outer := QAST::VM.new(
84-
:parrot(QAST::Op.new(
85-
:op('callmethod'), :name('set_outer_ctx'),
86-
QAST::BVal.new( :value($*UNIT) ),
87-
QAST::Op.new(
88-
:op('callmethod'), :name('load_setting'),
89-
QAST::Op.new(
90-
:op('getcurhllsym'),
91-
QAST::SVal.new( :value('ModuleLoader') )
92-
),
93-
QAST::SVal.new( :value($setting_name) )
94-
))),
95-
:jvm(QAST::Op.new(
96-
:op('forceouterctx'),
97-
QAST::BVal.new( :value($*UNIT) ),
83+
my $set_outer := QAST::Op.new(
84+
:op('forceouterctx'),
85+
QAST::BVal.new( :value($*UNIT) ),
86+
QAST::Op.new(
87+
:op('callmethod'), :name('load_setting'),
9888
QAST::Op.new(
99-
:op('callmethod'), :name('load_setting'),
100-
QAST::Op.new(
101-
:op('getcurhllsym'),
102-
QAST::SVal.new( :value('ModuleLoader') )
103-
),
104-
QAST::SVal.new( :value($setting_name) )
105-
))));
89+
:op('getcurhllsym'),
90+
QAST::SVal.new( :value('ModuleLoader') )
91+
),
92+
QAST::SVal.new( :value($setting_name) )
93+
));
10694
if self.is_precompilation_mode() {
10795
self.add_load_dependency_task(:deserialize_past(QAST::Stmts.new(
10896
QAST::Op.new(
@@ -240,7 +228,7 @@ class NQP::World is HLL::World {
240228
my $c := nqp::elems(@allcodes);
241229
my $i := 0;
242230
while $i < $c {
243-
my $subid := @allcodes[$i].get_subid();
231+
my $subid := nqp::getcodecuid(@allcodes[$i]);
244232
if nqp::existskey(%!code_objects_to_fix_up, $subid) {
245233
# First, go over the code objects. Update the $!do, and the
246234
# entry in the SC. Make sure the newly compiled code is marked

0 commit comments

Comments
 (0)