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

Commits on Mar 12, 2015

  1. Fix warning.

    headius committed Mar 12, 2015
    Copy the full SHA
    94bda8d View commit details

Commits on Mar 16, 2015

  1. Copy the full SHA
    af940b1 View commit details

Commits on Mar 17, 2015

  1. Copy the full SHA
    297c953 View commit details
  2. Revert "Use JDK8 for these three...they are affected by JVM+Travis is…

    …sues."
    
    This reverts commit 297c953.
    headius committed Mar 17, 2015
    Copy the full SHA
    df6bae2 View commit details
  3. Copy the full SHA
    14d1d29 View commit details

Commits on Mar 18, 2015

  1. correct (Java) equals/hashCode semantics for JavaAccessibleObject + m…

    …inor tweaks
    
    - return concrete types from getValue
    - also re-implemented (inherited) toJava conversion
    kares committed Mar 18, 2015
    Copy the full SHA
    d7217ca View commit details
  2. Copy the full SHA
    1337fbe View commit details
  3. Copy the full SHA
    015d9b4 View commit details
  4. Copy the full SHA
    1c5c4a3 View commit details
  5. Copy the full SHA
    ee0113e View commit details
  6. Copy the full SHA
    03acf55 View commit details
  7. Copy the full SHA
    ebc2422 View commit details
  8. Copy the full SHA
    0de8bdf View commit details
  9. Copy the full SHA
    b997129 View commit details
  10. add a factory onto ClassValue since we're be instantiating the same (…

    …based on opt)
    
    - JavaSupport internals now no longer deal with ClassValue impl constructors
    kares committed Mar 18, 2015
    Copy the full SHA
    cfa0011 View commit details
  11. Copy the full SHA
    99a4c30 View commit details
  12. Copy the full SHA
    bf85781 View commit details
  13. Copy the full SHA
    07e87cc View commit details
  14. Copy the full SHA
    9902ebd View commit details
  15. Copy the full SHA
    411086d View commit details
  16. re-factored candidate matching loops - for more readability and less …

    …implicit iterator use
    kares committed Mar 18, 2015
    Copy the full SHA
    b5c5e2b View commit details
  17. Copy the full SHA
    3635300 View commit details
  18. in case there's an exact parameter match - do not proceed with argume…

    …nt matching
    
    ... towards fixing #2595
    kares committed Mar 18, 2015
    Copy the full SHA
    6521ee4 View commit details
  19. 4
    Copy the full SHA
    adeb887 View commit details

