Commit Graph

2119 Commits

Author SHA1 Message Date
Alexey Pelykh
d5d2e50ac7 Trace writeout refactor 2013-02-09 09:42:51 +02:00
Alexey Pelykh
83e55ce9cc RUNTIME_ARRAY usage 2013-02-09 09:42:50 +02:00
Alexey Pelykh
e4bd01f7f3 Comment out printTrace 2013-02-09 09:42:49 +02:00
Alexey Pelykh
f3c443dbfa Fix dword<>qword mistake 2013-02-09 09:42:47 +02:00
Alexey Pelykh
b918389672 Support built-in jars when wusing multi-library 2013-02-09 09:42:45 +02:00
Alexey Pelykh
74c9f60b98 Fix crash if no avian.boostrap is specified (oops) 2013-02-09 09:42:36 +02:00
Alexey Pelykh
d0ac63292c Fix crash if no avian.boostrap is specified (oops) 2013-02-09 09:42:35 +02:00
Alexey Pelykh
bd2a836395 Fix crash if no avian.boostrap is specified (oops) 2013-02-09 09:42:34 +02:00
Alexey Pelykh
bde33c97f8 Fix crash if no avian.boostrap is specified 2013-02-09 09:42:33 +02:00
Alexey Pelykh
9ed312451a Allow avian.bootstrap to accept multiple libraries 2013-02-09 09:42:32 +02:00
Alexey Pelykh
c13149088e Fix crash on memory validation 2013-02-09 09:42:31 +02:00
Alexey Pelykh
c6694287e9 Finally, proper jvm.dll linking for WP8 2013-02-09 09:42:29 +02:00
Alexey Pelykh
d51db00136 Allow output of exceptions to debugger. Generate WinMD file 2013-02-09 09:42:28 +02:00
Alexey Pelykh
4228f69a0d Additional AOT_ONLY ifdef 2013-02-09 09:42:26 +02:00
Alexey Pelykh
acdd297fb2 Fixes to WP8/WinRT support 2013-02-09 09:42:25 +02:00
Alexey Pelykh
dca12d3cd0 WinRT/WP8 process=compile 2013-02-09 09:42:22 +02:00
Alexey Pelykh
4d03650544 Replaced TODO comments with messages ; More correct AVIAN_AOT_ONLY usage 2013-02-09 09:42:21 +02:00
Alexey Pelykh
1b43caf815 Makefile fix 2013-02-09 09:42:20 +02:00
Alexey Pelykh
2f2cac556c Windows Phone 8 / Windows RT initial support
Conflicts:

	makefile
2013-02-09 09:42:19 +02:00
Alexey Pelykh
b1990ba55f Android toolchain 2013-02-09 09:42:14 +02:00
Victor Shcherb
3a42db9f6f Add android platform 2013-02-09 09:42:13 +02:00
Joel Dice
f9b3be0301 fix format string in loadLibrary call to snprintf
"%*s" means "at least", whereas "%.*s" means at most, and the latter
is what I intended.  This only became noticable as of 9f22a70, when I
added another directory to the library path, which caused loadLibrary
to fail to find libraries in either directory.
2013-02-08 08:24:06 -07:00
Joel Dice
5a07e04d56 assert that there are no outstanding Get*Critical requests during allocation
When GetStringCritical or GetPrimitiveArrayCritical are called, the VM
cannot risk new Java heap allocations until the corresponding release
method is called because allocations may result in GC, which cannot
happen while a string or array is pinned in memory.  We already have a
check for this latter in the footprint function used during GC, but
it's best to catch the problem as early as possible.
2013-02-05 09:48:20 -07:00
Joel Dice
5dcf6eae5a fix GC safety issue in MyClasspath::updatePackageMap 2013-02-03 20:29:24 -07:00
Joel Dice
e8f8ebdc67 fail quickly if an object allocation cannot be satisfied
Previously, we would blithely exceed the heap ceiling and force the
next allocation to deal with the problem, including a major GC and
possible OutOfMemoryError.  As of this commit, we throw an error
immediately if we find that the allocation will push us over the
ceiling.
2013-02-03 15:53:36 -07:00
Joel Dice
23bb2e8743 force a GC in allocate3 if the heap limit has been exceeded
Otherwise, we'll throw an OOME even though there may be enough
unreachable objects eligible for collection to get back below the
limit.
2013-02-03 15:20:53 -07:00
Joel Dice
3db9e73aa1 fix GC safety issues in classpath-openjdk.cpp 2013-02-03 15:19:35 -07:00
Joel Dice
80c8940b7f ensure joining threads are always notified when a thread exits
Previously, we'd only do this if the thread exited without throwing an
exception.  Now we do it regardless.
2013-02-03 15:18:32 -07:00
Joel Dice
1890e348fb fix handling of classe, method, and field names with non-ASCII characters 2013-02-03 14:10:47 -07:00
Joel Dice
0c5471d25e remove temporary #error used for debugging
Sorry, that wasn't supposed to be checked in.
2013-01-28 16:24:08 -07:00
Joel Dice
67fd707254 fix handling of unusual exception handler layout
Scala sometimes generates bytecode such that the scope of an exception
handler starts at another exception handler, e.g.:

      Exception table:
         from    to  target type
           290   372   382   any
           382   451   451   any
           290   372   451   any

