Skip to content

Commit

Permalink
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.jruby.ir.instructions;

import org.jruby.RubyModule;
import org.jruby.ir.IRScope;
import org.jruby.ir.IRVisitor;
import org.jruby.ir.Operation;
import org.jruby.ir.operands.Boolean;
@@ -16,6 +17,8 @@
import java.util.Arrays;
import java.util.Map;

import static org.jruby.ir.IRFlags.REQUIRES_FRAME;

public class RuntimeHelperCall extends Instr implements ResultInstr {
public enum Methods {
HANDLE_PROPAGATE_BREAK, HANDLE_NONLOCAL_RETURN, HANDLE_BREAK_AND_RETURNS_IN_LAMBDA,
@@ -65,6 +68,25 @@ public void simplifyOperands(Map<Operand, Operand> valueMap, boolean force) {
}
}

/**
* Does this instruction do anything the scope is interested in?
*
* @param scope
* @return true if it modified the scope.
*/
@Override
public boolean computeScopeFlags(IRScope scope) {
boolean modifiedScope = false;

// FIXME: Impl of this helper uses frame class. Determine if we can do this another way.
if (helperMethod == Methods.IS_DEFINED_SUPER) {
modifiedScope = true;
scope.getFlags().add(REQUIRES_FRAME);
}

return modifiedScope;
}

@Override
public Instr clone(CloneInfo ii) {
// SSS FIXME: array of args cloning should be part of utility class

0 comments on commit b56f240

Please sign in to comment.