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

Commits on Feb 20, 2016

  1. Copy the full SHA
    2ccf3c0 View commit details
  2. Copy the full SHA
    ca850ad View commit details
  3. Copy the full SHA
    fbde821 View commit details
  4. Copy the full SHA
    44b2d7f View commit details
  5. 1
    Copy the full SHA
    2663f15 View commit details
  6. Copy the full SHA
    4eb309b View commit details
  7. 2
    Copy the full SHA
    1b884f8 View commit details
  8. Copy the full SHA
    4e2620b View commit details
  9. 1
    Copy the full SHA
    0228c08 View commit details
  10. [Truffle] Rename Read and WriteObjectFieldHeadNodes to without the He…

    …ad because the DSL does that now.
    chrisseaton committed Feb 20, 2016
    Copy the full SHA
    910dc52 View commit details
Showing with 913 additions and 959 deletions.
  1. +1 −0 core/src/main/java/org/jruby/util/cli/Options.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/MainNodes.java
  4. +28 −28 truffle/src/main/java/org/jruby/truffle/core/MathNodes.java
  5. +2 −2 truffle/src/main/java/org/jruby/truffle/core/ProcessNodes.java
  6. +2 −2 truffle/src/main/java/org/jruby/truffle/core/RaiseIfFrozenNode.java
  7. +1 −1 truffle/src/main/java/org/jruby/truffle/core/SetTopLevelBindingNode.java
  8. +2 −2 truffle/src/main/java/org/jruby/truffle/core/array/ArrayConcatNode.java
  9. +9 −9 truffle/src/main/java/org/jruby/truffle/core/array/ArrayDropTailNode.java
  10. +5 −5 truffle/src/main/java/org/jruby/truffle/core/array/ArrayDupNode.java
  11. +9 −9 truffle/src/main/java/org/jruby/truffle/core/array/ArrayGetTailNode.java
  12. +8 −8 truffle/src/main/java/org/jruby/truffle/core/array/ArrayLiteralNode.java
  13. +67 −67 truffle/src/main/java/org/jruby/truffle/core/array/ArrayNodes.java
  14. +9 −9 truffle/src/main/java/org/jruby/truffle/core/array/ArraySliceNode.java
  15. +7 −7 truffle/src/main/java/org/jruby/truffle/core/basicobject/BasicObjectNodes.java
  16. +3 −3 truffle/src/main/java/org/jruby/truffle/core/binding/BindingNodes.java
  17. +4 −4 truffle/src/main/java/org/jruby/truffle/core/cast/ArrayAttributeCastNode.java
  18. +3 −3 truffle/src/main/java/org/jruby/truffle/core/cast/ArrayCastNode.java
  19. +3 −3 truffle/src/main/java/org/jruby/truffle/core/cast/CmpIntNode.java
  20. +1 −1 truffle/src/main/java/org/jruby/truffle/core/cast/HashCastNode.java
  21. +1 −1 truffle/src/main/java/org/jruby/truffle/core/cast/IntegerCastNode.java
  22. +3 −3 truffle/src/main/java/org/jruby/truffle/core/cast/NumericToFloatNode.java
  23. +1 −1 truffle/src/main/java/org/jruby/truffle/core/cast/SingleValueCastNode.java
  24. +5 −5 truffle/src/main/java/org/jruby/truffle/core/cast/SplatCastNode.java
  25. +1 −1 truffle/src/main/java/org/jruby/truffle/core/cast/TaintResultNode.java
  26. +3 −3 truffle/src/main/java/org/jruby/truffle/core/coerce/NameToJavaStringNode.java
  27. +3 −3 truffle/src/main/java/org/jruby/truffle/core/coerce/NameToSymbolOrStringNode.java
  28. +3 −3 truffle/src/main/java/org/jruby/truffle/core/coerce/ToAryNode.java
  29. +4 −4 truffle/src/main/java/org/jruby/truffle/core/coerce/ToFNode.java
  30. +6 −6 truffle/src/main/java/org/jruby/truffle/core/coerce/ToIntNode.java
  31. +3 −3 truffle/src/main/java/org/jruby/truffle/core/coerce/ToProcNode.java
  32. +3 −3 truffle/src/main/java/org/jruby/truffle/core/coerce/ToStrNode.java
  33. +4 −4 truffle/src/main/java/org/jruby/truffle/core/encoding/EncodingConverterNodes.java
  34. +7 −7 truffle/src/main/java/org/jruby/truffle/core/encoding/EncodingNodes.java
  35. +3 −3 truffle/src/main/java/org/jruby/truffle/core/exception/ExceptionNodes.java
  36. +3 −3 truffle/src/main/java/org/jruby/truffle/core/fiber/FiberNodes.java
  37. +3 −3 truffle/src/main/java/org/jruby/truffle/core/hash/HashLiteralNode.java
  38. +9 −9 truffle/src/main/java/org/jruby/truffle/core/hash/HashNodes.java
  39. +54 −54 truffle/src/main/java/org/jruby/truffle/core/kernel/KernelNodes.java
  40. +3 −3 truffle/src/main/java/org/jruby/truffle/core/klass/ClassNodes.java
  41. +9 −9 truffle/src/main/java/org/jruby/truffle/core/method/MethodNodes.java
  42. +5 −5 truffle/src/main/java/org/jruby/truffle/core/method/UnboundMethodNodes.java
  43. +43 −43 truffle/src/main/java/org/jruby/truffle/core/module/ModuleNodes.java
  44. +1 −1 truffle/src/main/java/org/jruby/truffle/core/mutex/MutexNodes.java
  45. +5 −5 truffle/src/main/java/org/jruby/truffle/core/numeric/BignumNodes.java
  46. +3 −3 truffle/src/main/java/org/jruby/truffle/core/numeric/FixnumNodes.java
  47. +1 −1 truffle/src/main/java/org/jruby/truffle/core/numeric/FixnumOrBignumNode.java
  48. +6 −6 truffle/src/main/java/org/jruby/truffle/core/numeric/FloatNodes.java
  49. +7 −7 truffle/src/main/java/org/jruby/truffle/core/numeric/GeneralDivModNode.java
  50. +1 −1 truffle/src/main/java/org/jruby/truffle/core/numeric/IntegerNodes.java
  51. +8 −8 truffle/src/main/java/org/jruby/truffle/core/objectspace/ObjectSpaceNodes.java
  52. +5 −5 truffle/src/main/java/org/jruby/truffle/core/proc/ProcNodes.java
  53. +2 −2 truffle/src/main/java/org/jruby/truffle/core/queue/QueueNodes.java
  54. +4 −4 truffle/src/main/java/org/jruby/truffle/core/queue/SizedQueueNodes.java
  55. +10 −10 truffle/src/main/java/org/jruby/truffle/core/range/RangeNodes.java
  56. +1 −1 truffle/src/main/java/org/jruby/truffle/core/regexp/InterpolatedRegexpNode.java
  57. +10 −10 truffle/src/main/java/org/jruby/truffle/core/regexp/MatchDataNodes.java
  58. +2 −2 truffle/src/main/java/org/jruby/truffle/core/regexp/RegexpNodes.java
  59. +1 −1 truffle/src/main/java/org/jruby/truffle/core/rubinius/BignumPrimitiveNodes.java
  60. +3 −3 truffle/src/main/java/org/jruby/truffle/core/rubinius/ByteArrayNodes.java
  61. +1 −1 truffle/src/main/java/org/jruby/truffle/core/rubinius/ChannelPrimitiveNodes.java
  62. +1 −1 truffle/src/main/java/org/jruby/truffle/core/rubinius/DirPrimitiveNodes.java
  63. +5 −5 truffle/src/main/java/org/jruby/truffle/core/rubinius/EncodingConverterPrimitiveNodes.java
  64. +1 −1 truffle/src/main/java/org/jruby/truffle/core/rubinius/ExceptionPrimitiveNodes.java
  65. +2 −2 truffle/src/main/java/org/jruby/truffle/core/rubinius/FixnumPrimitiveNodes.java
  66. +3 −3 truffle/src/main/java/org/jruby/truffle/core/rubinius/FloatPrimitiveNodes.java
  67. +3 −3 truffle/src/main/java/org/jruby/truffle/core/rubinius/IOBufferPrimitiveNodes.java
  68. +27 −27 truffle/src/main/java/org/jruby/truffle/core/rubinius/IOPrimitiveNodes.java
  69. +10 −10 truffle/src/main/java/org/jruby/truffle/core/rubinius/ObjectPrimitiveNodes.java
  70. +8 −8 truffle/src/main/java/org/jruby/truffle/core/rubinius/PosixNodes.java
  71. +2 −2 truffle/src/main/java/org/jruby/truffle/core/rubinius/RandomizerPrimitiveNodes.java
  72. +5 −5 truffle/src/main/java/org/jruby/truffle/core/rubinius/RegexpPrimitiveNodes.java
  73. +1 −1 truffle/src/main/java/org/jruby/truffle/core/rubinius/RubiniusSingleBlockArgNode.java
  74. +12 −12 truffle/src/main/java/org/jruby/truffle/core/rubinius/StatPrimitiveNodes.java
  75. +13 −13 truffle/src/main/java/org/jruby/truffle/core/rubinius/StringPrimitiveNodes.java
  76. +6 −6 truffle/src/main/java/org/jruby/truffle/core/rubinius/TimePrimitiveNodes.java
  77. +14 −14 truffle/src/main/java/org/jruby/truffle/core/rubinius/VMPrimitiveNodes.java
  78. +1 −1 truffle/src/main/java/org/jruby/truffle/core/rubinius/WeakRefPrimitiveNodes.java
  79. +33 −33 truffle/src/main/java/org/jruby/truffle/core/string/StringNodes.java
  80. +4 −4 truffle/src/main/java/org/jruby/truffle/core/symbol/SymbolNodes.java
  81. +3 −3 truffle/src/main/java/org/jruby/truffle/core/thread/ThreadNodes.java
  82. +1 −1 truffle/src/main/java/org/jruby/truffle/core/time/ReadTimeZoneNode.java
  83. +1 −1 truffle/src/main/java/org/jruby/truffle/core/time/TimeNodes.java
  84. +1 −1 truffle/src/main/java/org/jruby/truffle/debug/AssertConstantNode.java
  85. +1 −1 truffle/src/main/java/org/jruby/truffle/debug/AssertNotCompiledNode.java
  86. +13 −13 truffle/src/main/java/org/jruby/truffle/extra/TrufflePrimitiveNodes.java
  87. +4 −4 truffle/src/main/java/org/jruby/truffle/interop/InteropNode.java
  88. +2 −2 truffle/src/main/java/org/jruby/truffle/interop/TruffleInteropNodes.java
  89. +1 −0 truffle/src/main/java/org/jruby/truffle/language/Options.java
  90. +9 −0 truffle/src/main/java/org/jruby/truffle/language/RubyGuards.java
  91. +7 −2 truffle/src/main/java/org/jruby/truffle/language/RubyNode.java
  92. +5 −5 truffle/src/main/java/org/jruby/truffle/language/arguments/CheckArityNode.java
  93. +1 −1 truffle/src/main/java/org/jruby/truffle/language/arguments/MissingKeywordArgumentNode.java
  94. +1 −1 truffle/src/main/java/org/jruby/truffle/language/arguments/ReadKeywordRestArgumentNode.java
  95. +1 −1 truffle/src/main/java/org/jruby/truffle/language/arguments/ReadRestArgumentNode.java
  96. +1 −1 truffle/src/main/java/org/jruby/truffle/language/arguments/RunBlockKWArgsHelperNode.java
  97. +1 −1 truffle/src/main/java/org/jruby/truffle/language/arguments/UnknownArgumentErrorNode.java
  98. +1 −1 truffle/src/main/java/org/jruby/truffle/language/constants/GetConstantNode.java
  99. +3 −3 truffle/src/main/java/org/jruby/truffle/language/constants/LookupConstantNode.java
  100. +1 −1 truffle/src/main/java/org/jruby/truffle/language/constants/LookupConstantWithLexicalScopeNode.java
  101. +1 −1 truffle/src/main/java/org/jruby/truffle/language/constants/ReadConstantWithLexicalScopeNode.java
  102. +1 −1 truffle/src/main/java/org/jruby/truffle/language/constants/WriteConstantNode.java
  103. +1 −1 truffle/src/main/java/org/jruby/truffle/language/control/BreakNode.java
  104. +4 −4 truffle/src/main/java/org/jruby/truffle/language/dispatch/CachedMethodMissingDispatchNode.java
  105. +4 −4 truffle/src/main/java/org/jruby/truffle/language/dispatch/CachedReturnMissingDispatchNode.java
  106. +1 −1 truffle/src/main/java/org/jruby/truffle/language/dispatch/DispatchNode.java
  107. +1 −1 truffle/src/main/java/org/jruby/truffle/language/dispatch/UncachedDispatchNode.java
  108. +10 −10 truffle/src/main/java/org/jruby/truffle/language/dispatch/UnresolvedDispatchNode.java
  109. +1 −1 truffle/src/main/java/org/jruby/truffle/language/exceptions/RescueAnyNode.java
  110. +1 −1 truffle/src/main/java/org/jruby/truffle/language/exceptions/TopLevelRaiseHandler.java
  111. +1 −1 truffle/src/main/java/org/jruby/truffle/language/globals/CheckMatchVariableTypeNode.java
  112. +1 −1 truffle/src/main/java/org/jruby/truffle/language/globals/CheckOutputSeparatorVariableTypeNode.java
  113. +1 −1 truffle/src/main/java/org/jruby/truffle/language/globals/CheckProgramNameVariableTypeNode.java
  114. +1 −1 truffle/src/main/java/org/jruby/truffle/language/globals/CheckRecordSeparatorVariableTypeNode.java
  115. +2 −2 truffle/src/main/java/org/jruby/truffle/language/globals/CheckStdoutVariableTypeNode.java
  116. +4 −4 truffle/src/main/java/org/jruby/truffle/language/globals/ReadGlobalVariableNode.java
  117. +4 −4 truffle/src/main/java/org/jruby/truffle/language/globals/ReadThreadLocalGlobalVariableNode.java
  118. +1 −1 truffle/src/main/java/org/jruby/truffle/language/globals/UpdateLastBacktraceNode.java
  119. +4 −4 truffle/src/main/java/org/jruby/truffle/language/globals/WriteGlobalVariableNode.java
  120. +1 −1 truffle/src/main/java/org/jruby/truffle/language/globals/WriteReadOnlyGlobalNode.java
  121. +1 −1 truffle/src/main/java/org/jruby/truffle/language/literal/StringLiteralNode.java
  122. +1 −1 truffle/src/main/java/org/jruby/truffle/language/methods/BlockDefinitionNode.java
  123. +1 −1 truffle/src/main/java/org/jruby/truffle/language/methods/CatchForLambdaNode.java
  124. +1 −1 truffle/src/main/java/org/jruby/truffle/language/methods/CatchForMethodNode.java
  125. +1 −1 truffle/src/main/java/org/jruby/truffle/language/methods/CatchForProcNode.java
  126. +1 −1 truffle/src/main/java/org/jruby/truffle/language/methods/CatchRetryAsErrorNode.java
  127. +1 −1 truffle/src/main/java/org/jruby/truffle/language/methods/CatchReturnAsErrorNode.java
  128. +6 −6 truffle/src/main/java/org/jruby/truffle/language/methods/ExceptionTranslatingNode.java
  129. +1 −1 truffle/src/main/java/org/jruby/truffle/language/methods/MethodDefinitionNode.java
  130. +1 −1 truffle/src/main/java/org/jruby/truffle/language/methods/ModuleBodyDefinitionNode.java
  131. +2 −2 truffle/src/main/java/org/jruby/truffle/language/objects/AllocateObjectNode.java
  132. +0 −63 truffle/src/main/java/org/jruby/truffle/language/objects/ClassNode.java
  133. +1 −1 truffle/src/main/java/org/jruby/truffle/language/objects/DefineOrGetClassNode.java
  134. +5 −5 truffle/src/main/java/org/jruby/truffle/language/objects/DefineOrGetModuleNode.java
  135. +9 −10 truffle/src/main/java/org/jruby/truffle/language/objects/FreezeNode.java
  136. +3 −3 truffle/src/main/java/org/jruby/truffle/language/objects/IsANode.java
  137. +5 −4 truffle/src/main/java/org/jruby/truffle/language/objects/IsFrozenNode.java
  138. +5 −6 truffle/src/main/java/org/jruby/truffle/language/objects/IsTaintedNode.java
  139. +85 −0 truffle/src/main/java/org/jruby/truffle/language/objects/LogicalClassNode.java
  140. +36 −15 truffle/src/main/java/org/jruby/truffle/language/objects/MetaClassNode.java
  141. +0 −84 truffle/src/main/java/org/jruby/truffle/language/objects/MetaClassWithShapeCacheNode.java
  142. +1 −1 truffle/src/main/java/org/jruby/truffle/language/objects/ReadClassVariableNode.java
  143. +2 −2 truffle/src/main/java/org/jruby/truffle/language/objects/ReadInstanceVariableNode.java
  144. +4 −3 ...java/org/jruby/truffle/language/objects/{ReadHeadObjectFieldNode.java → ReadObjectFieldNode.java}
  145. +0 −23 truffle/src/main/java/org/jruby/truffle/language/objects/ShapeCachingGuards.java
  146. +4 −4 truffle/src/main/java/org/jruby/truffle/language/objects/SingletonClassNode.java
  147. +11 −10 truffle/src/main/java/org/jruby/truffle/language/objects/TaintNode.java
  148. +3 −3 truffle/src/main/java/org/jruby/truffle/language/objects/WriteInstanceVariableNode.java
  149. +4 −3 ...va/org/jruby/truffle/language/objects/{WriteHeadObjectFieldNode.java → WriteObjectFieldNode.java}
  150. +4 −4 truffle/src/main/java/org/jruby/truffle/language/supercall/LookupSuperMethodNode.java
  151. +2 −2 truffle/src/main/java/org/jruby/truffle/language/supercall/ZSuperOutsideMethodNode.java
  152. +1 −1 truffle/src/main/java/org/jruby/truffle/language/yield/YieldNode.java
  153. +34 −34 truffle/src/main/java/org/jruby/truffle/stdlib/BigDecimalNodes.java
  154. +2 −2 truffle/src/main/java/org/jruby/truffle/stdlib/ObjSpaceNodes.java
  155. +4 −4 truffle/src/main/java/org/jruby/truffle/stdlib/psych/PsychParserNodes.java
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/util/cli/Options.java
Original file line number Diff line number Diff line change
@@ -246,6 +246,7 @@ public class Options {
public static final Option<Integer> TRUFFLE_PACK_CACHE = integer(TRUFFLE, "truffle.pack.cache", TRUFFLE_DEFAULT_CACHE.load(), "Array#pack cache size");
public static final Option<Integer> TRUFFLE_UNPACK_CACHE = integer(TRUFFLE, "truffle.unpack.cache", TRUFFLE_DEFAULT_CACHE.load(), "String#unpack cache size");
public static final Option<Integer> TRUFFLE_EVAL_CACHE = integer(TRUFFLE, "truffle.eval.cache", TRUFFLE_DEFAULT_CACHE.load(), "eval lookup cache size");
public static final Option<Integer> TRUFFLE_CLASS_CACHE = integer(TRUFFLE, "truffle.class.cache", TRUFFLE_DEFAULT_CACHE.load(), ".class and .metaclass cache size");
public static final Option<Integer> TRUFFLE_ENCODING_COMPATIBLE_QUERY_CACHE = integer(TRUFFLE, "truffle.encoding_compatible_query.cache", TRUFFLE_DEFAULT_CACHE.load(), "Encoding.compatible? cache size");

public static final Option<Boolean> TRUFFLE_CLONE_DEFAULT = bool(TRUFFLE, "truffle.clone.default", true, "Default option for cloning.");
Original file line number Diff line number Diff line change
@@ -926,8 +926,8 @@ public DynamicObject systemStackError(String message, Node currentNode) {
return ExceptionNodes.createRubyException(systemStackErrorClass, StringOperations.createString(context, StringOperations.encodeRope(message, UTF8Encoding.INSTANCE)), context.getCallStack().getBacktrace(currentNode));
}

@TruffleBoundary
public DynamicObject frozenError(String className, Node currentNode) {
CompilerAsserts.neverPartOfCompilation();
return runtimeError(String.format("can't modify frozen %s", className), currentNode);
}

4 changes: 2 additions & 2 deletions truffle/src/main/java/org/jruby/truffle/core/MainNodes.java
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ public PublicNode(RubyContext context, SourceSection sourceSection) {

@Specialization
public DynamicObject doPublic(VirtualFrame frame, Object[] args) {
final DynamicObject object = getContext().getCoreLibrary().getObjectClass();
final DynamicObject object = coreLibrary().getObjectClass();
return publicNode.executePublic(frame, object, args);
}
}
@@ -51,7 +51,7 @@ public PrivateNode(RubyContext context, SourceSection sourceSection) {

@Specialization
public DynamicObject doPrivate(VirtualFrame frame, Object[] args) {
final DynamicObject object = getContext().getCoreLibrary().getObjectClass();
final DynamicObject object = coreLibrary().getObjectClass();
return privateNode.executePrivate(frame, object, args);
}
}
56 changes: 28 additions & 28 deletions truffle/src/main/java/org/jruby/truffle/core/MathNodes.java
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ public ACosNode(RubyContext context, SourceSection sourceSection) {
protected double doFunction(double a) {
if (a < -1.0 || a > 1.0) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().mathDomainError("acos", this));
throw new RaiseException(coreLibrary().mathDomainError("acos", this));
}

return Math.acos(a);
@@ -62,7 +62,7 @@ protected double doFunction(double a) {
return Double.NaN;
} else if (a < 1) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().mathDomainError("acosh", this));
throw new RaiseException(coreLibrary().mathDomainError("acosh", this));
} else if (a < 94906265.62) {
return Math.log(a + Math.sqrt(a * a - 1.0));
} else{
@@ -83,7 +83,7 @@ public ASinNode(RubyContext context, SourceSection sourceSection) {
protected double doFunction(double a) {
if (a < -1.0 || a > 1.0) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().mathDomainError("asin", this));
throw new RaiseException(coreLibrary().mathDomainError("asin", this));
}

return Math.asin(a);
@@ -162,7 +162,7 @@ protected double doFunction(double a) {

if (a < -1.0 || a > 1.0) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().mathDomainError("atanh", this));
throw new RaiseException(coreLibrary().mathDomainError("atanh", this));
}

