Commit Graph

2271 Commits

Author SHA1 Message Date
Joel Dice
13d128c7be look for DirectByteBuffer, not ReadWriteDirectByteBuffer
The name of the class we need to use in makeDirectByteBuffer has
changed in Android's libcore, so now we use the new name.
2013-03-29 14:09:43 -06:00
Joel Dice
4777d1b6be fix Windows openjdk-src build regression 2013-03-26 09:53:47 -06:00
Joel Dice
e8a1900c2b fix openjdk-src build regression 2013-03-26 08:30:26 -06:00
Joel Dice
a648787e11 update method table for all classes in updateClassTables
Previously we only updated this table for non-interfaces, but
interfaces may have methods which need updating too.
2013-03-16 10:54:35 -06:00
Joel Dice
bad3a7979c fix parameter ordering in windows.cpp's MySystem::visit
It's amazing to me that ebp and esp have been swapped for over three
years without anybody noticing.  It was dumb luck that the Trace test
(which is designed to catch just such a thing) happened to fail when I
ran the whole suite, and further investigation revealed that it was
failing maybe five percent of the times it was run.  Now we know why.
2013-03-15 16:08:55 -06:00
Joel Dice
54b560b149 fix Windows 32-bit bootimage build regression 2013-03-15 14:35:29 -06:00
Joel Dice
c80ffa041d ensure that we can intercept static Java methods in bootimage build
Timezone code was broken in the Android class library bootimage build
because the code we use to intercept loading the tzdata file wasn't
working.  The reason is have no way of intercepting static methods at
runtime in the bootimage build without telling the bootimage-generator
we're going to do it ahead of time.  So now we do tell it so.

This commit also removes the need to intercept Thread methods since we
can update Thread.vmThread in VMThread.create instead.
2013-03-15 13:28:01 -06:00
Joel Dice
3309a9f4ad ensure that array classes implement Cloneable and Serializable in bootimage build 2013-03-15 13:26:18 -06:00
Joel Dice
d5504d8f58 first step towards supporting Android class library on Windows
A majority of the tests are passing, but more work is needed to get
them all to pass.
2013-03-14 15:33:05 -06:00
Joel Dice
5d3dc707cb briefly enter idle state in get*Volatile
In order for a thread to enter the "exclusive" state such that no
other threads are active in the VM, it must wait for all active
threads to enter the "idle" state.  In order for this to happen in a
timely manner, threads must check frequently to see if a thread is
waiting to enter the exclusive state.  These checks happen at every
memory allocation, wait, sleep, native call, etc.  However, if a
thread is in a busy loop that does none of those things, it will block
any other thread from entering that state.

The proper way to address this is to detect such loops (or tail
recursion in tail-call-optimized builds) at compile or interpret time
and insert explicit checks.  This hasn't been a high priority thus
far, though, since we had yet to encounter such code in the wild.

Now, however, we find that scala.concurrent.forkjoin.ForkJoinPool.scan
(and possibly some versions of java.util.concurrent.ForkJoinPool.scan,
on which we assume the former is based) has just such a loop.
Fortunately, that loop calls Unsafe.getObjectVolatile, which the VM
implements and thus can treat as a checkpoint.  That's the workaround
we use in this patch.
2013-03-08 18:21:12 -07:00
Joel Dice
ff19ab6c13 add avian.trace.port property
Setting this property (e.g. -Davian.trace.port=5555) will cause the VM
to start an extra daemon thread which listens on the specified TCP
port for incoming connections and dumps stack traces for all running
threads to that socket.  You can retrieve that dump using e.g. netcat:

  nc localhost 5555
2013-03-08 14:47:27 -07:00
Joel Dice
3c44cdc50b fix unintentionally retained finalizables and improve low mem performance
Objects which are eligable for finalization must be retained until
after their finalize methods are called.  However, the VM must
determine the entire set of such objects before retaining any of them;
otherwise the process of retaining a given object may cause others to
become reachable and thus be considered ineligible for finalization
even though they are only reachable via other finalizable objects.
The end result of this mistake is that only a few of the objects which
are finalizable will be recognized at each GC cycle, so it requires
many such cycles to find them all, and if new objects become
finalizable at a faster rate, the VM will never catch up and
eventually run out of memory.

