Commit Graph

11 Commits

Author SHA1 Message Date
Johannes Schindelin
6a81623690 Implement the Arrays#copyOf family
... as introduced in Java 6.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-11-04 15:11:00 -06:00
Johannes Schindelin
605701e40a Replace Arrays.sort() with an efficient sort algorithm
This change reuses the existing insertion sort (which was previously what
Arrays.sort() executed) in a full intro sort pipeline.

The implementation is based on the Musser paper on intro sort (Musser,
David R. "Introspective sorting and selection algorithms." Softw., Pract.
Exper. 27.8 (1997): 983-993.) and Wikipedia's current description of the
heap sort: http://en.wikipedia.org/wiki/Heapsort.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-11-04 00:27:04 -06:00
Damjan Jovanovic
5a09774353 tests don't compile when building with OpenJDK
I get this error when compiling with "make openjdk=...." on both x86_64 and
arm:

compiling test classes
test/Arrays.java:90: error: reference to equals is ambiguous, both method
equals(float[],float[]) in Arrays and method equals(Object[],Object[]) in
Arrays match
      expect(java.util.Arrays.equals(null, null));

test/Arrays.java:95: error: reference to hashCode is ambiguous, both method
hashCode(double[]) in Arrays and method hashCode(Object[]) in Arrays match
      java.util.Arrays.hashCode(null);

The attached patch fixes this.
2012-08-04 07:29:39 -06:00
Joel Dice
de086d1046 fix typo in Arrays test 2012-07-24 11:38:43 -06:00
Joshua Warner
fffde5f445 add Arrays test for equals and hashCode, handle corner cases with null 2012-07-24 11:31:47 -06:00
Joel Dice
7164743009 fix Array.makeObjectArray regression 2010-12-01 15:44:09 -07:00
Joel Dice
a611ccda6f Merge remote branch 'origin/master' into openjdk
Conflicts:
	makefile
	src/compile.cpp
	src/compiler.cpp
	src/type-generator.cpp
2010-11-16 10:18:08 -07:00
Joel Dice
7978102cb6 use register for indexing if constant offset is too large (or too small)
Immediate indexes on ARM must be no more than 12 bits, so we must use
a temporary register for values which don't fit.
2010-11-09 11:36:38 -07:00
Joel Dice
e75b57a127 don't abort when compiling an array lookup with a constant negative index
Instead, just compile it as a direct call to the thunk which throws an
ArrayIndexOutOfBoundsException.
2010-09-25 15:48:15 -06:00
Joel Dice
6297c8a906 add tests to Arrays.java and Longs.java 2009-02-02 19:12:07 -07:00
Joel Dice
cae5202be0 split Misc.java into four separate files 2008-11-10 17:07:15 -07:00