}
}
// Continuations case
Continuation continuation = (Continuation) Http.Request.current().args.get(C);
if (continuation == null) {
continuation = new Continuation(new StackRecorder((Runnable) null));
}
StackRecorder pStackRecorder = new StackRecorder(continuation.stackRecorder);
Object result = null;
final StackRecorder old = pStackRecorder.registerThread();
try {
pStackRecorder.isRestoring = !pStackRecorder.isEmpty();
// Execute code
result = method.invoke(instance, realArgs);
if (pStackRecorder.isCapturing) {
if (pStackRecorder.isEmpty()) {
throw new IllegalStateException("stack corruption. Is " + method + " instrumented for javaflow?");
}
Object trigger = pStackRecorder.value;
Continuation nextContinuation = new Continuation(pStackRecorder);
Http.Request.current().args.put(C, nextContinuation);
if (trigger instanceof Long) {
throw new Suspend((Long) trigger);
}