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: 9dd0df984be1
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e2dd8760fda0
Choose a head ref

Commits on Jan 26, 2016

  1. Copy the full SHA
    1bfa42d View commit details
  2. Copy the full SHA
    e322d64 View commit details
  3. Copy the full SHA
    a665a0b View commit details
  4. Copy the full SHA
    42901a3 View commit details
  5. Copy the full SHA
    c08684a View commit details
  6. Copy the full SHA
    e1a7514 View commit details
  7. Copy the full SHA
    570e9b4 View commit details
  8. Copy the full SHA
    ea0882d View commit details

Commits on Jan 27, 2016

  1. Copy the full SHA
    cff8053 View commit details
  2. Copy the full SHA
    25cd2c9 View commit details
  3. Copy the full SHA
    4ba0fad View commit details
  4. Copy the full SHA
    9a34277 View commit details
  5. Copy the full SHA
    161b014 View commit details
  6. Copy the full SHA
    2e5e942 View commit details
  7. separate filename selection from index on test/jruby and test/mri in …

    …IT tests
    
    ... there are some test names that are the same and thus one excludes another
    kares committed Jan 27, 2016
    Copy the full SHA
    ef56ae4 View commit details
  8. Update for next dev version

    enebo committed Jan 27, 2016
    3
    Copy the full SHA
    3a377e0 View commit details
  9. Copy the full SHA
    103562b View commit details
  10. Align verified startup with unverified command line.

    * Don't re-pass JRUBY_OPTS to Main.
    
    Fixes #3620.
    headius committed Jan 27, 2016
    1
    Copy the full SHA
    0193bdc View commit details
  11. Copy the full SHA
    40a8cf7 View commit details
  12. Copy the full SHA
    edb985a View commit details
  13. Copy the full SHA
    de7d227 View commit details
  14. Copy the full SHA
    d161377 View commit details
  15. Copy the full SHA
    07ecb32 View commit details
  16. Copy the full SHA
    8381451 View commit details
  17. Copy the full SHA
    159e9b0 View commit details
  18. [Truffle] Removed string_to_rope primitive.

    All Strings are now backed by ropes.
    nirvdrum committed Jan 27, 2016
    Copy the full SHA
    28ebd9b View commit details
  19. Copy the full SHA
    c8aa39c View commit details
  20. Copy the full SHA
    fd2f85c View commit details
  21. Copy the full SHA
    3657757 View commit details
  22. Copy the full SHA
    212d8c3 View commit details
  23. Copy the full SHA
    934fe51 View commit details
  24. Copy the full SHA
    0f4a614 View commit details
  25. Copy the full SHA
    c322cbc View commit details
  26. Copy the full SHA
    59bd955 View commit details
  27. Copy the full SHA
    1b058de View commit details
  28. Copy the full SHA
    6f3e31c View commit details
  29. Copy the full SHA
    e9d04d1 View commit details
  30. Copy the full SHA
    94b3862 View commit details
  31. Copy the full SHA
    caee20f View commit details
  32. Copy the full SHA
    9f370d0 View commit details
  33. Copy the full SHA
    c568516 View commit details
  34. Copy the full SHA
    1de42a6 View commit details
  35. Copy the full SHA
    ccf6bb3 View commit details
  36. Copy the full SHA
    55379f7 View commit details
  37. Copy the full SHA
    ee5d82f View commit details
  38. Copy the full SHA
    2767f1f View commit details
  39. Copy the full SHA
    18e442b View commit details
  40. Copy the full SHA
    499234b View commit details
  41. Copy the full SHA
    378939b View commit details
  42. Copy the full SHA
    fd6b762 View commit details
Showing with 6,134 additions and 1,659 deletions.
  1. +1 −1 VERSION
  2. +1 −1 bin/jruby.bash
  3. +1 −1 core/pom.xml
  4. +127 −0 core/src/main/java/org/jruby/ReifiedRubyObject.java
  5. +26 −5 core/src/main/java/org/jruby/RubyObjectVar0.java
  6. +38 −6 core/src/main/java/org/jruby/RubyObjectVar1.java
  7. +50 −6 core/src/main/java/org/jruby/RubyObjectVar2.java
  8. +62 −6 core/src/main/java/org/jruby/RubyObjectVar3.java
  9. +74 −6 core/src/main/java/org/jruby/RubyObjectVar4.java
  10. +86 −6 core/src/main/java/org/jruby/RubyObjectVar5.java
  11. +98 −6 core/src/main/java/org/jruby/RubyObjectVar6.java
  12. +110 −6 core/src/main/java/org/jruby/RubyObjectVar7.java
  13. +122 −6 core/src/main/java/org/jruby/RubyObjectVar8.java
  14. +134 −6 core/src/main/java/org/jruby/RubyObjectVar9.java
  15. +127 −0 core/src/main/java/org/jruby/internal/runtime/AbstractIRMethod.java
  16. +16 −21 core/src/main/java/org/jruby/internal/runtime/methods/CompiledIRMethod.java
  17. +4 −38 core/src/main/java/org/jruby/internal/runtime/methods/InterpretedIRMethod.java
  18. +3 −53 core/src/main/java/org/jruby/internal/runtime/methods/MixedModeIRMethod.java
  19. +14 −4 core/src/main/java/org/jruby/ir/targets/Bootstrap.java
  20. +3 −2 core/src/main/java/org/jruby/runtime/ivars/VariableAccessorVar0.java
  21. +3 −2 core/src/main/java/org/jruby/runtime/ivars/VariableAccessorVar1.java
  22. +3 −2 core/src/main/java/org/jruby/runtime/ivars/VariableAccessorVar2.java
  23. +3 −2 core/src/main/java/org/jruby/runtime/ivars/VariableAccessorVar3.java
  24. +3 −2 core/src/main/java/org/jruby/runtime/ivars/VariableAccessorVar4.java
  25. +3 −2 core/src/main/java/org/jruby/runtime/ivars/VariableAccessorVar5.java
  26. +3 −2 core/src/main/java/org/jruby/runtime/ivars/VariableAccessorVar6.java
  27. +3 −2 core/src/main/java/org/jruby/runtime/ivars/VariableAccessorVar7.java
  28. +3 −2 core/src/main/java/org/jruby/runtime/ivars/VariableAccessorVar8.java
  29. +3 −2 core/src/main/java/org/jruby/runtime/ivars/VariableAccessorVar9.java
  30. +3 −3 core/src/main/java/org/jruby/util/StringSupport.java
  31. +2 −1 core/src/main/java/org/jruby/util/cli/Options.java
  32. +4 −4 core/src/main/java/org/jruby/util/io/EncodingUtils.java
  33. +2 −2 lib/pom.xml
  34. +33 −38 maven/jruby/src/it/extended/src/test/java/org/example/BaseTest.java
  35. +25 −11 maven/jruby/src/it/extended/src/test/java/org/example/JRubyTest.java
  36. +32 −11 maven/jruby/src/it/extended/src/test/java/org/example/MRITest.java
  37. +0 −12 maven/jruby/src/it/extended/src/test/java/org/example/ObjectspaceTest.java
  38. +0 −12 maven/jruby/src/it/extended/src/test/java/org/example/SlowTest.java
  39. +1 −1 pom.rb
  40. +2 −2 pom.xml
  41. +2 −1 test/truffle/compiler/pe/core/eval_pe.rb
  42. +22 −1 test/truffle/compiler/pe/core/string_pe.rb
  43. +15 −2 tool/jt.rb
  44. +1 −1 truffle/pom.xml
  45. +2 −1 truffle/src/main/java/org/jruby/truffle/format/nodes/read/ReadBase64StringNode.java
  46. +2 −1 truffle/src/main/java/org/jruby/truffle/format/nodes/read/ReadBinaryStringNode.java
  47. +2 −1 truffle/src/main/java/org/jruby/truffle/format/nodes/read/ReadBitStringNode.java
  48. +2 −1 truffle/src/main/java/org/jruby/truffle/format/nodes/read/ReadHexStringNode.java
  49. +2 −1 truffle/src/main/java/org/jruby/truffle/format/nodes/read/ReadMIMEStringNode.java
  50. +2 −1 truffle/src/main/java/org/jruby/truffle/format/nodes/read/ReadUUStringNode.java
  51. +4 −4 truffle/src/main/java/org/jruby/truffle/format/nodes/type/ToStringNode.java
  52. +9 −0 truffle/src/main/java/org/jruby/truffle/nodes/RubyNode.java
  53. +13 −8 truffle/src/main/java/org/jruby/truffle/nodes/StringCachingGuards.java
  54. +105 −0 truffle/src/main/java/org/jruby/truffle/nodes/cast/ArrayAttributeCastNode.java
  55. +4 −0 truffle/src/main/java/org/jruby/truffle/nodes/coerce/ToIntNode.java
  56. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/conversion/ToSymbolNode.java
  57. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/BasicObjectNodes.java
  58. +39 −16 truffle/src/main/java/org/jruby/truffle/nodes/core/EncodingNodes.java
  59. +8 −4 truffle/src/main/java/org/jruby/truffle/nodes/core/InterpolatedRegexpNode.java
  60. +9 −5 truffle/src/main/java/org/jruby/truffle/nodes/core/InterpolatedStringNode.java
  61. +10 −9 truffle/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
  62. +6 −5 truffle/src/main/java/org/jruby/truffle/nodes/core/MatchDataNodes.java
  63. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/ModuleNodes.java
  64. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/RegexpGuards.java
  65. +51 −39 truffle/src/main/java/org/jruby/truffle/nodes/core/RegexpNodes.java
  66. +477 −0 truffle/src/main/java/org/jruby/truffle/nodes/core/RopeNodes.java
  67. +22 −9 truffle/src/main/java/org/jruby/truffle/nodes/core/StringGuards.java
  68. +669 −489 truffle/src/main/java/org/jruby/truffle/nodes/core/StringNodes.java
  69. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/core/SymbolNodes.java
  70. +14 −11 truffle/src/main/java/org/jruby/truffle/nodes/core/TruffleInteropNodes.java
  71. +55 −2 truffle/src/main/java/org/jruby/truffle/nodes/core/TrufflePrimitiveNodes.java
  72. +16 −5 truffle/src/main/java/org/jruby/truffle/nodes/core/array/ArrayNodes.java
  73. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/dispatch/CachedDispatchNode.java
  74. +7 −4 truffle/src/main/java/org/jruby/truffle/nodes/ext/DigestNodes.java
  75. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/ext/ObjSpaceNodes.java
  76. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/ext/psych/PsychParserNodes.java
  77. +4 −4 truffle/src/main/java/org/jruby/truffle/nodes/interop/InteropNode.java
  78. +5 −14 truffle/src/main/java/org/jruby/truffle/nodes/literal/StringLiteralNode.java
  79. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/ArrayPrimitiveNodes.java
  80. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/BignumPrimitiveNodes.java
  81. +24 −10 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/ByteArrayNodes.java
  82. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/ChannelPrimitiveNodes.java
  83. +5 −5 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/DirPrimitiveNodes.java
  84. +29 −27 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/EncodingConverterPrimitiveNodes.java
  85. +3 −4 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/EncodingPrimitiveNodes.java
  86. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/ExceptionPrimitiveNodes.java
  87. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/FixnumPrimitiveNodes.java
  88. +3 −3 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/FloatPrimitiveNodes.java
  89. +7 −6 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/IOBufferPrimitiveNodes.java
  90. +19 −19 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/IOPrimitiveNodes.java
  91. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/NativeFunctionPrimitiveNodes.java
  92. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/ObjectPrimitiveNodes.java
  93. +19 −18 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/PointerPrimitiveNodes.java
  94. +23 −36 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/PosixNodes.java
  95. +5 −5 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/RandomizerPrimitiveNodes.java
  96. +19 −18 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/RegexpPrimitiveNodes.java
  97. +26 −0 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/RubiniusPrimitiveArrayArgumentsNode.java
  98. +2 −3 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/RubiniusPrimitiveNode.java
  99. +15 −2 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/RubiniusPrimitiveNodeConstructor.java
  100. +5 −9 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/StatPrimitiveNodes.java
  101. +462 −336 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/StringPrimitiveNodes.java
  102. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/SymbolPrimitiveNodes.java
  103. +3 −3 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/ThreadPrimitiveNodes.java
  104. +12 −12 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/TimePrimitiveNodes.java
  105. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/UndefinedPrimitiveNodes.java
  106. +22 −22 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/VMPrimitiveNodes.java
  107. +3 −3 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/WeakRefPrimitiveNodes.java
  108. +540 −0 truffle/src/main/java/org/jruby/truffle/runtime/BaseLibC.java
  109. +25 −0 truffle/src/main/java/org/jruby/truffle/runtime/JavaLibC.java
  110. +2 −1 truffle/src/main/java/org/jruby/truffle/runtime/Options.java
  111. +636 −0 truffle/src/main/java/org/jruby/truffle/runtime/POSIXDelegator.java
  112. +17 −3 truffle/src/main/java/org/jruby/truffle/runtime/RubyContext.java
  113. +2 −1 truffle/src/main/java/org/jruby/truffle/runtime/RubyObjectType.java
  114. +50 −0 truffle/src/main/java/org/jruby/truffle/runtime/TruffleJavaFileStat.java
  115. +248 −0 truffle/src/main/java/org/jruby/truffle/runtime/TruffleJavaPOSIX.java
  116. +4 −3 truffle/src/main/java/org/jruby/truffle/runtime/adapaters/OutputStreamAdapter.java
  117. +108 −0 truffle/src/main/java/org/jruby/truffle/runtime/core/RopeTable.java
  118. +10 −6 truffle/src/main/java/org/jruby/truffle/runtime/core/StringCodeRangeableWrapper.java
  119. +108 −63 truffle/src/main/java/org/jruby/truffle/runtime/core/StringOperations.java
  120. +10 −14 truffle/src/main/java/org/jruby/truffle/runtime/core/SymbolCodeRangeableWrapper.java
  121. +20 −10 truffle/src/main/java/org/jruby/truffle/runtime/core/SymbolTable.java
  122. +4 −4 truffle/src/main/java/org/jruby/truffle/runtime/layouts/RegexpLayout.java
  123. +8 −12 truffle/src/main/java/org/jruby/truffle/runtime/layouts/StringLayout.java
  124. +3 −6 truffle/src/main/java/org/jruby/truffle/runtime/layouts/SymbolLayout.java
  125. +22 −0 truffle/src/main/java/org/jruby/truffle/runtime/rope/AsciiOnlyLeafRope.java
  126. +89 −0 truffle/src/main/java/org/jruby/truffle/runtime/rope/ConcatRope.java
  127. +22 −0 truffle/src/main/java/org/jruby/truffle/runtime/rope/InvalidLeafRope.java
  128. +45 −0 truffle/src/main/java/org/jruby/truffle/runtime/rope/LeafRope.java
  129. +145 −0 truffle/src/main/java/org/jruby/truffle/runtime/rope/Rope.java
  130. +368 −0 truffle/src/main/java/org/jruby/truffle/runtime/rope/RopeOperations.java
  131. +51 −0 truffle/src/main/java/org/jruby/truffle/runtime/rope/SubstringRope.java
  132. +22 −0 truffle/src/main/java/org/jruby/truffle/runtime/rope/ValidLeafRope.java
  133. +16 −7 truffle/src/main/java/org/jruby/truffle/translator/BodyTranslator.java
  134. +1 −0 truffle/src/main/ruby/core.rb
  135. +19 −0 truffle/src/main/ruby/core/rubinius/api/shims/string_mirror.rb
  136. +5 −0 truffle/src/main/ruby/core/rubinius/bootstrap/string.rb
  137. +0 −33 truffle/src/main/ruby/core/shims.rb
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.0.5.0
9.1.0.0-SNAPSHOT
2 changes: 1 addition & 1 deletion bin/jruby.bash
Original file line number Diff line number Diff line change
@@ -383,7 +383,7 @@ if [ "$VERIFY_JRUBY" != "" ]; then
"-Djruby.home=$JRUBY_HOME" \
"-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
"-Djruby.shell=$JRUBY_SHELL" \
$java_class $JRUBY_OPTS "$@"
$java_class $mode "$@"

