Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ebf1cf4cd622
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2c657d47c837
Choose a head ref
  • 4 commits
  • 51 files changed
  • 1 contributor

Commits on Mar 16, 2015

  1. Copy the full SHA
    7f1aa3b View commit details
  2. More decoding cleanup

    enebo committed Mar 16, 2015
    Copy the full SHA
    399d9e2 View commit details
  3. More decode cleanup

    enebo committed Mar 16, 2015
    Copy the full SHA
    14981a2 View commit details
  4. IR persistence read/write is unrotted. We need some specs testing thi…

    …s perhps as part of AOT to keep from rotting again
    enebo committed Mar 16, 2015
    Copy the full SHA
    2c657d4 View commit details
Showing with 461 additions and 305 deletions.
  1. +31 −0 core/src/main/java/org/jruby/ir/instructions/CallInstr.java
  2. +23 −0 core/src/main/java/org/jruby/ir/instructions/ClassSuperInstr.java
  3. +5 −0 core/src/main/java/org/jruby/ir/instructions/DefineClassInstr.java
  4. +5 −0 core/src/main/java/org/jruby/ir/instructions/DefineClassMethodInstr.java
  5. +5 −0 core/src/main/java/org/jruby/ir/instructions/DefineInstanceMethodInstr.java
  6. +5 −0 core/src/main/java/org/jruby/ir/instructions/DefineMetaClassInstr.java
  7. +5 −0 core/src/main/java/org/jruby/ir/instructions/DefineModuleInstr.java
  8. +5 −0 core/src/main/java/org/jruby/ir/instructions/EQQInstr.java
  9. +5 −0 core/src/main/java/org/jruby/ir/instructions/ExceptionRegionStartMarkerInstr.java
  10. +5 −0 core/src/main/java/org/jruby/ir/instructions/GVarAliasInstr.java
  11. +5 −0 core/src/main/java/org/jruby/ir/instructions/GetClassVariableInstr.java
  12. +6 −1 core/src/main/java/org/jruby/ir/instructions/GetEncodingInstr.java
  13. +5 −0 core/src/main/java/org/jruby/ir/instructions/GetFieldInstr.java
  14. +5 −0 core/src/main/java/org/jruby/ir/instructions/InheritanceSearchConstInstr.java
  15. +24 −0 core/src/main/java/org/jruby/ir/instructions/InstanceSuperInstr.java
  16. +5 −0 core/src/main/java/org/jruby/ir/instructions/JumpInstr.java
  17. +5 −0 core/src/main/java/org/jruby/ir/instructions/LexicalSearchConstInstr.java
  18. +5 −0 core/src/main/java/org/jruby/ir/instructions/LoadFrameClosureInstr.java
  19. +5 −0 core/src/main/java/org/jruby/ir/instructions/LoadImplicitClosureInstr.java
  20. +5 −0 core/src/main/java/org/jruby/ir/instructions/Match3Instr.java
  21. +5 −0 core/src/main/java/org/jruby/ir/instructions/MatchInstr.java
  22. +23 −1 core/src/main/java/org/jruby/ir/instructions/NoResultCallInstr.java
  23. +5 −0 core/src/main/java/org/jruby/ir/instructions/NonlocalReturnInstr.java
  24. +5 −0 core/src/main/java/org/jruby/ir/instructions/OptArgMultipleAsgnInstr.java
  25. +5 −0 core/src/main/java/org/jruby/ir/instructions/PopBindingInstr.java
  26. +5 −0 core/src/main/java/org/jruby/ir/instructions/PopFrameInstr.java
  27. +5 −0 core/src/main/java/org/jruby/ir/instructions/PushBindingInstr.java
  28. +5 −0 core/src/main/java/org/jruby/ir/instructions/PutClassVariableInstr.java
  29. +5 −0 core/src/main/java/org/jruby/ir/instructions/PutConstInstr.java
  30. +5 −0 core/src/main/java/org/jruby/ir/instructions/PutFieldInstr.java
  31. +5 −0 core/src/main/java/org/jruby/ir/instructions/RaiseArgumentErrorInstr.java
  32. +5 −0 core/src/main/java/org/jruby/ir/instructions/ReceiveKeywordArgInstr.java
  33. +5 −0 core/src/main/java/org/jruby/ir/instructions/ReceiveKeywordRestArgInstr.java
  34. +5 −0 core/src/main/java/org/jruby/ir/instructions/ReceiveOptArgInstr.java
  35. +5 −0 core/src/main/java/org/jruby/ir/instructions/ReceivePostReqdArgInstr.java
  36. +5 −0 core/src/main/java/org/jruby/ir/instructions/ReceivePreReqdArgInstr.java
  37. +5 −0 core/src/main/java/org/jruby/ir/instructions/ReceiveSelfInstr.java
  38. +5 −0 core/src/main/java/org/jruby/ir/instructions/RecordEndBlockInstr.java
  39. +5 −0 core/src/main/java/org/jruby/ir/instructions/ReqdArgMultipleAsgnInstr.java
  40. +5 −0 core/src/main/java/org/jruby/ir/instructions/RescueEQQInstr.java
  41. +5 −0 core/src/main/java/org/jruby/ir/instructions/RestArgMultipleAsgnInstr.java
  42. +5 −0 core/src/main/java/org/jruby/ir/instructions/ReturnInstr.java
  43. +5 −4 core/src/main/java/org/jruby/ir/instructions/ThreadPollInstr.java
  44. +5 −0 core/src/main/java/org/jruby/ir/instructions/ThrowExceptionInstr.java
  45. +5 −0 core/src/main/java/org/jruby/ir/instructions/ToAryInstr.java
  46. +5 −0 core/src/main/java/org/jruby/ir/instructions/UndefMethodInstr.java
  47. +27 −0 core/src/main/java/org/jruby/ir/instructions/UnresolvedSuperInstr.java
  48. +5 −0 core/src/main/java/org/jruby/ir/instructions/YieldInstr.java
  49. +5 −0 core/src/main/java/org/jruby/ir/instructions/defined/RestoreErrorInfoInstr.java
  50. +112 −42 core/src/main/java/org/jruby/ir/persistence/IRReaderStream.java
  51. +0 −257 core/src/main/java/org/jruby/ir/persistence/InstrDecoderMap.java