final double y = Math.abs(a);
@@ -358,16 +358,16 @@ public DynamicObject frexp(double a) {
for (; mantissa >= 1.0; mantissa *= 0.5, exponent +=1) { }
}

return Layouts.ARRAY.createArray(getContext().getCoreLibrary().getArrayFactory(), new Object[]{sign * mantissa, exponent}, 2);
return Layouts.ARRAY.createArray(coreLibrary().getArrayFactory(), new Object[]{sign * mantissa, exponent}, 2);
}

@Fallback
public DynamicObject frexp(VirtualFrame frame, Object a) {
if (isANode.executeIsA(a, getContext().getCoreLibrary().getNumericClass())) {
if (isANode.executeIsA(a, coreLibrary().getNumericClass())) {
return frexp(floatNode.callFloat(frame, a, "to_f", null));
} else {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().typeErrorCantConvertInto(a, "Float", this));
throw new RaiseException(coreLibrary().typeErrorCantConvertInto(a, "Float", this));
}
}

@@ -386,7 +386,7 @@ protected double doFunction(double a) {

if (a == -1) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().mathDomainError("gamma", this));
throw new RaiseException(coreLibrary().mathDomainError("gamma", this));
}

if (Double.isNaN(a)) {
@@ -398,7 +398,7 @@ protected double doFunction(double a) {
return Double.POSITIVE_INFINITY;
} else {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().mathDomainError("gamma", this));
throw new RaiseException(coreLibrary().mathDomainError("gamma", this));
}
}