# Record the exit status immediately, or it will be overridden.
JRUBY_STATUS=$?
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ DO NOT MODIFIY - GENERATED CODE
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-parent</artifactId>
<version>9.0.5.0</version>
<version>9.1.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-core</artifactId>
<name>JRuby Core</name>
127 changes: 127 additions & 0 deletions core/src/main/java/org/jruby/ReifiedRubyObject.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/*
***** BEGIN LICENSE BLOCK *****
* Version: EPL 1.0/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Eclipse Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.eclipse.org/legal/epl-v10.html
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the EPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the EPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
package org.jruby;

/**
* A RubyObject that provides a direct field for up to ten stored variables, to avoid
* the overhead of creating and managing a separate array and reference.
*/
public abstract class ReifiedRubyObject extends RubyObject {
public ReifiedRubyObject(Ruby runtime, RubyClass metaClass) {
super(runtime, metaClass);
}

@Override
public Object getVariable(int i) {
return super.getVariable(i);
}

@Override
public void setVariable(int index, Object value) {
super.setVariable(index, value);
}

public Object getVariable0() {
return getVariable(0);
}

public Object getVariable1() {
return getVariable(1);
}

public Object getVariable2() {
return getVariable(2);
}

public Object getVariable3() {
return getVariable(3);
}

public Object getVariable4() {
return getVariable(4);
}

public Object getVariable5() {
return getVariable(5);
}

public Object getVariable6() {
return getVariable(6);
}

public Object getVariable7() {
return getVariable(7);
}

public Object getVariable8() {
return getVariable(8);
}

public Object getVariable9() {
return getVariable(9);
}

public void setVariable0(Object value) {
setVariable(0, value);
}

public void setVariable1(Object value) {
setVariable(1, value);
}

public void setVariable2(Object value) {
setVariable(2, value);
}

public void setVariable3(Object value) {
setVariable(3, value);
}

public void setVariable4(Object value) {
setVariable(4, value);
}

public void setVariable5(Object value) {
setVariable(5, value);
}

public void setVariable6(Object value) {
setVariable(6, value);
}

public void setVariable7(Object value) {
setVariable(7, value);
}

public void setVariable8(Object value) {
setVariable(8, value);
}

public void setVariable9(Object value) {
setVariable(9, value);
}
}
31 changes: 26 additions & 5 deletions core/src/main/java/org/jruby/RubyObjectVar0.java
Original file line number Diff line number Diff line change
@@ -30,18 +30,39 @@
* A RubyObject that provides a direct field for one stored variable, to avoid
* the overhead of creating and managing a separate array and reference.
*/
public class RubyObjectVar0 extends RubyObject {
public class RubyObjectVar0 extends ReifiedRubyObject {
/**
* Standard path for object creation. Objects are entered into ObjectSpace
* only if ObjectSpace is enabled.
*/
public RubyObjectVar0(Ruby runtime, RubyClass metaClass) {
super(runtime, metaClass);
}

public static void setVariableChecked(RubyObjectVar0 self, Object value) {
self.ensureInstanceVariablesSettable();
self.var0 = value;

@Override
public Object getVariable(int i) {
switch (i) {
case 0: return var0;
default: return super.getVariable(i);
}
}

@Override
public void setVariable(int index, Object value) {
ensureInstanceVariablesSettable();
switch (index) {
case 0: var0 = value; break;
default: super.setVariable(index, value);
}
}

public Object getVariable0() {
return var0;
}

public void setVariable0(Object value) {
ensureInstanceVariablesSettable();
var0 = value;
}

public Object var0;
44 changes: 38 additions & 6 deletions core/src/main/java/org/jruby/RubyObjectVar1.java
Original file line number Diff line number Diff line change
@@ -30,19 +30,51 @@
* A RubyObject that provides a direct field for two stored variables, to avoid
* the overhead of creating and managing a separate array and reference.
*/
public class RubyObjectVar1 extends RubyObjectVar0 {
public class RubyObjectVar1 extends ReifiedRubyObject {
/**
* Standard path for object creation. Objects are entered into ObjectSpace
* only if ObjectSpace is enabled.
*/
public RubyObjectVar1(Ruby runtime, RubyClass metaClass) {
super(runtime, metaClass);
}

public static void setVariableChecked(RubyObjectVar1 self, Object value) {
self.ensureInstanceVariablesSettable();
self.var1 = value;

public Object getVariable(int i) {
switch (i) {
case 0: return var0;
case 1: return var1;
default: return super.getVariable(i);
}
}

@Override
public void setVariable(int index, Object value) {
ensureInstanceVariablesSettable();
switch (index) {
case 0: var0 = value; break;
case 1: var1 = value; break;
default: super.setVariable(index, value);
}
}

public Object getVariable0() {
return var0;
}

public Object getVariable1() {
return var1;
}

public void setVariable0(Object value) {
ensureInstanceVariablesSettable();
var0 = value;
}


public void setVariable1(Object value) {
ensureInstanceVariablesSettable();
var1 = value;
}

public Object var0;
public Object var1;
}
56 changes: 50 additions & 6 deletions core/src/main/java/org/jruby/RubyObjectVar2.java
Original file line number Diff line number Diff line change
@@ -30,19 +30,63 @@
* A RubyObject that provides a direct field for three stored variables, to avoid
* the overhead of creating and managing a separate array and reference.
*/
public class RubyObjectVar2 extends RubyObjectVar1 {
public class RubyObjectVar2 extends ReifiedRubyObject {
/**
* Standard path for object creation. Objects are entered into ObjectSpace
* only if ObjectSpace is enabled.
*/
public RubyObjectVar2(Ruby runtime, RubyClass metaClass) {
super(runtime, metaClass);
}

public static void setVariableChecked(RubyObjectVar2 self, Object value) {
self.ensureInstanceVariablesSettable();
self.var2 = value;

public Object getVariable(int i) {
switch (i) {
case 0: return var0;
case 1: return var1;
case 2: return var2;
default: return super.getVariable(i);
}
}

@Override
public void setVariable(int index, Object value) {
ensureInstanceVariablesSettable();
switch (index) {
case 0: var0 = value; break;
case 1: var1 = value; break;
case 2: var2 = value; break;
default: super.setVariable(index, value);
}
}

public Object getVariable0() {
return var0;
}

public Object getVariable1() {
return var1;
}

public Object getVariable2() {
return var2;
}

public void setVariable0(Object value) {
ensureInstanceVariablesSettable();
var0 = value;
}

public void setVariable1(Object value) {
ensureInstanceVariablesSettable();
var1 = value;
}

public void setVariable2(Object value) {
ensureInstanceVariablesSettable();
var2 = value;
}


public Object var0;
public Object var1;
public Object var2;
}
Loading