31 changes: 31 additions & 0 deletions core/src/main/java/org/jruby/ir/instructions/CallInstr.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jruby.ir.instructions;

import org.jruby.RubyInstanceConfig;
import org.jruby.ir.IRScope;
import org.jruby.ir.IRVisitor;
import org.jruby.ir.Operation;
@@ -10,6 +11,7 @@
import org.jruby.ir.instructions.specialized.ZeroOperandArgNoBlockCallInstr;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.operands.Variable;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.persistence.IRWriterEncoder;
import org.jruby.ir.transformations.inlining.CloneInfo;
import org.jruby.runtime.CallType;
@@ -72,6 +74,35 @@ public void encode(IRWriterEncoder e) {
e.encode(getResult());
}

public static CallInstr decode(IRReaderDecoder d) {
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decodeCall");
int callTypeOrdinal = d.decodeInt();
CallType callType = CallType.fromOrdinal(callTypeOrdinal);
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decodeCall - calltype: " + callType);
String methAddr = d.decodeString();
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decodeCall - methaddr: " + methAddr);
Operand receiver = d.decodeOperand();
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decodeCall - receiver: " + receiver);
int argsCount = d.decodeInt();
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decodeCall - # of args: " + argsCount);
boolean hasClosureArg = argsCount < 0;
int argsLength = hasClosureArg ? (-1 * (argsCount + 1)) : argsCount;
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decodeCall - # of args(2): " + argsLength);
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decodeCall - hasClosure: " + hasClosureArg);
Operand[] args = new Operand[argsLength];

for (int i = 0; i < argsLength; i++) {
args[i] = d.decodeOperand();
}

Operand closure = hasClosureArg ? d.decodeOperand() : null;
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("before result");
Variable result = d.decodeVariable();
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, result: "+ result);

return create(d.getCurrentScope(), callType, result, methAddr, receiver, args, closure);
}