@@ -418,7 +418,7 @@ protected double doFunction(double a) {

if (Double.isNaN(a)) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().mathDomainError("gamma", this));
throw new RaiseException(coreLibrary().mathDomainError("gamma", this));
}

return result;
@@ -513,21 +513,21 @@ public double function(double a, long b) {
public double function(double a, double b) {
if (Double.isNaN(b)) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().rangeError("float", Double.toString(b), "integer", this));
throw new RaiseException(coreLibrary().rangeError("float", Double.toString(b), "integer", this));
}

return a * Math.pow(2, b);
}

@Fallback
public double function(VirtualFrame frame, Object a, Object b) {
if (isANode.executeIsA(a, getContext().getCoreLibrary().getNumericClass())) {
if (isANode.executeIsA(a, coreLibrary().getNumericClass())) {
return function(
floatANode.callFloat(frame, a, "to_f", null),
integerBNode.callLongFixnum(frame, b, "to_int", null));
} else {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().typeErrorCantConvertInto(a, "Float", this));
throw new RaiseException(coreLibrary().typeErrorCantConvertInto(a, "Float", this));
}
}

@@ -568,21 +568,21 @@ public DynamicObject lgamma(double a) {

if (a < 0 && Double.isInfinite(a)) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().mathDomainError("log2", this));
throw new RaiseException(coreLibrary().mathDomainError("log2", this));
}

