From 6507e0cf52f140870851dda96a43bd8f9971f891 Mon Sep 17 00:00:00 2001 From: Daniel Green Date: Sat, 30 Mar 2024 22:43:48 -0400 Subject: [PATCH] Unbreak the JVM build 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. --- src/Raku/ast/name.rakumod | 3 ++- src/core.c/PseudoStash.rakumod | 12 +++++------- src/core.e/PseudoStash.rakumod | 13 +++++-------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/Raku/ast/name.rakumod b/src/Raku/ast/name.rakumod index 85c604eddc..4ca42bb733 100644 --- a/src/Raku/ast/name.rakumod +++ b/src/Raku/ast/name.rakumod @@ -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)); } diff --git a/src/core.c/PseudoStash.rakumod b/src/core.c/PseudoStash.rakumod index 9f8ca78624..ed06fbecf6 100644 --- a/src/core.c/PseudoStash.rakumod +++ b/src/core.c/PseudoStash.rakumod @@ -12,7 +12,7 @@ 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); @@ -20,13 +20,11 @@ my class PseudoStash is Map { $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) { diff --git a/src/core.e/PseudoStash.rakumod b/src/core.e/PseudoStash.rakumod index 04ec630187..53e1bce93b 100644 --- a/src/core.e/PseudoStash.rakumod +++ b/src/core.e/PseudoStash.rakumod @@ -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); @@ -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;