Avian's compiler was incorrectly initializing the stack frame for the
second handler in this case.  This commit fixes the problem.
2013-01-26 22:06:53 -07:00
Joel Dice
70a7a50a49 fix int-to-long conversions from memory on x86_32
The instruction for 32-bit-to-64-bit sign extension on x86_32 requires
that the input value be placed in EAX and the sign extension in EDX.
However, the compiler can get confused if the input value is in memory
addressed via one of those registers and doesn't know how to move it.
This patch works around that limitation by doing the move explicitly
in MemoryEvent::compile if necessary.
2013-01-26 17:15:15 -07:00
Joel Dice
1a44ec9eef fix incorrect macro name in bootimage.cpp 2013-01-25 16:47:31 -07:00
Joel Dice
2131adf3aa fix Windows OpenJDK build 2013-01-25 08:07:47 -07:00
Joel Dice
844520a402 fix embed.cpp build for 64-bit Windows 2013-01-25 07:57:57 -07:00
Joel Dice
36eee724c9 check argument types in JVM_InvokeMethod
Method.invoke must throw an IllegalArgumentException if it receives
the wrong number or types of arguments, and since this isn't done by
the OpenJDK class library, we must do it in the VM.
2013-01-24 12:16:41 -07:00
Joel Dice
0adccdc99c return unadorned filename from JVM_GetSystemPackage
Package.defineSystemPackage expects a filename, not a URL.
2013-01-24 12:16:40 -07:00
Joel Dice
2a45a5919c return XToolkit from iOS getPreferredToolkit stub
This is necessary to prevent an NPE in Hashtable.put when
System.initProperites tries to put a null value in the map for
java.awt.graphicsenv.
2013-01-19 14:10:31 -07:00
Joel Dice
ccbdd6723a specify CodeCapacity based on target arch, not build arch 2013-01-19 14:08:07 -07:00
Carsten Elton Sørensen
cad4719f7d Handle null pointer in PopLocalFrame 2012-12-21 09:38:03 -07:00
Joel Dice
9f22a701cc load libmawt.so proactively when booting the VM for OpenJDK
This library is placed in the xawt subdirectory of jre/lib/$arch on
POSIX systems, so it isn't found automatically when third-party
libraries which depend on it are loaded.  The simplest way to ensure
that it's found seems to be to just load it when the VM starts up.
2012-12-20 12:30:15 -07:00
Joel Dice
b75497c8ff implement JNIEnv::NewLocalRef 2012-12-20 09:05:30 -07:00
Joel Dice
1094483a7c fix 32-bit build regression 2012-12-19 16:48:20 -07:00
Joel Dice
d200019d10 implement JNI reflection methods
These include FromReflectedMethod, ToReflectedMethod,
FromReflectedField, and ToReflectedField.
2012-12-19 12:39:33 -07:00
Joel Dice
7b07b5b9a3 print more of the stack map when DebugFrameMaps is enabled 2012-12-12 16:04:26 -07:00
Joel Dice
663d8da975 fix stack mapping bug for try blocks containing jsr/ret instructions
In order to calculate the initial stack map of GC roots for an
exception handler, we do a logical "and" of maps across all the
instructions contained in the try block for that handler.  This is
complicated by the presence of jsr/ret instructions, though, because
instructions in a subroutine may have multiple maps associated with
them corresponding to all the paths from which execution might flow to
them.

The bug in this case was that we were using an uninitialized map in
our calculation, resulting in a map with no GC roots at all.  By the
time the map was initialized, the damage had already been done.  The
solution is to treat an uninitialized map as if it has roots at all
positions so that it has no effect on the calculation until it has
been initialized with real data.
2012-12-12 15:54:15 -07:00
Joel Dice
f79f320859 fix MSVC build regression 2012-12-05 17:17:29 -07:00
Joel Dice
36aa74316a fix Windows cross-compile build 2012-12-04 17:37:02 -07:00
Joel Dice
2659e32b80 Merge remote-tracking branch 'csoren/master' 2012-12-04 14:04:57 -07:00
Stanisław Szymczyk
de1f5c7b9f fix pthread mutex and condition leak
Hi,

I did some more tests with my x86 QNX Avian port and found one major problem
in Avian VM while trying to run Apache Ivy. The problem manifests as
follows:

1. MySystem::Thread X is created, during its creation pthread mutex and
conditional variable are initialized
2. Program runs for some time
3. MySystem Thread X is disposed, it's memory is freed (during garbage
collection I guess)
4. Program runs for some time
5. MySystem::Thread Y is created in exactly the same memory address as
MySystem::Thread X disposed in step 3 (I suppose that's due to the way
memory allocator works in Avian)
6. During MySystem::Thread Y creation pthread mutex and conditional variable
initialization fail silently with EBUSY. QNX documentation says it means
"The given mutex was previously initialized and hasn't been destroyed."
which is correct, because it's exactly in the same memory address as mutex
and conditional variable of MySystem::Thread X and they haven't been
destroyed during MySystem::Thread X disposal

Fortunately solution for this is easy, see the attached patch. Now Apache
Ivy works without any problems.

Regards,
Stanisław Szymczyk
2012-12-04 10:14:44 -07:00