Skip to content

Commit 0637faa

Browse files
committed
Update HLL::Backend::Parrot to use new EvalPMC/PackfileView API.
Resolves issue #76, but requires a Parrot newer than RELEASE_5_7_0-20-g07dfdb4. See issue #76 for more details.
1 parent 384469f commit 0637faa

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/vm/parrot/HLL/Backend.nqp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,19 +114,24 @@ class HLL::Backend::Parrot {
114114

115115
method evalpmc($source, *%adverbs) {
116116
my $compiler := nqp::getcomp('PIR');
117-
$compiler($source)
117+
my $pbc := $compiler($source);
118+
unless $pbc.is_initialized('init') {
119+
for $pbc.subs_by_tag('init') -> $sub { $sub() }
120+
$pbc.mark_initialized('init');
121+
}
122+
$pbc
118123
}
119124

120125
method is_compunit($cuish) {
121126
!pir::isa__IPs($cuish, 'String')
122127
}
123128

124129
method compunit_mainline($cu) {
125-
$cu[0]
130+
$cu.all_subs()[0]
126131
}
127132

128133
method compunit_coderefs($cu) {
129-
$cu
134+
$cu.all_subs();
130135
}
131136

132137
method recursion_limit($limit) {

0 commit comments

Comments
 (0)