Skip to content

Commit

Permalink
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions core/src/main/java/org/jruby/ir/instructions/MatchInstr.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.jruby.ir.instructions;

import org.jruby.RubyRegexp;
import org.jruby.ir.IRScope;
import org.jruby.ir.IRVisitor;
import org.jruby.ir.Operation;
@@ -9,33 +8,15 @@
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.persistence.IRWriterEncoder;
import org.jruby.ir.transformations.inlining.CloneInfo;
import org.jruby.parser.StaticScope;
import org.jruby.runtime.CallType;
import org.jruby.runtime.DynamicScope;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.runtime.callsite.CachingCallSite;
import org.jruby.runtime.callsite.NormalCachingCallSite;

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

public class MatchInstr extends CallBase implements FixedArityInstr, ResultInstr {
protected Variable result;

public class MatchInstr extends CallInstr implements FixedArityInstr {
public MatchInstr(Variable result, Operand receiver, Operand arg) {
super(Operation.MATCH, CallType.NORMAL, "=~", receiver, new Operand[]{arg}, null, false);
super(Operation.MATCH, CallType.NORMAL, result, "=~", receiver, new Operand[]{arg}, null, false);

assert result != null : "Match2Instr result is null";

this.result = result;
}

public Variable getResult() {
return result;
}

public void updateResult(Variable v) {
this.result = v;
}

@Override
@@ -54,7 +35,8 @@ public Instr clone(CloneInfo ii) {

@Override
public void encode(IRWriterEncoder e) {
super.encode(e);
e.encode(getOperation());
e.encode(getResult());
e.encode(getReceiver());
e.encode(getArg1());
}

0 comments on commit 5387c34

Please sign in to comment.