Commits on Mar 19, 2015

  1. Merge branch 'jruby-1_7' into master

    * jruby-1_7: (24 commits)
      calculate 'sofisticated' type preference when ambiguous callables found (fixes #2595)
      in case there's an exact parameter match - do not proceed with argument matching
      do not do equals on Class objects (just compare by identity) + remove unused imports
      re-factored candidate matching loops - for more readability and less implicit iterator use
      cleanup the constructor search - keeping redundant ~ 'intended' code as comments
      a slight Java integration (mostly bootstrap internals) cleanup
      update CallableSelector's (Map) cache internals - so we can easily refactor further
      move Java.method_missing into native
      loadPaths list generics - easier to guess for JavaEmbedUtils consumers
      add a factory onto ClassValue since we're be instantiating the same (based on opt)
      one JRubyMethod with 2 names is enough to have
      more base-class sharing between JavaCallable method/constructor impl + minor tweaks
      move getArity/getParameterTypes into base class as finals + help used methods to JIT
      guess name-class hash-map size without internal resizing (currently <= 48 elements)
      after several concurrency fixes in Java integration - un-comment a multi-threaded test
      non need to cast intValue to (int)
      move (and tune) error logic from CallableSelector into the invoker impl where it's used
      align JavaField's value/static_value conversions and return values + test functionality
      correct (Java) equals/hashCode semantics for JavaAccessibleObject + minor tweaks
      Try turning off sudo:false to fix build issues.
      ...
    
    Conflicts:
    	.travis.yml
    	core/src/main/java/org/jruby/RubyObject.java
    	core/src/main/java/org/jruby/java/proxies/MapJavaProxy.java
    	core/src/main/java/org/jruby/javasupport/JavaCallable.java
    	core/src/main/java/org/jruby/javasupport/JavaEmbedUtils.java
    	core/src/main/java/org/jruby/javasupport/JavaSupport.java
    	core/src/main/java/org/jruby/runtime/Helpers.java
    	core/src/main/java/org/jruby/util/CodegenUtils.java
    	core/src/main/ruby/jruby/java.rb
    	core/src/test/java/org/jruby/test/TestCodeCache.java
    	test/test_higher_javasupport.rb
    kares committed Mar 19, 2015
    Copy the full SHA
    f2b9bf7 View commit details
  2. Merge branch 'master' of github.com:jruby/jruby

    * 'master' of github.com:jruby/jruby: (56 commits)
      [Truffle] Renamed some classes to generate smaller filenames.
      [Truffle] Moving Array#join to array.rb.
      [Truffle] FindBugs: remove unused fields.
      [Truffle] JT: Remove useless enumerator.
      [Truffle] JT: Move paths inside the methods using them.
      [Truffle] JT: Find appropriate Graal based on Truffle version.
      [Truffle] JT: Do not specify full path.
      Re-tag exposed failures in m17n_comb while we fix on a branch.
      [Truffle] JT: Rename Utilities.branch to git_branch.
      [Truffle] Refactoring ReturnEnumeratorIfNoBlockNode arguments unshift into RubyArguments method.
      [Truffle] Fix hardcoded path and grammar.
      [Truffle] Allow GRAAL_BIN to be set per branch by an environment variable.
      [Truffle] jt run --igv option.
      [Truffle] No such thing as a FrozenError.
      implements strict base64 encoding
      [build] regenerate pom.xml [skip ci]
      [Truffle] Fix SourceSection identifier for def* nodes.
      [build] remove warning on duplicate plugin definitions [skip ci]
      [Truffle] Implementing more of Array#concat
      [Truffle] Display non-aliased (called) name in backtrace of core methods.
      ...
    kares committed Mar 19, 2015
    Copy the full SHA
    96ee1d8 View commit details
Showing with 1,241 additions and 1,099 deletions.
  1. +19 −21 core/src/main/java/org/jruby/RubyObject.java
  2. +261 −249 core/src/main/java/org/jruby/java/dispatch/CallableSelector.java
  3. +66 −9 core/src/main/java/org/jruby/java/invokers/RubyToJavaInvoker.java
  4. +3 −3 core/src/main/java/org/jruby/java/proxies/ConcreteJavaProxy.java
  5. +24 −24 core/src/main/java/org/jruby/java/proxies/MapJavaProxy.java
  6. +55 −39 core/src/main/java/org/jruby/javasupport/Java.java
  7. +40 −18 core/src/main/java/org/jruby/javasupport/JavaAccessibleObject.java
  8. +15 −12 core/src/main/java/org/jruby/javasupport/JavaArray.java
  9. +92 −44 core/src/main/java/org/jruby/javasupport/JavaCallable.java
  10. +82 −71 core/src/main/java/org/jruby/javasupport/JavaClass.java
  11. +81 −117 core/src/main/java/org/jruby/javasupport/JavaConstructor.java
  12. +10 −10 core/src/main/java/org/jruby/javasupport/JavaEmbedUtils.java
  13. +55 −70 core/src/main/java/org/jruby/javasupport/JavaField.java
  14. +33 −63 core/src/main/java/org/jruby/javasupport/JavaMethod.java
  15. +9 −9 core/src/main/java/org/jruby/javasupport/JavaObject.java
  16. +0 −1 core/src/main/java/org/jruby/javasupport/JavaSupport.java
  17. +33 −69 core/src/main/java/org/jruby/javasupport/JavaSupportImpl.java
  18. +209 −205 core/src/main/java/org/jruby/runtime/Helpers.java
  19. +22 −23 core/src/main/java/org/jruby/util/CodegenUtils.java
  20. +32 −3 core/src/main/java/org/jruby/util/collections/ClassValue.java
  21. +1 −2 core/src/main/ruby/jruby/java.rb
  22. +1 −8 core/src/main/ruby/jruby/java/java_module.rb
  23. +3 −3 core/src/test/java/org/jruby/runtime/EventHookTest.java
  24. +95 −26 test/jruby/test_higher_javasupport.rb
40 changes: 19 additions & 21 deletions core/src/main/java/org/jruby/RubyObject.java
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@
* RubyObject represents the implementation of the Object class in Ruby. As such,
* it defines very few methods of its own, inheriting most from the included
* Kernel module.
*
*
* Methods that are implemented here, such as "initialize" should be implemented
* with care; reification of Ruby classes into Java classes can produce
* conflicting method names in rare cases. See JRUBY-5906 for an example.
@@ -139,77 +139,77 @@ public IRubyObject allocate(Ruby runtime, RubyClass klass) {
return new RubyObject(runtime, klass);
}
};

