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: 65d7a2d3c209
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f51b67084fda
Choose a head ref
  • 10 commits
  • 64 files changed
  • 1 contributor

Commits on Aug 26, 2016

  1. [Truffle] Start to use our own internal source section when building …

    …the AST.
    
    We currently do a lot of work to turn line numbers into offsets and back
    again. During translation let's just just keep track of the line
    numbers. In the future we'll want to store the line numbers in the nodes
    and lazily create the actual source sections.
    chrisseaton committed Aug 26, 2016
    Copy the full SHA
    57909b1 View commit details
  2. Copy the full SHA
    3c27bfb View commit details
  3. Copy the full SHA
    d245ce1 View commit details
  4. Copy the full SHA
    90b1328 View commit details
  5. Copy the full SHA
    e6ca65e View commit details
  6. Copy the full SHA
    85d423b View commit details
  7. Copy the full SHA
    deb0971 View commit details
  8. Copy the full SHA
    4908fbd View commit details
  9. [Truffle] In most cases, we don't need to give an internal child node…

    … the same source section as the parent.
    chrisseaton committed Aug 26, 2016
    Copy the full SHA
    d02ea47 View commit details
  10. [Truffle] Remove all internal use of getSourceSection()

    We don't want to force expensive source sections ourselves.
    chrisseaton committed Aug 26, 2016
    Copy the full SHA
    f51b670 View commit details
