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

Commits on Aug 31, 2016

  1. extract install field helper into a standalone method (for later re-use)

    also better error messages on fails - the whole field will now be printed
    kares committed Aug 31, 2016
    Copy the full SHA
    fe0ec0e View commit details
  2. [ji] tidy-up Java field reader/writer impls - use same exception types

    - for IllegalAccessException on get/set now always map to SecurityError
    - IllegalArgumentException on field set mapped as TypeError (as before)
    kares committed Aug 31, 2016
    Copy the full SHA
    b4d13bf View commit details
  3. Copy the full SHA
    5639518 View commit details
  4. cleanup class.rb and JavaSignature - export as_java_type helper

    will know handle all primitive types correctly (inc :byte and :short) !
    and there's no reliance on internals from org.jruby.ast.java_signature.*
    kares committed Aug 31, 2016
    Copy the full SHA
    1d9f204 View commit details
  5. Copy the full SHA
    5aa263f View commit details
  6. anonymous Ruby classes should have a familiar Java class name

    ... for easier identification of which Ruby class they represent
    kares committed Aug 31, 2016
    Copy the full SHA
    84eb04f View commit details
  7. Copy the full SHA
    297a03f View commit details
  8. helpers for converting args with space left for proxy invocation-handler

    ... so that the Java (sub-class) proxy calls do not convert args twice
    
    also improved "Constructor invocation failed: " ArgumentError message
    kares committed Aug 31, 2016
    Copy the full SHA
    b6ec793 View commit details
  9. [ji] semi-optimize for 1 constructor (with arity one) in Java proxies

    ... which is the most common (having zero or one arity) to stumble upon
    
    code is dup-ed but reduces garbage generated on 'optimized' invocations
    kares committed Aug 31, 2016
    Copy the full SHA
    bcfcbbe View commit details
  10. avoid @JRubyMethod name/alias array copy-ing + review processing

    ... also AnnotationHelper can be re-used again from IndyBinder
    kares committed Aug 31, 2016
    Copy the full SHA
    77fb92b View commit details
  11. Copy the full SHA
    975cfe6 View commit details
  12. cleanum unused imports

    kares committed Aug 31, 2016
    Copy the full SHA
    1fd1a96 View commit details
  13. introduce ArraySupport helper for dealing with (small) array copy-ing

    ... arraycopy times added up on a profiling session and a quick bench
    session confirmed they can run quite faster for the usual small arrays
    kares committed Aug 31, 2016
    Copy the full SHA
    3a67809 View commit details
  14. Copy the full SHA
    90a93bc View commit details
  15. Copy the full SHA
    b2a0a59 View commit details
  16. unused runtime local var

    kares committed Aug 31, 2016
    Copy the full SHA
    805bfe4 View commit details
  17. use ArraySupport copy-ing since it will mostly be a small array

    + potentially avoid another array copy from to_ary-zed array
    kares committed Aug 31, 2016
    Copy the full SHA
    4fdbfa6 View commit details
  18. Copy the full SHA
    7680cdc View commit details
  19. extract get_with_class guts into another getProxyClass

    ... was confusing the Ruby method is now never used from JRuby
    kares committed Aug 31, 2016
    Copy the full SHA
    8c0f962 View commit details
  20. Copy the full SHA
    0d4844c View commit details
  21. Copy the full SHA
    c79157b View commit details
  22. Copy the full SHA
    58c0310 View commit details
  23. allow for (potential) JavaProxyClassFactory overrides ... as intented

    since JavaProxyClass is user-supliable make it easy for them to only
    worry about the details -> overriding newProxyClass method and not worrying about possibly changing impl internals: JavaSupportImpl
    or the runtimeTLS.
    
    renamed JavaProxyClass' get->newProxyClass for clarity ...
    method delegates to the factory's newProxyClass and now does the 
    existing Java proxy class checking on its own!
    
    also removed the "wild" Error catch (never a good idea) since we're re-throwing the 'unexpected' exceptions + added a message assertion
    kares committed Aug 31, 2016
    Copy the full SHA
    c4a44b8 View commit details
  24. Copy the full SHA
    fb74efb View commit details
  25. [test] try resolving javac from JAVA_HOME (for rake test:compile)

    ... will make sure test Java classes are compiled under same Java version
    kares committed Aug 31, 2016
    Copy the full SHA
    90413a8 View commit details
