-
-
Save zoffixznet/bbc4158b7ef905f743efe33d95fcbfce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2018.05.43 zoffix@VirtualBox~/R/rakudo (master)$ gd | |
diff --git a/src/core/stubs.pm6 b/src/core/stubs.pm6 | |
index 7388a84a7..b2b3d6022 100644 | |
--- a/src/core/stubs.pm6 | |
+++ b/src/core/stubs.pm6 | |
@@ -30,32 +30,35 @@ my class MixHash { ... } | |
my class Lock is repr('ReentrantMutex') { ... } | |
my class Lock::Async { ... } | |
-sub DYNAMIC(\name) is raw { | |
- nqp::ifnull( | |
- nqp::getlexdyn(name), | |
- nqp::stmts( | |
- nqp::unless( | |
- nqp::isnull(my $prom := nqp::getlexdyn('$*PROMISE')), | |
- (my Mu $x := nqp::getlexreldyn( | |
- nqp::getattr($prom,Promise,'$!dynamic_context'),name) | |
- ) | |
- ), | |
- nqp::ifnull( | |
- $x, | |
- nqp::stmts( | |
- (my str $pkgname = nqp::replace(name,1,1,'')), | |
+sub DYNAMIC-SLOW-PATH(\name) is raw { | |
+ nqp::stmts( | |
+ nqp::unless( | |
+ nqp::isnull(my $prom := nqp::getlexdyn('$*PROMISE')), | |
+ (my Mu $x := nqp::getlexreldyn( | |
+ nqp::getattr($prom,Promise,'$!dynamic_context'),name) | |
+ ) | |
+ ), | |
+ nqp::ifnull( | |
+ $x, | |
+ nqp::stmts( | |
+ (my str $pkgname = nqp::replace(name,1,1,'')), | |
+ nqp::ifnull( | |
+ nqp::atkey(GLOBAL.WHO,$pkgname), | |
nqp::ifnull( | |
- nqp::atkey(GLOBAL.WHO,$pkgname), | |
- nqp::ifnull( | |
- nqp::atkey(PROCESS.WHO,$pkgname), | |
- Rakudo::Internals.INITIALIZE-DYNAMIC(name) | |
- ) | |
+ nqp::atkey(PROCESS.WHO,$pkgname), | |
+ Rakudo::Internals.INITIALIZE-DYNAMIC(name) | |
) | |
) | |
) | |
) | |
) | |
} | |
+sub DYNAMIC(\name) is raw { | |
+ # keeping this sub small enough to be inlined by MoarVM's spesh | |
+ nqp::ifnull( | |
+ nqp::getlexdyn(name), | |
+ DYNAMIC-SLOW-PATH name) | |
+} | |
# Set up ClassHOW's auto-gen proto (nested scope so it won't | |
# actually appear in the setting). | |
2018.05.43 zoffix@VirtualBox~/R/rakudo (master)$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment