Permalink
Browse files

Eliminate &EXHAUST and the use of it.

We used to use it to replace the RETURN lexical, used for implementing
(lexotic) return. At one point, it would also give an improved error
for the case of returning from an already returned routine. However,
at this point it did not do so, and there are better ways to make that
happen. It did, however, carry a high cost, and frustrated inlining.
Its removal made one simple loop/methodcall/increment benchmark run in
63% of the CPU cycles it previously did, which is a nice win.
  • Loading branch information...
1 parent 3cb602d commit 725054360efa8e703367be8dc5d792769b19caed @jnthn jnthn committed Jun 1, 2016
Showing with 1 addition and 5 deletions.
  1. +1 −1 src/Perl6/Actions.nqp
  2. +0 −4 src/core/control.pm
@@ -8895,7 +8895,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
QAST::Op.new(
:op<bind>,
QAST::Var.new(:name<RETURN>, :scope<lexical>),
- QAST::Var.new(:name<&EXHAUST>, :scope<lexical>))
+ QAST::Op.new( :op('null') ))
),
$*DECLARAND
)
View
@@ -251,10 +251,6 @@ multi sub EVALFILE($filename, :$lang = 'perl6') {
constant Inf = nqp::p6box_n(nqp::inf());
constant NaN = nqp::p6box_n(nqp::nan());
-sub EXHAUST(|) {
- X::ControlFlow::Return.new.throw();
-}
-
sub CLONE-HASH-DECONTAINERIZED(\hash) {
my Mu $clone := nqp::hash();
my Mu $iter := nqp::iterator(nqp::getattr(hash,Map,'$!storage'));

0 comments on commit 7250543

Please sign in to comment.