Showing with 787 additions and 555 deletions.
  1. +5 −2 truffle/src/main/java/org/jruby/truffle/builtins/CoreMethodNodeManager.java
  2. +1 −1 truffle/src/main/java/org/jruby/truffle/core/CoreLibrary.java
  3. +2 −2 truffle/src/main/java/org/jruby/truffle/core/ObjectNodes.java
  4. +16 −15 truffle/src/main/java/org/jruby/truffle/core/array/ArrayLiteralNode.java
  5. +11 −11 truffle/src/main/java/org/jruby/truffle/core/array/ArrayNodes.java
  6. +1 −1 truffle/src/main/java/org/jruby/truffle/core/array/ArrayReadDenormalizedNode.java
  7. +1 −1 truffle/src/main/java/org/jruby/truffle/core/array/ArrayReadSliceDenormalizedNode.java
  8. +1 −1 truffle/src/main/java/org/jruby/truffle/core/array/ArrayWriteNormalizedNode.java
  9. +1 −1 truffle/src/main/java/org/jruby/truffle/core/cast/DurationToMillisecondsNode.java
  10. +1 −1 truffle/src/main/java/org/jruby/truffle/core/cast/ToIntNode.java
  11. +1 −1 truffle/src/main/java/org/jruby/truffle/core/cast/ToSNode.java
  12. +2 −2 truffle/src/main/java/org/jruby/truffle/core/encoding/EncodingNodes.java
  13. +1 −1 truffle/src/main/java/org/jruby/truffle/core/fiber/FiberNodes.java
  14. +1 −1 truffle/src/main/java/org/jruby/truffle/core/format/convert/ReinterpretAsUnsignedNode.java
  15. +1 −1 truffle/src/main/java/org/jruby/truffle/core/format/convert/ToDoubleWithCoercionNode.java
  16. +1 −1 truffle/src/main/java/org/jruby/truffle/core/hash/HashLiteralNode.java
  17. +1 −1 truffle/src/main/java/org/jruby/truffle/core/hash/HashNodes.java
  18. +1 −1 truffle/src/main/java/org/jruby/truffle/core/hash/SetNode.java
  19. +4 −4 truffle/src/main/java/org/jruby/truffle/core/kernel/KernelNodes.java
  20. +8 −6 truffle/src/main/java/org/jruby/truffle/core/module/ModuleNodes.java
  21. +1 −1 truffle/src/main/java/org/jruby/truffle/core/numeric/BignumNodes.java
  22. +1 −1 truffle/src/main/java/org/jruby/truffle/core/numeric/FixnumNodes.java
  23. +2 −2 truffle/src/main/java/org/jruby/truffle/core/regexp/MatchDataNodes.java
  24. +2 −2 truffle/src/main/java/org/jruby/truffle/core/regexp/RegexpNodes.java
  25. +21 −21 truffle/src/main/java/org/jruby/truffle/core/string/StringNodes.java
  26. +3 −1 truffle/src/main/java/org/jruby/truffle/core/symbol/SymbolNodes.java
  27. +3 −3 truffle/src/main/java/org/jruby/truffle/interop/ForeignExecuteHelperNode.java
  28. +1 −1 truffle/src/main/java/org/jruby/truffle/interop/ForeignReadStringCachingHelperNode.java
  29. +1 −1 truffle/src/main/java/org/jruby/truffle/interop/ForeignWriteStringCachingHelperNode.java
  30. +51 −5 truffle/src/main/java/org/jruby/truffle/language/RubyBaseNode.java
  31. +16 −0 truffle/src/main/java/org/jruby/truffle/language/RubyNode.java
  32. +83 −0 truffle/src/main/java/org/jruby/truffle/language/RubySourceSection.java
  33. +1 −1 truffle/src/main/java/org/jruby/truffle/language/arguments/ShouldDestructureNode.java
  34. +4 −2 truffle/src/main/java/org/jruby/truffle/language/control/NotNode.java
  35. +1 −1 truffle/src/main/java/org/jruby/truffle/language/dispatch/CachedMethodMissingDispatchNode.java
  36. +1 −1 truffle/src/main/java/org/jruby/truffle/language/dispatch/CachedReturnMissingDispatchNode.java
  37. +1 −1 truffle/src/main/java/org/jruby/truffle/language/dispatch/DispatchNode.java
  38. +1 −1 truffle/src/main/java/org/jruby/truffle/language/exceptions/RescueNode.java
  39. +1 −1 truffle/src/main/java/org/jruby/truffle/language/exceptions/TopLevelRaiseHandler.java
  40. +1 −1 truffle/src/main/java/org/jruby/truffle/language/globals/ReadLastBacktraceNode.java
  41. +1 −1 truffle/src/main/java/org/jruby/truffle/language/globals/ReadMatchReferenceNode.java
  42. +1 −1 truffle/src/main/java/org/jruby/truffle/language/globals/ReadThreadLocalGlobalVariableNode.java
  43. +1 −1 truffle/src/main/java/org/jruby/truffle/language/globals/UpdateLastBacktraceNode.java
  44. +6 −0 truffle/src/main/java/org/jruby/truffle/language/locals/InstrumentedWriteLocalVariableNode.java
  45. +1 −1 truffle/src/main/java/org/jruby/truffle/language/locals/ReadDeclarationVariableNode.java
  46. +1 −1 truffle/src/main/java/org/jruby/truffle/language/locals/ReadLocalVariableNode.java
  47. +10 −0 truffle/src/main/java/org/jruby/truffle/language/locals/WriteDeclarationVariableNode.java
  48. +17 −1 truffle/src/main/java/org/jruby/truffle/language/locals/WriteLocalVariableNode.java
  49. +1 −1 truffle/src/main/java/org/jruby/truffle/language/methods/AddMethodNode.java
  50. +1 −1 truffle/src/main/java/org/jruby/truffle/language/methods/MethodDefinitionNode.java
  51. +11 −1 truffle/src/main/java/org/jruby/truffle/language/methods/ModuleBodyDefinitionNode.java
  52. +12 −2 truffle/src/main/java/org/jruby/truffle/language/objects/AllocateObjectNode.java
  53. +1 −1 truffle/src/main/java/org/jruby/truffle/language/objects/IsANode.java
  54. +3 −2 truffle/src/main/java/org/jruby/truffle/language/objects/SingletonClassNode.java
  55. +2 −2 truffle/src/main/java/org/jruby/truffle/language/objects/TaintNode.java
  56. +291 −259 truffle/src/main/java/org/jruby/truffle/language/parser/jruby/BodyTranslator.java
  57. +48 −39 truffle/src/main/java/org/jruby/truffle/language/parser/jruby/LoadArgumentsTranslator.java
  58. +53 −68 truffle/src/main/java/org/jruby/truffle/language/parser/jruby/MethodTranslator.java
  59. +10 −8 truffle/src/main/java/org/jruby/truffle/language/parser/jruby/ReloadArgumentsTranslator.java
  60. +37 −44 truffle/src/main/java/org/jruby/truffle/language/parser/jruby/Translator.java
  61. +14 −12 truffle/src/main/java/org/jruby/truffle/language/parser/jruby/TranslatorDriver.java
  62. +5 −4 truffle/src/main/java/org/jruby/truffle/language/parser/jruby/TranslatorEnvironment.java
  63. +2 −2 truffle/src/main/java/org/jruby/truffle/stdlib/bigdecimal/BigDecimalCoreMethodNode.java
  64. +1 −1 truffle/src/main/java/org/jruby/truffle/stdlib/psych/PsychParserNodes.java
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@
import org.jruby.truffle.language.RubyGuards;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.language.RubyRootNode;
import org.jruby.truffle.language.RubySourceSection;
import org.jruby.truffle.language.arguments.MissingArgumentBehavior;
import org.jruby.truffle.language.arguments.ProfileArgumentNode;
import org.jruby.truffle.language.arguments.ReadBlockNode;
@@ -185,6 +186,8 @@ private static CallTarget makeGenericMethod(RubyContext context, MethodDetails m
final CoreMethod method = methodDetails.getMethodAnnotation();

final SourceSection sourceSection = sharedMethodInfo.getSourceSection();
final RubySourceSection rubySourceSection = new RubySourceSection(sourceSection);

final int required = method.required();
final int optional = method.optional();

@@ -248,13 +251,13 @@ private static CallTarget makeGenericMethod(RubyContext context, MethodDetails m
AmbiguousOptionalArgumentChecker.verifyNoAmbiguousOptionalArguments(methodDetails);
}

final RubyNode checkArity = Translator.createCheckArityNode(context, sourceSection, sharedMethodInfo.getArity());
final RubyNode checkArity = Translator.createCheckArityNode(context, rubySourceSection, sharedMethodInfo.getArity());

RubyNode node;
if (!isSafe(context, method.unsafe())) {
node = new UnsafeNode(context, sourceSection);
} else {
node = Translator.sequence(context, sourceSection, Arrays.asList(checkArity, methodNode));
node = Translator.sequence(context, rubySourceSection, Arrays.asList(checkArity, methodNode));
node = transformResult(method, node);
}

Original file line number Diff line number Diff line change
@@ -319,7 +319,7 @@ private static class CoreLibraryNode extends RubyNode {
@Child FreezeNode freezeNode;

public CoreLibraryNode(RubyContext context) {
super(context, null);
super(context);
this.singletonClassNode = SingletonClassNodeGen.create(context, null, null);
this.freezeNode = FreezeNodeGen.create(context, null, null);
adoptChildren();
4 changes: 2 additions & 2 deletions truffle/src/main/java/org/jruby/truffle/core/ObjectNodes.java
Original file line number Diff line number Diff line change
@@ -123,15 +123,15 @@ public ObjectInfectPrimitiveNode(RubyContext context, SourceSection sourceSectio
public Object objectInfect(Object host, Object source) {
if (isTaintedNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
isTaintedNode = insert(IsTaintedNodeGen.create(getContext(), getSourceSection(), null));
isTaintedNode = insert(IsTaintedNodeGen.create(getContext(), null, null));
}

if (isTaintedNode.executeIsTainted(source)) {
// This lazy node allocation effectively gives us a branch profile

if (taintNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
taintNode = insert(TaintNodeGen.create(getContext(), getSourceSection(), null));
taintNode = insert(TaintNodeGen.create(getContext(), null, null));
}

taintNode.executeTaint(host);
Original file line number Diff line number Diff line change
@@ -20,28 +20,29 @@
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.core.CoreLibrary;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.language.RubySourceSection;
import org.jruby.truffle.language.objects.AllocateObjectNode;
import org.jruby.truffle.language.objects.AllocateObjectNodeGen;

public abstract class ArrayLiteralNode extends RubyNode {

public static ArrayLiteralNode create(RubyContext context, SourceSection sourceSection, RubyNode[] values) {
public static ArrayLiteralNode create(RubyContext context, RubySourceSection sourceSection, RubyNode[] values) {
return new UninitialisedArrayLiteralNode(context, sourceSection, values);
}

@Children protected final RubyNode[] values;
@Child protected AllocateObjectNode allocateObjectNode;

public ArrayLiteralNode(RubyContext context, SourceSection sourceSection, RubyNode[] values) {
public ArrayLiteralNode(RubyContext context, RubySourceSection sourceSection, RubyNode[] values) {
super(context, sourceSection);
this.values = values;
this.allocateObjectNode = AllocateObjectNodeGen.create(context, sourceSection, false, null, null);
this.allocateObjectNode = AllocateObjectNodeGen.create(context, (RubySourceSection) null, false, null, null);
}

protected DynamicObject makeGeneric(VirtualFrame frame, Object[] alreadyExecuted) {
CompilerAsserts.neverPartOfCompilation();

replace(new ObjectArrayLiteralNode(getContext(), getSourceSection(), values));
replace(new ObjectArrayLiteralNode(getContext(), getRubySourceSection(), values));

final Object[] executedValues = new Object[values.length];

@@ -96,7 +97,7 @@ public RubyNode stealNode(int index) {

private static class EmptyArrayLiteralNode extends ArrayLiteralNode {

public EmptyArrayLiteralNode(RubyContext context, SourceSection sourceSection, RubyNode[] values) {
public EmptyArrayLiteralNode(RubyContext context, RubySourceSection sourceSection, RubyNode[] values) {
super(context, sourceSection, values);
}

@@ -109,7 +110,7 @@ public Object execute(VirtualFrame frame) {

private static class FloatArrayLiteralNode extends ArrayLiteralNode {

public FloatArrayLiteralNode(RubyContext context, SourceSection sourceSection, RubyNode[] values) {
public FloatArrayLiteralNode(RubyContext context, RubySourceSection sourceSection, RubyNode[] values) {
super(context, sourceSection, values);
}

@@ -143,7 +144,7 @@ private DynamicObject makeGeneric(VirtualFrame frame, final double[] executedVal

private static class IntegerArrayLiteralNode extends ArrayLiteralNode {

public IntegerArrayLiteralNode(RubyContext context, SourceSection sourceSection, RubyNode[] values) {
public IntegerArrayLiteralNode(RubyContext context, RubySourceSection sourceSection, RubyNode[] values) {
super(context, sourceSection, values);
}

@@ -177,7 +178,7 @@ private DynamicObject makeGeneric(VirtualFrame frame, final int[] executedValues

private static class LongArrayLiteralNode extends ArrayLiteralNode {

public LongArrayLiteralNode(RubyContext context, SourceSection sourceSection, RubyNode[] values) {
public LongArrayLiteralNode(RubyContext context, RubySourceSection sourceSection, RubyNode[] values) {
super(context, sourceSection, values);
}

@@ -211,7 +212,7 @@ private DynamicObject makeGeneric(VirtualFrame frame, final long[] executedValue

private static class ObjectArrayLiteralNode extends ArrayLiteralNode {

public ObjectArrayLiteralNode(RubyContext context, SourceSection sourceSection, RubyNode[] values) {
public ObjectArrayLiteralNode(RubyContext context, RubySourceSection sourceSection, RubyNode[] values) {
super(context, sourceSection, values);
}

@@ -231,7 +232,7 @@ public Object execute(VirtualFrame frame) {

private static class UninitialisedArrayLiteralNode extends ArrayLiteralNode {

public UninitialisedArrayLiteralNode(RubyContext context, SourceSection sourceSection, RubyNode[] values) {
public UninitialisedArrayLiteralNode(RubyContext context, RubySourceSection sourceSection, RubyNode[] values) {
super(context, sourceSection, values);
}

@@ -249,15 +250,15 @@ public Object execute(VirtualFrame frame) {
final Object store = Layouts.ARRAY.getStore(array);

if (store == null) {
replace(new EmptyArrayLiteralNode(getContext(), getSourceSection(), values));
replace(new EmptyArrayLiteralNode(getContext(), getRubySourceSection(), values));
} if (store instanceof int[]) {
replace(new IntegerArrayLiteralNode(getContext(), getSourceSection(), values));
replace(new IntegerArrayLiteralNode(getContext(), getRubySourceSection(), values));
} else if (store instanceof long[]) {
replace(new LongArrayLiteralNode(getContext(), getSourceSection(), values));
replace(new LongArrayLiteralNode(getContext(), getRubySourceSection(), values));
} else if (store instanceof double[]) {
replace(new FloatArrayLiteralNode(getContext(), getSourceSection(), values));
replace(new FloatArrayLiteralNode(getContext(), getRubySourceSection(), values));
} else {
replace(new ObjectArrayLiteralNode(getContext(), getSourceSection(), values));
replace(new ObjectArrayLiteralNode(getContext(), getRubySourceSection(), values));
}

return array;
22 changes: 11 additions & 11 deletions truffle/src/main/java/org/jruby/truffle/core/array/ArrayNodes.java
Original file line number Diff line number Diff line change
@@ -256,7 +256,7 @@ public Object mulObjectCount(
public boolean respondToToStr(VirtualFrame frame, Object object) {
if (respondToToStrNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
respondToToStrNode = insert(KernelNodesFactory.RespondToNodeFactory.create(getContext(), getSourceSection(), null, null, null));
respondToToStrNode = insert(KernelNodesFactory.RespondToNodeFactory.create(getContext(), null, null, null, null));
}
return respondToToStrNode.doesRespondToString(frame, object, create7BitString("to_str", UTF8Encoding.INSTANCE), false);
}
@@ -281,7 +281,7 @@ public IndexNode(RubyContext context, SourceSection sourceSection) {
public Object index(DynamicObject array, int index, NotProvided length) {
if (readNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
readNode = insert(ArrayReadDenormalizedNodeGen.create(getContext(), getSourceSection(), null, null));
readNode = insert(ArrayReadDenormalizedNodeGen.create(getContext(), null, null, null));
}
return readNode.executeRead(array, index);
}
@@ -294,7 +294,7 @@ public DynamicObject slice(VirtualFrame frame, DynamicObject array, int start, i

if (readSliceNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
readSliceNode = insert(ArrayReadSliceDenormalizedNodeGen.create(getContext(), getSourceSection(), null, null, null));
readSliceNode = insert(ArrayReadSliceDenormalizedNodeGen.create(getContext(), null, null, null, null));
}

return readSliceNode.executeReadSlice(array, start, length);
@@ -321,7 +321,7 @@ public DynamicObject slice(VirtualFrame frame, DynamicObject array, DynamicObjec

if (readNormalizedSliceNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
readNormalizedSliceNode = insert(ArrayReadSliceNormalizedNodeGen.create(getContext(), getSourceSection(), null, null, null));
readNormalizedSliceNode = insert(ArrayReadSliceNormalizedNodeGen.create(getContext(), null, null, null, null));
}

return readNormalizedSliceNode.executeReadSlice(array, normalizedIndex, length);
@@ -558,23 +558,23 @@ protected int getArraySize(DynamicObject array) {
private Object read(DynamicObject array, int index) {
if (readNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
readNode = insert(ArrayReadNormalizedNodeGen.create(getContext(), getSourceSection(), null, null));
readNode = insert(ArrayReadNormalizedNodeGen.create(getContext(), null, null, null));
}
return readNode.executeRead(array, index);
}

private Object write(DynamicObject array, int index, Object value) {
if (writeNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
writeNode = insert(ArrayWriteNormalizedNodeGen.create(getContext(), getSourceSection(), null, null, null));
writeNode = insert(ArrayWriteNormalizedNodeGen.create(getContext(), null, null, null, null));
}
return writeNode.executeWrite(array, index, value);
}

private DynamicObject readSlice(DynamicObject array, int start, int length) {
if (readSliceNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
readSliceNode = insert(ArrayReadSliceNormalizedNodeGen.create(getContext(), getSourceSection(), null, null, null));
readSliceNode = insert(ArrayReadSliceNormalizedNodeGen.create(getContext(), null, null, null, null));
}
return readSliceNode.executeReadSlice(array, start, length);
}
@@ -606,7 +606,7 @@ public abstract static class AtNode extends CoreMethodNode {
public Object at(DynamicObject array, int index) {
if (readNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
readNode = insert(ArrayReadDenormalizedNodeGen.create(getContext(), getSourceSection(), null, null));
readNode = insert(ArrayReadDenormalizedNodeGen.create(getContext(), null, null, null));
}
return readNode.executeRead(array, index);
}
@@ -786,7 +786,7 @@ public Object delete(VirtualFrame frame, DynamicObject array, Object value, Obje
public void checkFrozen(Object object) {
if (isFrozenNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
isFrozenNode = insert(IsFrozenNodeGen.create(getContext(), getSourceSection(), null));
isFrozenNode = insert(IsFrozenNodeGen.create(getContext(), null, null));
}
isFrozenNode.raiseIfFrozen(object);
}
@@ -1133,7 +1133,7 @@ public DynamicObject initialize(VirtualFrame frame, DynamicObject array, Object
public boolean respondToToAry(VirtualFrame frame, Object object) {
if (respondToToAryNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
respondToToAryNode = insert(KernelNodesFactory.RespondToNodeFactory.create(getContext(), getSourceSection(), null, null, null));
respondToToAryNode = insert(KernelNodesFactory.RespondToNodeFactory.create(getContext(), null, null, null, null));
}
return respondToToAryNode.doesRespondToString(frame, object, create7BitString("to_ary", UTF8Encoding.INSTANCE), true);
}
@@ -1351,7 +1351,7 @@ public Object map(VirtualFrame frame, DynamicObject array, DynamicObject block,
}

protected ArrayWriteNormalizedNode createWriteNode() {
return ArrayWriteNormalizedNodeGen.create(getContext(), getSourceSection(), null, null, null);
return ArrayWriteNormalizedNodeGen.create(getContext(), null, null, null, null);
}

}
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ public abstract class ArrayReadDenormalizedNode extends RubyNode {

public ArrayReadDenormalizedNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
readNode = ArrayReadNormalizedNodeGen.create(getContext(), getSourceSection(), null, null);
readNode = ArrayReadNormalizedNodeGen.create(getContext(), null, null, null);
}

public abstract Object executeRead(DynamicObject array, int index);
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ public abstract class ArrayReadSliceDenormalizedNode extends RubyNode {

public ArrayReadSliceDenormalizedNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
readNode = ArrayReadSliceNormalizedNodeGen.create(getContext(), getSourceSection(), null, null, null);
readNode = ArrayReadSliceNormalizedNodeGen.create(getContext(), null, null, null, null);
}

public abstract DynamicObject executeReadSlice(DynamicObject array, int index, int length);
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@ public Object writeExtendByOne(DynamicObject array, int index, Object value,
}

protected ArrayAppendOneNode createArrayAppendOneNode() {
return ArrayAppendOneNodeGen.create(getContext(), getSourceSection(), null, null);
return ArrayAppendOneNodeGen.create(getContext(), null, null, null);
}

// Writing beyond the end of an array - may need to generalize to Object[] or otherwise extend
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ public long durationNil(DynamicObject duration) {
public long duration(VirtualFrame frame, DynamicObject duration) {
if (floatCastNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
floatCastNode = insert(NumericToFloatNodeGen.create(getContext(), getSourceSection(), "to_f", null));
floatCastNode = insert(NumericToFloatNodeGen.create(getContext(), null, "to_f", null));
}
return duration(floatCastNode.executeDouble(frame, duration));
}
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ public DynamicObject coerceRubyBignum(DynamicObject value) {
public Object coerceDouble(VirtualFrame frame, double value) {
if (floatToIntNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
floatToIntNode = insert(FloatNodesFactory.ToINodeFactory.create(getContext(), getSourceSection(), null));
floatToIntNode = insert(FloatNodesFactory.ToINodeFactory.create(getContext(), null, null));
}
return floatToIntNode.executeToI(frame, value);
}
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ public ToSNode(RubyContext context, SourceSection sourceSection) {
protected DynamicObject kernelToS(VirtualFrame frame, Object object) {
if (kernelToSNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
kernelToSNode = insert(KernelNodesFactory.ToSNodeFactory.create(getContext(), getSourceSection(), null));
kernelToSNode = insert(KernelNodesFactory.ToSNodeFactory.create(getContext(), null, null));
}
return kernelToSNode.executeToS(frame, object);
}
Original file line number Diff line number Diff line change
@@ -358,7 +358,7 @@ public DynamicObject defaultExternal(Object nil) {
public DynamicObject defaultExternal(VirtualFrame frame, Object encoding) {
if (toStrNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
toStrNode = insert(ToStrNodeGen.create(getContext(), getSourceSection(), null));
toStrNode = insert(ToStrNodeGen.create(getContext(), null, null));
}

return defaultExternal(toStrNode.executeToStr(frame, encoding));
@@ -392,7 +392,7 @@ public DynamicObject defaultInternal(Object encoding) {
public DynamicObject defaultInternal(VirtualFrame frame, Object encoding) {
if (toStrNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
toStrNode = insert(ToStrNodeGen.create(getContext(), getSourceSection(), null));
toStrNode = insert(ToStrNodeGen.create(getContext(), null, null));
}

final DynamicObject encodingName = toStrNode.executeToStr(frame, encoding);
Original file line number Diff line number Diff line change
@@ -217,7 +217,7 @@ public abstract static class FiberTransferNode extends CoreMethodArrayArgumentsN
protected Object singleValue(VirtualFrame frame, Object[] args) {
if (singleValueCastNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
singleValueCastNode = insert(SingleValueCastNodeGen.create(getContext(), getSourceSection(), null));
singleValueCastNode = insert(SingleValueCastNodeGen.create(getContext(), null, null));
}
return singleValueCastNode.executeSingleValue(frame, args);
}
Loading