Commit Graph

1055 Commits

Author SHA1 Message Date
Marcin Olawski
ab3ee4c6e2 Add Character.isJavaIdentifierStart(char ch) and isJavaIdentifierPart(char ch) 2015-02-06 15:26:40 +01:00
Joel Dice
c2a0210c7b fix ARM64 iOS JNI crashes
As documented at
https://developer.apple.com/library/ios/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html,
the ARM64 iOS ABI differs from the generic ABI in a few important
ways.  Specifically, arguments passed via the stack are aligned
according to their natural alignment instead of 8 bytes.  The VM's
dynamic call code was aligning each argument to 8 bytes, so native JNI
code couldn't find them in their expected places.

Also, we weren't setting the "os.arch" system property on ARM64, so I
fixed that too.
2015-02-05 17:20:53 -07:00
Joel Dice
d37cb93d50 remove redundant class qualifiers from Classes.java 2014-12-29 10:00:51 -07:00
Mike Jensen
ee0ad22415 Undo my collections changes, as I was wrong here 2014-12-15 17:15:00 -07:00
Mike Jensen
32a1fb21f2 Some small classpath tweaks to be compatible with openJDK's api 2014-12-15 16:26:41 -07:00
Mike Jensen
7baa5243b0 Add Collections.synchronizedList to classpath 2014-12-12 11:35:39 -07:00
Joel Dice
66f1b7cf8f Merge pull request #370 from lostdj/patch-8
Added missing MIX/MAX_VALUE for basic types.
2014-11-19 08:15:16 -07:00
lostdj
0ec230497b Added missing MIX/MAX_VALUE for basic types. 2014-11-19 14:27:11 +03:00
Timofey Lagutin
e657863656 String.equalsIgnoreCase(): fix nullptrex.
It's logical and conforms OpenJDK..
2014-11-19 14:06:31 +03:00
Joel Dice
78a0e207c0 Merge pull request #367 from lostdj/patch-6
Fix some native and managed function signatures.
2014-11-11 14:33:51 -07:00
lostdj
3cff81da8d Fix some native and managed function signatures. 2014-11-08 14:06:11 +03:00
Joel Dice
4fd8396ba3 fix WSA error 10093 when openning a ServerSocketChannel
We need to call Socket.init before trying to use the Windows Socket
library.  We were already doing this in SocketChannel.open, but not in
ServerSocketChannel.open.
2014-11-07 11:31:19 -07:00
Joel Dice
8ac58b7d77 add minimal NavigableMap interface 2014-11-05 14:27:24 -07:00
Joel Dice
2776e98bf5 use .dylib instead of .jnilib as OS X library suffix
This matches the behavior of System.mapLibraryName on
JDK 7 and later.
2014-10-28 14:53:43 -06:00
Joel Dice
f25d5921a5 implement StringWriter.getBuffer
This is used by json.org's JSON library.
2014-10-28 14:52:02 -06:00
Joshua Warner
331c635814 Merge pull request #357 from lostdj/patch-2
Added missing cp/avian/Math.atan2(double,double)
2014-10-11 20:47:17 -06:00
Ilya Mizus
75dda14691 Fixed small bug in getClassType() function. 2014-10-11 23:36:14 +04:00
Timofey Lagutin
d4d31af740 Added missing cp/avian/Math.atan2(double,double)
It was implemented as native function, but wasn't added to java.lang.Math.
2014-10-11 14:33:48 +04:00
Timofey Lagutin
a820370cb2 cp/avian/java-net.cpp: fix segfault
In Java_java_net_InetAddress_ipv4AddressForName:
  Throw nullptrex on hostname = null.
2014-10-10 19:06:36 +04:00
Ilya Mizus
85fec988d5 Added Class.getGenericSuperclass() and improved Member subclasses. Fixed Makefile on OS X 2014-10-09 02:32:56 +04:00
Joel Dice
998f99af44 Merge remote-tracking branch 'bfbc/avian-pack'
Conflicts:
	makefile
2014-10-08 14:04:00 -06:00
Joel Dice
fbcdfd6dec Merge remote-tracking branch 'dicej/android-upgrade' 2014-10-08 13:41:50 -06:00
Ilya Mizus
7d4cd23837 Some improvements in the code 2014-10-08 03:46:52 +04:00
Ilya Mizus
d1d97351b9 Reflection improved 2014-10-07 16:50:02 +04:00
Joel Dice
be91d792e4 fix Class.getInterfaces to return only declared interfaces
Previously, we returned all interfaces implemented directly or
indirectly, which did not match the JDK behavior.
2014-10-05 16:28:36 -06:00
Ilya Mizus
270bbc66f9 Added getGenericInterfaces() and fixed SignatureParser to work for everything except TypeVariable-s 2014-10-04 22:17:49 +04:00
Ilya Mizus
67cafb118c Added isAnonymousClass(), isLocalClass(), isMemberClass() functions to Class class 2014-10-02 23:51:25 +04:00
Joel Dice
b406e9c2ed Merge remote-tracking branch 'origin/master' into android-upgrade 2014-09-24 10:59:39 -06:00
Joel Dice
a81879129a add a TODO comment about class comparison 2014-09-03 16:24:15 -06:00
Joel Dice
831c529a98 make Class.getMethod (and getConstructor) more strict about parameter types
This matches the JDK behavior.
2014-08-28 17:00:33 -06:00
Joel Dice
7f4c0b3118 fix SSL stack and Android JAR resource loading 2014-08-22 07:20:19 -06:00
Joel Dice
b96cc3c575 update to more recent version of Android class library
Lots has changed since we forked Android's libcore, so merging the
latest upstream code has required extensive changes to the
Avian/Android port.