Showing with 1,303 additions and 803 deletions.
  1. +2 −3 core/src/main/java/org/jruby/RubyArray.java
  2. +8 −32 core/src/main/java/org/jruby/RubyBasicObject.java
  3. +13 −17 core/src/main/java/org/jruby/RubyClass.java
  4. +5 −3 core/src/main/java/org/jruby/RubyEnumerator.java
  5. +8 −9 core/src/main/java/org/jruby/RubyFloat.java
  6. +2 −5 core/src/main/java/org/jruby/RubyGenerator.java
  7. +9 −16 core/src/main/java/org/jruby/RubyKernel.java
  8. +24 −35 core/src/main/java/org/jruby/RubyModule.java
  9. +3 −4 core/src/main/java/org/jruby/RubyNoMethodError.java
  10. +0 −1 core/src/main/java/org/jruby/RubyObject.java
  11. +5 −5 core/src/main/java/org/jruby/RubyProc.java
  12. +2 −1 core/src/main/java/org/jruby/RubyTime.java
  13. +40 −25 core/src/main/java/org/jruby/anno/AnnotationBinder.java
  14. +19 −20 core/src/main/java/org/jruby/anno/AnnotationHelper.java
  15. +2 −1 core/src/main/java/org/jruby/anno/ExecutableElementDescriptor.java
  16. +38 −47 core/src/main/java/org/jruby/anno/IndyBinder.java
  17. +12 −6 core/src/main/java/org/jruby/anno/MethodDescriptor.java
  18. +19 −12 core/src/main/java/org/jruby/anno/TypePopulator.java
  19. +4 −4 core/src/main/java/org/jruby/ext/digest/RubyDigest.java
  20. +2 −9 core/src/main/java/org/jruby/internal/runtime/methods/InvokeDynamicMethodFactory.java
  21. +2 −3 core/src/main/java/org/jruby/ir/instructions/CallBase.java
  22. +9 −16 core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java
  23. +65 −1 core/src/main/java/org/jruby/java/addons/ClassJavaAddons.java
  24. +8 −9 core/src/main/java/org/jruby/java/invokers/ConstructorInvoker.java
  25. +25 −5 core/src/main/java/org/jruby/java/invokers/FieldMethodOne.java
  26. +25 −16 core/src/main/java/org/jruby/java/invokers/FieldMethodZero.java
  27. +3 −6 core/src/main/java/org/jruby/java/invokers/InstanceFieldGetter.java
  28. +6 −9 core/src/main/java/org/jruby/java/invokers/InstanceFieldSetter.java
  29. +6 −6 core/src/main/java/org/jruby/java/invokers/InstanceMethodInvoker.java
  30. +63 −2 core/src/main/java/org/jruby/java/invokers/RubyToJavaInvoker.java
  31. +3 −3 core/src/main/java/org/jruby/java/invokers/StaticFieldGetter.java
  32. +4 −5 core/src/main/java/org/jruby/java/invokers/StaticFieldSetter.java
  33. +7 −7 core/src/main/java/org/jruby/java/invokers/StaticMethodInvoker.java
  34. +42 −28 core/src/main/java/org/jruby/java/proxies/JavaProxy.java
  35. +126 −49 core/src/main/java/org/jruby/javasupport/Java.java
  36. +1 −1 core/src/main/java/org/jruby/javasupport/JavaClass.java
  37. +3 −4 core/src/main/java/org/jruby/javasupport/JavaSupportImpl.java
  38. +1 −1 core/src/main/java/org/jruby/javasupport/JavaUtil.java
  39. +78 −66 core/src/main/java/org/jruby/javasupport/proxy/JavaProxyClass.java
  40. +27 −29 core/src/main/java/org/jruby/javasupport/proxy/JavaProxyClassFactory.java
  41. +43 −17 core/src/main/java/org/jruby/javasupport/proxy/JavaProxyConstructor.java
  42. +6 −8 core/src/main/java/org/jruby/runtime/Arity.java
  43. +28 −44 core/src/main/java/org/jruby/runtime/Helpers.java
  44. +46 −58 core/src/main/java/org/jruby/runtime/MethodIndex.java
  45. +0 −2 core/src/main/java/org/jruby/runtime/builtin/IRubyObject.java
  46. +5 −4 core/src/main/java/org/jruby/runtime/ivars/NonvolatileVariableAccessor.java
  47. +3 −2 core/src/main/java/org/jruby/runtime/ivars/StampedVariableAccessor.java
  48. +4 −2 core/src/main/java/org/jruby/runtime/ivars/SynchronizedVariableAccessor.java
  49. +12 −16 core/src/main/java/org/jruby/runtime/ivars/VariableTableManager.java
  50. +2 −1 core/src/main/java/org/jruby/runtime/scope/ManyVarsDynamicScope.java
  51. +2 −1 core/src/main/java/org/jruby/runtime/scope/SharedBindingDynamicScope.java
  52. +140 −0 core/src/main/java/org/jruby/util/ArraySupport.java
  53. +158 −0 core/src/test/java/org/jruby/bench/BenchArrayCopy.java
  54. +34 −41 lib/ruby/stdlib/jruby/compiler/java_signature.rb
  55. +22 −69 lib/ruby/stdlib/jruby/core_ext/class.rb
  56. +4 −1 rakelib/test.rake
  57. +28 −13 spec/java_integration/reify/become_java_spec.rb
  58. +37 −1 spec/java_integration/types/construction_spec.rb
  59. +8 −2 test/jruby/test_java_extension.rb
