-
-
Notifications
You must be signed in to change notification settings - Fork 941
Expand file tree
/
Copy pathIRReturnJump.java
More file actions
31 lines (25 loc) · 1 KB
/
IRReturnJump.java
File metadata and controls
31 lines (25 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package org.jruby.ir.runtime;
import org.jruby.exceptions.Unrescuable;
import org.jruby.ir.IRScope;
import org.jruby.parser.StaticScope;
import org.jruby.runtime.DynamicScope;
public class IRReturnJump extends IRJump implements Unrescuable {
public final StaticScope returnScope;
public final DynamicScope methodToReturnFrom;
public final Object returnValue;
private IRReturnJump(StaticScope returnScope, DynamicScope scopeToReturnFrom, Object rv) {
this.methodToReturnFrom = scopeToReturnFrom;
this.returnScope = returnScope;
this.returnValue = rv;
}
public static IRReturnJump create(StaticScope returnScope, DynamicScope scopeToReturnFrom, Object rv) {
return new IRReturnJump(returnScope, scopeToReturnFrom, rv);
}
public boolean isReturnToScope(DynamicScope scope) {
return methodToReturnFrom == scope;
}
@Override
public String toString() {
return "IRReturnJump:<" + methodToReturnFrom + ":" + returnValue + ">";
}
}