One big change is that we now use Avian's versions of
java.lang.Object, java.lang.Class, java.lang.ClassLoader, some
java.lang.reflect.* classes, etc. instead of the Android versions.
The main reason is that the Android versions have become very
Dex/Dalvik-specific, and since Avian is based on Java class files, not
dex archives, that code doesn't make sense here.  This has the side
benefit that we can share more native code with classpath-avian.cpp
and reduce the amount of Java/C++ code duplication.
2014-08-21 13:42:49 -06:00
Joel Dice
8b83de8985 add avian.Machine.tryNative
This function allows you to call native code such that any
SIGSEGV/SIGBUS/SIGFPE/EXC_ACCESS_VIOLATION/etc. raised by that code is
transformed into a Java exception and thrown by tryNative.  Note that
this effectively results in a longjmp out of whatever function raised
the exception, so any C++ destructors or other cleanup code will not
be run.
2014-08-19 14:03:46 -06:00
Joel Dice
5b618982b5 explicitly override UNUSED definition
Recent versions of jni.h such as the one provided by Debian Jessie's
OpenJDK define UNUSED in a way that conflicts with our definition and
usage, so we need to explicitly undefine it before redefining it to
avoid compiler noise.
2014-08-17 15:34:44 -06:00
Joshua Warner
46f7a45f12 add hashCode and equals methods to java/util/Map
Granted, this is weird - but this is what openjdk does.  Therefore,
some code that is compiled for openjdk (say, protobufs) will treat
calls to Map.hashCode as interface calls instead of virtual calls, as
they would have previously been under avian's classpath.

Also note that this error caused avian to abort in findInterfaceMethod
rather than throw an AbstractMethodError or somesuch - but that's a
problem for another day.
2014-08-15 10:44:22 -06:00
Joel Dice
60ea4b2cc2 Merge pull request #317 from joshuawarner32/cmake-vs
Get cmake build working with visual studio 2013
2014-07-31 08:16:48 -06:00
Joshua Warner
d47fcdc349 fix ubuntu precise mingw math.h problems 2014-07-30 14:15:22 -06:00
Vasily Litvinov
c52a9bdf0d Fixing Avian classpath on Windows 2014-07-29 13:51:33 +04:00
Joel Dice
2a43e68c16 fix all the bugs
So there I was, planning to just fix one little bug: Thread.holdsLock
and Thread.yield were missing for the Android class library.  Easy
enough, right?  So, I added a test, got it passing, and figured I'd go
ahead and run ci.sh with all three class libraries.  Big mistake.

Here's the stuff I found:

 * minor inconsistency in README.md about OpenSSL version

 * untested, broken Class.getEnclosingMethod (reported by Josh)

 * JNI test failed for tails=true Android build

 * Runtime.nativeExit missing for Android build

 * obsolete assertion in CallEvent broke tails=true Android build

 * obsolete superclass field offset padding broke bootimage=true Android build

 * runtime annotation parsing broke bootimage=true Android build
   (because we couldn't modify Addendum.annotationTable for classes in
   the heap image)

 * ci.sh tried building with both android=... and openjdk=..., which
   the makefile rightfully balked at

Sorry this is all in a single commit; I didn't expect so many
unrelated issues, and I'm too lazy to break them apart.
2014-07-12 16:57:24 -06:00
Joshua Warner
836cc41320 bulk, global reformat 2014-07-11 13:25:22 -06:00
Joshua Warner
7642b94308 reformat changes since master 2014-07-11 13:25:22 -06:00
Joshua Warner
b0490b8233 finish using setters 2014-07-11 13:25:22 -06:00
Joshua Warner
a1583f1ecc touch up type safety in types.def 2014-07-11 13:25:20 -06:00
Joshua Warner
1e201e54fc staticly type GcContinuation* 2014-07-11 13:25:20 -06:00
Joshua Warner
0ec87c6aa1 statically type Addendum.pool better 2014-07-11 13:25:19 -06:00
Joshua Warner
9f5912c2b6 add stronger typing to method.code 2014-07-11 13:25:19 -06:00
Joshua Warner
194e3b2701 add VMClass changes 2014-07-11 13:25:18 -06:00
Joshua Warner
5adb558355 add Code to classpath 2014-07-11 09:32:57 -06:00
Joel Dice
5d3c612d0e fix JNIEnv::FindClass calls from JNI_OnLoad for all supported class libraries
This also fixes the some Android build rot and updates the version of
OpenSSL used.
2014-07-01 10:53:26 -06:00
Joel Dice
254e3f938d fix unused declaration/definition warnings from GCC 4.9 2014-06-30 09:54:01 -06:00