final RubyMath.NemesLogGamma l = new RubyMath.NemesLogGamma(a);

return Layouts.ARRAY.createArray(getContext().getCoreLibrary().getArrayFactory(), new Object[]{l.value, l.sign}, 2);
return Layouts.ARRAY.createArray(coreLibrary().getArrayFactory(), new Object[]{l.value, l.sign}, 2);
}

@Fallback
public DynamicObject lgamma(VirtualFrame frame, Object a) {
if (isANode.executeIsA(a, getContext().getCoreLibrary().getNumericClass())) {
if (isANode.executeIsA(a, coreLibrary().getNumericClass())) {
return lgamma(floatNode.callFloat(frame, a, "to_f", null));
} else {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().typeErrorCantConvertInto(a, "Float", this));
throw new RaiseException(coreLibrary().typeErrorCantConvertInto(a, "Float", this));
}
}

@@ -617,18 +617,18 @@ public double function(double a, NotProvided b) {

@Specialization
public double function(VirtualFrame frame, Object a, NotProvided b) {
if (isANode.executeIsA(a, getContext().getCoreLibrary().getNumericClass())) {
if (isANode.executeIsA(a, coreLibrary().getNumericClass())) {
return doFunction(floatANode.callFloat(frame, a, "to_f", null));
} else {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().typeErrorCantConvertInto(a, "Float", this));
throw new RaiseException(coreLibrary().typeErrorCantConvertInto(a, "Float", this));
}
}

private double doFunction(double a) {
if (a < 0) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().mathDomainError("log", this));
throw new RaiseException(coreLibrary().mathDomainError("log", this));
}

