-
-
Save jackcviers/04efea109a5459a989533a6b10b72d2b to your computer and use it in GitHub Desktop.
Full examples, transformed output, and bytecode output for Suspended Functions Strawman replay
This file contains hidden or 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
package examples | |
import continuations.Continuation | |
import continuations.SafeContinuation | |
import continuations.Suspend | |
import java.util.concurrent.ExecutorService | |
import java.util.concurrent.Executors | |
import scala.util.Random | |
given ExecutorService = Executors.newWorkStealingPool() | |
@main def ListMapNoResume = | |
def zeroArgumentsZeroContinuations()(using Suspend): Int = 1 | |
def twoArgumentsOneContinuationsCFBefore(x: Int, y: Int): Suspend ?=> Int | Continuation.State.Suspended.type = | |
println("twoArgumentsOneContinuationsCFBefore") | |
val z = 1 | |
summon[Suspend].suspendContinuation[Int]{ c => | |
summon[ExecutorService].submit(new Runnable{ | |
override def run = | |
val sleepTime = Random.between(10, 5000) | |
println(s"sleepTime $sleepTime") | |
Thread.sleep(sleepTime) | |
c.resume(Right(x + y + z))}) | |
} | |
val mappedContinuations = (1 to 100).toList.map(twoArgumentsOneContinuationsCFBefore(1, _)) | |
println(mappedContinuations) |
This file contains hidden or 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
[info] [[syntax trees at end of continuationsCallsPhase]] // /home/jackcviers/Documents/development/TBD/list-map/src/main/scala/examples/ListMapNoResume.scala | |
[info] package examples { | |
[info] import continuations.Continuation | |
[info] import continuations.SafeContinuation | |
[info] import continuations.Suspend | |
[info] import java.util.concurrent.ExecutorService | |
[info] import java.util.concurrent.Executors | |
[info] import scala.util.Random | |
[info] final lazy module val ListMapNoResume$package: examples.ListMapNoResume$package = new examples.ListMapNoResume$package() | |
[info] @SourceFile("list-map/src/main/scala/examples/ListMapNoResume.scala") final module class ListMapNoResume$package() extends Object() { | |
[info] this: examples.ListMapNoResume$package.type => | |
[info] private def writeReplace(): AnyRef = new scala.runtime.ModuleSerializationProxy(classOf[examples.ListMapNoResume$package.type]) | |
[info] final lazy given val given_ExecutorService: java.util.concurrent.ExecutorService = java.util.concurrent.Executors.newWorkStealingPool() | |
[info] @main def ListMapNoResume: Unit = | |
[info] { | |
[info] def zeroArgumentsZeroContinuations(completion: continuations.Continuation[Int | Any]): Any = 1 | |
[info] def twoArgumentsOneContinuationsCFBefore(x: Int, y: Int, | |
[info] completion: continuations.Continuation[Int | (continuations.Continuation.State.Suspended : continuations.Continuation.State)] | |
[info] ): Any | Null | (continuations.Continuation.State.Suspended : continuations.Continuation.State) = | |
[info] { | |
[info] println("twoArgumentsOneContinuationsCFBefore") | |
[info] val z: Int = 1 | |
[info] { | |
[info] val continuation1: continuations.Continuation[Int | (continuations.Continuation.State.Suspended : continuations.Continuation.State)] = completion | |
[info] val safeContinuation: continuations.SafeContinuation[Int | (continuations.Continuation.State.Suspended : continuations.Continuation.State)] = | |
[info] new continuations.SafeContinuation[Int | (continuations.Continuation.State.Suspended : continuations.Continuation.State)]( | |
[info] continuations.intrinsics.IntrinsicsJvm$package.intercepted[Int | (continuations.Continuation.State.Suspended : continuations.Continuation.State)]( | |
[info] continuation1 | |
[info] )() | |
[info] , continuations.Continuation.State.Undecided) | |
[info] { | |
[info] examples.ListMapNoResume$package.given_ExecutorService.submit( | |
[info] { | |
[info] final class $anon() extends Object(), Runnable { | |
[info] override def run: Unit = | |
[info] { | |
[info] val sleepTime: Int = util.Random.between(10, 5000) | |
[info] println(_root_.scala.StringContext.apply(["sleepTime ","" : String]*).s([sleepTime : Any]*)) | |
[info] Thread.sleep(Int.int2long(sleepTime)) | |
[info] safeContinuation.resume(Right.apply[Nothing, Int](x.+(y).+(z))) | |
[info] } | |
[info] } | |
[info] new $anon():Runnable | |
[info] } | |
[info] ).$asInstanceOf[java.util.concurrent.Future[?1.CAP]] | |
[info] () | |
[info] } | |
[info] safeContinuation.getOrThrow() | |
[info] } | |
[info] } | |
[info] val mappedContinuations: List[Matchable] = | |
[info] intWrapper(1).to(100).toList.map[Matchable]( | |
[info] { | |
[info] def $anonfun(_$1: Int): Matchable = twoArgumentsOneContinuationsCFBefore(1, _$1, continuations.jvm.internal.ContinuationStub.contImpl) | |
[info] closure($anonfun) | |
[info] } | |
[info] ) | |
[info] println(mappedContinuations) | |
[info] } | |
[info] } | |
[info] @SourceFile("list-map/src/main/scala/examples/ListMapNoResume.scala") final class ListMapNoResume() extends Object() { | |
[info] <static> def main(args: Array[String]): Unit = | |
[info] try examples.ListMapNoResume$package.ListMapNoResume catch | |
[info] { | |
[info] case error @ _:scala.util.CommandLineParser.ParseError => scala.util.CommandLineParser.showError(error) | |
[info] } | |
[info] } | |
[info] } |
This file contains hidden or 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
Compiled from "ListMapNoResume.scala" | |
final class examples.ListMapNoResume$package$$anon$1 implements java.lang.Runnable { | |
public examples.ListMapNoResume$package$$anon$1(int, int, continuations.SafeContinuation, int); | |
Code: | |
0: aload_0 | |
1: iload_1 | |
2: putfield #26 // Field x$1:I | |
5: aload_0 | |
6: iload_2 | |
7: putfield #28 // Field y$1:I | |
10: aload_0 | |
11: aload_3 | |
12: putfield #30 // Field safeContinuation$1:Lcontinuations/SafeContinuation; | |
15: aload_0 | |
16: iload 4 | |
18: putfield #32 // Field z$1:I | |
21: aload_0 | |
22: invokespecial #35 // Method java/lang/Object."<init>":()V | |
25: return | |
public void run(); | |
Code: | |
0: getstatic #44 // Field scala/util/Random$.MODULE$:Lscala/util/Random$; | |
3: bipush 10 | |
5: sipush 5000 | |
8: invokevirtual #48 // Method scala/util/Random$.between:(II)I | |
11: istore_1 | |
12: getstatic #53 // Field scala/Predef$.MODULE$:Lscala/Predef$; | |
15: new #55 // class java/lang/StringBuilder | |
18: dup | |
19: ldc #56 // int 10 | |
21: invokespecial #59 // Method java/lang/StringBuilder."<init>":(I)V | |
24: ldc #61 // String sleepTime | |
26: invokevirtual #65 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; | |
29: iload_1 | |
30: invokevirtual #68 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder; | |
33: invokevirtual #72 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; | |
36: invokevirtual #76 // Method scala/Predef$.println:(Ljava/lang/Object;)V | |
39: getstatic #81 // Field scala/Int$.MODULE$:Lscala/Int$; | |
42: iload_1 | |
43: invokevirtual #85 // Method scala/Int$.int2long:(I)J | |
46: invokestatic #91 // Method java/lang/Thread.sleep:(J)V | |
49: aload_0 | |
50: getfield #30 // Field safeContinuation$1:Lcontinuations/SafeContinuation; | |
53: getstatic #96 // Field scala/package$.MODULE$:Lscala/package$; | |
56: invokevirtual #100 // Method scala/package$.Right:()Lscala/util/Right$; | |
59: aload_0 | |
60: getfield #26 // Field x$1:I | |
63: aload_0 | |
64: getfield #28 // Field y$1:I | |
67: iadd | |
68: aload_0 | |
69: getfield #32 // Field z$1:I | |
72: iadd | |
73: invokestatic #106 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
76: invokevirtual #112 // Method scala/util/Right$.apply:(Ljava/lang/Object;)Lscala/util/Right; | |
79: invokevirtual #118 // Method continuations/SafeContinuation.resume:(Lscala/util/Either;)V | |
82: return | |
} | |
Compiled from "ListMapNoResume.scala" | |
public final class examples.ListMapNoResume$package$ implements java.io.Serializable { | |
public static final long OFFSET$_m_0; | |
public long 0bitmap$1; | |
public static java.util.concurrent.ExecutorService given_ExecutorService$lzy1; | |
public static final examples.ListMapNoResume$package$ MODULE$; | |
public final java.util.concurrent.ExecutorService given_ExecutorService(); | |
Code: | |
0: getstatic #40 // Field scala/runtime/LazyVals$.MODULE$:Lscala/runtime/LazyVals$; | |
3: aload_0 | |
4: getstatic #47 // Field OFFSET$_m_0:J | |
7: invokevirtual #65 // Method scala/runtime/LazyVals$.get:(Ljava/lang/Object;J)J | |
10: lstore_1 | |
11: getstatic #40 // Field scala/runtime/LazyVals$.MODULE$:Lscala/runtime/LazyVals$; | |
14: lload_1 | |
15: iconst_0 | |
16: invokevirtual #69 // Method scala/runtime/LazyVals$.STATE:(JI)J | |
19: lstore_3 | |
20: lload_3 | |
21: ldc2_w #70 // long 3l | |
24: lcmp | |
25: ifne 35 | |
28: getstatic #73 // Field given_ExecutorService$lzy1:Ljava/util/concurrent/ExecutorService; | |
31: areturn | |
32: nop | |
33: nop | |
34: athrow | |
35: lload_3 | |
36: lconst_0 | |
37: lcmp | |
38: ifne 109 | |
41: getstatic #40 // Field scala/runtime/LazyVals$.MODULE$:Lscala/runtime/LazyVals$; | |
44: aload_0 | |
45: getstatic #47 // Field OFFSET$_m_0:J | |
48: lload_1 | |
49: iconst_1 | |
50: iconst_0 | |
51: invokevirtual #77 // Method scala/runtime/LazyVals$.CAS:(Ljava/lang/Object;JJII)Z | |
54: ifeq 106 | |
57: invokestatic #82 // Method java/util/concurrent/Executors.newWorkStealingPool:()Ljava/util/concurrent/ExecutorService; | |
60: astore 5 | |
62: aload 5 | |
64: putstatic #73 // Field given_ExecutorService$lzy1:Ljava/util/concurrent/ExecutorService; | |
67: getstatic #40 // Field scala/runtime/LazyVals$.MODULE$:Lscala/runtime/LazyVals$; | |
70: aload_0 | |
71: getstatic #47 // Field OFFSET$_m_0:J | |
74: iconst_3 | |
75: iconst_0 | |
76: invokevirtual #86 // Method scala/runtime/LazyVals$.setFlag:(Ljava/lang/Object;JII)V | |
79: aload 5 | |
81: areturn | |
82: nop | |
83: nop | |
84: athrow | |
85: astore 6 | |
87: getstatic #40 // Field scala/runtime/LazyVals$.MODULE$:Lscala/runtime/LazyVals$; | |
90: aload_0 | |
91: getstatic #47 // Field OFFSET$_m_0:J | |
94: iconst_0 | |
95: iconst_0 | |
96: invokevirtual #86 // Method scala/runtime/LazyVals$.setFlag:(Ljava/lang/Object;JII)V | |
99: aload 6 | |
101: athrow | |
102: nop | |
103: nop | |
104: athrow | |
105: athrow | |
106: goto 121 | |
109: getstatic #40 // Field scala/runtime/LazyVals$.MODULE$:Lscala/runtime/LazyVals$; | |
112: aload_0 | |
113: getstatic #47 // Field OFFSET$_m_0:J | |
116: lload_1 | |
117: iconst_0 | |
118: invokevirtual #90 // Method scala/runtime/LazyVals$.wait4Notification:(Ljava/lang/Object;JJI)V | |
121: goto 0 | |
124: nop | |
125: athrow | |
Exception table: | |
from to target type | |
57 82 85 Class java/lang/Throwable | |
public void ListMapNoResume(); | |
Code: | |
0: getstatic #96 // Field scala/runtime/RichInt$.MODULE$:Lscala/runtime/RichInt$; | |
3: getstatic #101 // Field scala/Predef$.MODULE$:Lscala/Predef$; | |
6: iconst_1 | |
7: invokevirtual #105 // Method scala/Predef$.intWrapper:(I)I | |
10: bipush 100 | |
12: invokevirtual #109 // Method scala/runtime/RichInt$.to$extension:(II)Lscala/collection/immutable/Range$Inclusive; | |
15: invokevirtual #113 // Method scala/collection/immutable/Range$Inclusive.toList:()Lscala/collection/immutable/List; | |
18: aload_0 | |
19: invokedynamic #131, 0 // InvokeDynamic #0:apply:(Lexamples/ListMapNoResume$package$;)Lscala/Function1; | |
24: invokevirtual #137 // Method scala/collection/immutable/List.map:(Lscala/Function1;)Lscala/collection/immutable/List; | |
27: astore_1 | |
28: getstatic #101 // Field scala/Predef$.MODULE$:Lscala/Predef$; | |
31: aload_1 | |
32: invokevirtual #141 // Method scala/Predef$.println:(Ljava/lang/Object;)V | |
35: return | |
} | |
Compiled from "ListMapNoResume.scala" | |
public final class examples.ListMapNoResume$package { | |
public static void ListMapNoResume(); | |
Code: | |
0: getstatic #13 // Field examples/ListMapNoResume$package$.MODULE$:Lexamples/ListMapNoResume$package$; | |
3: invokevirtual #15 // Method examples/ListMapNoResume$package$.ListMapNoResume:()V | |
6: return | |
public static java.util.concurrent.ExecutorService given_ExecutorService(); | |
Code: | |
0: getstatic #13 // Field examples/ListMapNoResume$package$.MODULE$:Lexamples/ListMapNoResume$package$; | |
3: invokevirtual #19 // Method examples/ListMapNoResume$package$.given_ExecutorService:()Ljava/util/concurrent/ExecutorService; | |
6: areturn | |
} | |
Compiled from "ListMapNoResume.scala" | |
public final class examples.ListMapNoResume { | |
public examples.ListMapNoResume(); | |
Code: | |
0: aload_0 | |
1: invokespecial #14 // Method java/lang/Object."<init>":()V | |
4: return | |
public static void main(java.lang.String[]); | |
Code: | |
0: getstatic #25 // Field examples/ListMapNoResume$package$.MODULE$:Lexamples/ListMapNoResume$package$; | |
3: invokevirtual #28 // Method examples/ListMapNoResume$package$.ListMapNoResume:()V | |
6: goto 20 | |
9: astore_1 | |
10: getstatic #33 // Field scala/util/CommandLineParser$.MODULE$:Lscala/util/CommandLineParser$; | |
13: aload_1 | |
14: invokevirtual #37 // Method scala/util/CommandLineParser$.showError:(Lscala/util/CommandLineParser$ParseError;)V | |
17: goto 20 | |
20: return | |
Exception table: | |
from to target type | |
0 6 9 Class scala/util/CommandLineParser$ParseError | |
} |
This file contains hidden or 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
package examples | |
import continuations.* | |
@main def ThreeDependentContinuations = | |
def threeDependentContinuations(a: Int, b: Int, c: Int)(using s: Suspend): Int = | |
val d = 4 | |
val continuationOne:Int = s.suspendContinuation(_.resume(Right(d + a))) // 5 | |
val e = 5 | |
val continuationTwo:Int = s.suspendContinuation(_.resume(Right(continuationOne + e + b))) // 12 | |
val f = 6 | |
val result:Int = s.suspendContinuation(_.resume(Right(continuationTwo + f + c))) // 21 | |
result | |
println(threeDependentContinuations(1,2,3)) |
This file contains hidden or 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
[[syntax trees at end of continuationsCallsPhase]] // /home/jackcviers/Documents/development/TBD/list-map/src/main/scala/examples/ThreeDependentContinuations.scala | |
package examples { | |
import continuations.* | |
final lazy module val ThreeDependentContinuations$package: examples.ThreeDependentContinuations$package = new examples.ThreeDependentContinuations$package() | |
@SourceFile("list-map/src/main/scala/examples/ThreeDependentContinuations.scala") final module class ThreeDependentContinuations$package() extends Object() { | |
this: examples.ThreeDependentContinuations$package.type => | |
private def writeReplace(): AnyRef = new scala.runtime.ModuleSerializationProxy(classOf[examples.ThreeDependentContinuations$package.type]) | |
@main def ThreeDependentContinuations: Unit = | |
{ | |
class ThreeDependentContinuations$threeDependentContinuations$1($completion: continuations.Continuation[Any | Null]) extends | |
continuations.jvm.internal.ContinuationImpl | |
($completion, $completion.context) { | |
var I$0: Any = _ | |
var I$1: Any = _ | |
var I$2: Any = _ | |
var I$3: Any = _ | |
var I$4: Any = _ | |
var I$5: Any = _ | |
def I$0_=(x$0: Any): Unit = () | |
def I$1_=(x$0: Any): Unit = () | |
def I$2_=(x$0: Any): Unit = () | |
def I$3_=(x$0: Any): Unit = () | |
def I$4_=(x$0: Any): Unit = () | |
def I$5_=(x$0: Any): Unit = () | |
var $result: Either[Throwable, Any | Null | (continuations.Continuation.State.Suspended : continuations.Continuation.State)] = _ | |
var $label: Int = _ | |
def $result_=(x$0: Either[Throwable, Any | Null | (continuations.Continuation.State.Suspended : continuations.Continuation.State)]): Unit = () | |
def $label_=(x$0: Int): Unit = () | |
protected override def invokeSuspend(result: Either[Throwable, Any | Null | (continuations.Continuation.State.Suspended : continuations.Continuation.State)]): | |
Any | Null | |
= | |
{ | |
this.$result = result | |
this.$label = this.$label.|(scala.Int.MinValue) | |
threeDependentContinuations(null, null, null, this.asInstanceOf[continuations.Continuation[Int]]) | |
} | |
} | |
def threeDependentContinuations(a: Int, b: Int, c: Int, completion: continuations.Continuation[Int]): | |
Int | Null | (continuations.Continuation.State.Suspended : continuations.Continuation.State) | |
= | |
{ | |
var a##1: Int = a | |
var b##1: Int = b | |
var c##1: Int = c | |
var continuationOne: Int = null | |
var continuationTwo: Int = null | |
var result: Int = null | |
{ | |
var $continuation: continuations.Continuation[Any] | Null = null | |
completion match | |
{ | |
case x$0 @ <empty> if | |
x$0.isInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].&&( | |
x$0.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].$label.&(scala.Int.MinValue).!=(0) | |
) | |
=> | |
$continuation = x$0.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1] | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].$label = | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].$label.-(scala.Int.MinValue) | |
case _ => $continuation = new ThreeDependentContinuations$threeDependentContinuations$1(completion.asInstanceOf[continuations.Continuation[Any | Null]]) | |
} | |
val $result: Either[Throwable, Any | Null | (continuations.Continuation.State.Suspended : continuations.Continuation.State)] = | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].$result | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].$label match | |
{ | |
case 0 => | |
if $result.!=(null) then | |
$result.fold[Unit]( | |
{ | |
def $anonfun(x$0: Throwable): Nothing = throw x$0 | |
closure($anonfun) | |
} | |
, | |
{ | |
def $anonfun(x$0: Any | Null | (continuations.Continuation.State.Suspended : continuations.Continuation.State)): Unit = () | |
closure($anonfun) | |
} | |
) | |
else () | |
val d: Int = 4 | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$0 = c##1 | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$1 = b##1 | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$2 = a##1 | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].$label = 1 | |
val safeContinuation: continuations.SafeContinuation[Int] = | |
new continuations.SafeContinuation[Int](continuations.intrinsics.IntrinsicsJvm$package.intercepted[Int]($continuation)(), | |
continuations.Continuation.State.Undecided | |
) | |
safeContinuation.resume(Right.apply[Nothing, Int](d.+(a##1))) | |
val orThrow: Any | Null | (continuations.Continuation.State.Suspended : continuations.Continuation.State) = safeContinuation.getOrThrow() | |
if orThrow.==(continuations.Continuation.State.Suspended) then return continuations.Continuation.State.Suspended | |
continuationOne = orThrow.asInstanceOf[Int] | |
return[label1] () | |
() | |
case 1 => | |
c##1 = $continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$0 | |
b##1 = $continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$1 | |
a##1 = $continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$2 | |
if $result.!=(null) then | |
$result.fold[Unit]( | |
{ | |
def $anonfun(x$0: Throwable): Nothing = throw x$0 | |
closure($anonfun) | |
} | |
, | |
{ | |
def $anonfun(x$0: Any | Null | (continuations.Continuation.State.Suspended : continuations.Continuation.State)): Unit = () | |
closure($anonfun) | |
} | |
) | |
else () | |
continuationOne = $result.asInstanceOf[Int] | |
label1[Unit]: <empty> | |
val e: Int = 5 | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$0 = c##1 | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$1 = b##1 | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$2 = a##1 | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$3 = continuationOne | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].$label = 2 | |
val safeContinuation: continuations.SafeContinuation[Int] = | |
new continuations.SafeContinuation[Int](continuations.intrinsics.IntrinsicsJvm$package.intercepted[Int]($continuation)(), | |
continuations.Continuation.State.Undecided | |
) | |
safeContinuation.resume(Right.apply[Nothing, Int](continuationOne.+(e).+(b##1))) | |
val orThrow: Any | Null | (continuations.Continuation.State.Suspended : continuations.Continuation.State) = safeContinuation.getOrThrow() | |
if orThrow.==(continuations.Continuation.State.Suspended) then return continuations.Continuation.State.Suspended | |
continuationTwo = orThrow.asInstanceOf[Int] | |
return[label2] () | |
() | |
case 2 => | |
c##1 = $continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$0 | |
b##1 = $continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$1 | |
a##1 = $continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$2 | |
continuationOne = $continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$3 | |
if $result.!=(null) then | |
$result.fold[Unit]( | |
{ | |
def $anonfun(x$0: Throwable): Nothing = throw x$0 | |
closure($anonfun) | |
} | |
, | |
{ | |
def $anonfun(x$0: Any | Null | (continuations.Continuation.State.Suspended : continuations.Continuation.State)): Unit = () | |
closure($anonfun) | |
} | |
) | |
else () | |
continuationTwo = $result.asInstanceOf[Int] | |
label2[Unit]: <empty> | |
val f: Int = 6 | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$0 = c##1 | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$1 = b##1 | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$2 = a##1 | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$3 = continuationOne | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$4 = continuationTwo | |
$continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].$label = 3 | |
val safeContinuation: continuations.SafeContinuation[Int] = | |
new continuations.SafeContinuation[Int](continuations.intrinsics.IntrinsicsJvm$package.intercepted[Int]($continuation)(), | |
continuations.Continuation.State.Undecided | |
) | |
safeContinuation.resume(Right.apply[Nothing, Int](continuationTwo.+(f).+(c##1))) | |
val orThrow: Any | Null | (continuations.Continuation.State.Suspended : continuations.Continuation.State) = safeContinuation.getOrThrow() | |
if orThrow.==(continuations.Continuation.State.Suspended) then return continuations.Continuation.State.Suspended | |
result = orThrow.asInstanceOf[Int] | |
() | |
case 3 => | |
c##1 = $continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$0 | |
b##1 = $continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$1 | |
a##1 = $continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$2 | |
continuationOne = $continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$3 | |
continuationTwo = $continuation.asInstanceOf[ThreeDependentContinuations$threeDependentContinuations$1].I$4 | |
if $result.!=(null) then | |
$result.fold[Unit]( | |
{ | |
def $anonfun(x$0: Throwable): Nothing = throw x$0 | |
closure($anonfun) | |
} | |
, | |
{ | |
def $anonfun(x$0: Any | Null | (continuations.Continuation.State.Suspended : continuations.Continuation.State)): Unit = () | |
closure($anonfun) | |
} | |
) | |
else () | |
result = $result.asInstanceOf[Int] | |
case _ => throw new IllegalArgumentException("call to \'resume\' before \'invoke\' with coroutine") | |
} | |
} | |
result | |
} | |
println(threeDependentContinuations(1, 2, 3, continuations.jvm.internal.ContinuationStub.contImpl)) | |
} | |
} | |
@SourceFile("list-map/src/main/scala/examples/ThreeDependentContinuations.scala") final class ThreeDependentContinuations() extends Object() { | |
<static> def main(args: Array[String]): Unit = | |
try examples.ThreeDependentContinuations$package.ThreeDependentContinuations catch | |
{ | |
case error @ _:scala.util.CommandLineParser.ParseError => scala.util.CommandLineParser.showError(error) | |
} | |
} | |
} |
This file contains hidden or 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
Compiled from "ThreeDependentContinuations.scala" | |
public final class examples.ThreeDependentContinuations$package$ implements java.io.Serializable { | |
public static final examples.ThreeDependentContinuations$package$ MODULE$; | |
public static {}; | |
Code: | |
0: new #2 // class examples/ThreeDependentContinuations$package$ | |
3: dup | |
4: invokespecial #27 // Method "<init>":()V | |
7: putstatic #29 // Field MODULE$:Lexamples/ThreeDependentContinuations$package$; | |
10: return | |
public void ThreeDependentContinuations(); | |
Code: | |
0: getstatic #42 // Field scala/Predef$.MODULE$:Lscala/Predef$; | |
3: aload_0 | |
4: iconst_1 | |
5: iconst_2 | |
6: iconst_3 | |
7: getstatic #47 // Field continuations/jvm/internal/ContinuationStub$.MODULE$:Lcontinuations/jvm/internal/ContinuationStub$; | |
10: invokevirtual #51 // Method continuations/jvm/internal/ContinuationStub$.contImpl:()Lcontinuations/jvm/internal/ContinuationImpl; | |
13: invokevirtual #55 // Method examples$ThreeDependentContinuations$package$$$_$threeDependentContinuations$1:(IIILcontinuations/Continuation;)Ljava/lang/Object; | |
16: invokevirtual #59 // Method scala/Predef$.println:(Ljava/lang/Object;)V | |
19: return | |
public final java.lang.Object examples$ThreeDependentContinuations$package$$$_$threeDependentContinuations$1(int, int, int, continuations.Continuation); | |
Code: | |
0: iload_1 | |
1: istore 5 | |
3: iload_2 | |
4: istore 6 | |
6: iload_3 | |
7: istore 7 | |
9: aconst_null | |
10: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
13: istore 8 | |
15: aconst_null | |
16: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
19: istore 9 | |
21: aconst_null | |
22: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
25: istore 10 | |
27: aconst_null | |
28: astore 11 | |
30: aload 4 | |
32: astore 12 | |
34: aload 12 | |
36: astore 13 | |
38: aload 13 | |
40: instanceof #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
43: ifeq 90 | |
46: aload 13 | |
48: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
51: invokevirtual #85 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.$label:()I | |
54: ldc #86 // int -2147483648 | |
56: iand | |
57: iconst_0 | |
58: if_icmpeq 90 | |
61: aload 13 | |
63: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
66: astore 11 | |
68: aload 11 | |
70: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
73: aload 11 | |
75: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
78: invokevirtual #85 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.$label:()I | |
81: ldc #86 // int -2147483648 | |
83: isub | |
84: invokevirtual #90 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.$label_$eq:(I)V | |
87: goto 104 | |
90: new #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
93: dup | |
94: aload 4 | |
96: invokespecial #93 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1."<init>":(Lcontinuations/Continuation;)V | |
99: astore 11 | |
101: goto 104 | |
104: aload 11 | |
106: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
109: invokevirtual #97 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.$result:()Lscala/util/Either; | |
112: astore 14 | |
114: aload 11 | |
116: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
119: invokevirtual #85 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.$label:()I | |
122: istore 15 | |
124: iload 15 | |
126: tableswitch { // 0 to 3 | |
0: 156 | |
1: 330 | |
2: 566 | |
3: 826 | |
default: 930 | |
} | |
156: aload 14 | |
158: ifnull 179 | |
161: aload 14 | |
163: aload_0 | |
164: invokedynamic #116, 0 // InvokeDynamic #0:apply:(Lexamples/ThreeDependentContinuations$package$;)Lscala/Function1; | |
169: aload_0 | |
170: invokedynamic #124, 0 // InvokeDynamic #1:applyVoid:(Lexamples/ThreeDependentContinuations$package$;)Lscala/runtime/function/JProcedure1; | |
175: invokevirtual #130 // Method scala/util/Either.fold:(Lscala/Function1;Lscala/Function1;)Ljava/lang/Object; | |
178: pop | |
179: iconst_4 | |
180: istore 16 | |
182: aload 11 | |
184: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
187: iload 7 | |
189: invokestatic #134 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
192: invokevirtual #137 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$0_$eq:(Ljava/lang/Object;)V | |
195: aload 11 | |
197: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
200: iload 6 | |
202: invokestatic #134 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
205: invokevirtual #140 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$1_$eq:(Ljava/lang/Object;)V | |
208: aload 11 | |
210: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
213: iload 5 | |
215: invokestatic #134 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
218: invokevirtual #143 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$2_$eq:(Ljava/lang/Object;)V | |
221: aload 11 | |
223: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
226: iconst_1 | |
227: invokevirtual #90 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.$label_$eq:(I)V | |
230: new #145 // class continuations/SafeContinuation | |
233: dup | |
234: getstatic #150 // Field continuations/intrinsics/IntrinsicsJvm$package$.MODULE$:Lcontinuations/intrinsics/IntrinsicsJvm$package$; | |
237: aload 11 | |
239: invokevirtual #154 // Method continuations/intrinsics/IntrinsicsJvm$package$.intercepted:(Lcontinuations/Continuation;)Lcontinuations/Continuation; | |
242: getstatic #158 // Field continuations/Continuation$State$.Undecided:Lcontinuations/Continuation$State; | |
245: invokespecial #161 // Method continuations/SafeContinuation."<init>":(Lcontinuations/Continuation;Ljava/lang/Object;)V | |
248: astore 17 | |
250: aload 17 | |
252: getstatic #166 // Field scala/package$.MODULE$:Lscala/package$; | |
255: invokevirtual #170 // Method scala/package$.Right:()Lscala/util/Right$; | |
258: iload 16 | |
260: iload 5 | |
262: iadd | |
263: invokestatic #134 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
266: invokevirtual #175 // Method scala/util/Right$.apply:(Ljava/lang/Object;)Lscala/util/Right; | |
269: invokevirtual #179 // Method continuations/SafeContinuation.resume:(Lscala/util/Either;)V | |
272: aload 17 | |
274: invokevirtual #182 // Method continuations/SafeContinuation.getOrThrow:()Ljava/lang/Object; | |
277: astore 18 | |
279: aload 18 | |
281: getstatic #185 // Field continuations/Continuation$State$.Suspended:Lcontinuations/Continuation$State; | |
284: astore 19 | |
286: dup | |
287: ifnonnull 299 | |
290: pop | |
291: aload 19 | |
293: ifnull 307 | |
296: goto 311 | |
299: aload 19 | |
301: invokevirtual #189 // Method java/lang/Object.equals:(Ljava/lang/Object;)Z | |
304: ifeq 311 | |
307: getstatic #185 // Field continuations/Continuation$State$.Suspended:Lcontinuations/Continuation$State; | |
310: areturn | |
311: aload 18 | |
313: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
316: istore 8 | |
318: goto 399 | |
321: nop | |
322: nop | |
323: nop | |
324: nop | |
325: nop | |
326: athrow | |
327: nop | |
328: nop | |
329: athrow | |
330: aload 11 | |
332: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
335: invokevirtual #198 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$0:()Ljava/lang/Object; | |
338: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
341: istore 7 | |
343: aload 11 | |
345: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
348: invokevirtual #201 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$1:()Ljava/lang/Object; | |
351: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
354: istore 6 | |
356: aload 11 | |
358: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
361: invokevirtual #204 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$2:()Ljava/lang/Object; | |
364: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
367: istore 5 | |
369: aload 14 | |
371: ifnull 392 | |
374: aload 14 | |
376: aload_0 | |
377: invokedynamic #208, 0 // InvokeDynamic #2:apply:(Lexamples/ThreeDependentContinuations$package$;)Lscala/Function1; | |
382: aload_0 | |
383: invokedynamic #212, 0 // InvokeDynamic #3:applyVoid:(Lexamples/ThreeDependentContinuations$package$;)Lscala/runtime/function/JProcedure1; | |
388: invokevirtual #130 // Method scala/util/Either.fold:(Lscala/Function1;Lscala/Function1;)Ljava/lang/Object; | |
391: pop | |
392: aload 14 | |
394: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
397: istore 8 | |
399: iconst_5 | |
400: istore 20 | |
402: aload 11 | |
404: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
407: iload 7 | |
409: invokestatic #134 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
412: invokevirtual #137 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$0_$eq:(Ljava/lang/Object;)V | |
415: aload 11 | |
417: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
420: iload 6 | |
422: invokestatic #134 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
425: invokevirtual #140 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$1_$eq:(Ljava/lang/Object;)V | |
428: aload 11 | |
430: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
433: iload 5 | |
435: invokestatic #134 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
438: invokevirtual #143 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$2_$eq:(Ljava/lang/Object;)V | |
441: aload 11 | |
443: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
446: iload 8 | |
448: invokestatic #134 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
451: invokevirtual #215 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$3_$eq:(Ljava/lang/Object;)V | |
454: aload 11 | |
456: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
459: iconst_2 | |
460: invokevirtual #90 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.$label_$eq:(I)V | |
463: new #145 // class continuations/SafeContinuation | |
466: dup | |
467: getstatic #150 // Field continuations/intrinsics/IntrinsicsJvm$package$.MODULE$:Lcontinuations/intrinsics/IntrinsicsJvm$package$; | |
470: aload 11 | |
472: invokevirtual #154 // Method continuations/intrinsics/IntrinsicsJvm$package$.intercepted:(Lcontinuations/Continuation;)Lcontinuations/Continuation; | |
475: getstatic #158 // Field continuations/Continuation$State$.Undecided:Lcontinuations/Continuation$State; | |
478: invokespecial #161 // Method continuations/SafeContinuation."<init>":(Lcontinuations/Continuation;Ljava/lang/Object;)V | |
481: astore 21 | |
483: aload 21 | |
485: getstatic #166 // Field scala/package$.MODULE$:Lscala/package$; | |
488: invokevirtual #170 // Method scala/package$.Right:()Lscala/util/Right$; | |
491: iload 8 | |
493: iload 20 | |
495: iadd | |
496: iload 6 | |
498: iadd | |
499: invokestatic #134 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
502: invokevirtual #175 // Method scala/util/Right$.apply:(Ljava/lang/Object;)Lscala/util/Right; | |
505: invokevirtual #179 // Method continuations/SafeContinuation.resume:(Lscala/util/Either;)V | |
508: aload 21 | |
510: invokevirtual #182 // Method continuations/SafeContinuation.getOrThrow:()Ljava/lang/Object; | |
513: astore 22 | |
515: aload 22 | |
517: getstatic #185 // Field continuations/Continuation$State$.Suspended:Lcontinuations/Continuation$State; | |
520: astore 23 | |
522: dup | |
523: ifnonnull 535 | |
526: pop | |
527: aload 23 | |
529: ifnull 543 | |
532: goto 547 | |
535: aload 23 | |
537: invokevirtual #189 // Method java/lang/Object.equals:(Ljava/lang/Object;)Z | |
540: ifeq 547 | |
543: getstatic #185 // Field continuations/Continuation$State$.Suspended:Lcontinuations/Continuation$State; | |
546: areturn | |
547: aload 22 | |
549: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
552: istore 9 | |
554: goto 648 | |
557: nop | |
558: nop | |
559: nop | |
560: nop | |
561: nop | |
562: athrow | |
563: nop | |
564: nop | |
565: athrow | |
566: aload 11 | |
568: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
571: invokevirtual #198 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$0:()Ljava/lang/Object; | |
574: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
577: istore 7 | |
579: aload 11 | |
581: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
584: invokevirtual #201 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$1:()Ljava/lang/Object; | |
587: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
590: istore 6 | |
592: aload 11 | |
594: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
597: invokevirtual #204 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$2:()Ljava/lang/Object; | |
600: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
603: istore 5 | |
605: aload 11 | |
607: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
610: invokevirtual #218 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$3:()Ljava/lang/Object; | |
613: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
616: istore 8 | |
618: aload 14 | |
620: ifnull 641 | |
623: aload 14 | |
625: aload_0 | |
626: invokedynamic #222, 0 // InvokeDynamic #4:apply:(Lexamples/ThreeDependentContinuations$package$;)Lscala/Function1; | |
631: aload_0 | |
632: invokedynamic #226, 0 // InvokeDynamic #5:applyVoid:(Lexamples/ThreeDependentContinuations$package$;)Lscala/runtime/function/JProcedure1; | |
637: invokevirtual #130 // Method scala/util/Either.fold:(Lscala/Function1;Lscala/Function1;)Ljava/lang/Object; | |
640: pop | |
641: aload 14 | |
643: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
646: istore 9 | |
648: bipush 6 | |
650: istore 24 | |
652: aload 11 | |
654: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
657: iload 7 | |
659: invokestatic #134 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
662: invokevirtual #137 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$0_$eq:(Ljava/lang/Object;)V | |
665: aload 11 | |
667: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
670: iload 6 | |
672: invokestatic #134 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
675: invokevirtual #140 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$1_$eq:(Ljava/lang/Object;)V | |
678: aload 11 | |
680: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
683: iload 5 | |
685: invokestatic #134 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
688: invokevirtual #143 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$2_$eq:(Ljava/lang/Object;)V | |
691: aload 11 | |
693: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
696: iload 8 | |
698: invokestatic #134 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
701: invokevirtual #215 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$3_$eq:(Ljava/lang/Object;)V | |
704: aload 11 | |
706: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
709: iload 9 | |
711: invokestatic #134 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
714: invokevirtual #229 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$4_$eq:(Ljava/lang/Object;)V | |
717: aload 11 | |
719: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
722: iconst_3 | |
723: invokevirtual #90 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.$label_$eq:(I)V | |
726: new #145 // class continuations/SafeContinuation | |
729: dup | |
730: getstatic #150 // Field continuations/intrinsics/IntrinsicsJvm$package$.MODULE$:Lcontinuations/intrinsics/IntrinsicsJvm$package$; | |
733: aload 11 | |
735: invokevirtual #154 // Method continuations/intrinsics/IntrinsicsJvm$package$.intercepted:(Lcontinuations/Continuation;)Lcontinuations/Continuation; | |
738: getstatic #158 // Field continuations/Continuation$State$.Undecided:Lcontinuations/Continuation$State; | |
741: invokespecial #161 // Method continuations/SafeContinuation."<init>":(Lcontinuations/Continuation;Ljava/lang/Object;)V | |
744: astore 25 | |
746: aload 25 | |
748: getstatic #166 // Field scala/package$.MODULE$:Lscala/package$; | |
751: invokevirtual #170 // Method scala/package$.Right:()Lscala/util/Right$; | |
754: iload 9 | |
756: iload 24 | |
758: iadd | |
759: iload 7 | |
761: iadd | |
762: invokestatic #134 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
765: invokevirtual #175 // Method scala/util/Right$.apply:(Ljava/lang/Object;)Lscala/util/Right; | |
768: invokevirtual #179 // Method continuations/SafeContinuation.resume:(Lscala/util/Either;)V | |
771: aload 25 | |
773: invokevirtual #182 // Method continuations/SafeContinuation.getOrThrow:()Ljava/lang/Object; | |
776: astore 26 | |
778: aload 26 | |
780: getstatic #185 // Field continuations/Continuation$State$.Suspended:Lcontinuations/Continuation$State; | |
783: astore 27 | |
785: dup | |
786: ifnonnull 798 | |
789: pop | |
790: aload 27 | |
792: ifnull 806 | |
795: goto 810 | |
798: aload 27 | |
800: invokevirtual #189 // Method java/lang/Object.equals:(Ljava/lang/Object;)Z | |
803: ifeq 810 | |
806: getstatic #185 // Field continuations/Continuation$State$.Suspended:Lcontinuations/Continuation$State; | |
809: areturn | |
810: aload 26 | |
812: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
815: istore 10 | |
817: getstatic #195 // Field scala/runtime/BoxedUnit.UNIT:Lscala/runtime/BoxedUnit; | |
820: goto 944 | |
823: nop | |
824: nop | |
825: athrow | |
826: aload 11 | |
828: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
831: invokevirtual #198 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$0:()Ljava/lang/Object; | |
834: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
837: istore 7 | |
839: aload 11 | |
841: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
844: invokevirtual #201 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$1:()Ljava/lang/Object; | |
847: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
850: istore 6 | |
852: aload 11 | |
854: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
857: invokevirtual #204 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$2:()Ljava/lang/Object; | |
860: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
863: istore 5 | |
865: aload 11 | |
867: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
870: invokevirtual #218 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$3:()Ljava/lang/Object; | |
873: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
876: istore 8 | |
878: aload 11 | |
880: checkcast #17 // class examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 | |
883: invokevirtual #232 // Method examples/ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1.I$4:()Ljava/lang/Object; | |
886: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
889: istore 9 | |
891: aload 14 | |
893: ifnull 914 | |
896: aload 14 | |
898: aload_0 | |
899: invokedynamic #236, 0 // InvokeDynamic #6:apply:(Lexamples/ThreeDependentContinuations$package$;)Lscala/Function1; | |
904: aload_0 | |
905: invokedynamic #240, 0 // InvokeDynamic #7:applyVoid:(Lexamples/ThreeDependentContinuations$package$;)Lscala/runtime/function/JProcedure1; | |
910: invokevirtual #130 // Method scala/util/Either.fold:(Lscala/Function1;Lscala/Function1;)Ljava/lang/Object; | |
913: pop | |
914: aload 14 | |
916: invokestatic #81 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
919: istore 10 | |
921: getstatic #195 // Field scala/runtime/BoxedUnit.UNIT:Lscala/runtime/BoxedUnit; | |
924: goto 944 | |
927: nop | |
928: nop | |
929: athrow | |
930: new #242 // class java/lang/IllegalArgumentException | |
933: dup | |
934: ldc #244 // String call to \'resume\' before \'invoke\' with coroutine | |
936: invokespecial #247 // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V | |
939: athrow | |
940: nop | |
941: nop | |
942: athrow | |
943: athrow | |
944: pop | |
945: iload 10 | |
947: invokestatic #134 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
950: areturn | |
} | |
Compiled from "ThreeDependentContinuations.scala" | |
class examples.ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1 extends continuations.jvm.internal.ContinuationImpl { | |
public examples.ThreeDependentContinuations$package$ThreeDependentContinuations$threeDependentContinuations$1$1(continuations.Continuation); | |
Code: | |
0: aload_0 | |
1: aload_1 | |
2: aload_1 | |
3: invokeinterface #31, 1 // InterfaceMethod continuations/Continuation.context:()Lscala/Product; | |
8: invokespecial #34 // Method continuations/jvm/internal/ContinuationImpl."<init>":(Lcontinuations/Continuation;Lscala/Product;)V | |
11: return | |
public java.lang.Object I$0(); | |
Code: | |
0: aload_0 | |
1: getfield #40 // Field I$0:Ljava/lang/Object; | |
4: areturn | |
public java.lang.Object I$1(); | |
Code: | |
0: aload_0 | |
1: getfield #42 // Field I$1:Ljava/lang/Object; | |
4: areturn | |
public java.lang.Object I$2(); | |
Code: | |
0: aload_0 | |
1: getfield #44 // Field I$2:Ljava/lang/Object; | |
4: areturn | |
public java.lang.Object I$3(); | |
Code: | |
0: aload_0 | |
1: getfield #46 // Field I$3:Ljava/lang/Object; | |
4: areturn | |
public java.lang.Object I$4(); | |
Code: | |
0: aload_0 | |
1: getfield #48 // Field I$4:Ljava/lang/Object; | |
4: areturn | |
public java.lang.Object I$5(); | |
Code: | |
0: aload_0 | |
1: getfield #50 // Field I$5:Ljava/lang/Object; | |
4: areturn | |
public void I$0_$eq(java.lang.Object); | |
Code: | |
0: aload_0 | |
1: aload_1 | |
2: putfield #40 // Field I$0:Ljava/lang/Object; | |
5: return | |
public void I$1_$eq(java.lang.Object); | |
Code: | |
0: aload_0 | |
1: aload_1 | |
2: putfield #42 // Field I$1:Ljava/lang/Object; | |
5: return | |
public void I$2_$eq(java.lang.Object); | |
Code: | |
0: aload_0 | |
1: aload_1 | |
2: putfield #44 // Field I$2:Ljava/lang/Object; | |
5: return | |
public void I$3_$eq(java.lang.Object); | |
Code: | |
0: aload_0 | |
1: aload_1 | |
2: putfield #46 // Field I$3:Ljava/lang/Object; | |
5: return | |
public void I$4_$eq(java.lang.Object); | |
Code: | |
0: aload_0 | |
1: aload_1 | |
2: putfield #48 // Field I$4:Ljava/lang/Object; | |
5: return | |
public void I$5_$eq(java.lang.Object); | |
Code: | |
0: aload_0 | |
1: aload_1 | |
2: putfield #50 // Field I$5:Ljava/lang/Object; | |
5: return | |
public scala.util.Either $result(); | |
Code: | |
0: aload_0 | |
1: getfield #61 // Field $result:Lscala/util/Either; | |
4: areturn | |
public int $label(); | |
Code: | |
0: aload_0 | |
1: getfield #64 // Field $label:I | |
4: ireturn | |
public void $result_$eq(scala.util.Either); | |
Code: | |
0: aload_0 | |
1: aload_1 | |
2: putfield #61 // Field $result:Lscala/util/Either; | |
5: return | |
public void $label_$eq(int); | |
Code: | |
0: aload_0 | |
1: iload_1 | |
2: putfield #64 // Field $label:I | |
5: return | |
public java.lang.Object invokeSuspend(scala.util.Either); | |
Code: | |
0: aload_0 | |
1: aload_1 | |
2: invokevirtual #73 // Method $result_$eq:(Lscala/util/Either;)V | |
5: aload_0 | |
6: aload_0 | |
7: invokevirtual #75 // Method $label:()I | |
10: ldc #76 // int -2147483648 | |
12: ior | |
13: invokevirtual #78 // Method $label_$eq:(I)V | |
16: getstatic #82 // Field examples/ThreeDependentContinuations$package$.MODULE$:Lexamples/ThreeDependentContinuations$package$; | |
19: aconst_null | |
20: invokestatic #88 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
23: aconst_null | |
24: invokestatic #88 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
27: aconst_null | |
28: invokestatic #88 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I | |
31: aload_0 | |
32: checkcast #27 // class continuations/Continuation | |
35: invokevirtual #92 // Method examples/ThreeDependentContinuations$package$.examples$ThreeDependentContinuations$package$$$_$threeDependentContinuations$1:(IIILcontinuations/Continuation;)Ljava/lang/Object; | |
38: areturn | |
} | |
Compiled from "ThreeDependentContinuations.scala" | |
public final class examples.ThreeDependentContinuations$package { | |
public static void ThreeDependentContinuations(); | |
Code: | |
0: getstatic #13 // Field examples/ThreeDependentContinuations$package$.MODULE$:Lexamples/ThreeDependentContinuations$package$; | |
3: invokevirtual #15 // Method examples/ThreeDependentContinuations$package$.ThreeDependentContinuations:()V | |
6: return | |
} | |
Compiled from "ThreeDependentContinuations.scala" | |
public final class examples.ThreeDependentContinuations { | |
public examples.ThreeDependentContinuations(); | |
Code: | |
0: aload_0 | |
1: invokespecial #14 // Method java/lang/Object."<init>":()V | |
4: return | |
public static void main(java.lang.String[]); | |
Code: | |
0: getstatic #25 // Field examples/ThreeDependentContinuations$package$.MODULE$:Lexamples/ThreeDependentContinuations$package$; | |
3: invokevirtual #28 // Method examples/ThreeDependentContinuations$package$.ThreeDependentContinuations:()V | |
6: goto 20 | |
9: astore_1 | |
10: getstatic #33 // Field scala/util/CommandLineParser$.MODULE$:Lscala/util/CommandLineParser$; | |
13: aload_1 | |
14: invokevirtual #37 // Method scala/util/CommandLineParser$.showError:(Lscala/util/CommandLineParser$ParseError;)V | |
17: goto 20 | |
20: return | |
Exception table: | |
from to target type | |
0 6 9 Class scala/util/CommandLineParser$ParseError | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment