Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move RuntimeHelpers to org.jruby.runtime.Helpers.

  • Loading branch information...
commit bb98e4b8decffc0361b70a6c99c1ade5fed0abcb 1 parent 7db296c
@headius headius authored
Showing with 3,523 additions and 3,644 deletions.
  1. +4 −4 lib/ruby/shared/jruby/compiler/java_class.rb
  2. +1 −1  lib/ruby/shared/jruby/core_ext/method.rb
  3. +2 −2 lib/ruby/shared/jruby/ext.rb
  4. +1 −1  samples/jrubyc_java/annotated.rb
  5. +3 −3 samples/jrubyc_java/overloads.rb
  6. +3 −3 samples/jrubyc_java/simple_junit.rb
  7. +3 −3 spec/java_integration/jrubyc/java/constructor_spec.rb
  8. +13 −13 spec/java_integration/jrubyc/java/method_spec.rb
  9. +13 −12 src/org/jruby/BasicObjectStub.java
  10. +6 −19 src/org/jruby/Ruby.java
  11. +22 −23 src/org/jruby/RubyArray.java
  12. +17 −17 src/org/jruby/RubyBasicObject.java
  13. +23 −23 src/org/jruby/RubyClass.java
  14. +1 −1  src/org/jruby/RubyComparable.java
  15. +1 −1  src/org/jruby/RubyComplex.java
  16. +16 −23 src/org/jruby/RubyEnumerable.java
  17. +4 −6 src/org/jruby/RubyEnumerator.java
  18. +1 −1  src/org/jruby/RubyFloat.java
  19. +7 −7 src/org/jruby/RubyGlobal.java
  20. +7 −7 src/org/jruby/RubyHash.java
  21. +3 −3 src/org/jruby/RubyIO.java
  22. +11 −11 src/org/jruby/RubyKernel.java
  23. +3 −3 src/org/jruby/RubyModule.java
  24. +5 −5 src/org/jruby/RubyNumeric.java
  25. +8 −8 src/org/jruby/RubyObject.java
  26. +4 −5 src/org/jruby/RubyProc.java
  27. +1 −1  src/org/jruby/RubyProcess.java
  28. +7 −7 src/org/jruby/RubyRandom.java
  29. +6 −7 src/org/jruby/RubyRange.java
  30. +1 −2  src/org/jruby/RubyRational.java
  31. +4 −5 src/org/jruby/RubyString.java
  32. +6 −6 src/org/jruby/RubyStruct.java
  33. +0 −2  src/org/jruby/RubySymbol.java
  34. +1 −1  src/org/jruby/RubyTime.java
  35. +4 −4 src/org/jruby/ast/AliasNode.java
  36. +2 −3 src/org/jruby/ast/ArgsCatNode.java
  37. +2 −5 src/org/jruby/ast/ArgsNode.java
  38. +5 −6 src/org/jruby/ast/AttrAssignNode.java
  39. +2 −2 src/org/jruby/ast/BreakNode.java
  40. +2 −2 src/org/jruby/ast/CallManyArgsBlockNode.java
  41. +2 −2 src/org/jruby/ast/CallManyArgsBlockPassNode.java
  42. +2 −2 src/org/jruby/ast/CallNoArgBlockNode.java
  43. +2 −2 src/org/jruby/ast/CallNoArgBlockPassNode.java
  44. +2 −6 src/org/jruby/ast/CallNoArgNode.java
  45. +3 −4 src/org/jruby/ast/CallNode.java
  46. +2 −2 src/org/jruby/ast/CallOneArgBlockNode.java
  47. +2 −2 src/org/jruby/ast/CallOneArgBlockPassNode.java
  48. +2 −2 src/org/jruby/ast/CallSpecialArgBlockNode.java
  49. +2 −2 src/org/jruby/ast/CallSpecialArgBlockPassNode.java
  50. +2 −2 src/org/jruby/ast/CallThreeArgBlockNode.java
  51. +2 −2 src/org/jruby/ast/CallThreeArgBlockPassNode.java
  52. +2 −2 src/org/jruby/ast/CallTwoArgBlockNode.java
  53. +2 −2 src/org/jruby/ast/CallTwoArgBlockPassNode.java
  54. +3 −4 src/org/jruby/ast/Colon2ConstNode.java
  55. +2 −3 src/org/jruby/ast/Colon2MethodNode.java
  56. +2 −2 src/org/jruby/ast/Colon2Node.java
  57. +3 −3 src/org/jruby/ast/ConstDeclNode.java
  58. +3 −7 src/org/jruby/ast/DNode.java
  59. +2 −2 src/org/jruby/ast/FCallManyArgsBlockNode.java
  60. +2 −2 src/org/jruby/ast/FCallManyArgsBlockPassNode.java
  61. +2 −2 src/org/jruby/ast/FCallNoArgBlockNode.java
  62. +2 −2 src/org/jruby/ast/FCallNoArgBlockPassNode.java
  63. +2 −2 src/org/jruby/ast/FCallOneArgBlockNode.java
  64. +2 −2 src/org/jruby/ast/FCallOneArgBlockPassNode.java
  65. +2 −2 src/org/jruby/ast/FCallSpecialArgBlockNode.java
  66. +2 −2 src/org/jruby/ast/FCallSpecialArgBlockPassNode.java
  67. +2 −2 src/org/jruby/ast/FCallThreeArgBlockNode.java
  68. +2 −2 src/org/jruby/ast/FCallThreeArgBlockPassNode.java
  69. +2 −2 src/org/jruby/ast/FCallTwoArgBlockNode.java
  70. +2 −2 src/org/jruby/ast/FCallTwoArgBlockPassNode.java
  71. +2 −2 src/org/jruby/ast/Match2CaptureNode.java
  72. +2 −3 src/org/jruby/ast/NotNode.java
  73. +3 −5 src/org/jruby/ast/RescueNode.java
  74. +2 −4 src/org/jruby/ast/SClassNode.java
  75. +2 −2 src/org/jruby/ast/SValue19Node.java
  76. +2 −2 src/org/jruby/ast/SValueNode.java
  77. +2 −2 src/org/jruby/ast/Splat19Node.java
  78. +2 −2 src/org/jruby/ast/SplatNode.java
  79. +2 −3 src/org/jruby/ast/SuperNode.java
  80. +2 −2 src/org/jruby/ast/ToAryNode.java
  81. +2 −2 src/org/jruby/ast/UndefNode.java
  82. +2 −2 src/org/jruby/ast/UntilNode.java
  83. +2 −2 src/org/jruby/ast/WhenNode.java
  84. +2 −2 src/org/jruby/ast/WhileNode.java
  85. +2 −2 src/org/jruby/ast/Yield19Node.java
  86. +2 −4 src/org/jruby/ast/YieldNode.java
  87. +2 −3 src/org/jruby/ast/ZSuperNode.java
  88. +7 −7 src/org/jruby/ast/executable/RuntimeCache.java
  89. +6 −6 src/org/jruby/cext/JRuby.java
  90. +3 −12 src/org/jruby/compiler/ASTCompiler.java
  91. +3 −3 src/org/jruby/compiler/ASTCompiler19.java
  92. +7 −7 src/org/jruby/compiler/impl/AbstractVariableCompiler.java
  93. +11 −13 src/org/jruby/compiler/impl/BaseBodyCompiler.java
  94. +6 −6 src/org/jruby/compiler/impl/InheritedCacheCompiler.java
  95. +7 −8 src/org/jruby/compiler/impl/InvokeDynamicCacheCompiler.java
  96. +9 −11 src/org/jruby/compiler/impl/StandardASMCompiler.java
  97. +6 −6 src/org/jruby/embed/internal/EmbedRubyObjectAdapterImpl.java
  98. +2 −3 src/org/jruby/evaluator/ASTInterpreter.java
  99. +3 −5 src/org/jruby/exceptions/RaiseException.java
  100. +2 −4 src/org/jruby/ext/jruby/JRubyLibrary.java
  101. +2 −3 src/org/jruby/ext/openssl/SSLContext.java
  102. +1 −10 src/org/jruby/ext/psych/PsychParser.java
  103. +2 −2 src/org/jruby/ext/rbconfig/RbConfigLibrary.java
  104. +7 −7 src/org/jruby/ext/ripper/RipperParser.java
  105. +3 −3 src/org/jruby/ext/socket/RubyUNIXServer.java
  106. +3 −3 src/org/jruby/ext/socket/RubyUNIXSocket.java
  107. +3 −4 src/org/jruby/ext/timeout/Timeout.java
  108. +2 −2 src/org/jruby/ext/weakref/WeakRef.java
  109. +3 −3 src/org/jruby/ext/zlib/JZlibRubyGzipReader.java
  110. +3 −3 src/org/jruby/ext/zlib/JZlibRubyGzipWriter.java
  111. +0 −6 src/org/jruby/internal/runtime/methods/CompiledIRMethod.java
  112. +2 −2 src/org/jruby/ir/IRBuilder19.java
  113. +2 −2 src/org/jruby/ir/instructions/AttrAssignInstr.java
  114. +2 −2 src/org/jruby/ir/instructions/CallInstr.java
  115. +2 −2 src/org/jruby/ir/instructions/ClassSuperInstr.java
  116. +2 −2 src/org/jruby/ir/instructions/DefineMetaClassInstr.java
  117. +2 −2 src/org/jruby/ir/instructions/InstanceSuperInstr.java
  118. +1 −1  src/org/jruby/ir/instructions/RescueEQQInstr.java
  119. +2 −2 src/org/jruby/ir/instructions/ToAryInstr.java
  120. +2 −2 src/org/jruby/ir/instructions/UndefMethodInstr.java
  121. +3 −3 src/org/jruby/ir/instructions/UnresolvedSuperInstr.java
  122. +2 −2 src/org/jruby/ir/instructions/calladapter/AttrAssignCallAdapter.java
  123. +2 −2 src/org/jruby/ir/instructions/defined/BackrefIsMatchDataInstr.java
  124. +2 −2 src/org/jruby/ir/instructions/defined/GetBackrefInstr.java
  125. +2 −3 src/org/jruby/ir/instructions/defined/GetDefinedConstantOrMethodInstr.java
  126. +2 −3 src/org/jruby/ir/instructions/defined/MethodDefinedInstr.java
  127. +2 −2 src/org/jruby/ir/instructions/defined/SuperMethodBoundInstr.java
  128. +2 −2 src/org/jruby/ir/instructions/specialized/OneArgOperandAttrAssignInstr.java
  129. +2 −2 src/org/jruby/ir/operands/CompoundArray.java
  130. +2 −2 src/org/jruby/ir/operands/Splat.java
  131. +2 −2 src/org/jruby/ir/targets/Bootstrap.java
  132. +3 −3 src/org/jruby/ir/targets/IRBytecodeAdapter.java
  133. +10 −12 src/org/jruby/ir/targets/JVMVisitor.java
  134. +2 −2 src/org/jruby/java/addons/KernelJavaAddons.java
  135. +12 −12 src/org/jruby/java/proxies/JavaInterfaceTemplate.java
  136. +9 −9 src/org/jruby/java/proxies/JavaProxy.java
  137. +4 −4 src/org/jruby/java/util/ArrayUtils.java
  138. +7 −9 src/org/jruby/javasupport/Java.java
  139. +3 −8 src/org/jruby/javasupport/JavaClass.java
  140. +3 −3 src/org/jruby/javasupport/JavaEmbedUtils.java
  141. +2 −2 src/org/jruby/javasupport/JavaUtil.java
  142. +3 −3 src/org/jruby/javasupport/proxy/JavaProxyConstructor.java
  143. +3 −2,868 src/org/jruby/javasupport/util/RuntimeHelpers.java
  144. +3 −4 src/org/jruby/runtime/CompiledBlock19.java
  145. +2,852 −0 src/org/jruby/runtime/Helpers.java
  146. +7 −8 src/org/jruby/runtime/Interpreted19Block.java
  147. +2 −3 src/org/jruby/runtime/InterpretedIRBlockBody.java
  148. +2 −3 src/org/jruby/runtime/InterpretedIRBlockBody19.java
  149. +7 −7 src/org/jruby/runtime/assigner/Pre0Rest0Post0BlockAssigner.java
  150. +7 −7 src/org/jruby/runtime/assigner/Pre0Rest1Post0BlockAssigner.java
  151. +6 −6 src/org/jruby/runtime/assigner/Pre1ExpandedRest0Post0BlockAssigner.java
  152. +5 −5 src/org/jruby/runtime/assigner/Pre1Rest0Post0BlockAssigner.java
  153. +7 −7 src/org/jruby/runtime/assigner/Pre1Rest1Post0BlockAssigner.java
  154. +5 −5 src/org/jruby/runtime/assigner/Pre2Rest0Post0BlockAssigner.java
  155. +7 −7 src/org/jruby/runtime/assigner/Pre2Rest1Post0BlockAssigner.java
  156. +5 −5 src/org/jruby/runtime/assigner/Pre3Rest0Post0BlockAssigner.java
  157. +7 −7 src/org/jruby/runtime/assigner/Pre3Rest1Post0BlockAssigner.java
  158. +7 −7 src/org/jruby/runtime/assigner/PreManyRest0Post0BlockAssigner.java
  159. +7 −7 src/org/jruby/runtime/assigner/PreManyRest1Post0BlockAssigner.java
  160. +11 −11 src/org/jruby/runtime/callsite/CachingCallSite.java
  161. +12 −12 src/org/jruby/runtime/callsite/SuperCallSite.java
  162. +17 −17 src/org/jruby/runtime/invokedynamic/InvokeDynamicSupport.java
  163. +1 −1  src/org/jruby/runtime/invokedynamic/MethodNames.java
  164. +3 −5 src/org/jruby/runtime/marshal/UnmarshalStream.java
  165. +2 −2 src/org/jruby/runtime/scope/FourVarDynamicScope.java
  166. +2 −2 src/org/jruby/runtime/scope/ManyVarsDynamicScope.java
  167. +2 −2 src/org/jruby/runtime/scope/OneVarDynamicScope.java
  168. +2 −2 src/org/jruby/runtime/scope/SharedBindingDynamicScope.java
  169. +2 −2 src/org/jruby/runtime/scope/ThreeVarDynamicScope.java
  170. +2 −2 src/org/jruby/runtime/scope/TwoVarDynamicScope.java
  171. +1 −1  src/org/jruby/util/Numeric.java
  172. +1 −1  src/org/jruby/util/RecursiveComparator.java
  173. +3 −5 src/org/jruby/util/ShellLauncher.java
View
8 lib/ruby/shared/jruby/compiler/java_class.rb
@@ -279,7 +279,7 @@ class RubyScript
BASE_IMPORTS = [
"org.jruby.Ruby",
"org.jruby.RubyObject",
- "org.jruby.javasupport.util.RuntimeHelpers",
+ "org.jruby.runtime.Helpers",
"org.jruby.runtime.builtin.IRubyObject",
"org.jruby.javasupport.JavaUtil",
"org.jruby.RubyClass"
@@ -446,7 +446,7 @@ def constructor_string
*/
public #{name}() {
this(__ruby__, __metaclass__);
- RuntimeHelpers.invoke(__ruby__.getCurrentContext(), this, "initialize");
+ Helpers.invoke(__ruby__.getCurrentContext(), this, "initialize");
}
JAVA
end
@@ -508,7 +508,7 @@ def to_s
declarator_string do
<<-JAVA
#{conversion_string(var_names)}
- IRubyObject ruby_result = RuntimeHelpers.invoke(__ruby__.getCurrentContext(), #{static ? '__metaclass__' : 'this'}, \"#{name}\"#{passed_args});
+ IRubyObject ruby_result = Helpers.invoke(__ruby__.getCurrentContext(), #{static ? '__metaclass__' : 'this'}, \"#{name}\"#{passed_args});
#{return_string}
JAVA
end
@@ -660,7 +660,7 @@ def to_s
<<-JAVA
this(__ruby__, __metaclass__);
#{conversion_string(var_names)}
- RuntimeHelpers.invoke(__ruby__.getCurrentContext(), this, \"initialize\"#{passed_args});
+ Helpers.invoke(__ruby__.getCurrentContext(), this, \"initialize\"#{passed_args});
JAVA
end
end
View
2  lib/ruby/shared/jruby/core_ext/method.rb
@@ -8,7 +8,7 @@ def parameters
case method
when MethodArgs2
- return RuntimeHelpers.parameter_list_to_parameters(JRuby.runtime, method.parameter_list, true)
+ return Helpers.parameter_list_to_parameters(JRuby.runtime, method.parameter_list, true)
when MethodArgs
args_node = method.args_node
View
4 lib/ruby/shared/jruby/ext.rb
@@ -5,7 +5,7 @@ module JRuby
MethodArgs = org.jruby.internal.runtime.methods.MethodArgs
MethodArgs2 = org.jruby.internal.runtime.methods.MethodArgs2
IRMethodArgs = org.jruby.internal.runtime.methods.IRMethodArgs
- RuntimeHelpers = org.jruby.javasupport.util.RuntimeHelpers
+ Helpers = org.jruby.runtime.Helpers
MultipleAsgn19Node = org.jruby.ast.MultipleAsgn19Node
UnnamedRestArgNode = org.jruby.ast.UnnamedRestArgNode
Arity = org.jruby.runtime.Arity
@@ -57,7 +57,7 @@ def args
case method
when MethodArgs2
- return RuntimeHelpers.parameter_list_to_parameters(JRuby.runtime, method.parameter_list, true)
+ return Helpers.parameter_list_to_parameters(JRuby.runtime, method.parameter_list, true)
when IRMethodArgs
arg_desc = method.parameter_list
for a in arg_desc
View
2  samples/jrubyc_java/annotated.rb
@@ -9,7 +9,7 @@ class DeprecatedClass
=begin
import org.jruby.Ruby;
import org.jruby.RubyObject;
-import org.jruby.javasupport.util.RuntimeHelpers;
+import org.jruby.runtime.Helpers;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.javasupport.JavaUtil;
import org.jruby.RubyClass;
View
6 samples/jrubyc_java/overloads.rb
@@ -19,7 +19,7 @@ def run2(a); end
~/projects/jruby/samples/jrubyc_java ➔ cat OverloadedClass.java
import org.jruby.Ruby;
import org.jruby.RubyObject;
-import org.jruby.javasupport.util.RuntimeHelpers;
+import org.jruby.runtime.Helpers;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.javasupport.JavaUtil;
import org.jruby.RubyClass;
@@ -41,7 +41,7 @@ def run2(a); end
public void run(String a) {
IRubyObject ruby_a = JavaUtil.convertJavaToRuby(__ruby__, a);
- IRubyObject ruby_result = RuntimeHelpers.invoke(__ruby__.getCurrentContext(), this, "run1" ,ruby_a);
+ IRubyObject ruby_result = Helpers.invoke(__ruby__.getCurrentContext(), this, "run1" ,ruby_a);
}
@@ -49,7 +49,7 @@ def run2(a); end
public void run(int a) {
IRubyObject ruby_a = JavaUtil.convertJavaToRuby(__ruby__, a);
- IRubyObject ruby_result = RuntimeHelpers.invoke(__ruby__.getCurrentContext(), this, "run2" ,ruby_a);
+ IRubyObject ruby_result = Helpers.invoke(__ruby__.getCurrentContext(), this, "run2" ,ruby_a);
}
View
6 samples/jrubyc_java/simple_junit.rb
@@ -21,7 +21,7 @@ def test_jruby_will_never_support_annotations
~/projects/jruby/samples/compiler2 ➔ cat TestSomething.java
import org.jruby.Ruby;
import org.jruby.RubyObject;
-import org.jruby.javasupport.util.RuntimeHelpers;
+import org.jruby.runtime.Helpers;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.javasupport.JavaUtil;
import org.jruby.RubyClass;
@@ -43,7 +43,7 @@ def test_jruby_will_never_support_annotations
@org.junit.Test()
public Object test_jruby_rocks() {
- IRubyObject ruby_result = RuntimeHelpers.invoke(__ruby__.getCurrentContext(), this, "test_jruby_rocks" );
+ IRubyObject ruby_result = Helpers.invoke(__ruby__.getCurrentContext(), this, "test_jruby_rocks" );
return (Object)ruby_result.toJava(Object.class);
}
@@ -51,7 +51,7 @@ def test_jruby_will_never_support_annotations
@org.junit.Test()
public Object test_jruby_will_never_support_annotations() {
- IRubyObject ruby_result = RuntimeHelpers.invoke(__ruby__.getCurrentContext(), this, "test_jruby_will_never_support_annotations" );
+ IRubyObject ruby_result = Helpers.invoke(__ruby__.getCurrentContext(), this, "test_jruby_will_never_support_annotations" );
return (Object)ruby_result.toJava(Object.class);
}
View
6 spec/java_integration/jrubyc/java/constructor_spec.rb
@@ -10,11 +10,11 @@ def generate(script)
end
EMPTY_INITIALIZE_PATTERN =
- /public\s+Foo\(\) {\s+this\(__ruby__, __metaclass__\);\s+RuntimeHelpers.invoke\(.*, this, "initialize"\);/
+ /public\s+Foo\(\) {\s+this\(__ruby__, __metaclass__\);\s+Helpers.invoke\(.*, this, "initialize"\);/
OBJECT_INITIALIZE_PATTERN =
- /public\s+Foo\(Object \w+\) {\s+this\(__ruby__, __metaclass__\);\s+IRubyObject \w+ = JavaUtil.convertJavaToRuby\(__ruby__, \w+\);\s+RuntimeHelpers.invoke\(.*, this, "initialize", .*\);/
+ /public\s+Foo\(Object \w+\) {\s+this\(__ruby__, __metaclass__\);\s+IRubyObject \w+ = JavaUtil.convertJavaToRuby\(__ruby__, \w+\);\s+Helpers.invoke\(.*, this, "initialize", .*\);/
STRING_INITIALIZE_PATTERN =
- /public\s+Foo\(String \w+\) {\s+this\(__ruby__, __metaclass__\);\s+IRubyObject \w+ = JavaUtil.convertJavaToRuby\(__ruby__, \w+\);\s+RuntimeHelpers.invoke\(.*, this, "initialize", .*\);/
+ /public\s+Foo\(String \w+\) {\s+this\(__ruby__, __metaclass__\);\s+IRubyObject \w+ = JavaUtil.convertJavaToRuby\(__ruby__, \w+\);\s+Helpers.invoke\(.*, this, "initialize", .*\);/
describe "with no initialize method" do
it "generates a default constructor" do
View
26 spec/java_integration/jrubyc/java/method_spec.rb
@@ -10,31 +10,31 @@ def generate(script)
end
OBJECT_VOID_BAR_PATTERN =
- /public *(.*) *Object bar\(\) {\s+.*IRubyObject ruby_result = RuntimeHelpers\.invoke\(.*, this, "bar"\);\s+return \(Object\)ruby_result\.toJava\(Object\.class\);/
+ /public *(.*) *Object bar\(\) {\s+.*IRubyObject ruby_result = Helpers\.invoke\(.*, this, "bar"\);\s+return \(Object\)ruby_result\.toJava\(Object\.class\);/
OBJECT_OBJECT_BAR_PATTERN =
- /public *(.*) *Object bar\(Object \w+\) {\s+IRubyObject \S+ = JavaUtil\.convertJavaToRuby\(__ruby__, \S+\);\s+IRubyObject ruby_result = RuntimeHelpers\.invoke\(.*, this, "bar", .*\);\s+return \(Object\)ruby_result\.toJava\(Object\.class\);/
+ /public *(.*) *Object bar\(Object \w+\) {\s+IRubyObject \S+ = JavaUtil\.convertJavaToRuby\(__ruby__, \S+\);\s+IRubyObject ruby_result = Helpers\.invoke\(.*, this, "bar", .*\);\s+return \(Object\)ruby_result\.toJava\(Object\.class\);/
BYTE_VOID_BAR_PATTERN =
- /public *(.*) *byte bar_byte\(\) {\s+.*IRubyObject ruby_result = RuntimeHelpers\.invoke\(.*, this, "bar_byte"\);\s+return \(Byte\)ruby_result\.toJava\(byte\.class\);/
+ /public *(.*) *byte bar_byte\(\) {\s+.*IRubyObject ruby_result = Helpers\.invoke\(.*, this, "bar_byte"\);\s+return \(Byte\)ruby_result\.toJava\(byte\.class\);/
SHORT_VOID_BAR_PATTERN =
- /public *(.*) *short bar_short\(\) {\s+.*IRubyObject ruby_result = RuntimeHelpers\.invoke\(.*, this, "bar_short"\);\s+return \(Short\)ruby_result\.toJava\(short\.class\);/
+ /public *(.*) *short bar_short\(\) {\s+.*IRubyObject ruby_result = Helpers\.invoke\(.*, this, "bar_short"\);\s+return \(Short\)ruby_result\.toJava\(short\.class\);/
CHAR_VOID_BAR_PATTERN =
- /public *(.*) *char bar_char\(\) {\s+.*IRubyObject ruby_result = RuntimeHelpers\.invoke\(.*, this, "bar_char"\);\s+return \(Character\)ruby_result\.toJava\(char\.class\);/
+ /public *(.*) *char bar_char\(\) {\s+.*IRubyObject ruby_result = Helpers\.invoke\(.*, this, "bar_char"\);\s+return \(Character\)ruby_result\.toJava\(char\.class\);/
INT_VOID_BAR_PATTERN =
- /public *(.*) *int bar_int\(\) {\s+.*IRubyObject ruby_result = RuntimeHelpers\.invoke\(.*, this, "bar_int"\);\s+return \(Integer\)ruby_result\.toJava\(int\.class\);/
+ /public *(.*) *int bar_int\(\) {\s+.*IRubyObject ruby_result = Helpers\.invoke\(.*, this, "bar_int"\);\s+return \(Integer\)ruby_result\.toJava\(int\.class\);/
LONG_VOID_BAR_PATTERN =
- /public *(.*) *long bar_long\(\) {\s+.*IRubyObject ruby_result = RuntimeHelpers\.invoke\(.*, this, "bar_long"\);\s+return \(Long\)ruby_result\.toJava\(long\.class\);/
+ /public *(.*) *long bar_long\(\) {\s+.*IRubyObject ruby_result = Helpers\.invoke\(.*, this, "bar_long"\);\s+return \(Long\)ruby_result\.toJava\(long\.class\);/
FLOAT_VOID_BAR_PATTERN =
- /public *(.*) *float bar_float\(\) {\s+.*IRubyObject ruby_result = RuntimeHelpers\.invoke\(.*, this, "bar_float"\);\s+return \(Float\)ruby_result\.toJava\(float\.class\);/
+ /public *(.*) *float bar_float\(\) {\s+.*IRubyObject ruby_result = Helpers\.invoke\(.*, this, "bar_float"\);\s+return \(Float\)ruby_result\.toJava\(float\.class\);/
DOUBLE_VOID_BAR_PATTERN =
- /public *(.*) *double bar_double\(\) {\s+.*IRubyObject ruby_result = RuntimeHelpers\.invoke\(.*, this, "bar_double"\);\s+return \(Double\)ruby_result\.toJava\(double\.class\);/
+ /public *(.*) *double bar_double\(\) {\s+.*IRubyObject ruby_result = Helpers\.invoke\(.*, this, "bar_double"\);\s+return \(Double\)ruby_result\.toJava\(double\.class\);/
BOOLEAN_VOID_BAR_PATTERN =
- /public *(.*) *boolean bar_boolean\(\) {\s+.*IRubyObject ruby_result = RuntimeHelpers\.invoke\(.*, this, "bar_boolean"\);\s+return \(Boolean\)ruby_result\.toJava\(boolean\.class\);/
+ /public *(.*) *boolean bar_boolean\(\) {\s+.*IRubyObject ruby_result = Helpers\.invoke\(.*, this, "bar_boolean"\);\s+return \(Boolean\)ruby_result\.toJava\(boolean\.class\);/
VOID_STRING_BAR_PATTERN =
- /public *(.*) *void bar\(String \w+\) {\s+IRubyObject \S+ = JavaUtil\.convertJavaToRuby\(__ruby__, \S+\);\s+IRubyObject ruby_result = RuntimeHelpers\.invoke\(.*, this, "bar\S*", .*\);\s+return;/
+ /public *(.*) *void bar\(String \w+\) {\s+IRubyObject \S+ = JavaUtil\.convertJavaToRuby\(__ruby__, \S+\);\s+IRubyObject ruby_result = Helpers\.invoke\(.*, this, "bar\S*", .*\);\s+return;/
VOID_INT_BAR_PATTERN =
- /public *(.*) *void bar\(int \w+\) {\s+IRubyObject \S+ = JavaUtil\.convertJavaToRuby\(__ruby__, \S+\);\s+IRubyObject ruby_result = RuntimeHelpers\.invoke\(.*, this, "bar\S*", .*\);\s+return;/
+ /public *(.*) *void bar\(int \w+\) {\s+IRubyObject \S+ = JavaUtil\.convertJavaToRuby\(__ruby__, \S+\);\s+IRubyObject ruby_result = Helpers\.invoke\(.*, this, "bar\S*", .*\);\s+return;/
DOUBLE_ARY_VOID_BAR_PATTERN =
- /public *(.*) *double\[\] bar_double_ary\(\) {\s+.*IRubyObject ruby_result = RuntimeHelpers\.invoke\(.*, this, "bar_double_ary"\);\s+return \(double\[\]\)ruby_result\.toJava\(double\[\]\.class\);/
+ /public *(.*) *double\[\] bar_double_ary\(\) {\s+.*IRubyObject ruby_result = Helpers\.invoke\(.*, this, "bar_double_ary"\);\s+return \(double\[\]\)ruby_result\.toJava\(double\[\]\.class\);/
describe "with a method" do
describe "with no java_signature" do
View
25 src/org/jruby/BasicObjectStub.java
@@ -29,7 +29,8 @@
import java.util.Collections;
import java.util.List;
-import org.jruby.javasupport.util.RuntimeHelpers;
+
+import org.jruby.runtime.Helpers;
import org.jruby.runtime.Block;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject;
@@ -37,38 +38,38 @@
import org.jruby.runtime.builtin.InternalVariables;
import org.jruby.runtime.builtin.RubyJavaObject;
import org.jruby.runtime.builtin.Variable;
-import org.jruby.runtime.invokedynamic.MethodNames;
+
import static org.jruby.runtime.invokedynamic.MethodNames.INSPECT;
-import static org.jruby.javasupport.util.RuntimeHelpers.invokedynamic;
+import static org.jruby.runtime.Helpers.invokedynamic;
import org.jruby.util.TypeConverter;
public final class BasicObjectStub {
public static IRubyObject callSuper(IRubyObject self, ThreadContext context, IRubyObject[] args, Block block) {
- return RuntimeHelpers.invokeSuper(context, self, args, block);
+ return Helpers.invokeSuper(context, self, args, block);
}
public static IRubyObject callMethod(IRubyObject self, ThreadContext context, String name) {
- return RuntimeHelpers.invoke(context, self, name);
+ return Helpers.invoke(context, self, name);
}
public static IRubyObject callMethod(IRubyObject self, ThreadContext context, String name, IRubyObject arg) {
- return RuntimeHelpers.invoke(context, self, name, arg);
+ return Helpers.invoke(context, self, name, arg);
}
public static IRubyObject callMethod(IRubyObject self, ThreadContext context, String name, IRubyObject[] args) {
- return RuntimeHelpers.invoke(context, self, name, args);
+ return Helpers.invoke(context, self, name, args);
}
public static IRubyObject callMethod(IRubyObject self, ThreadContext context, String name, IRubyObject[] args, Block block) {
- return RuntimeHelpers.invoke(context, self, name, args, block);
+ return Helpers.invoke(context, self, name, args, block);
}
public static IRubyObject callMethod(IRubyObject self, ThreadContext context, int methodIndex, String name) {
- return RuntimeHelpers.invoke(context, self, name);
+ return Helpers.invoke(context, self, name);
}
public static IRubyObject callMethod(IRubyObject self, ThreadContext context, int methodIndex, String name, IRubyObject arg) {
- return RuntimeHelpers.invoke(context, self, name, arg);
+ return Helpers.invoke(context, self, name, arg);
}
public static boolean isNil(IRubyObject self) {
@@ -149,7 +150,7 @@ public static String asJavaString(IRubyObject self) {
}
public static RubyString asString(IRubyObject self) {
- IRubyObject str = RuntimeHelpers.invoke(getRuntime(self).getCurrentContext(), self, "to_s");
+ IRubyObject str = Helpers.invoke(getRuntime(self).getCurrentContext(), self, "to_s");
if (!(str instanceof RubyString)) return (RubyString)anyToString(self);
if (isTaint(self)) str.setTaint(true);
@@ -240,7 +241,7 @@ public static IRubyObject inspect(IRubyObject self) {
}
}
- return RuntimeHelpers.invoke(runtime.getCurrentContext(), self, "to_s");
+ return Helpers.invoke(runtime.getCurrentContext(), self, "to_s");
}
View
25 src/org/jruby/Ruby.java
@@ -78,7 +78,8 @@
import org.jruby.ir.interpreter.Interpreter;
import org.jruby.ir.targets.JVMVisitor;
import org.jruby.javasupport.JavaSupport;
-import org.jruby.javasupport.util.RuntimeHelpers;
+import org.jruby.runtime.*;
+import org.jruby.runtime.Helpers;
import org.jruby.management.BeanManager;
import org.jruby.management.BeanManagerFactory;
import org.jruby.management.ClassCache;
@@ -90,19 +91,6 @@
import org.jruby.parser.StaticScope;
import org.jruby.parser.StaticScopeFactory;
import org.jruby.platform.Platform;
-import org.jruby.runtime.Binding;
-import org.jruby.runtime.Block;
-import org.jruby.runtime.CallSite;
-import org.jruby.runtime.CallbackFactory;
-import org.jruby.runtime.ClassIndex;
-import org.jruby.runtime.DynamicScope;
-import org.jruby.runtime.EventHook;
-import org.jruby.runtime.GlobalVariable;
-import org.jruby.runtime.IAccessor;
-import org.jruby.runtime.ObjectAllocator;
-import org.jruby.runtime.ObjectSpace;
-import org.jruby.runtime.RubyEvent;
-import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.runtime.encoding.EncodingService;
import org.jruby.runtime.invokedynamic.MethodNames;
@@ -160,7 +148,6 @@
import static org.jruby.internal.runtime.GlobalVariable.Scope.*;
import org.jruby.internal.runtime.methods.CallConfiguration;
import org.jruby.internal.runtime.methods.JavaMethod;
-import org.jruby.runtime.Visibility;
/**
* The Ruby object represents the top-level of a JRuby "instance" in a given VM.
@@ -606,7 +593,7 @@ public IRubyObject runWithGetsLoop(Node scriptNode, boolean printing, boolean pr
// we do pre and post load outside the "body" versions to pre-prepare
// and pre-push the dynamic scope we need for lastline
- RuntimeHelpers.preLoad(context, ((RootNode)scriptNode).getStaticScope().getVariables());
+ Helpers.preLoad(context, ((RootNode) scriptNode).getStaticScope().getVariables());
try {
while (RubyKernel.gets(context, getTopSelf(), IRubyObject.NULL_ARRAY).isTrue()) {
@@ -640,7 +627,7 @@ public IRubyObject runWithGetsLoop(Node scriptNode, boolean printing, boolean pr
}
}
} finally {
- RuntimeHelpers.postLoad(context);
+ Helpers.postLoad(context);
}
return getNil();
@@ -750,10 +737,10 @@ public IRubyObject __file__(ThreadContext context, IRubyObject self, IRubyObject
public IRubyObject load(ThreadContext context, IRubyObject self, boolean wrap) {
try {
- RuntimeHelpers.preLoadCommon(context, staticScope, false);
+ Helpers.preLoadCommon(context, staticScope, false);
return __file__(context, self, IRubyObject.NULL_ARRAY, Block.NULL_BLOCK);
} finally {
- RuntimeHelpers.postLoad(context);
+ Helpers.postLoad(context);
}
}
};
View
45 src/org/jruby/RubyArray.java
@@ -58,7 +58,7 @@
import org.jruby.anno.JRubyMethod;
import org.jruby.common.IRubyWarnings.ID;
import org.jruby.javasupport.JavaUtil;
-import org.jruby.javasupport.util.RuntimeHelpers;
+import org.jruby.runtime.Helpers;
import org.jruby.runtime.Arity;
import org.jruby.runtime.Block;
import org.jruby.runtime.BlockBody;
@@ -80,10 +80,9 @@
import org.jruby.util.RecursiveComparator;
import org.jruby.util.TypeConverter;
-import static org.jruby.javasupport.util.RuntimeHelpers.invokedynamic;
+import static org.jruby.runtime.Helpers.invokedynamic;
import static org.jruby.runtime.invokedynamic.MethodNames.HASH;
import static org.jruby.runtime.invokedynamic.MethodNames.OP_CMP;
-import org.jruby.util.Numeric;
/**
* The implementation of the built-in class Array in Ruby.
@@ -165,13 +164,13 @@ public static final RubyArray newArrayLight(final Ruby runtime, final long len)
public static final RubyArray newArray(final Ruby runtime, final int len) {
RubyArray array = new RubyArray(runtime, len);
- RuntimeHelpers.fillNil(array.values, 0, array.values.length, runtime);
+ Helpers.fillNil(array.values, 0, array.values.length, runtime);
return array;
}
public static final RubyArray newArrayLight(final Ruby runtime, final int len) {
RubyArray array = new RubyArray(runtime, len, false);
- RuntimeHelpers.fillNil(array.values, 0, array.values.length, runtime);
+ Helpers.fillNil(array.values, 0, array.values.length, runtime);
return array;
}
@@ -361,7 +360,7 @@ private RubyArray(Ruby runtime, RubyClass klass, IRubyObject[] vals) {
private void alloc(int length) {
final IRubyObject[] newValues = new IRubyObject[length];
- RuntimeHelpers.fillNil(newValues, getRuntime());
+ Helpers.fillNil(newValues, getRuntime());
values = newValues;
begin = 0;
}
@@ -369,7 +368,7 @@ private void alloc(int length) {
private void realloc(int newLength, int valuesLength) {
IRubyObject[] reallocated = new IRubyObject[newLength];
if (newLength > valuesLength) {
- RuntimeHelpers.fillNil(reallocated, valuesLength, newLength, getRuntime());
+ Helpers.fillNil(reallocated, valuesLength, newLength, getRuntime());
safeArrayCopy(values, begin, reallocated, 0, valuesLength); // elements and trailing nils
} else {
safeArrayCopy(values, begin, reallocated, 0, newLength); // ???
@@ -575,7 +574,7 @@ private IRubyObject initializeCommon(ThreadContext context, IRubyObject arg0, IR
} else {
try {
if (arg1 == null) {
- RuntimeHelpers.fillNil(values, begin, begin + ilen, runtime);
+ Helpers.fillNil(values, begin, begin + ilen, runtime);
} else {
fill(values, begin, begin + ilen, arg1);
}
@@ -865,7 +864,7 @@ private final void splice(long beg, long len, IRubyObject rpl, boolean oneNine)
len = beg + rlen;
if (len >= valuesLength) spliceRealloc((int)len, valuesLength);
try {
- RuntimeHelpers.fillNil(values, begin + realLength, begin + ((int)beg), getRuntime());
+ Helpers.fillNil(values, begin + realLength, begin + ((int) beg), getRuntime());
} catch (ArrayIndexOutOfBoundsException e) {
concurrentModification();
}
@@ -898,7 +897,7 @@ private final void spliceOne(long beg, IRubyObject rpl) {
if (beg >= realLength) {
int len = (int)beg + 1;
if (len >= valuesLength) spliceRealloc((int)len, valuesLength);
- RuntimeHelpers.fillNil(values, begin + realLength, begin + ((int)beg), getRuntime());
+ Helpers.fillNil(values, begin + realLength, begin + ((int) beg), getRuntime());
realLength = (int) len;
} else {
int len = beg > realLength ? realLength - (int)beg : 0;
@@ -921,7 +920,7 @@ private void spliceRealloc(int length, int valuesLength) {
System.arraycopy(values, begin, vals, 0, realLength);
// only fill if there actually will remain trailing storage
- if (len > length) RuntimeHelpers.fillNil(vals, length, len, getRuntime());
+ if (len > length) Helpers.fillNil(vals, length, len, getRuntime());
begin = 0;
values = vals;
}
@@ -1074,7 +1073,7 @@ private final IRubyObject values_at(long olen, IRubyObject[] args) {
result.append(entry(RubyNumeric.num2long(args[i])));
}
- RuntimeHelpers.fillNil(result.values, result.realLength, result.values.length, getRuntime());
+ Helpers.fillNil(result.values, result.realLength, result.values.length, getRuntime());
return result;
}
@@ -1253,7 +1252,7 @@ public IRubyObject unshift(IRubyObject item) {
newLength += valuesLength;
IRubyObject[]vals = new IRubyObject[newLength];
safeArrayCopy(values, begin, vals, 1, valuesLength);
- RuntimeHelpers.fillNil(vals, valuesLength + 1, newLength, getRuntime());
+ Helpers.fillNil(vals, valuesLength + 1, newLength, getRuntime());
values = vals;
begin = 0;
} else {
@@ -1947,7 +1946,7 @@ public IRubyObject op_equal(ThreadContext context, IRubyObject obj) {
if (!obj.respondsTo("to_ary")) {
return runtime.getFalse();
}
- return RuntimeHelpers.rbEqual(context, obj, this);
+ return Helpers.rbEqual(context, obj, this);
}
return RecursiveComparator.compare(context, MethodNames.OP_EQUAL, this, obj);
}
@@ -1960,7 +1959,7 @@ public RubyBoolean compare(ThreadContext context, MethodNames method, IRubyObjec
if (!other.respondsTo("to_ary")) {
return runtime.getFalse();
} else {
- return RuntimeHelpers.rbEqual(context, other, this);
+ return Helpers.rbEqual(context, other, this);
}
}
@@ -2058,7 +2057,7 @@ public IRubyObject rb_clear() {
} else {
try {
begin = 0;
- RuntimeHelpers.fillNil(values, 0, realLength, getRuntime());
+ Helpers.fillNil(values, 0, realLength, getRuntime());
} catch (ArrayIndexOutOfBoundsException e) {
concurrentModification();
}
@@ -2455,7 +2454,7 @@ public IRubyObject selectCommon(ThreadContext context, Block block) {
if (block.yield(context, value).isTrue()) result.append(value);
}
- RuntimeHelpers.fillNil(result.values, result.realLength, result.values.length, runtime);
+ Helpers.fillNil(result.values, result.realLength, result.values.length, runtime);
return result;
}
@@ -2535,7 +2534,7 @@ public IRubyObject delete(ThreadContext context, IRubyObject item, Block block)
final IRubyObject[] myValues = this.values;
try {
if (myRealLength > i2) {
- RuntimeHelpers.fillNil(myValues, myBegin + i2, myBegin + myRealLength, context.runtime);
+ Helpers.fillNil(myValues, myBegin + i2, myBegin + myRealLength, context.runtime);
this.realLength = i2;
int valuesLength = myValues.length - myBegin;
if (i2 << 1 < valuesLength && valuesLength > ARRAY_DEFAULT_SIZE) realloc(i2 << 1, valuesLength);
@@ -2627,7 +2626,7 @@ public IRubyObject rejectBang(ThreadContext context, Block block) {
if (i2 < realLength) {
try {
- RuntimeHelpers.fillNil(values, begin + i2, begin + realLength, context.runtime);
+ Helpers.fillNil(values, begin + i2, begin + realLength, context.runtime);
} catch (ArrayIndexOutOfBoundsException e) {
concurrentModification();
}
@@ -3274,7 +3273,7 @@ public IRubyObject op_diff(IRubyObject other) {
} catch (ArrayIndexOutOfBoundsException aioob) {
concurrentModification();
}
- RuntimeHelpers.fillNil(ary3.values, ary3.realLength, ary3.values.length, getRuntime());
+ Helpers.fillNil(ary3.values, ary3.realLength, ary3.values.length, getRuntime());
return ary3;
}
@@ -3293,7 +3292,7 @@ public IRubyObject op_and(IRubyObject other) {
if (hash.fastDelete(v)) ary3.append(v);
}
- RuntimeHelpers.fillNil(ary3.values, ary3.realLength, ary3.values.length, getRuntime());
+ Helpers.fillNil(ary3.values, ary3.realLength, ary3.values.length, getRuntime());
return ary3;
}
@@ -3317,7 +3316,7 @@ public IRubyObject op_or(IRubyObject other) {
if (set.fastDelete(v)) ary3.append(v);
}
- RuntimeHelpers.fillNil(ary3.values, ary3.realLength, ary3.values.length, getRuntime());
+ Helpers.fillNil(ary3.values, ary3.realLength, ary3.values.length, getRuntime());
return ary3;
}
@@ -3431,7 +3430,7 @@ public IRubyObject sort_by_bang(ThreadContext context, Block block) {
if (!block.isGiven()) return enumeratorize(context.runtime, this, "sort_by!");
modifyCheck();
- RubyArray sorted = RuntimeHelpers.invoke(context, this, "sort_by", block).convertToArray();
+ RubyArray sorted = Helpers.invoke(context, this, "sort_by", block).convertToArray();
values = sorted.values;
isShared = false;
begin = 0;
View
34 src/org/jruby/RubyBasicObject.java
@@ -45,7 +45,7 @@
import org.jruby.internal.runtime.methods.DynamicMethod;
import org.jruby.javasupport.JavaObject;
import org.jruby.javasupport.JavaUtil;
-import org.jruby.javasupport.util.RuntimeHelpers;
+import org.jruby.runtime.Helpers;
import org.jruby.runtime.Block;
import org.jruby.runtime.CallType;
import org.jruby.runtime.ClassIndex;
@@ -67,7 +67,7 @@
import org.jruby.util.log.LoggerFactory;
import org.jruby.util.unsafe.UnsafeHolder;
-import static org.jruby.javasupport.util.RuntimeHelpers.invokedynamic;
+import static org.jruby.runtime.Helpers.invokedynamic;
import static org.jruby.runtime.invokedynamic.MethodNames.OP_EQUAL;
import static org.jruby.runtime.invokedynamic.MethodNames.OP_CMP;
import static org.jruby.runtime.invokedynamic.MethodNames.EQL;
@@ -340,14 +340,14 @@ public final boolean getFlag(int flag) {
* method missing exists. Otherwise returns null. 1.9: rb_check_funcall
*/
public final IRubyObject checkCallMethod(ThreadContext context, String name) {
- return RuntimeHelpers.invokeChecked(context, this, name);
+ return Helpers.invokeChecked(context, this, name);
}
/**
* Will invoke a named method with no arguments and no block.
*/
public final IRubyObject callMethod(ThreadContext context, String name) {
- return RuntimeHelpers.invoke(context, this, name);
+ return Helpers.invoke(context, this, name);
}
/**
@@ -355,7 +355,7 @@ public final IRubyObject callMethod(ThreadContext context, String name) {
* functional invocation.
*/
public final IRubyObject callMethod(ThreadContext context, String name, IRubyObject arg) {
- return RuntimeHelpers.invoke(context, this, name, arg);
+ return Helpers.invoke(context, this, name, arg);
}
/**
@@ -363,15 +363,15 @@ public final IRubyObject callMethod(ThreadContext context, String name, IRubyObj
* block with functional invocation.
*/
public final IRubyObject callMethod(ThreadContext context, String name, IRubyObject[] args) {
- return RuntimeHelpers.invoke(context, this, name, args);
+ return Helpers.invoke(context, this, name, args);
}
public final IRubyObject callMethod(String name, IRubyObject... args) {
- return RuntimeHelpers.invoke(getRuntime().getCurrentContext(), this, name, args);
+ return Helpers.invoke(getRuntime().getCurrentContext(), this, name, args);
}
public final IRubyObject callMethod(String name) {
- return RuntimeHelpers.invoke(getRuntime().getCurrentContext(), this, name);
+ return Helpers.invoke(getRuntime().getCurrentContext(), this, name);
}
/**
@@ -379,7 +379,7 @@ public final IRubyObject callMethod(String name) {
* supplied block with functional invocation.
*/
public final IRubyObject callMethod(ThreadContext context, String name, IRubyObject[] args, Block block) {
- return RuntimeHelpers.invoke(context, this, name, args, block);
+ return Helpers.invoke(context, this, name, args, block);
}
/**
@@ -663,7 +663,7 @@ public String asJavaString() {
* instead.
*/
public RubyString asString() {
- IRubyObject str = RuntimeHelpers.invoke(getRuntime().getCurrentContext(), this, "to_s");
+ IRubyObject str = Helpers.invoke(getRuntime().getCurrentContext(), this, "to_s");
if (!(str instanceof RubyString)) return (RubyString)anyToString();
if (isTaint()) str.setTaint(true);
@@ -1035,7 +1035,7 @@ public IRubyObject inspect() {
}
if (isNil()) return RubyNil.inspect(this);
- return RuntimeHelpers.invoke(runtime.getCurrentContext(), this, "to_s");
+ return Helpers.invoke(runtime.getCurrentContext(), this, "to_s");
}
public IRubyObject hashyInspect() {
@@ -1981,7 +1981,7 @@ public void finalize() {
}
private void callFinalizer(IRubyObject finalizer) {
- RuntimeHelpers.invoke(
+ Helpers.invoke(
finalizer.getRuntime().getCurrentContext(),
finalizer, "call", id);
}
@@ -2071,7 +2071,7 @@ public IRubyObject respond_to_p19(IRubyObject mname) {
String name = mname.asJavaString();
IRubyObject respond = getRuntime().newBoolean(getMetaClass().isMethodBound(name, true, true));
if (!respond.isTrue()) {
- respond = RuntimeHelpers.invoke(getRuntime().getCurrentContext(), this, "respond_to_missing?", mname, getRuntime().getFalse());
+ respond = Helpers.invoke(getRuntime().getCurrentContext(), this, "respond_to_missing?", mname, getRuntime().getFalse());
respond = getRuntime().newBoolean(respond.isTrue());
}
return respond;
@@ -2103,7 +2103,7 @@ public IRubyObject respond_to_p19(IRubyObject mname, IRubyObject includePrivate)
String name = mname.asJavaString();
IRubyObject respond = getRuntime().newBoolean(getMetaClass().isMethodBound(name, !includePrivate.isTrue()));
if (!respond.isTrue()) {
- respond = RuntimeHelpers.invoke(getRuntime().getCurrentContext(), this, "respond_to_missing?", mname, includePrivate);
+ respond = Helpers.invoke(getRuntime().getCurrentContext(), this, "respond_to_missing?", mname, includePrivate);
respond = getRuntime().newBoolean(respond.isTrue());
}
return respond;
@@ -3072,17 +3072,17 @@ protected RubyBasicObject(Ruby runtime, RubyClass metaClass, boolean useObjectSp
@Deprecated
public IRubyObject callSuper(ThreadContext context, IRubyObject[] args, Block block) {
- return RuntimeHelpers.invokeSuper(context, this, args, block);
+ return Helpers.invokeSuper(context, this, args, block);
}
@Deprecated
public final IRubyObject callMethod(ThreadContext context, int methodIndex, String name) {
- return RuntimeHelpers.invoke(context, this, name);
+ return Helpers.invoke(context, this, name);
}
@Deprecated
public final IRubyObject callMethod(ThreadContext context, int methodIndex, String name, IRubyObject arg) {
- return RuntimeHelpers.invoke(context, this, name, arg, Block.NULL_BLOCK);
+ return Helpers.invoke(context, this, name, arg, Block.NULL_BLOCK);
}
@Deprecated
View
46 src/org/jruby/RubyClass.java
@@ -62,7 +62,7 @@
import org.jruby.java.codegen.RealClassGenerator;
import org.jruby.java.codegen.Reified;
import org.jruby.javasupport.Java;
-import org.jruby.javasupport.util.RuntimeHelpers;
+import org.jruby.runtime.Helpers;
import org.jruby.runtime.Block;
import org.jruby.runtime.CallSite;
import org.jruby.runtime.CallType;
@@ -565,7 +565,7 @@ public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
DynamicMethod method = searchMethod(name);
IRubyObject caller = context.getFrameSelf();
if (shouldCallMethodMissing(method, name, caller, callType)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, callType, block);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, callType, block);
}
return method.call(context, self, this, name, block);
}
@@ -573,7 +573,7 @@ public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name, Block block) {
DynamicMethod method = searchMethod(name);
if (shouldCallMethodMissing(method)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, block);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, block);
}
return method.call(context, self, this, name, block);
}
@@ -584,7 +584,7 @@ public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
DynamicMethod method = searchMethod(name);
IRubyObject caller = context.getFrameSelf();
if (shouldCallMethodMissing(method, name, caller, callType)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, callType, args, block);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, callType, args, block);
}
return method.call(context, self, this, name, args, block);
}
@@ -594,7 +594,7 @@ public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name,
assert args != null;
DynamicMethod method = searchMethod(name);
if (shouldCallMethodMissing(method)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, args, block);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, args, block);
}
return method.call(context, self, this, name, args, block);
}
@@ -604,7 +604,7 @@ public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
DynamicMethod method = searchMethod(name);
IRubyObject caller = context.getFrameSelf();
if (shouldCallMethodMissing(method, name, caller, callType)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, callType, arg, block);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, callType, arg, block);
}
return method.call(context, self, this, name, arg, block);
}
@@ -613,7 +613,7 @@ public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name,
IRubyObject arg, Block block) {
DynamicMethod method = searchMethod(name);
if (shouldCallMethodMissing(method)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, arg, block);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, arg, block);
}
return method.call(context, self, this, name, arg, block);
}
@@ -623,7 +623,7 @@ public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
DynamicMethod method = searchMethod(name);
IRubyObject caller = context.getFrameSelf();
if (shouldCallMethodMissing(method, name, caller, callType)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, callType, arg0, arg1, block);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, callType, arg0, arg1, block);
}
return method.call(context, self, this, name, arg0, arg1, block);
}
@@ -632,7 +632,7 @@ public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name,
IRubyObject arg0, IRubyObject arg1, Block block) {
DynamicMethod method = searchMethod(name);
if (shouldCallMethodMissing(method)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, arg0, arg1, block);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, arg0, arg1, block);
}
return method.call(context, self, this, name, arg0, arg1, block);
}
@@ -642,7 +642,7 @@ public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
DynamicMethod method = searchMethod(name);
IRubyObject caller = context.getFrameSelf();
if (shouldCallMethodMissing(method, name, caller, callType)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, callType, arg0, arg1, arg2, block);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, callType, arg0, arg1, arg2, block);
}
return method.call(context, self, this, name, arg0, arg1, arg2, block);
}
@@ -651,7 +651,7 @@ public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name,
IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) {
DynamicMethod method = searchMethod(name);
if (shouldCallMethodMissing(method)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, arg0, arg1, arg2, block);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, arg0, arg1, arg2, block);
}
return method.call(context, self, this, name, arg0, arg1, arg2, block);
}
@@ -661,7 +661,7 @@ public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
DynamicMethod method = searchMethod(name);
IRubyObject caller = context.getFrameSelf();
if (shouldCallMethodMissing(method, name, caller, callType)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, callType, Block.NULL_BLOCK);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, callType, Block.NULL_BLOCK);
}
return method.call(context, self, this, name);
}
@@ -669,7 +669,7 @@ public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name) {
DynamicMethod method = searchMethod(name);
if (shouldCallMethodMissing(method)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, Block.NULL_BLOCK);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, Block.NULL_BLOCK);
}
return method.call(context, self, this, name);
}
@@ -683,7 +683,7 @@ public IRubyObject finvokeChecked(ThreadContext context, IRubyObject self, Strin
}
try {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, Block.NULL_BLOCK);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, Block.NULL_BLOCK);
} catch(RaiseException e) {
if(context.runtime.getNoMethodError().isInstance(e.getException())) {
if(self.respondsTo(name)) {
@@ -707,7 +707,7 @@ public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
DynamicMethod method = searchMethod(name);
IRubyObject caller = context.getFrameSelf();
if (shouldCallMethodMissing(method, name, caller, callType)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, callType, args, Block.NULL_BLOCK);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, callType, args, Block.NULL_BLOCK);
}
return method.call(context, self, this, name, args);
}
@@ -717,7 +717,7 @@ public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name,
assert args != null;
DynamicMethod method = searchMethod(name);
if (shouldCallMethodMissing(method)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, args, Block.NULL_BLOCK);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, args, Block.NULL_BLOCK);
}
return method.call(context, self, this, name, args);
}
@@ -727,7 +727,7 @@ public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
DynamicMethod method = searchMethod(name);
IRubyObject caller = context.getFrameSelf();
if (shouldCallMethodMissing(method, name, caller, callType)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, callType, arg, Block.NULL_BLOCK);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, callType, arg, Block.NULL_BLOCK);
}
return method.call(context, self, this, name, arg);
}
@@ -736,7 +736,7 @@ public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name,
IRubyObject arg) {
DynamicMethod method = searchMethod(name);
if (shouldCallMethodMissing(method)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, arg, Block.NULL_BLOCK);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, arg, Block.NULL_BLOCK);
}
return method.call(context, self, this, name, arg);
}
@@ -746,7 +746,7 @@ public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
DynamicMethod method = searchMethod(name);
IRubyObject caller = context.getFrameSelf();
if (shouldCallMethodMissing(method, name, caller, callType)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, callType, arg0, arg1, Block.NULL_BLOCK);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, callType, arg0, arg1, Block.NULL_BLOCK);
}
return method.call(context, self, this, name, arg0, arg1);
}
@@ -755,7 +755,7 @@ public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name,
IRubyObject arg0, IRubyObject arg1) {
DynamicMethod method = searchMethod(name);
if (shouldCallMethodMissing(method)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, arg0, arg1, Block.NULL_BLOCK);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, arg0, arg1, Block.NULL_BLOCK);
}
return method.call(context, self, this, name, arg0, arg1);
}
@@ -765,7 +765,7 @@ public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
DynamicMethod method = searchMethod(name);
IRubyObject caller = context.getFrameSelf();
if (shouldCallMethodMissing(method, name, caller, callType)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, callType, arg0, arg1, arg2, Block.NULL_BLOCK);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, callType, arg0, arg1, arg2, Block.NULL_BLOCK);
}
return method.call(context, self, this, name, arg0, arg1, arg2);
}
@@ -774,7 +774,7 @@ public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name,
IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) {
DynamicMethod method = searchMethod(name);
if (shouldCallMethodMissing(method)) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, arg0, arg1, arg2, Block.NULL_BLOCK);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, arg0, arg1, arg2, Block.NULL_BLOCK);
}
return method.call(context, self, this, name, arg0, arg1, arg2);
}
@@ -833,7 +833,7 @@ public IRubyObject invokeInherited(ThreadContext context, IRubyObject self, IRub
DynamicMethod method = getMetaClass().searchMethod("inherited");
if (method.isUndefined()) {
- return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), "inherited", CallType.FUNCTIONAL, Block.NULL_BLOCK);
+ return Helpers.callMethodMissing(context, self, method.getVisibility(), "inherited", CallType.FUNCTIONAL, Block.NULL_BLOCK);
}
return method.call(context, self, getMetaClass(), "inherited", subclass, Block.NULL_BLOCK);
View
2  src/org/jruby/RubyComparable.java
@@ -38,7 +38,7 @@
import org.jruby.exceptions.RaiseException;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject;
-import static org.jruby.javasupport.util.RuntimeHelpers.invokedynamic;
+import static org.jruby.runtime.Helpers.invokedynamic;
import static org.jruby.runtime.invokedynamic.MethodNames.OP_CMP;
/** Implementation of the Comparable module.
View
2  src/org/jruby/RubyComplex.java
@@ -70,7 +70,7 @@
import org.jruby.util.ByteList;
import org.jruby.util.Numeric;
-import static org.jruby.javasupport.util.RuntimeHelpers.invokedynamic;
+import static org.jruby.runtime.Helpers.invokedynamic;
import static org.jruby.runtime.invokedynamic.MethodNames.HASH;
/**
View
39 src/org/jruby/RubyEnumerable.java
@@ -27,8 +27,8 @@
***** END LICENSE BLOCK *****/
package org.jruby;
-import org.jruby.runtime.BlockBody;
-import org.jruby.runtime.Visibility;
+import org.jruby.runtime.*;
+
import java.util.ArrayList;
import static org.jruby.RubyEnumerator.enumeratorize;
@@ -45,18 +45,11 @@
import org.jruby.exceptions.JumpException;
import org.jruby.exceptions.RaiseException;
-import org.jruby.javasupport.util.RuntimeHelpers;
-import org.jruby.runtime.Arity;
-import org.jruby.runtime.Block;
-import org.jruby.runtime.CallBlock;
-import org.jruby.runtime.BlockCallback;
-import org.jruby.runtime.CallBlock19;
-import org.jruby.runtime.JavaInternalBlockBody;
-import org.jruby.runtime.ThreadContext;
+import org.jruby.runtime.Helpers;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.util.TypeConverter;
-import static org.jruby.javasupport.util.RuntimeHelpers.invokedynamic;
+import static org.jruby.runtime.Helpers.invokedynamic;
import static org.jruby.runtime.invokedynamic.MethodNames.OP_CMP;
/**
@@ -77,43 +70,43 @@ public static RubyModule createEnumerableModule(Ruby runtime) {
public static IRubyObject callEach(Ruby runtime, ThreadContext context, IRubyObject self,
BlockCallback callback) {
- return RuntimeHelpers.invoke(context, self, "each", CallBlock.newCallClosure(self, runtime.getEnumerable(),
+ return Helpers.invoke(context, self, "each", CallBlock.newCallClosure(self, runtime.getEnumerable(),
Arity.OPTIONAL, callback, context));
}
public static IRubyObject callEach19(Ruby runtime, ThreadContext context, IRubyObject self,
BlockCallback callback) {
- return RuntimeHelpers.invoke(context, self, "each", CallBlock19.newCallClosure(self, runtime.getEnumerable(),
+ return Helpers.invoke(context, self, "each", CallBlock19.newCallClosure(self, runtime.getEnumerable(),
Arity.OPTIONAL, callback, context));
}
@Deprecated
public static IRubyObject callEach(Ruby runtime, ThreadContext context, IRubyObject self, IRubyObject[] args,
BlockCallback callback) {
- return RuntimeHelpers.invoke(context, self, "each", args, CallBlock.newCallClosure(self, runtime.getEnumerable(), Arity.OPTIONAL, callback, context));
+ return Helpers.invoke(context, self, "each", args, CallBlock.newCallClosure(self, runtime.getEnumerable(), Arity.OPTIONAL, callback, context));
}
public static IRubyObject callEach(Ruby runtime, ThreadContext context, IRubyObject self,
Arity arity, BlockCallback callback) {
- return RuntimeHelpers.invoke(context, self, "each", CallBlock.newCallClosure(self, runtime.getEnumerable(),
+ return Helpers.invoke(context, self, "each", CallBlock.newCallClosure(self, runtime.getEnumerable(),
arity, callback, context));
}
public static IRubyObject callEach19(Ruby runtime, ThreadContext context, IRubyObject self,
Arity arity, BlockCallback callback) {
- return RuntimeHelpers.invoke(context, self, "each", CallBlock19.newCallClosure(self, runtime.getEnumerable(),
+ return Helpers.invoke(context, self, "each", CallBlock19.newCallClosure(self, runtime.getEnumerable(),
arity, callback, context));
}
public static IRubyObject each(ThreadContext context, IRubyObject self, BlockBody body) {
Block block = new Block(body, context.currentBinding(self, Visibility.PUBLIC));
- return RuntimeHelpers.invoke(context, self, "each", block);
+ return Helpers.invoke(context, self, "each", block);
}
@Deprecated
public static IRubyObject callEach(Ruby runtime, ThreadContext context, IRubyObject self, IRubyObject[] args,
Arity arity, BlockCallback callback) {
- return RuntimeHelpers.invoke(context, self, "each", args, CallBlock.newCallClosure(self, runtime.getEnumerable(), arity, callback, context));
+ return Helpers.invoke(context, self, "each", args, CallBlock.newCallClosure(self, runtime.getEnumerable(), arity, callback, context));
}
private static void checkContext(ThreadContext firstContext, ThreadContext secondContext, String name) {
@@ -373,7 +366,7 @@ public static IRubyObject to_a(ThreadContext context, IRubyObject self) {
public static IRubyObject to_a(ThreadContext context, IRubyObject self, IRubyObject[] args) {
Ruby runtime = context.runtime;
RubyArray result = runtime.newArray();
- RuntimeHelpers.invoke(context, self, "each", args, CallBlock.newCallClosure(self, runtime.getEnumerable(),
+ Helpers.invoke(context, self, "each", args, CallBlock.newCallClosure(self, runtime.getEnumerable(),
Arity.OPTIONAL, new AppendBlockCallback(runtime, result), context));
return result;
}
@@ -391,7 +384,7 @@ public static IRubyObject to_a19(ThreadContext context, IRubyObject self) {
public static IRubyObject to_a19(ThreadContext context, IRubyObject self, IRubyObject[] args) {
Ruby runtime = context.runtime;
RubyArray result = runtime.newArray();
- RuntimeHelpers.invoke(context, self, "each", args, CallBlock.newCallClosure(self, runtime.getEnumerable(),
+ Helpers.invoke(context, self, "each", args, CallBlock.newCallClosure(self, runtime.getEnumerable(),
Arity.OPTIONAL, new AppendBlockCallback(runtime, result), context));
result.infectBy(self);
return result;
@@ -1688,9 +1681,9 @@ public static IRubyObject chunk(ThreadContext context, IRubyObject self, final I
enumerator.getInternalVariables().setInternalVariable("chunk_categorize", RubyProc.newProc(context.runtime, block, block.type));
enumerator.getInternalVariables().setInternalVariable("chunk_initial_state", initialState);
- RuntimeHelpers.invoke(context, enumerator, "initialize",
- CallBlock.newCallClosure(self, context.runtime.getEnumerable(), Arity.ONE_ARGUMENT,
- new ChunkedBlockCallback(context.runtime, enumerator), context));
+ Helpers.invoke(context, enumerator, "initialize",
+ CallBlock.newCallClosure(self, context.runtime.getEnumerable(), Arity.ONE_ARGUMENT,
+ new ChunkedBlockCallback(context.runtime, enumerator), context));
return enumerator;
}
View
10 src/org/jruby/RubyEnumerator.java
@@ -27,11 +27,9 @@
***** END LICENSE BLOCK *****/
package org.jruby;
-import java.util.Arrays;
import org.jruby.anno.JRubyMethod;
import org.jruby.anno.JRubyModule;
-import org.jruby.javasupport.util.RuntimeHelpers;
-import org.jruby.runtime.Arity;
+import org.jruby.runtime.Helpers;
import org.jruby.runtime.Block;
import org.jruby.runtime.BlockCallback;
import org.jruby.runtime.ObjectAllocator;
@@ -40,7 +38,7 @@
import org.jruby.util.ByteList;
import static org.jruby.CompatVersion.*;
import static org.jruby.runtime.Visibility.*;
-import static org.jruby.javasupport.util.RuntimeHelpers.toArray;
+import static org.jruby.runtime.Helpers.toArray;
/**
* Implementation of Ruby's Enumerator module.
@@ -331,11 +329,11 @@ protected static IRubyObject newEnumerator(ThreadContext context, IRubyObject ar
}
protected static IRubyObject newEnumerator(ThreadContext context, IRubyObject arg1, IRubyObject arg2) {
- return RuntimeHelpers.invoke(context, context.runtime.getEnumerator(), "new", arg1, arg2);
+ return Helpers.invoke(context, context.runtime.getEnumerator(), "new", arg1, arg2);
}
protected static IRubyObject newEnumerator(ThreadContext context, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3) {
- return RuntimeHelpers.invoke(context, context.runtime.getEnumerator(), "new", arg1, arg2, arg3);
+ return Helpers.invoke(context, context.runtime.getEnumerator(), "new", arg1, arg2, arg3);
}
@JRubyMethod(required = 1, compat = CompatVersion.RUBY1_9)
View
2  src/org/jruby/RubyFloat.java
@@ -70,7 +70,7 @@
import org.jruby.util.ConvertDouble;
import org.jruby.util.Sprintf;
-import static org.jruby.javasupport.util.RuntimeHelpers.invokedynamic;
+import static org.jruby.runtime.Helpers.invokedynamic;
import static org.jruby.runtime.invokedynamic.MethodNames.OP_EQUAL;
/**
View
14 src/org/jruby/RubyGlobal.java
@@ -43,7 +43,7 @@
import org.jruby.internal.runtime.GlobalVariables;
import org.jruby.internal.runtime.ValueAccessor;
import org.jruby.javasupport.JavaUtil;
-import org.jruby.javasupport.util.RuntimeHelpers;
+import org.jruby.runtime.Helpers;
import org.jruby.platform.Platform;
import org.jruby.runtime.Constants;
import org.jruby.runtime.GlobalVariable;
@@ -410,9 +410,9 @@ protected IRubyObject case_aware_op_aset(ThreadContext context, IRubyObject key,
return super.delete(context, key, org.jruby.runtime.Block.NULL_BLOCK);
}
- IRubyObject keyAsStr = normalizeEnvString(RuntimeHelpers.invoke(context, key, "to_str"));
+ IRubyObject keyAsStr = normalizeEnvString(Helpers.invoke(context, key, "to_str"));
IRubyObject valueAsStr = value.isNil() ? getRuntime().getNil() :
- normalizeEnvString(RuntimeHelpers.invoke(context, value, "to_str"));
+ normalizeEnvString(Helpers.invoke(context, value, "to_str"));
if (updateRealENV) {
POSIX posix = getRuntime().getPosix();
@@ -562,12 +562,12 @@ public BackRefGlobalVariable(Ruby runtime, String name) {
@Override
public IRubyObject get() {
- return RuntimeHelpers.getBackref(runtime, runtime.getCurrentContext());
+ return Helpers.getBackref(runtime, runtime.getCurrentContext());
}
@Override
public IRubyObject set(IRubyObject value) {
- RuntimeHelpers.setBackref(runtime, runtime.getCurrentContext(), value);
+ Helpers.setBackref(runtime, runtime.getCurrentContext(), value);
return value;
}
}
@@ -755,12 +755,12 @@ public LastlineGlobalVariable(Ruby runtime, String name) {
@Override
public IRubyObject get() {
- return RuntimeHelpers.getLastLine(runtime, runtime.getCurrentContext());
+ return Helpers.getLastLine(runtime, runtime.getCurrentContext());
}
@Override
public IRubyObject set(IRubyObject value) {
- RuntimeHelpers.setLastLine(runtime, runtime.getCurrentContext(), value);
+ Helpers.setLastLine(runtime, runtime.getCurrentContext(), value);
return value;
}
}
View
14 src/org/jruby/RubyHash.java
@@ -55,7 +55,7 @@
import org.jruby.common.IRubyWarnings.ID;
import org.jruby.exceptions.RaiseException;
import org.jruby.javasupport.JavaUtil;
-import org.jruby.javasupport.util.RuntimeHelpers;
+import org.jruby.runtime.Helpers;
import org.jruby.runtime.Arity;
import org.jruby.runtime.Block;
import org.jruby.runtime.ClassIndex;
@@ -70,7 +70,7 @@
import org.jruby.util.RecursiveComparator;
import static org.jruby.CompatVersion.*;
-import static org.jruby.javasupport.util.RuntimeHelpers.invokedynamic;
+import static org.jruby.runtime.Helpers.invokedynamic;
import static org.jruby.runtime.invokedynamic.MethodNames.HASH;
// Design overview:
@@ -687,7 +687,7 @@ public IRubyObject default_value_get(ThreadContext context) {
@JRubyMethod(name = "default")
public IRubyObject default_value_get(ThreadContext context, IRubyObject arg) {
if ((flags & PROCDEFAULT_HASH_F) != 0) {
- return RuntimeHelpers.invoke(context, ifNone, "call", this, arg);
+ return Helpers.invoke(context, ifNone, "call", this, arg);
}
return ifNone;
}
@@ -1059,7 +1059,7 @@ public RubyBoolean compare(final ThreadContext context, final MethodNames method
if (!other.respondsTo("to_hash")) {
return runtime.getFalse();
} else {
- return RuntimeHelpers.rbEqual(context, other, this);
+ return Helpers.rbEqual(context, other, this);
}
}
@@ -1080,8 +1080,8 @@ public void visit(IRubyObject key, IRubyObject value) {
}
if (!(method == MethodNames.OP_EQUAL ?
- RuntimeHelpers.rbEqual(context, value, value2) :
- RuntimeHelpers.rbEql(context, value, value2)).isTrue()) {
+ Helpers.rbEqual(context, value, value2) :
+ Helpers.rbEql(context, value, value2)).isTrue()) {
throw MISMATCH;
}
}
@@ -1545,7 +1545,7 @@ public IRubyObject shift(ThreadContext context) {
}
if ((flags & PROCDEFAULT_HASH_F) != 0) {
- return RuntimeHelpers.invoke(context, ifNone, "call", this, getRuntime().getNil());
+ return Helpers.invoke(context, ifNone, "call", this, getRuntime().getNil());
} else {
return ifNone;
}
View
6 src/org/jruby/RubyIO.java
@@ -40,6 +40,7 @@
import org.jcodings.specific.UTF32BEEncoding;
import org.jcodings.specific.UTF32LEEncoding;
import org.jcodings.specific.UTF8Encoding;
+import org.jruby.runtime.Helpers;
import org.jruby.util.StringSupport;
import org.jruby.util.io.EncodingUtils;
import org.jruby.util.io.ModeFlags;
@@ -97,7 +98,6 @@
import org.jruby.util.io.ChannelDescriptor;
import org.jcodings.specific.ASCIIEncoding;
-import org.jruby.javasupport.util.RuntimeHelpers;
import org.jruby.runtime.Arity;
import static org.jruby.CompatVersion.*;
@@ -3618,7 +3618,7 @@ public static IRubyObject binread(ThreadContext context, IRubyObject recv, IRuby
} else if (args.length > 1) {
length = args[1];
}
- RubyIO file = (RubyIO)RuntimeHelpers.invoke(context, runtime.getFile(), "new", path, runtime.newString("rb:ASCII-8BIT"));
+ RubyIO file = (RubyIO) Helpers.invoke(context, runtime.getFile(), "new", path, runtime.newString("rb:ASCII-8BIT"));
try {
if (!offset.isNil()) file.seek(context, offset);
@@ -3674,7 +3674,7 @@ public static IRubyObject binwrite(ThreadContext context, IRubyObject recv, IRub
if (args.length > 2) {
offset = args[2];
}
- RubyIO file = (RubyIO)RuntimeHelpers.invoke(context, runtime.getFile(), "new", path, runtime.newString("wb:ASCII-8BIT"));
+ RubyIO file = (RubyIO) Helpers.invoke(context, runtime.getFile(), "new", path, runtime.newString("wb:ASCII-8BIT"));
try {
if (!offset.isNil()) file.seek(context, offset);
View
22 src/org/jruby/RubyKernel.java
@@ -52,7 +52,7 @@
import org.jruby.internal.runtime.methods.CallConfiguration;
import org.jruby.internal.runtime.methods.DynamicMethod;
import org.jruby.internal.runtime.methods.JavaMethod.JavaMethodNBlock;
-import org.jruby.javasupport.util.RuntimeHelpers;
+import org.jruby.runtime.Helpers;
import org.jruby.platform.Platform;
import org.jruby.runtime.Binding;
import org.jruby.runtime.Block;
@@ -360,33 +360,33 @@ public static IRubyObject abort(ThreadContext context, IRubyObject recv, IRubyOb
@JRubyMethod(name = "Array", required = 1, module = true, visibility = PRIVATE)
public static IRubyObject new_array(ThreadContext context, IRubyObject recv, IRubyObject object) {
- return RuntimeHelpers.arrayValue(context, context.runtime, object);
+ return Helpers.arrayValue(context, context.runtime, object);
}
@JRubyMethod(name = "Complex", module = true, visibility = PRIVATE, compat = RUBY1_9)
public static IRubyObject new_complex(ThreadContext context, IRubyObject recv) {
- return RuntimeHelpers.invoke(context, context.runtime.getComplex(), "convert");
+ return Helpers.invoke(context, context.runtime.getComplex(), "convert");
}
@JRubyMethod(name = "Complex", module = true, visibility = PRIVATE, compat = RUBY1_9)
public static IRubyObject new_complex(ThreadContext context, IRubyObject recv, IRubyObject arg) {
- return RuntimeHelpers.invoke(context, context.runtime.getComplex(), "convert", arg);
+ return Helpers.invoke(context, context.runtime.getComplex(), "convert", arg);
}
@JRubyMethod(name = "Complex", module = true, visibility = PRIVATE, compat = RUBY1_9)
public static IRubyObject new_complex(ThreadContext context, IRubyObject recv, IRubyObject arg0, IRubyObject arg1) {
- return RuntimeHelpers.invoke(context, context.runtime.getComplex(), "convert", arg0, arg1);
+ return Helpers.invoke(context, context.runtime.getComplex(), "convert", arg0, arg1);
}
@JRubyMethod(name = "Rational", module = true, visibility = PRIVATE, compat = RUBY1_9)
public static IRubyObject new_rational(ThreadContext context, IRubyObject recv) {
- return RuntimeHelpers.invoke(context, context.runtime.getRational(), "convert");
+ return Helpers.invoke(context, context.runtime.getRational(), "convert");
}
@JRubyMethod(name = "Rational", module = true, visibility = PRIVATE, compat = RUBY1_9)
public static IRubyObject new_rational(ThreadContext context, IRubyObject recv, IRubyObject arg) {
- return RuntimeHelpers.invoke(context, context.runtime.getRational(), "convert", arg);
+ return Helpers.invoke(context, context.runtime.getRational(), "convert", arg);
}
@JRubyMethod(name = "Rational", module = true, visibility = PRIVATE, compat = RUBY1_9)
public static IRubyObject new_rational(ThreadContext context, IRubyObject recv, IRubyObject arg0, IRubyObject arg1) {
- return RuntimeHelpers.invoke(context, context.runtime.getRational(), "convert", arg0, arg1);
+ return Helpers.invoke(context, context.runtime.getRational(), "convert", arg0, arg1);
}
@JRubyMethod(name = "Float", module = true, visibility = PRIVATE, compat = RUBY1_8)
@@ -1288,8 +1288,8 @@ public static IRubyObject warn(ThreadContext context, IRubyObject recv, IRubyObj
if (runtime.warningsEnabled()) {
IRubyObject out = runtime.getGlobalVariables().get("$stderr");
- RuntimeHelpers.invoke(context, out, "write", message);
- RuntimeHelpers.invoke(context, out, "write", runtime.getGlobalVariables().getDefaultSeparator());
+ Helpers.invoke(context, out, "write", message);
+ Helpers.invoke(context, out, "write", runtime.getGlobalVariables().getDefaultSeparator());
}
return runtime.getNil();
}
@@ -1840,7 +1840,7 @@ public static IRubyObject public_send(ThreadContext context, IRubyObject recv, I
DynamicMethod method = recv.getMetaClass().searchMethod(name);
if (method.isUndefined() || method.getVisibility() != PUBLIC) {
- return RuntimeHelpers.callMethodMissing(context, recv, method.getVisibility(), name, CallType.NORMAL, newArgs, block);
+ return Helpers.callMethodMissing(context, recv, method.getVisibility(), name, CallType.NORMAL, newArgs, block);
}
return method.call(context, recv, recv.getMetaClass(), name, newArgs, block);
View
6 src/org/jruby/RubyModule.java
@@ -79,7 +79,7 @@
import org.jruby.internal.runtime.methods.SynchronizedDynamicMethod;
import org.jruby.internal.runtime.methods.UndefinedMethod;
import org.jruby.internal.runtime.methods.WrapperMethod;
-import org.jruby.javasupport.util.RuntimeHelpers;
+import org.jruby.runtime.Helpers;
import org.jruby.parser.StaticScope;
import org.jruby.runtime.Arity;
import org.jruby.runtime.Block;
@@ -1435,7 +1435,7 @@ public IRubyObject define_method(ThreadContext context, IRubyObject arg0, Block
newMethod = createProcMethod(name, visibility, proc);
- RuntimeHelpers.addInstanceMethod(this, name, newMethod, visibility, context, runtime);
+ Helpers.addInstanceMethod(this, name, newMethod, visibility, context, runtime);
return proc;
}
@@ -1466,7 +1466,7 @@ public IRubyObject define_method(ThreadContext context, IRubyObject arg0, IRubyO
throw runtime.newTypeError("wrong argument type " + arg1.getType().getName() + " (expected Proc/Method)");
}
- RuntimeHelpers.addInstanceMethod(this, name, newMethod, visibility, context, runtime);
+ Helpers.addInstanceMethod(this, name, newMethod, visibility, context, runtime);
return body;
}
View
10 src/org/jruby/RubyNumeric.java
@@ -46,7 +46,7 @@
import org.jruby.anno.JRubyMethod;
import org.jruby.exceptions.RaiseException;
import org.jruby.javasupport.JavaUtil;
-import org.jruby.javasupport.util.RuntimeHelpers;
+import org.jruby.runtime.Helpers;
import org.jruby.runtime.Block;
import org.jruby.runtime.ClassIndex;
import org.jruby.runtime.ObjectAllocator;
@@ -58,8 +58,8 @@
import org.jruby.util.ConvertBytes;
import static org.jruby.CompatVersion.*;
-import static org.jruby.javasupport.util.RuntimeHelpers.invokedynamic;
-import static org.jruby.runtime.MethodIndex.OP_EQUAL;
+import static org.jruby.runtime.Helpers.invokedynamic;
+
import org.jruby.runtime.invokedynamic.MethodNames;
/**
@@ -646,7 +646,7 @@ public IRubyObject divmod19(ThreadContext context, IRubyObject other) {
/** num_fdiv (1.9) */
@JRubyMethod(name = "fdiv", compat = RUBY1_9)
public IRubyObject fdiv(ThreadContext context, IRubyObject other) {
- return RuntimeHelpers.invoke(context, this.convertToFloat(), "/", other);
+ return Helpers.invoke(context, this.convertToFloat(), "/", other);
}
/** num_modulo
@@ -709,7 +709,7 @@ public IRubyObject magnitude(ThreadContext context) {
*/
@JRubyMethod(name = "to_int")
public IRubyObject to_int(ThreadContext context) {
- return RuntimeHelpers.invoke(context, this, "to_i");
+ return Helpers.invoke(context, this, "to_i");
}
/** num_real_p
View
16 src/org/jruby/RubyObject.java
@@ -46,7 +46,7 @@
import org.jruby.anno.JRubyClass;
import org.jruby.anno.JRubyMethod;
-import org.jruby.javasupport.util.RuntimeHelpers;
+import org.jruby.runtime.Helpers;
import org.jruby.runtime.Block;
import org.jruby.runtime.ClassIndex;
import org.jruby.runtime.ObjectAllocator;
@@ -56,7 +56,7 @@
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.runtime.marshal.DataType;
-import static org.jruby.javasupport.util.RuntimeHelpers.invokedynamic;
+import static org.jruby.runtime.Helpers.invokedynamic;
import static org.jruby.runtime.invokedynamic.MethodNames.EQL;
import static org.jruby.runtime.invokedynamic.MethodNames.OP_EQUAL;
import static org.jruby.runtime.invokedynamic.MethodNames.HASH;
@@ -208,7 +208,7 @@ public boolean equals(Object other) {
*/
@Override
public String toString() {
- RubyString rubyString = RuntimeHelpers.invoke(getRuntime().getCurrentContext(), this, "to_s").convertToString();
+ RubyString rubyString = Helpers.invoke(getRuntime().getCurrentContext(), this, "to_s").convertToString();
return rubyString.getUnicodeValue();
}
@@ -216,35 +216,35 @@ public String toString() {
* Call the Ruby initialize method with the supplied arguments and block.
*/
public final void callInit(IRubyObject[] args, Block block) {
- RuntimeHelpers.invoke(getRuntime().getCurrentContext(), this, "initialize", args, block);
+ Helpers.invoke(getRuntime().getCurrentContext(), this, "initialize", args, block);
}
/**
* Call the Ruby initialize method with the supplied arguments and block.
*/
public final void callInit(Block block) {
- RuntimeHelpers.invoke(getRuntime().getCurrentContext(), this, "initialize", block);
+ Helpers.invoke(getRuntime().getCurrentContext(), this, "initialize", block);
}
/**
* Call the Ruby initialize method with the supplied arguments and block.
*/
public final void callInit(IRubyObject arg0, Block block) {
- RuntimeHelpers.invoke(getRuntime().getCurrentContext(), this, "initialize", arg0, block);
+ Helpers.invoke(getRuntime().getCurrentContext(), this, "initialize", arg0, block);
}
/**
* Call the Ruby initialize method with the supplied arguments and block.
*/
public final void callInit(IRubyObject arg0, IRubyObject arg1, Block block) {
- RuntimeHelpers.invoke(getRuntime().getCurrentContext(), this, "initialize", arg0, arg1, block);
+ Helpers.invoke(getRuntime().getCurrentContext(), this, "initialize", arg0, arg1, block);
}
/**
* Call the Ruby initialize method with the supplied arguments and block.
*/
public final void callInit(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) {
- RuntimeHelpers.invoke(getRuntime().getCurrentContext(), this, "initialize", arg0, arg1, arg2, block);
+ Helpers.invoke(getRuntime().getCurrentContext(), this, "initialize", arg0, arg1, arg2, block);
}
public final void callInit(ThreadContext context, IRubyObject[] args, Block block) {
View
9 src/org/jruby/RubyProc.java
@@ -34,13 +34,12 @@
***** END LICENSE BLOCK *****/
package org.jruby;
-import java.util.ArrayList;
import java.util.Arrays;
-import java.util.List;
+
import org.jruby.anno.JRubyMethod;
import org.jruby.anno.JRubyClass;
import org.jruby.exceptions.JumpException;
-import org.jruby.javasupport.util.RuntimeHelpers;
+import org.jruby.runtime.Helpers;
import org.jruby.lexer.yacc.ISourcePosition;
import org.jruby.parser.StaticScope;
import org.jruby.runtime.Arity;
@@ -237,7 +236,7 @@ public IRubyObject call(ThreadContext context, IRubyObject[] args) {
// pad with nil
if (required > actual) {
- RuntimeHelpers.fillNil(newArgs, actual, required, context.runtime);
+ Helpers.fillNil(newArgs, actual, required, context.runtime);
}
args = newArgs;
@@ -351,7 +350,7 @@ public IRubyObject parameters(ThreadContext context) {
if (body instanceof MethodBlock) return ((MethodBlock) body).getMethod().parameters(context);
- return RuntimeHelpers.parameterListToParameters(context.runtime,
+ return Helpers.parameterListToParameters(context.runtime,
body.getParameterList(), isLambda());
}
View
2  src/org/jruby/RubyProcess.java
@@ -49,7 +49,7 @@
import org.jruby.util.ShellLauncher;
import static org.jruby.CompatVersion.*;
-import static org.jruby.javasupport.util.RuntimeHelpers.invokedynamic;
+import static org.jruby.runtime.Helpers.invokedynamic;
import static org.jruby.runtime.invokedynamic.MethodNames.OP_EQUAL;
View
14 src/org/jruby/RubyRandom.java
@@ -29,7 +29,7 @@
import org.jruby.anno.JRubyClass;
import org.jruby.anno.JRubyMethod;
-import org.jruby.javasupport.util.RuntimeHelpers;
+import org.jruby.runtime.Helpers;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.ThreadContext;
import static org.jruby.runtime.Visibility.PRIVATE;
@@ -515,7 +515,7 @@ private static IRubyObject randomRand(ThreadContext context, IRubyObject vmax, R
return ((RubyFloat) v).op_plus(context, f);
}
}
- return RuntimeHelpers.invoke(context, range.begin, "+", v);
+ return Helpers.invoke(context, range.begin, "+", v);
}
// c: float_value
@@ -563,11 +563,11 @@ private static RangeLike rangeValues(ThreadContext context, IRubyObject range) {
|| !range.respondsTo("exclude_end?")) {
return null;
}
- like.begin = RuntimeHelpers.invoke(context, range, "begin");
- like.end = RuntimeHelpers.invoke(context, range, "end");
- like.excl = RuntimeHelpers.invoke(context, range, "exlucde_end?").isTrue();
+ like.begin = Helpers.invoke(context, range, "begin");
+ like.end = Helpers.invoke(context, range, "end");
+ like.excl = Helpers.invoke(context, range, "exlucde_end?").isTrue();
}
- like.range = RuntimeHelpers.invoke(context, like.end, "-", like.begin);
+ like.range = Helpers.invoke(context, like.end, "-", like.begin);
return like;
}
@@ -701,7 +701,7 @@ public static double randomReal(ThreadContext context, IRubyObject obj) {
if (random != null) {
return random.genrandReal();
}
- double d = RubyNumeric.num2dbl(RuntimeHelpers.invoke(context, obj, "rand"));
+ double d = RubyNumeric.num2dbl(Helpers.invoke(context, obj, "rand"));
if (d < 0.0 || d >= 1.0) {
throw context.runtime.newRangeError("random number too big: " + d);
}
View
13 src/org/jruby/RubyRange.java
@@ -46,7 +46,7 @@
import