Commit Graph

3412 Commits

Author SHA1 Message Date
Joel Dice
d873f096a1 set SO_NOSIGPIPE socket option when available
This ensures we avoid SIGPIPE on socket disconnect on Darwin.
2013-03-18 11:43:00 -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
3497354bbf allow extra flags to be passed to make in ci.sh 2013-03-15 17:48:47 -06:00
Joel Dice
1630739849 fix Windows x86_64 build regression due to unspecified AVIAN_TARGET_FORMAT 2013-03-15 17:47:15 -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
651145bd61 remove -static-libstdc++ -static-libgcc from bootimage-generator-lflags
MinGW-w64's GCC doesn't understand those flags, and we shouldn't be
linking statically or dynamically with either of those libraries.
2013-03-15 13:57:44 -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
96a4b6e508 test non-debug build first in ci.sh
If something's broken, the script will fail faster if we test the
faster build first, giving us quicker feedback.
2013-03-15 13:17:53 -06:00
Joel Dice
c3e34b9438 exit with error code from test.sh if any test fails 2013-03-15 13:17:04 -06:00
Joel Dice
9f2e0f6c4f rebuild bootimage-generator when vm-objects have changed 2013-03-15 13:16:20 -06:00
Joel Dice
8ac1f68a79 fix Android library build regression for non-Windows platforms 2013-03-15 13:15:48 -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
caa632d601 fix build when let expressions aren't available 2013-03-04 14:42:18 -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
06bc978d33 Merge branch 'wip' 2013-03-01 15:44:02 -07:00
Joshua Warner
df23c379bf fix windows embed-loader build 2013-03-01 14:52:27 -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
Joel Dice
625c04e786 a few tweaks to fix the OS X Android class library build
With corresponding changes to libcore, all the tests are passing
except Datagrams, which fails with a NPE in
NetworkInterface.getNetworkInterfacesList due to OS X not having
/sys/class/net.  Porting that class to OS X looks like a non-trivial
task.
2013-02-28 10:15:10 -07:00
Joel Dice
b409bba318 link makefile.in to Makefile.in for Android fdlibm build 2013-02-28 08:17:16 -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
27d7c8a3c0 skip bootimage test in ci.sh if openjdk is set 2013-02-27 13:47:43 -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
c261e1c283 fix OpenJDK tests on OS X 2013-02-27 12:05:57 -07:00
Joel Dice
726cdb645b support iOS SDK 6.1 2013-02-27 12:05:57 -07:00
Joel Dice
22ecf27aa5 use -I$(src) instead of -idirafter $(src)
This fixes the iOS build, where the wrong version of util.h was being
used.  The change to use -idirafter happened way back in 2007, and I
can't remember what its intention was.  We'll have to watch for
regressions on other platforms.
2013-02-27 12:05:57 -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
20cb5c7068 add KQueueArrayWrapper to openjdk-srcs on OS X
This is necessary to ensure java.nio.channels.Selector works.
2013-02-27 10:57:01 -07:00
Joel Dice
3eda6ab0a2 Merge remote-tracking branch 'github/master' into dicej
Conflicts:
	makefile
2013-02-27 10:09:38 -07:00
Joel Dice
d4a42c7a26 add Android class library instructions to README.md 2013-02-27 10:03:17 -07:00
Joel Dice
99e5edcc16 add android.pro for using Avian, Android, and ProGuard in combination 2013-02-27 10:03:07 -07:00
Carsten Elton Sorensen
ce9bc520e1 Keep java.net.SocketTimeoutException for OpenJDK 2013-02-27 14:54:50 +01: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
8a976fafa7 fix avian-unittest openjdk-src build 2013-02-25 16:55:44 -07:00
Joel Dice
025b628894 Merge remote-tracking branch 'github/master' into dicej 2013-02-25 16:43:09 -07:00