Commit Graph

2734 Commits

Author SHA1 Message Date
joshuawarner32@gmail.com
10442dc7d6 finish renaming lir:: types (fixup arm) 2014-12-09 08:19:43 -07:00
joshuawarner32@gmail.com
2939480a65 begin renaming lir:: types 2014-12-09 08:19:43 -07:00
joshuawarner32@gmail.com
94761711c9 make RegisterMask a class 2014-12-09 08:19:43 -07:00
joshuawarner32@gmail.com
87465e890b typedef Register and RegisterMask in arm 2014-12-09 08:19:43 -07:00
joshuawarner32@gmail.com
61e79d4f3b typdef Register 2014-12-09 08:19:43 -07:00
Joshua Warner
45cc85829a remove old 32-bit registerMask stuff 2014-12-09 08:19:43 -07:00
Joshua Warner
76197e1f1d typedef RegisterMask 2014-12-09 08:19:43 -07:00
Joshua Warner
a509575a86 remove unused arm utilities / constants 2014-12-09 08:19:43 -07:00
Joshua Warner
f187361889 rename RegisterMask to BoundedRegisterMask 2014-12-09 08:19:43 -07:00
Joshua Warner
1110d3ff50 begin converting to setLowHighRegisterMasks 2014-12-09 08:19:43 -07:00
Joshua Warner
ac72aa8b91 split low/high register mask in OperandMask 2014-12-09 08:19:42 -07:00
Joel Dice
d52d0f6d96 add process=interpret support for Linux/ARM64
This makes all the tests pass for the platform=linux arch=arm64
process=interpret build.  Next step: process=compile support.
2014-11-25 20:02:59 -07:00
Joshua Warner
0b89357968 Merge pull request #368 from dicej/printf-formats
use inttypes.h macros to determine printf format symbols if possible
2014-11-12 10:28:59 -07:00
Joel Dice
1b19dc2c4f use inttypes.h macros to determine printf format symbols if possible
This addresses a recent regression where different versions of
MinGW(-w64) had different opinions about whether to use e.g. %I64d or
%lld to print 64-bit integers on 32-bit platforms.
2014-11-11 14:13:26 -07:00
Timofey Lagutin
fd2cdafed3 builtin.cpp: Remove native Class.getDeclaringClass()
It's implemented in pure Java and is not used.
2014-11-07 14:40:31 +03:00
Joel Dice
adcaeb513c Merge pull request #363 from lostdj/patch-4
interpret.invokeNative(): call native function with a right signature
2014-10-31 07:16:04 -06:00
lostdj
b7abaf7a78 interpret.invokeNative(): call native function with a right signature 2014-10-31 12:22:13 +03:00
Joel Dice
347a56824a fix MSYS/MinGW build
MinGW defines __STRICT_ANSI__ when -std=c++0x is specified, which we
have to override in order to get e.g. strdup.  Also, we need to
specify -D_WIN32_WINNT=0x0500 to get post-Windows-2000 functions like
GetModuleHandleEx.  Finally, it seems that GCC 4.8.1 wants us to use
%I64d instead of %lld on Windows.
2014-10-27 09:39:53 -06:00
Joel Dice
82952b29d9 Merge pull request #360 from xranby/master
Implement JVM_FindClassFromCaller OpenJDK: 8015256: Better class accessibility
2014-10-27 08:48:42 -06:00
Xerxes Rånby
2e5990a6b0 OpenJDK: Implement JVM_FindClassFromCaller
8015256: Better class accessibility
Summary: Improve protection domain check in forName()

Signed-off-by: Xerxes Rånby <xerxes@gudinna.com>
2014-10-26 21:46:09 +01:00
Timofey Lagutin
d8f66a84ea jnienv.h: deleted redefinition of BOOTCLASSPATH_APPEND_OPTION 2014-10-25 17:43:46 +04:00
Joel Dice
d930fbcda2 ensure Object.notify is available for Android classpath build and reduce duplication 2014-10-10 07:38:41 -06:00
Joel Dice
1575b901d4 implement Class.getEnclosingClass 2014-10-09 08:01:42 -06:00
Joel Dice
fbcdfd6dec Merge remote-tracking branch 'dicej/android-upgrade' 2014-10-08 13:41:50 -06:00
Joshua Warner
03c1f43304 make x86 backend build on arm 2014-10-06 11:01:48 -06:00
Joel Dice
ffb0f9b345 provide slightly more complete Thread.nativeGetStatus implementation
This fixes SimpleFramework (which depends on Thread.getState returning
Thread.State.NEW for unstarted threads) when using the Android class
library.
2014-09-29 11:08:41 -06:00
Joel Dice
b406e9c2ed Merge remote-tracking branch 'origin/master' into android-upgrade 2014-09-24 10:59:39 -06:00
Joel Dice
f347414675 abort if JIT triggered when AVIAN_AOT_ONLY is defined
If AVIAN_AOT_ONLY is defined and the VM is asked to compile a method
anyway, we should abort immediately rather than let it crash later
(e.g. due to an access violation on a non-jailbroken iPhone).  This
makes debugging such issues a bit easier since the failure will come
earlier and with a more obvious cause.
2014-09-22 16:35:53 -06:00
Joel Dice
69d9ab004a implement JVM_isNaN
This method was previously unimplemented and untested.  However, the
JMH benchmark suite requires it, so now it's time to implement it.
2014-09-21 17:31:45 -06:00
Joel Dice
ce91905b33 fix segfault in BuiltinElement::dispose
If a BuiltinElement is never used (i.e. we never try to load anything
from it), its init method will never be called, and thus its backing
library will never be loaded.  In that case, we should not try to call
library->disposeAll() in the destructor.
2014-09-15 09:03:02 -06:00
Joel Dice
1ca3e9a549 add Avian_java_lang_Thread_nativeSetName stub 2014-09-15 08:57:30 -06:00
Joel Dice
6e209e2925 a couple of tweaks to get Mac/Android tests passing 2014-09-02 10:14:04 -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
58cbf5face fix Android thread enumeration 2014-08-22 16:07:44 -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
32aefaf421 ensure Thread::flags is always updated atomically
Since this field is sometimes updated from other threads, it is
essential that we always update it atomically.
2014-08-20 09:49:00 -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
Joshua Warner
0c464f3f84 Merge pull request #328 from dicej/windows
Windows
2014-08-19 12:53:59 -06:00
Joel Dice
42ae8cbe39 fix openjdk-src Windows build regression 2014-08-19 11:49:18 -06:00
Joshua Warner
62983ebd7a Merge pull request #326 from dicej/gc-jvmfillinstacktrace
fix GC safety bug in jvmFillInStackTrace
2014-08-19 11:06:31 -06:00
Joel Dice
f94157aa38 fix GC safety bug in jvmFillInStackTrace
This fixes spurious Trace test failures with openjdk-src build.
2014-08-19 10:14:07 -06:00
Joshua Warner
5210cbaa54 use prototype for __clear_cache across all linux-arm systems, not just android 2014-08-19 08:53:21 -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
Joel Dice
1fb297775c fix clang "always true" warning in lzma/main.cpp 2014-08-11 08:40:08 -06:00
Joel Dice
8c1e7d48ad fix bootimage lzma build
We were using the length of the uncompressed boot image when
generating the object file, whereas we should have been using the
compressed length.
2014-08-04 17:21:23 -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
e92230c89c use c++11-conformant _WIN32 test macro 2014-07-30 16:05:30 -06:00
Joshua Warner
ce1a5f5c28 fix macosx arch=i386 process=interpret build 2014-07-30 14:15:22 -06:00
Joshua Warner
d8e0f5cc06 fix zlib headers / linking for windows 2014-07-30 14:15:22 -06:00
Joshua Warner
ef3f77695c use inline asm for sse detection 2014-07-30 14:15:22 -06:00
Joshua Warner
51b510cbea first pass at cmake + visual studio support 2014-07-30 14:15:15 -06:00
Joel Dice
9f182d4613 Merge pull request #316 from bigfatbrowncat/fixing-windows-build
Fixed Android build on Windows
2014-07-29 08:43:39 -06:00
Vasily Litvinov
d668c6a259 Fixed Android build on Windows 2014-07-29 13:01:51 +04:00
Joshua Warner
857c155980 Merge pull request #313 from dicej/lzma-bootimage
fix LZMA/bootimage build
2014-07-28 09:49:08 -06:00
Joel Dice
a1e9315fa2 fix LZMA/bootimage build
This includes some tweaks to README.md and makefile to ensure the
directions in the former for building a bootimage actually work.
2014-07-28 09:19:39 -06:00
Joel Dice
b811ca60c1 Merge pull request #291 from joshuawarner32/cpp11
Begin using c++11 features
2014-07-24 13:13:30 -06:00
Joel Dice
bcbce54b9e fix iOS build when using recent versions of OpenJDK 7
This is based on recent feedback on the Avian group.  I've tested it
using both OpenJDK 7u40 and 7u60.
2014-07-24 11:20:17 -06:00
Joshua Warner
31de9a48c9 reformat 2014-07-24 10:09:29 -06:00
Joshua Warner
1ad1fe9048 use enum class in ir 2014-07-24 10:09:29 -06:00
Joshua Warner
060b5c8f13 use c++11 variadic templates in Compiler::call 2014-07-24 10:09:29 -06:00
Joshua Warner
d8ddc95315 use c++11 enhanced-for and auto in type-generator 2014-07-24 10:09:29 -06:00
Joshua Warner
d48093b777 fix unused variable warning when building with cmake 2014-07-24 09:42:44 -06:00
Joshua Warner
d248ad53b0 add initial cmake script (only builds parts of the code) 2014-07-24 09:36:40 -06:00
Joshua Warner
41cb6fabf5 split avian::system::crash into its own file 2014-07-24 09:36:40 -06:00
Joshua Warner
c26fb78f2c Merge pull request #307 from dicej/posix-spawn
fix Processes test failure for openjdk-src build with recent versions of...
2014-07-22 17:42:40 -06:00
Joel Dice
1bee015af3 fix Processes test failure for openjdk-src build with recent versions of OpenJDK 7
It looks like the UNIXProcess class has added posix_spawn support,
which is enabled by default unless overriden by the
jdk.lang.Process.launchMechanism system property.  For some reason I
haven't bothered to investigate, posix_spawn fails on MacOS, so this
patch sets the aforementioned property to "fork" to get the old,
working behavior.
2014-07-22 17:06:55 -06:00
Joshua Warner
f3968d2401 fix compiler problems discovered in openjdk-src arm bootimage build
This particular problem was introduced in the recent "compiler types" refactor.
It's unclear why it wasn't encountered before now.

Note that the full, unproguarded bootimage build is still blocked by #305
2014-07-22 15:38:43 -06:00
Pierre Carrier
375703fbd3 src/jnienv.cpp: support G size suffix 2014-07-18 06:09:53 -07:00
Joel Dice
4c8f3933f5 fix order of operations regression in referenceTargetUnreachable
We need to dereference the GcJreference** before we change what it
points to.  The code was mistakenly reordered in the recent type
refactoring.
2014-07-17 17:53:36 -06:00
Joshua Warner
4d79f3bea1 Replace Allocator with Alloc or AllocOnly where possible 2014-07-16 18:51:35 -06:00
Joshua Warner
fa1e3d74c0 reduce Allocator interface 2014-07-16 18:51:29 -06:00
Joshua Warner
2d0ac3ac17 reduce vm::Zone interface 2014-07-16 18:41:02 -06:00
Joshua Warner
eb92c904c6 split Tokenizer into its own header 2014-07-16 18:41:02 -06:00
Joshua Warner
29ee088f19 remove unused Half type 2014-07-16 18:41:02 -06:00
Joshua Warner
80cf745424 move executable allocator out of System class 2014-07-16 18:40:57 -06:00
Joshua Warner
a1631c00f9 use size_t in Allocator 2014-07-16 18:10:51 -06:00
Joel Dice
cae4b49005 fix heapdump=true build 2014-07-16 15:51:48 -06:00
Joshua Warner
2778531873 fix arm build 2014-07-16 08:59:50 -06:00
Joel Dice
4b7b3d2680 Merge pull request #295 from joshuawarner32/fix-windows-build
fix windows build
2014-07-15 12:31:10 -06:00
Joshua Warner
bfddef54c6 fix openjdk-src build (oversight from type-generator refactor) 2014-07-15 08:31:22 -06:00
Joshua Warner
21cec8834f fix LLD macro for gcc >= 4.8 on windows 2014-07-14 10:42:53 -06:00
Joshua Warner
2f94c5b03d fix windows build 2014-07-14 08:57:03 -06: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
80f19abf3a put all commented code in if(false) blocks instead; fix ensuing broken code 2014-07-12 10:16:03 -06:00
Joshua Warner
8a4b043ee3 generate makeZeroed method, to return a zero-initialzed instance of a Gc* class 2014-07-11 13:47:43 -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
cbad6931af retypedef object to GcObject*, remove (almost?) all unnecessary reinterpret_casts 2014-07-11 13:25:22 -06:00
Joshua Warner
b0490b8233 finish using setters 2014-07-11 13:25:22 -06:00
Joshua Warner
4367867be9 use setters in classpath-android.cpp 2014-07-11 13:25:22 -06:00
Joshua Warner
43b9cce7d0 don't mark nogc fields 2014-07-11 13:25:21 -06:00
Joshua Warner
40e71a4856 use setters in machine.cpp 2014-07-11 13:25:21 -06:00
Joshua Warner
880b9fa910 use setters in machine.h 2014-07-11 13:25:21 -06:00
Joshua Warner
cc4eaae706 use setters in compile.cpp 2014-07-11 13:25:21 -06:00
Joshua Warner
e548d37666 use setters in classpath-common.h 2014-07-11 13:25:21 -06:00
Joshua Warner
3a9454117e use setters in util.cpp 2014-07-11 13:25:21 -06:00
Joshua Warner
07a9599d1a generate new setters in type-generator 2014-07-11 13:25:21 -06:00
Joshua Warner
ed1f34dca3 formalize MyProcessor::roots (for Compiler) in types.def 2014-07-11 13:25:21 -06:00
Joshua Warner
052f2498aa formalize Machine::roots in types.def 2014-07-11 13:25:21 -06:00