This patch fixes the above mistake and also includes tuning to
minimize the need for GC in low memory situations.
2013-03-07 20:32:02 -07:00
Joel Dice
ca84dd26f1 fix System.loadLibrary for OpenJDK tails=true build 2013-03-05 15:43:49 -07:00
Joel Dice
585186f7d3 avoid allocating a new gen2 heap larger than the available heap capacity 2013-03-05 09:35:21 -07:00
Joel Dice
84f99f0dca remove thread from thread group on termination
In the OpenJDK library, ThreadGroup maintains an array of all Threads
in that group, so the VM must explicitly remove threads as they exit
or else neither they nor any objects they reference will be eligable
for GC.
2013-03-05 09:06:19 -07:00
Joel Dice
c6185c8034 remove "low memory" heuristic from heap code
The original goal was to minimize memory usage by garbage collecting
more frequently and more comprehensively as we got closer to the heap
limit.  In practice, though, this just slowed the VM to a crawl as
memory pressure increased.  If an app really wants to use a lot of
memory, the VM shouldn't penalize it aside from throwing an
OutOfMemoryError if it exceeds the limit.
2013-03-04 16:02:59 -07:00
Joel Dice
3209f8750a fix heapdump build 2013-03-04 16:00:35 -07:00
Joel Dice
5d730fe8fa various tweaks to get hello-ios working with the Android library 2013-03-04 14:24:41 -07:00
Joel Dice
b3978c0a0a fix msvc build 2013-03-04 11:09:59 -07:00
Joel Dice
a142a46d41 Merge remote-tracking branch 'jw/master' 2013-03-04 09:37:22 -07:00
Zsombor Gegesy
7726bf49de fix lzma includes 2013-03-02 22:26:24 +01:00
Joshua Warner
5b973c8fc3 fix bootimage build 2013-03-01 16:27:41 -07:00
Joshua Warner
add029ad3c fix powerpc build
Evidently, the powerpc gcc compiler feels it necessary to #define powerpc to 1. Seriously?  SERIOUSLY????
2013-02-28 16:41:44 -07:00
Joshua Warner
0b01dd565a fix multiple-include-of-stdint errors 2013-02-28 15:57:09 -07:00
Joshua Warner
9327043bc5 Merge branch 'master' into wip
Conflicts:
	makefile
	src/codegen/arm/assembler.cpp
	src/codegen/powerpc/assembler.cpp
	src/codegen/x86/assembler.cpp
2013-02-27 19:27:07 -07:00
Joel Dice
5e2d00010b move headers from src to src/avian
This is necessary to avoid name conflicts on various platforms.  For
example, iOS has its own util.h, and Windows has a process.h.  By
including our version as e.g. "avian/util.h", we avoid confusion with
the system version.
2013-02-27 13:33:29 -07:00
Joel Dice
44defda878 fix unused parameter error 2013-02-27 12:10:10 -07:00
Joel Dice
3c1db46c57 don't throw an error if the mawt library can't be loaded 2013-02-27 11:34:43 -07:00
Joel Dice
e6a46fc014 various fixes to get avian-swt-examples working with the Android class library 2013-02-26 16:24:02 -07:00
Joel Dice
025b628894 Merge remote-tracking branch 'github/master' into dicej 2013-02-25 16:43:09 -07:00
Joel Dice
0bb0b1ec0e enable use of Android class library on 64-bit systems
This involved patching libcore.git to make it 64-bit safe.
2013-02-25 16:41:46 -07:00
Joel Dice
1310fbbe4f reset alignment at inheritence boundary when iterating over fields
In type-generator, we were incorrectly calculating field offsets where
a class inherits from another class whose last field has a natural
alignment which is different from the native word size.  Surprisingly,
this only popped up when I built using the Android class library on a
64-bit system.
2013-02-25 16:37:46 -07:00
Joel Dice
fddd3ec49d fix openjdk-src build regression due to RUNTIME_ARRAY changes 2013-02-25 10:38:06 -07:00
Joshua Warner
4d38873096 begin merging target assembler multimethod code 2013-02-24 22:38:58 -07:00
Joshua Warner
82eec28856 rename x86 Offset for consistency with arm and powerpc OffsetPromise 2013-02-24 20:48:06 -07:00
Joshua Warner
d2caf50772 fix debug build 2013-02-24 16:03:19 -07:00
Joshua Warner
4c8b593539 break Architecture out of Assembler 2013-02-23 23:03:01 -07:00
Joshua Warner
56625b89d8 group x86, arm, and powerpc target directories into 'target' 2013-02-23 22:47:52 -07:00
Joshua Warner
3d1ae1d517 fix include-what-you-use violations in x86 assembler 2013-02-23 22:29:58 -07:00
Joshua Warner
900b447e27 further break out powerpc assembler 2013-02-23 22:29:03 -07:00
Joshua Warner
73dda9c26e begin splitting out powerpc assembler 2013-02-23 22:26:48 -07:00
Joshua Warner
22d6ed1bec further split out arm assembler 2013-02-23 22:25:15 -07:00
Joshua Warner
fd59e1e08d begin splitting out arm assembler 2013-02-22 20:47:56 -07:00
Joel Dice
686c2352c1 all tests now pass for Android class library build 2013-02-22 17:23:59 -07:00
Joel Dice
0a4a04cc09 Merge remote-tracking branch 'github/master' into dicej 2013-02-22 17:13:10 -07:00
Joshua Warner
fc84f62a65 prevent garbage collection as vm shuts down 2013-02-22 16:33:07 -07:00
Joel Dice
b32dfb674c fix merge fallout (take 2) 2013-02-22 14:54:13 -07:00
Joel Dice
5e65468fef fix merge fallout 2013-02-22 14:50:15 -07:00
Joel Dice
9060a31348 Merge remote-tracking branch 'github/master' into dicej
Conflicts:
	src/classpath-openjdk.cpp
2013-02-22 14:43:20 -07:00
Joel Dice
d152f8cf74 fix openjdk build 2013-02-22 14:41:24 -07:00