return Math.log(a);
@@ -638,7 +638,7 @@ private double doFunction(double a) {
protected double doFunction(double a, double b) {
if (a < 0) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().mathDomainError("log", this));
throw new RaiseException(coreLibrary().mathDomainError("log", this));
}

return Math.log(a) / Math.log(b);
@@ -657,7 +657,7 @@ public Log10Node(RubyContext context, SourceSection sourceSection) {
protected double doFunction(double a) {
if (a < 0) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().mathDomainError("log10", this));
throw new RaiseException(coreLibrary().mathDomainError("log10", this));
}

return Math.log10(a);
@@ -678,7 +678,7 @@ public Log2Node(RubyContext context, SourceSection sourceSection) {
protected double doFunction(double a) {
if (a < 0) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().mathDomainError("log2", this));
throw new RaiseException(coreLibrary().mathDomainError("log2", this));
}

return Math.log(a) / LOG2;
@@ -795,11 +795,11 @@ public double function(double a) {

@Fallback
public double function(VirtualFrame frame, Object a) {
if (isANode.executeIsA(a, getContext().getCoreLibrary().getNumericClass())) {
if (isANode.executeIsA(a, coreLibrary().getNumericClass())) {
return doFunction(floatNode.callFloat(frame, a, "to_f", null));
} else {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().typeErrorCantConvertInto(a, "Float", this));
throw new RaiseException(coreLibrary().typeErrorCantConvertInto(a, "Float", this));
}
}

@@ -906,15 +906,15 @@ public double function(double a, double b) {

@Fallback
public double function(VirtualFrame frame, Object a, Object b) {
if (isANode.executeIsA(a, getContext().getCoreLibrary().getNumericClass()) &&
isANode.executeIsA(b, getContext().getCoreLibrary().getNumericClass())) {
if (isANode.executeIsA(a, coreLibrary().getNumericClass()) &&
isANode.executeIsA(b, coreLibrary().getNumericClass())) {
return doFunction(
floatANode.callFloat(frame, a, "to_f", null),
floatBNode.callFloat(frame, b, "to_f", null));
} else {
CompilerDirectives.transferToInterpreter();

throw new RaiseException(getContext().getCoreLibrary().typeErrorCantConvertInto(a, "Float", this));
throw new RaiseException(coreLibrary().typeErrorCantConvertInto(a, "Float", this));
}
}

Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ private Object clock_gettime_clock_id(int clock_id, DynamicObject unit) {
int r = libCClockGetTime.clock_gettime(clock_id, timeSpec);
if (r != 0) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().systemCallError("clock_gettime failed: " + r, this));
throw new RaiseException(coreLibrary().systemCallError("clock_gettime failed: " + r, this));
}
long nanos = timeSpec.getTVsec() * 1_000_000_000 + timeSpec.getTVnsec();
return timeToUnit(nanos, unit);
@@ -146,7 +146,7 @@ private int raise(String signalName) {
try {
getContext().getNativePlatform().getSignalManager().raise(signal);
} catch (IllegalArgumentException e) {
throw new RaiseException(getContext().getCoreLibrary().argumentError(e.getMessage(), this));
throw new RaiseException(coreLibrary().argumentError(e.getMessage(), this));
}
return 1;
}
Original file line number Diff line number Diff line change
@@ -34,8 +34,8 @@ public Object execute(VirtualFrame frame) {

if (isFrozenNode.executeIsFrozen(result)) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().frozenError(
Layouts.MODULE.getFields(getContext().getCoreLibrary().getLogicalClass(result)).getName(), this));
throw new RaiseException(coreLibrary().frozenError(
Layouts.MODULE.getFields(coreLibrary().getLogicalClass(result)).getName(), this));
}

return result;
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ public SetTopLevelBindingNode(RubyContext context, SourceSection sourceSection)
@Override
public Object execute(VirtualFrame frame) {
final DynamicObject binding = BindingNodes.createBinding(getContext(), frame.materialize());
Layouts.MODULE.getFields(getContext().getCoreLibrary().getObjectClass()).setConstant(getContext(), this, "TOPLEVEL_BINDING", binding);
Layouts.MODULE.getFields(coreLibrary().getObjectClass()).setConstant(getContext(), this, "TOPLEVEL_BINDING", binding);
return nil();
}

Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ private DynamicObject executeSingle(VirtualFrame frame, Object store, int length
store = arrayBuilderNode.appendValue(store, length, childObject);
length++;
}
return Layouts.ARRAY.createArray(getContext().getCoreLibrary().getArrayFactory(), arrayBuilderNode.finish(store, length), length);
return Layouts.ARRAY.createArray(coreLibrary().getArrayFactory(), arrayBuilderNode.finish(store, length), length);
}

@ExplodeLoop
@@ -85,7 +85,7 @@ private DynamicObject executeRubyArray(VirtualFrame frame, Object store, int len
}
}

return Layouts.ARRAY.createArray(getContext().getCoreLibrary().getArrayFactory(), arrayBuilderNode.finish(store, length), length);
return Layouts.ARRAY.createArray(coreLibrary().getArrayFactory(), arrayBuilderNode.finish(store, length), length);
}

@ExplodeLoop
Loading