Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

control operator crossed continuation barrier #3509

Closed
p6rt opened this issue Sep 8, 2014 · 8 comments
Closed

control operator crossed continuation barrier #3509

p6rt opened this issue Sep 8, 2014 · 8 comments
Labels
JVM Related to Rakudo-JVM

Comments

@p6rt
Copy link

p6rt commented Sep 8, 2014

Migrated from rt.perl.org#122732 (status was 'resolved')

Searchable as RT122732$

@p6rt
Copy link
Author

p6rt commented Sep 8, 2014

From @FROGGS

This patch break the jvm build​:
rakudo/rakudo@bdf153c

The code was fudged but the issue remains.

@p6rt
Copy link
Author

p6rt commented Oct 21, 2014

From @usev6

Those are the emergency hot-fix commits, which are still in nom​:

* rakudo/rakudo@33131e0

* rakudo/rakudo@94d83c1

@p6rt
Copy link
Author

p6rt commented Oct 21, 2014

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Sep 21, 2016

From @usev6

On Tue Oct 21 00​:20​:02 2014, bartolin@​gmx.de wrote​:

Those are the emergency hot-fix commits, which are still in nom​:

*
rakudo/rakudo@33131e0

*
rakudo/rakudo@94d83c1

As an experiment I made the following change to nqp​:

====

Inline Patch
diff --git a/src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java b/src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java
index fb95495..b0b4ba4 100644
--- a/src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java
+++ b/src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java
@@ -2386,8 +2386,6 @@ public final class Ops {
             ArgsExpectation.invokeByExpectation(tc, cr, csd, args);
         }
         catch (ControlException e) {
-            if (barrier && (e instanceof SaveStackException))
-                ExceptionHandling.dieInternal(tc, "control operator crossed continuation barrier");
             throw e;
         }
         catch (Throwable e) {
====

Afterwards I removed the mentioned special cases for JVM ("emergency hostfixes") in rakudo's code. I was able to build rakudo-j and to run 'make install'. Also, 'make test' and 'make spectest' didn't show any new failures.

====

Inline Patch
diff --git a/src/core/control.pm b/src/core/control.pm
index 4d82aa0..3037767 100644
--- a/src/core/control.pm
+++ b/src/core/control.pm
@@ -51,31 +51,13 @@ multi sub return(**@x is raw --> Nil) {
     nqp::throwpayloadlexcaller(nqp::const::CONTROL_RETURN, @x);
 }
 
-# RT #122732 - control operator crossed continuation barrier
-#?if jvm
-my &take-rw := -> | {
-    THROW(nqp::const::CONTROL_TAKE,RETURN-LIST(nqp::p6argvmarray));
-}
-#?endif
-#?if !jvm
 proto sub take-rw(|) { * }
 multi sub take-rw()   { die "take-rw without parameters doesn't make sense" }
 multi sub take-rw(\x) { THROW(nqp::const::CONTROL_TAKE, x) }
 multi sub take-rw(|) {
     THROW(nqp::const::CONTROL_TAKE,RETURN-LIST(nqp::p6argvmarray))
 }
-#?endif

-# RT #122732 - control operator crossed continuation barrier
-#?if jvm
-my &take := -> | {
-    THROW(
-      nqp::const::CONTROL_TAKE,
-      nqp::p6recont_ro(RETURN-LIST(nqp::p6argvmarray))
-    )
-}
-#?endif
-#?if !jvm
 proto sub take(|) { * }
 multi sub take()   { die "take without parameters doesn't make sense" }
 multi sub take(\x) {
@@ -87,7 +69,6 @@ multi sub take(|) {
       nqp::p6recont_ro(RETURN-LIST(nqp::p6argvmarray))
     )
 }
-#?endif
 
 proto sub goto(|) { * }
 multi sub goto(Label:D \x --> Nil) { x.goto }
====

I must admit that I don't understand the purpose of the two lines I removed from src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java. They were added with nqp commit bfee0177b1 back in 2013.

@p6rt
Copy link
Author

p6rt commented Sep 21, 2016

From @geekosaur

On Wed, Sep 21, 2016 at 2​:58 PM, Christian Bartolomaeus via RT <
perl6-bugs-followup@​perl.org> wrote​:

I must admit that I don't understand the purpose of the two lines I
removed from src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java. They were
added with nqp commit bfee0177b1 back in 2013.

I don't recall either, but as rakudo was IIRC changed within the past few
months to use control exceptions for `return`, it's not that surprising
that they cause problems now.

--
brandon s allbery kf8nh sine nomine associates
allbery.b@​gmail.com ballbery@​sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

@p6rt
Copy link
Author

p6rt commented Sep 29, 2016

From @usev6

The workaround for JVM has been removed with Rakudo commit c4055e455d.

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Sep 29, 2016

From @usev6

The workaround for JVM has been removed with Rakudo commit c4055e455d.

I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Sep 29, 2016

@usev6 - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Sep 29, 2016
@p6rt p6rt added the JVM Related to Rakudo-JVM label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JVM Related to Rakudo-JVM
Projects
None yet
Development

No branches or pull requests

1 participant