Skip to content

Commit

Permalink
defined? super impl uses frame klazz. Force ACP frame push if it is e…
Browse files Browse the repository at this point in the history
…ncountered
  • Loading branch information
enebo committed Oct 24, 2014
1 parent 8da3a82 commit b56f240
Showing 1 changed file with 22 additions and 0 deletions.
@@ -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;
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b56f240

Please sign in to comment.