public static final ObjectAllocator OBJECT_VAR0_ALLOCATOR = new ObjectAllocator() {
@Override
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
return new RubyObjectVar0(runtime, klass);
}
};

public static final ObjectAllocator OBJECT_VAR1_ALLOCATOR = new ObjectAllocator() {
@Override
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
return new RubyObjectVar1(runtime, klass);
}
};

public static final ObjectAllocator OBJECT_VAR2_ALLOCATOR = new ObjectAllocator() {
@Override
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
return new RubyObjectVar2(runtime, klass);
}
};

public static final ObjectAllocator OBJECT_VAR3_ALLOCATOR = new ObjectAllocator() {
@Override
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
return new RubyObjectVar3(runtime, klass);
}
};

public static final ObjectAllocator OBJECT_VAR4_ALLOCATOR = new ObjectAllocator() {
@Override
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
return new RubyObjectVar4(runtime, klass);
}
};

public static final ObjectAllocator OBJECT_VAR5_ALLOCATOR = new ObjectAllocator() {
@Override
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
return new RubyObjectVar5(runtime, klass);
}
};

public static final ObjectAllocator OBJECT_VAR6_ALLOCATOR = new ObjectAllocator() {
@Override
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
return new RubyObjectVar6(runtime, klass);
}
};

public static final ObjectAllocator OBJECT_VAR7_ALLOCATOR = new ObjectAllocator() {
@Override
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
return new RubyObjectVar7(runtime, klass);
}
};

public static final ObjectAllocator OBJECT_VAR8_ALLOCATOR = new ObjectAllocator() {
@Override
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
return new RubyObjectVar8(runtime, klass);
}
};

public static final ObjectAllocator OBJECT_VAR9_ALLOCATOR = new ObjectAllocator() {
@Override
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
return new RubyObjectVar9(runtime, klass);
}
};

public static final ObjectAllocator[] FIELD_ALLOCATORS = {
OBJECT_ALLOCATOR,
OBJECT_VAR0_ALLOCATOR,
@@ -223,7 +223,7 @@ public IRubyObject allocate(Ruby runtime, RubyClass klass) {
OBJECT_VAR8_ALLOCATOR,
OBJECT_VAR9_ALLOCATOR
};

public static final Class[] FIELD_ALLOCATED_CLASSES = {
RubyObject.class,
RubyObjectVar0.class,
@@ -237,7 +237,7 @@ public IRubyObject allocate(Ruby runtime, RubyClass klass) {
RubyObjectVar8.class,
RubyObjectVar9.class,
};

/**
* Allocator that inspects all methods for instance variables and chooses
* a concrete class to construct based on that. This allows using
@@ -252,19 +252,19 @@ public IRubyObject allocate(Ruby runtime, RubyClass klass) {
if (Options.DUMP_INSTANCE_VARS.load()) {
System.err.println(klass + ";" + foundVariables);
}

int count = 0;
for (String name : foundVariables) {
klass.getVariableTableManager().getVariableAccessorForVar(name, count);
count++;
if (count >= 10) break;
}

ObjectAllocator allocator = FIELD_ALLOCATORS[count];
Class reified = FIELD_ALLOCATED_CLASSES[count];
klass.setAllocator(allocator);
klass.setReifiedClass(reified);

return allocator.allocate(runtime, klass);
}
};
@@ -516,13 +516,11 @@ public int hashCode() {
}

private int nonFixnumHashCode(IRubyObject hashValue) {
Ruby runtime = getRuntime();
RubyInteger integer = hashValue.convertToInteger();
if (integer instanceof RubyBignum) {
return (int)integer.getBigIntegerValue().intValue();
} else {
return (int)integer.getLongValue();
return integer.getBigIntegerValue().intValue();
}
return (int) integer.getLongValue();
}

/** rb_inspect
Loading