5 changes: 2 additions & 3 deletions core/src/main/java/org/jruby/RubyArray.java
Original file line number Diff line number Diff line change
@@ -61,6 +61,7 @@
import org.jruby.runtime.marshal.UnmarshalStream;
import org.jruby.specialized.RubyArrayOneObject;
import org.jruby.specialized.RubyArrayTwoObject;
import org.jruby.util.ArraySupport;
import org.jruby.util.ByteList;
import org.jruby.util.Pack;
import org.jruby.util.RecursiveComparator;
@@ -4072,9 +4073,7 @@ public IRubyObject sample(ThreadContext context, IRubyObject[] args) {
if (argRandgen != null) {
randgen = argRandgen;
}
IRubyObject[] newargs = new IRubyObject[args.length - 1];
System.arraycopy(args, 0, newargs, 0, args.length - 1);
args = newargs;
args = ArraySupport.newCopy(args, args.length - 1);
}
}
if (args.length == 0) {
40 changes: 8 additions & 32 deletions core/src/main/java/org/jruby/RubyBasicObject.java
Original file line number Diff line number Diff line change
@@ -68,6 +68,7 @@
import org.jruby.runtime.builtin.Variable;
import org.jruby.runtime.component.VariableEntry;
import org.jruby.runtime.marshal.CoreObjectType;
import org.jruby.util.ArraySupport;
import org.jruby.util.IdUtil;
import org.jruby.util.TypeConverter;
import org.jruby.util.unsafe.UnsafeHolder;
@@ -1651,17 +1652,10 @@ public IRubyObject send19(ThreadContext context, IRubyObject arg0, IRubyObject a
@JRubyMethod(name = "__send__", required = 1, rest = true, omit = true)
public IRubyObject send19(ThreadContext context, IRubyObject[] args, Block block) {
String name = RubySymbol.objectToSymbolString(args[0]);
int newArgsLength = args.length - 1;

IRubyObject[] newArgs;
if (newArgsLength == 0) {
newArgs = IRubyObject.NULL_ARRAY;
} else {
newArgs = new IRubyObject[newArgsLength];
System.arraycopy(args, 1, newArgs, 0, newArgs.length);
}

return getMetaClass().finvoke(context, this, name, newArgs, block);
final int length = args.length - 1;
args = ( length == 0 ) ? IRubyObject.NULL_ARRAY : ArraySupport.newCopy(args, 1, length);
return getMetaClass().finvoke(context, this, name, args, block);
}

@JRubyMethod(name = "instance_eval",
@@ -2645,35 +2639,17 @@ public IRubyObject send(ThreadContext context, Block block) {
throw context.runtime.newArgumentError(0, 1);
}
public IRubyObject send(ThreadContext context, IRubyObject arg0, Block block) {
String name = RubySymbol.objectToSymbolString(arg0);

return getMetaClass().finvoke(context, this, name, block);
return send19(context, arg0, block);
}
public IRubyObject send(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block) {
String name = RubySymbol.objectToSymbolString(arg0);

return getMetaClass().finvoke(context, this, name, arg1, block);
return send19(context, arg0, arg1, block);
}
public IRubyObject send(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) {
String name = RubySymbol.objectToSymbolString(arg0);

return getMetaClass().finvoke(context, this, name, arg1, arg2, block);
return send19(context, arg0, arg1, arg2, block);
}
public IRubyObject send(ThreadContext context, IRubyObject[] args, Block block) {
if (args.length == 0) return send(context, block);

String name = RubySymbol.objectToSymbolString(args[0]);
int newArgsLength = args.length - 1;

IRubyObject[] newArgs;
if (newArgsLength == 0) {
newArgs = IRubyObject.NULL_ARRAY;
} else {
newArgs = new IRubyObject[newArgsLength];
System.arraycopy(args, 1, newArgs, 0, newArgs.length);
}

return getMetaClass().finvoke(context, this, name, newArgs, block);
return send19(context, args, block);
}

/** rb_false
30 changes: 13 additions & 17 deletions core/src/main/java/org/jruby/RubyClass.java
Original file line number Diff line number Diff line change
@@ -86,6 +86,7 @@
import org.jruby.runtime.marshal.MarshalStream;
import org.jruby.runtime.marshal.UnmarshalStream;
import org.jruby.runtime.opto.Invalidator;
import org.jruby.util.ArraySupport;
import org.jruby.util.OneShotClassLoader;
import org.jruby.util.ClassDefiningClassLoader;
import org.jruby.util.CodegenUtils;
@@ -696,18 +697,12 @@ private IRubyObject checkFuncallDefault(ThreadContext context, IRubyObject self,

// MRI: check_funcall_exec
private static IRubyObject checkFuncallExec(ThreadContext context, IRubyObject self, String name, IRubyObject... args) {
IRubyObject[] newArgs = new IRubyObject[args.length + 1];
System.arraycopy(args, 0, newArgs, 1, args.length);
newArgs[0] = context.runtime.newSymbol(name);
return self.callMethod(context, "method_missing", newArgs);
return self.callMethod(context, "method_missing", ArraySupport.newCopy(context.runtime.newSymbol(name), args));
}

// MRI: check_funcall_exec
private static IRubyObject checkFuncallExec(ThreadContext context, IRubyObject self, String name, CallSite methodMissingSite, IRubyObject... args) {
IRubyObject[] newArgs = new IRubyObject[args.length + 1];
System.arraycopy(args, 0, newArgs, 1, args.length);
newArgs[0] = context.runtime.newSymbol(name);
return methodMissingSite.call(context, self, self, newArgs);
return methodMissingSite.call(context, self, self, ArraySupport.newCopy(context.runtime.newSymbol(name), args));
}

// MRI: check_funcall_failed
@@ -1396,22 +1391,20 @@ public synchronized void reify(String classDumpDir, boolean useChildLoader) {
// re-check reifiable in case another reify call has jumped in ahead of us
if (!isReifiable()) return;

// calculate an appropriate name, using "Anonymous####" if none is present
final String name = getBaseName() != null ? getName() : ("AnonymousRubyClass__" + id);
// calculate an appropriate name, for anonymous using inspect like format e.g. "Class:0x628fad4a"
final String name = getBaseName() != null ? getName() :
( "Class:0x" + Integer.toHexString(System.identityHashCode(this)) );

final String javaName = "rubyobj." + name.replaceAll("::", ".");
final String javaPath = "rubyobj/" + name.replaceAll("::", "/");

final Class parentReified = superClass.getRealClass().getReifiedClass();
if (parentReified == null) {
throw getClassRuntime().newTypeError("class " + getName() + " parent class is not yet reified");
throw getClassRuntime().newTypeError(getName() + "'s parent class is not yet reified");
}

Class reifiedParent = RubyObject.class;

if (superClass.reifiedClass != null) {
reifiedParent = superClass.reifiedClass;
}
if (superClass.reifiedClass != null) reifiedParent = superClass.reifiedClass;

final byte[] classBytes = new Reificator(reifiedParent).reify(javaName, javaPath);

@@ -1541,7 +1534,10 @@ byte[] reify(final String javaName, final String javaPath) {
for (Map.Entry<String,DynamicMethod> methodEntry : getMethods().entrySet()) {
final String methodName = methodEntry.getKey();

if (!JavaNameMangler.willMethodMangleOk(methodName)) continue;
if ( ! JavaNameMangler.willMethodMangleOk(methodName) ) {
LOG.debug("{} method: '{}' won't be part of reified Java class", getName(), methodName);
continue;
}

String javaMethodName = JavaNameMangler.mangleMethodName(methodName);

@@ -1616,7 +1612,7 @@ byte[] reify(final String javaName, final String javaPath) {

// indices for temp values
Class[] params = new Class[methodSignature.length - 1];
System.arraycopy(methodSignature, 1, params, 0, params.length);
ArraySupport.copy(methodSignature, 1, params, 0, params.length);
final int baseIndex = RealClassGenerator.calcBaseIndex(params, 1);
final int rubyIndex = baseIndex;

8 changes: 5 additions & 3 deletions core/src/main/java/org/jruby/RubyEnumerator.java
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@
import org.jruby.runtime.Signature;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.util.ArraySupport;
import org.jruby.util.ByteList;
import org.jruby.util.cli.Options;

@@ -328,9 +329,10 @@ public IRubyObject each(ThreadContext context, IRubyObject[] args, Block block)
return each(context, block);
}

IRubyObject[] newArgs = new IRubyObject[methodArgs.length + args.length];
System.arraycopy(methodArgs, 0, newArgs, 0, methodArgs.length);
System.arraycopy(args, 0, newArgs, methodArgs.length, args.length);
final int mlen = methodArgs.length;
IRubyObject[] newArgs = new IRubyObject[mlen + args.length];
ArraySupport.copy(methodArgs, newArgs, 0, mlen);
ArraySupport.copy(args, newArgs, mlen, args.length);

return new RubyEnumerator(context.runtime, getType(), object, context.runtime.newSymbol("each"), newArgs);
}
17 changes: 8 additions & 9 deletions core/src/main/java/org/jruby/RubyFloat.java
Original file line number Diff line number Diff line change
@@ -273,14 +273,14 @@ public IRubyObject op_plus(ThreadContext context, IRubyObject other) {
case FIXNUM:
case BIGNUM:
case FLOAT:
return RubyFloat.newFloat(getRuntime(), value + ((RubyNumeric) other).getDoubleValue());
return RubyFloat.newFloat(context.runtime, value + ((RubyNumeric) other).getDoubleValue());
default:
return coerceBin(context, sites(context).op_plus, other);
}
}

public IRubyObject op_plus(ThreadContext context, double other) {
return RubyFloat.newFloat(getRuntime(), value + other);
return RubyFloat.newFloat(context.runtime, value + other);
}

/** flo_minus
@@ -292,14 +292,14 @@ public IRubyObject op_minus(ThreadContext context, IRubyObject other) {
case FIXNUM:
case BIGNUM:
case FLOAT:
return RubyFloat.newFloat(getRuntime(), value - ((RubyNumeric) other).getDoubleValue());
return RubyFloat.newFloat(context.runtime, value - ((RubyNumeric) other).getDoubleValue());
default:
return coerceBin(context, sites(context).op_minus, other);
}
}

public IRubyObject op_minus(ThreadContext context, double other) {
return RubyFloat.newFloat(getRuntime(), value - other);
return RubyFloat.newFloat(context.runtime, value - other);
}

/** flo_mul
@@ -311,8 +311,7 @@ public IRubyObject op_mul(ThreadContext context, IRubyObject other) {
case FIXNUM:
case BIGNUM:
case FLOAT:
return RubyFloat.newFloat(
getRuntime(), value * ((RubyNumeric) other).getDoubleValue());
return RubyFloat.newFloat(context.runtime, value * ((RubyNumeric) other).getDoubleValue());
default:
return coerceBin(context, sites(context).op_times, other);
}
@@ -332,14 +331,14 @@ public IRubyObject op_fdiv(ThreadContext context, IRubyObject other) { // don't
case FIXNUM:
case BIGNUM:
case FLOAT:
return RubyFloat.newFloat(getRuntime(), value / ((RubyNumeric) other).getDoubleValue());
return RubyFloat.newFloat(context.runtime, value / ((RubyNumeric) other).getDoubleValue());
default:
return coerceBin(context, sites(context).op_quo, other);
}
}

public IRubyObject op_fdiv(ThreadContext context, double other) { // don't override Numeric#div !
return RubyFloat.newFloat(getRuntime(), value / other);
return RubyFloat.newFloat(context.runtime, value / other);
}

/** flo_quo
@@ -374,7 +373,7 @@ public IRubyObject op_mod(ThreadContext context, double other) {
mod += other;
}

return RubyFloat.newFloat(getRuntime(), mod);
return RubyFloat.newFloat(context.runtime, mod);
}

/** flo_mod
7 changes: 2 additions & 5 deletions core/src/main/java/org/jruby/RubyGenerator.java
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.Visibility;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.util.ArraySupport;

public class RubyGenerator extends RubyObject {
public static void createGeneratorClass(Ruby runtime) {
@@ -95,11 +96,7 @@ public IRubyObject initialize_copy(ThreadContext context, IRubyObject other) {
// generator_each
@JRubyMethod(rest = true)
public IRubyObject each(ThreadContext context, IRubyObject[] args, Block block) {
IRubyObject[] newArgs = new IRubyObject[args.length + 1];
newArgs[0] = RubyYielder.newYielder(context, block);
if (args.length > 0) System.arraycopy(args, 0, newArgs, 1, args.length);

return ((RubyProc)proc).call19(context, newArgs, Block.NULL_BLOCK);
return ((RubyProc) proc).call19(context, ArraySupport.newCopy(RubyYielder.newYielder(context, block), args), Block.NULL_BLOCK);
}


25 changes: 9 additions & 16 deletions core/src/main/java/org/jruby/RubyKernel.java
Original file line number Diff line number Diff line change
@@ -64,6 +64,7 @@
import org.jruby.runtime.DynamicScope;
import org.jruby.runtime.backtrace.RubyStackTraceElement;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.util.ArraySupport;
import org.jruby.util.ByteList;
import org.jruby.util.ConvertBytes;
import org.jruby.util.IdUtil;
@@ -1571,9 +1572,7 @@ public static IRubyObject system19(ThreadContext context, IRubyObject recv, IRub
runtime.getENV().merge_bang(context, env, Block.NULL_BLOCK);
}
// drop the first element for calling systemCommon()
IRubyObject[] rest = new IRubyObject[args.length - 1];
System.arraycopy(args, 1, rest, 0, args.length - 1);
args = rest;
args = ArraySupport.newCopy(args, 1, args.length - 1);
}
int resultCode = systemCommon(context, recv, args);
switch (resultCode) {
@@ -1796,23 +1795,17 @@ public static IRubyObject public_send(ThreadContext context, IRubyObject recv, I
}

String name = RubySymbol.objectToSymbolString(args[0]);
int newArgsLength = args.length - 1;

IRubyObject[] newArgs;
if (newArgsLength == 0) {
newArgs = IRubyObject.NULL_ARRAY;
} else {
newArgs = new IRubyObject[newArgsLength];
System.arraycopy(args, 1, newArgs, 0, newArgs.length);
}
final int length = args.length - 1;
args = ( length == 0 ) ? IRubyObject.NULL_ARRAY : ArraySupport.newCopy(args, 1, length);

DynamicMethod method = recv.getMetaClass().searchMethod(name);

if (method.isUndefined() || method.getVisibility() != PUBLIC) {
return Helpers.callMethodMissing(context, recv, method.getVisibility(), name, CallType.NORMAL, newArgs, block);
return Helpers.callMethodMissing(context, recv, method.getVisibility(), name, CallType.NORMAL, args, block);
}

return method.call(context, recv, recv.getMetaClass(), name, newArgs, block);
return method.call(context, recv, recv.getMetaClass(), name, args, block);
}

/*
@@ -1828,17 +1821,17 @@ public static IRubyObject eql_p(IRubyObject self, IRubyObject obj) {

@JRubyMethod(name = "===", required = 1)
public static IRubyObject op_eqq(ThreadContext context, IRubyObject self, IRubyObject other) {
return ((RubyBasicObject)self).op_eqq(context, other);
return ((RubyBasicObject) self).op_eqq(context, other);
}

@JRubyMethod(name = "<=>", required = 1)
public static IRubyObject op_cmp(ThreadContext context, IRubyObject self, IRubyObject other) {
return ((RubyBasicObject)self).op_cmp(context, other);
return ((RubyBasicObject) self).op_cmp(context, other);
}

@JRubyMethod(name = "initialize_copy", required = 1, visibility = PRIVATE)
public static IRubyObject initialize_copy(IRubyObject self, IRubyObject original) {
return ((RubyBasicObject)self).initialize_copy(original);
return ((RubyBasicObject) self).initialize_copy(original);
}

// Replaced in jruby/kernel/kernel.rb with Ruby for better caching
Loading