public Variable getResult() {
return result;
}
23 changes: 23 additions & 0 deletions core/src/main/java/org/jruby/ir/instructions/ClassSuperInstr.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package org.jruby.ir.instructions;

import org.jruby.RubyInstanceConfig;
import org.jruby.RubyModule;
import org.jruby.ir.IRVisitor;
import org.jruby.ir.Operation;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.operands.Variable;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.runtime.IRRuntimeHelpers;
import org.jruby.ir.transformations.inlining.CloneInfo;
import org.jruby.parser.StaticScope;
@@ -26,6 +28,27 @@ public Instr clone(CloneInfo ii) {
cloneCallArgs(ii), getClosureArg() == null ? null : getClosureArg().cloneForInlining(ii));
}

public static ClassSuperInstr decode(IRReaderDecoder d) {
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding super");
int callTypeOrdinal = d.decodeInt();
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding super, calltype(ord): "+ callTypeOrdinal);
String methAddr = d.decodeString();
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding super, methaddr: "+ methAddr);
Operand receiver = d.decodeOperand();
int argsCount = d.decodeInt();
boolean hasClosureArg = argsCount < 0;
int argsLength = hasClosureArg ? (-1 * (argsCount + 1)) : argsCount;
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("ARGS: " + argsLength + ", CLOSURE: " + hasClosureArg);
Operand[] args = new Operand[argsLength];

for (int i = 0; i < argsLength; i++) {
args[i] = d.decodeOperand();
}

Operand closure = hasClosureArg ? d.decodeOperand() : null;

return new ClassSuperInstr(d.decodeVariable(), receiver, methAddr, args, closure);
}
// We cannot convert this into a NoCallResultInstr
@Override
public Instr discardResult() {
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
import org.jruby.ir.operands.Operand;
import org.jruby.ir.operands.UndefinedValue;
import org.jruby.ir.operands.Variable;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.persistence.IRWriterEncoder;
import org.jruby.ir.runtime.IRRuntimeHelpers;
import org.jruby.ir.transformations.inlining.CloneInfo;
@@ -56,6 +57,10 @@ public void encode(IRWriterEncoder e) {
e.encode(getSuperClass());
}

public static DefineClassInstr decode(IRReaderDecoder d) {
return new DefineClassInstr((d.decodeVariable()), (IRClassBody) d.decodeScope(), d.decodeOperand(), d.decodeOperand());
}

@Override
public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) {
Object container = getContainer().retrieve(context, self, currScope, currDynScope, temp);
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
import org.jruby.ir.IRVisitor;
import org.jruby.ir.Operation;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.persistence.IRWriterEncoder;
import org.jruby.ir.runtime.IRRuntimeHelpers;
import org.jruby.ir.transformations.inlining.CloneInfo;
@@ -47,6 +48,10 @@ public void encode(IRWriterEncoder e) {
e.encode(getMethod());
}

public static DefineClassMethodInstr decode(IRReaderDecoder d) {
return new DefineClassMethodInstr(d.decodeOperand(), (IRMethod) d.decodeScope());
}

@Override
public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) {
IRubyObject obj = (IRubyObject) getContainer().retrieve(context, self, currScope, currDynScope, temp);
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.jruby.ir.instructions;

import org.jruby.ir.*;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.persistence.IRWriterEncoder;
import org.jruby.ir.runtime.IRRuntimeHelpers;
import org.jruby.ir.transformations.inlining.CloneInfo;
@@ -46,6 +47,10 @@ public void encode(IRWriterEncoder e) {
e.encode(getMethod());
}

public static DefineInstanceMethodInstr decode(IRReaderDecoder d) {
return new DefineInstanceMethodInstr((IRMethod) d.decodeScope());
}

@Override
public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) {
IRRuntimeHelpers.defInterpretedInstanceMethod(context, method, currDynScope, self);
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
import org.jruby.ir.*;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.operands.Variable;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.persistence.IRWriterEncoder;
import org.jruby.ir.runtime.IRRuntimeHelpers;
import org.jruby.ir.transformations.inlining.CloneInfo;
@@ -59,6 +60,10 @@ public void encode(IRWriterEncoder e) {
e.encode(getMetaClassBody());
}

public static DefineMetaClassInstr decode(IRReaderDecoder d) {
return new DefineMetaClassInstr(d.decodeVariable(), d.decodeOperand(), (IRModuleBody) d.decodeScope());
}

@Override
public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) {
Ruby runtime = context.runtime;
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
import org.jruby.ir.Operation;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.operands.Variable;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.persistence.IRWriterEncoder;
import org.jruby.ir.runtime.IRRuntimeHelpers;
import org.jruby.ir.transformations.inlining.CloneInfo;
@@ -50,6 +51,10 @@ public void encode(IRWriterEncoder e) {
e.encode(getContainer());
}

public static DefineModuleInstr decode(IRReaderDecoder d) {
return new DefineModuleInstr(d.decodeVariable(), (IRModuleBody) d.decodeScope(), d.decodeOperand());
}

@Override
public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) {
Object rubyContainer = getContainer().retrieve(context, self, currScope, currDynScope, temp);
5 changes: 5 additions & 0 deletions core/src/main/java/org/jruby/ir/instructions/EQQInstr.java
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
import org.jruby.ir.Operation;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.operands.Variable;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.persistence.IRWriterEncoder;
import org.jruby.ir.runtime.IRRuntimeHelpers;
import org.jruby.ir.transformations.inlining.CloneInfo;
@@ -40,6 +41,10 @@ public void encode(IRWriterEncoder e) {
e.encode(getArg2());
}

public static EQQInstr decode(IRReaderDecoder d) {
return new EQQInstr(d.decodeVariable(), d.decodeOperand(), d.decodeOperand());
}

@Override
public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) {
return IRRuntimeHelpers.isEQQ(context,
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
import org.jruby.ir.Operation;
import org.jruby.ir.operands.Label;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.persistence.IRWriterEncoder;
import org.jruby.ir.transformations.inlining.CloneInfo;

@@ -27,6 +28,10 @@ public void encode(IRWriterEncoder e) {
e.encode(getFirstRescueBlockLabel());
}

public static ExceptionRegionStartMarkerInstr decode(IRReaderDecoder d) {
return new ExceptionRegionStartMarkerInstr(d.decodeLabel());
}

@Override
public void visit(IRVisitor visitor) {
visitor.ExceptionRegionStartMarkerInstr(this);
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
import org.jruby.ir.IRVisitor;
import org.jruby.ir.Operation;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.persistence.IRWriterEncoder;
import org.jruby.ir.transformations.inlining.CloneInfo;
import org.jruby.parser.StaticScope;
@@ -35,6 +36,10 @@ public void encode(IRWriterEncoder e) {
e.encode(getOldName());
}

public static GVarAliasInstr decode(IRReaderDecoder d) {
return new GVarAliasInstr(d.decodeOperand(), d.decodeOperand());
}

@Override
public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) {
String newNameString = getNewName().retrieve(context, self, currScope, currDynScope, temp).toString();
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
import org.jruby.ir.Operation;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.operands.Variable;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.persistence.IRWriterEncoder;
import org.jruby.ir.transformations.inlining.CloneInfo;
import org.jruby.parser.StaticScope;
@@ -23,6 +24,10 @@ public Instr clone(CloneInfo ii) {
getSource().cloneForInlining(ii), getRef());
}

public static GetClassVariableInstr decode(IRReaderDecoder d) {
return new GetClassVariableInstr(d.decodeVariable(), d.decodeOperand(), d.decodeString());
}

@Override
public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) {
return ((RubyModule) getSource().retrieve(context, self, currScope, currDynScope, temp)).getClassVar(getRef());
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
import org.jruby.ir.operands.Operand;
import org.jruby.ir.operands.StringLiteral;
import org.jruby.ir.operands.Variable;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.persistence.IRWriterEncoder;
import org.jruby.ir.transformations.inlining.CloneInfo;
import org.jruby.parser.StaticScope;
@@ -44,7 +45,11 @@ public Object interpret(ThreadContext context, StaticScope currScope, DynamicSco
@Override
public void encode(IRWriterEncoder e) {
super.encode(e);
e.encode(getEncoding().toString());
e.encode(getEncoding());
}

public static GetEncodingInstr decode(IRReaderDecoder d) {
return new GetEncodingInstr(d.decodeVariable(), d.decodeEncoding());
}

@Override
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
import org.jruby.ir.Operation;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.operands.Variable;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.transformations.inlining.CloneInfo;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.runtime.ivars.VariableAccessor;
@@ -22,6 +23,10 @@ public Instr clone(CloneInfo ii) {
getSource().cloneForInlining(ii), getRef());
}

public static GetFieldInstr decode(IRReaderDecoder d) {
return new GetFieldInstr(d.decodeVariable(), d.decodeOperand(), d.decodeString());
}

public VariableAccessor getAccessor(IRubyObject o) {
RubyClass cls = o.getMetaClass().getRealClass();
VariableAccessor localAccessor = accessor;
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
import org.jruby.ir.IRVisitor;
import org.jruby.ir.Operation;
import org.jruby.ir.operands.*;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.persistence.IRWriterEncoder;
import org.jruby.ir.transformations.inlining.CloneInfo;
import org.jruby.parser.StaticScope;
@@ -78,6 +79,10 @@ public void encode(IRWriterEncoder e) {
e.encode(isNoPrivateConsts());
}

public static InheritanceSearchConstInstr decode(IRReaderDecoder d) {
return new InheritanceSearchConstInstr(d.decodeVariable(), d.decodeOperand(), d.decodeString(), d.decodeBoolean());
}

@Override
public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) {
Object cmVal = getCurrentModule().retrieve(context, self, currScope, currDynScope, temp);
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package org.jruby.ir.instructions;

import org.jruby.RubyInstanceConfig;
import org.jruby.RubyModule;
import org.jruby.ir.IRVisitor;
import org.jruby.ir.Operation;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.operands.Variable;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.runtime.IRRuntimeHelpers;
import org.jruby.ir.transformations.inlining.CloneInfo;
import org.jruby.parser.StaticScope;
@@ -29,6 +31,28 @@ public Instr clone(CloneInfo ii) {
cloneCallArgs(ii), getClosureArg() == null ? null : getClosureArg().cloneForInlining(ii));
}

public static InstanceSuperInstr decode(IRReaderDecoder d) {
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding super");
int callTypeOrdinal = d.decodeInt();
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding super, calltype(ord): "+ callTypeOrdinal);
String methAddr = d.decodeString();
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding super, methaddr: "+ methAddr);
Operand receiver = d.decodeOperand();
int argsCount = d.decodeInt();
boolean hasClosureArg = argsCount < 0;
int argsLength = hasClosureArg ? (-1 * (argsCount + 1)) : argsCount;
if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("ARGS: " + argsLength + ", CLOSURE: " + hasClosureArg);
Operand[] args = new Operand[argsLength];

for (int i = 0; i < argsLength; i++) {
args[i] = d.decodeOperand();
}

Operand closure = hasClosureArg ? d.decodeOperand() : null;

return new InstanceSuperInstr(d.decodeVariable(), receiver, methAddr, args, closure);
}

// We cannot convert this into a NoCallResultInstr
@Override
public Instr discardResult() {
5 changes: 5 additions & 0 deletions core/src/main/java/org/jruby/ir/instructions/JumpInstr.java
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
import org.jruby.ir.Operation;
import org.jruby.ir.operands.Label;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.persistence.IRWriterEncoder;
import org.jruby.ir.transformations.inlining.CloneInfo;

@@ -27,6 +28,10 @@ public void encode(IRWriterEncoder e) {
e.encode(getJumpTarget());
}

public static JumpInstr decode(IRReaderDecoder d) {
return new JumpInstr(d.decodeLabel());
}

@Override
public void visit(IRVisitor visitor) {
visitor.JumpInstr(this);
Loading