-
-
Notifications
You must be signed in to change notification settings - Fork 941
Expand file tree
/
Copy pathIRLoop.java
More file actions
29 lines (25 loc) · 931 Bytes
/
IRLoop.java
File metadata and controls
29 lines (25 loc) · 931 Bytes
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
package org.jruby.ir.builder;
import org.jruby.ir.IRScope;
import org.jruby.ir.operands.Label;
import org.jruby.ir.operands.Variable;
class IRLoop {
public final IRScope container;
public final IRLoop parentLoop;
public final Label loopStartLabel;
public final Label loopEndLabel; // for `break`
public final Label iterStartLabel;
public final Label iterEndLabel; // for `next`
public final Variable loopResult;
public boolean hasNext = false;
public boolean hasBreak = false;
public IRLoop(IRScope s, IRLoop outerLoop, Variable result) {
container = s;
parentLoop = outerLoop;
loopStartLabel = s.getNewLabel("_LOOP_BEGIN");
loopEndLabel = s.getNewLabel("_LOOP_END");
iterStartLabel = s.getNewLabel("_ITER_BEGIN");
iterEndLabel = s.getNewLabel("_ITER_END");
loopResult = result;
s.setHasLoops();
}
}