Skip to content

Instantly share code, notes, and snippets.

@mlschroe
mlschroe / updateexample.c
Created June 26, 2013 15:47
Example implementation
find_pkg_updates(Pool *pool, Solvable *s)
{
Id p, pp, evr;
Dataiterator di;
Solvable *is = 0;
Queue q;
/* first find installed package for the range */
FOR_PROVIDES(p, pp, s->name)
@mlschroe
mlschroe / doit.diff
Created June 26, 2013 12:46
Get rid of priorInvokation
diff --git a/src/vm/jvm/runtime/org/perl6/nqp/runtime/CallFrame.java b/src/vm/jvm/runtime/org/perl6/nqp/runtime/CallFrame.java
index bc7c752..9246140 100644
--- a/src/vm/jvm/runtime/org/perl6/nqp/runtime/CallFrame.java
+++ b/src/vm/jvm/runtime/org/perl6/nqp/runtime/CallFrame.java
@@ -96,7 +96,7 @@ public class CallFrame implements Cloneable {
this.caller = tc.curFrame;
// Set outer; if it's explicitly in the code ref, use that. If not,
- // go hunting for one. Fall back to outer's prior invocation.
+ // go hunting for one.
diff --git a/src/NQP/Actions.pm b/src/NQP/Actions.pm
index 2607093..a364536 100644
--- a/src/NQP/Actions.pm
+++ b/src/NQP/Actions.pm
@@ -700,6 +700,9 @@ class NQP::Actions is HLL::Actions {
}
my $block := $past;
+
+ @BLOCK[0][0].push(PAST::Op.new( :pirop('capture_lex__vP'), PAST::Val.new( :value($past))));
diff --git a/src/ops/perl6.ops b/src/ops/perl6.ops
index 7569467..8ea0f48 100644
--- a/src/ops/perl6.ops
+++ b/src/ops/perl6.ops
@@ -1355,7 +1355,7 @@ block.
inline op perl6_rethrow_skipnextctx(in PMC) :base_core {
PMC *except = $1;
opcode_t *dest;
- STRING *handler_iter_str = Parrot_str_new_constant(interp, "handler_iter");
+ STRING *handlers_left_str = Parrot_str_new_constant(interp, "handlers_left");
diff --git a/src/Perl6/Actions.pm b/src/Perl6/Actions.pm
index cc1e558..9b731ac 100644
--- a/src/Perl6/Actions.pm
+++ b/src/Perl6/Actions.pm
@@ -3811,6 +3814,7 @@ class Perl6::Actions is HLL::Actions {
:pasttype('callmethod'), :name('clone'),
$code
);
+ $closure := PAST::Op.new( :pirop('perl6_capture_lex__0P'), $closure);
$closure<past_block> := $code<past_block>;
--- a/src/Perl6/Actions.pm
+++ b/src/Perl6/Actions.pm
@@ -1410,6 +1410,7 @@ class Perl6::Actions is HLL::Actions {
# install it in the lexpad.
my $outer := $*ST.cur_lexpad();
$outer[0].push(PAST::Stmt.new($block));
+ $outer[0].push(PAST::Op.new( :pirop('capture_lex__vP'), PAST::Val.new( :value($block))));
# Install &?ROUTINE.
$*ST.install_lexical_symbol($block, '&?ROUTINE', $code);
sub foo($x) {
my $z = $x;
if ($x) {
foo(0);
}
for (1) {
say "z = $z";
}
}
foo(1);
.sub "main" :main
"bar"(0)
.end
.sub "bar" :main
.param int run
.lex "a", $S0
$S0 = "hello"
if run goto done
.sub "main" :main
.const "Sub" $P0 = "bar"
$P0 = clone $P0
$P0()
.end
.sub "bar" :main
.lex "a", $S0
$S0 = "hello"
"foo"()
--- src/Perl6/Metamodel/BOOTSTRAP.pm.orig 2011-10-31 19:22:14.000000000 +0000
+++ src/Perl6/Metamodel/BOOTSTRAP.pm 2011-10-31 19:22:28.000000000 +0000
@@ -28,7 +28,7 @@ my class BOOTSTRAPATTR {
method box_target() { $!box_target }
method has_accessor() { 0 }
method has-accessor() { 0 }
- method build() { }
+ method build() { pir::null__P() }
method is_generic() { $!type.HOW.archetypes.generic }
method instantiate_generic($type_environment) {