Skip to content

Commit

Permalink
Unbreak the JVM build
Browse files Browse the repository at this point in the history
An edit of 196fbee that un-multis the PseudoStash new()s and just adds a
different method that gets called after the PseudoStash is created. The
suspicion is that maybe this is to early in the build for the JVM backend
to support multis.
  • Loading branch information
MasterDuke17 committed Apr 3, 2024
1 parent c7d24b3 commit 6507e0c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
3 changes: 2 additions & 1 deletion src/Raku/ast/name.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ class RakuAST::Name
my $PseudoStash := $PseudoStash-lookup.resolution.compile-time-value;
my $package := Perl6::Metamodel::ModuleHOW.new_type(:name('CORE'));
my $found-ctx := $context.setting;
my $stash := $PseudoStash.new($found-ctx, :$package);
my $stash := $PseudoStash.new();
$stash.update-with-new-values($found-ctx, :$package);
$context.ensure-sc($stash);
$result := QAST::WVal.new(:value($stash));
}
Expand Down
12 changes: 5 additions & 7 deletions src/core.c/PseudoStash.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,19 @@ my class PseudoStash is Map {
my int constant PRECISE_SCOPE = 4;
my int constant REQUIRE_DYNAMIC = 8;

multi method new() {
method new() {
my $obj := nqp::create(self);
my $ctx := nqp::ctxcaller(nqp::ctx());
nqp::bindattr($obj, PseudoStash, '$!ctx', $ctx);
nqp::bindattr($obj, Map, '$!storage', nqp::ctxlexpad($ctx));
$obj
}

multi method new(Mu $ctx is raw, :$mode = STATIC_CHAIN) {
my $obj := nqp::create(self);
method update-with-new-stuff-values(Mu $ctx is raw, :$mode = STATIC_CHAIN) {
my Mu $dctx := nqp::decont($ctx);
nqp::bindattr($obj, PseudoStash, '$!ctx', $dctx);
nqp::bindattr($obj, Map, '$!storage', nqp::ctxlexpad($ctx));
nqp::bindattr_i($obj, PseudoStash, '$!mode', nqp::decont($mode));
$obj
nqp::bindattr(self, PseudoStash, '$!ctx', $dctx);
nqp::bindattr(self, Map, '$!storage', nqp::ctxlexpad($ctx));
nqp::bindattr_i(self, PseudoStash, '$!mode', nqp::decont($mode));
}

sub ok-to-include(Mu \value) {
Expand Down
13 changes: 5 additions & 8 deletions src/core.e/PseudoStash.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ my class PseudoStash is CORE::v6c::PseudoStash {
# A convenience shortcut
my constant PseudoStash6c = CORE::v6c::PseudoStash;

multi method new(Mu :$ctx is raw, :$mode = STATIC_CHAIN) {
method new(Mu :$ctx is raw, :$mode = STATIC_CHAIN) {
my $stash := nqp::create(self);
my Mu $dctx := nqp::decont($ctx);
$dctx := nqp::ctxcaller(nqp::ctx()) unless nqp::defined($dctx);
Expand All @@ -29,15 +29,12 @@ my class PseudoStash is CORE::v6c::PseudoStash {
nqp::p6bindattrinvres($stash, Map, '$!storage', nqp::hash())
}

multi method new(Mu $ctx is raw, Mu :$package!, :$mode = STATIC_CHAIN) {
my $stash := nqp::create(self);
method update-with-new-values(Mu $ctx is raw, Mu :$package!, :$mode = STATIC_CHAIN) {
my Mu $dctx := nqp::decont($ctx);
$dctx := nqp::ctxcaller(nqp::ctx()) unless nqp::defined($dctx);
nqp::bindattr($stash, PseudoStash6c, '$!ctx', nqp::decont($dctx));
nqp::bindattr_i($stash, PseudoStash6c, '$!mode', nqp::decont($mode));
nqp::bindattr($stash, PseudoStash, '$!package', nqp::decont($package));
# See the other method candidate
nqp::p6bindattrinvres($stash, Map, '$!storage', nqp::hash())
nqp::bindattr(self, PseudoStash6c, '$!ctx', nqp::decont($dctx));
nqp::bindattr_i(self, PseudoStash6c, '$!mode', nqp::decont($mode));
nqp::bindattr(self, PseudoStash, '$!package', nqp::decont($package));
}

my Int $id = 0;
Expand Down

0 comments on commit 6507e0c

Please sign in to comment.