Commit Graph

4704 Commits

Author SHA1 Message Date
Joel Dice
0ab8235237 streamline SDK search in makefile 2016-04-06 07:40:49 -06:00
Joel Dice
18b27c9436 update to iOS 9.2 SDK and define sysroot for iOS
Previously, we only seemed to define sysroot for MacOS, not iOS, yet
we reference $(sysroot) in both cases.  This ensures it is defined in
both cases as well.
2016-04-04 11:55:03 -06:00
Joshua Warner
c299319b16 Merge pull request #478 from dicej/putDouble
add sun.misc.Unsafe.putDouble(Object,long,double)
2016-03-02 15:41:20 +00:00
Joel Dice
a538f54033 add sun.misc.Unsafe.putDouble(Object,long,double) 2016-03-01 18:28:04 -07:00
Joshua Warner
cbfce38aa1 Merge pull request #477 from dicej/getEntryBytes
do not null-terminate ZipEntry names in openjdk-src builds
2016-02-16 15:02:33 +00:00
Joel Dice
2bb3ea2532 do not null-terminate ZipEntry names in openjdk-src builds
OpenJDK's java.util.zip.ZipFile.getEntryBytes should return a byte
array that is not null-terminated, but we were giving it one that was
null-terminated, which caused lookups to fail later when
ZipFile.getInputStream was called.
2016-02-15 18:30:56 -07:00
Joshua Warner
3b83277d5e Merge pull request #476 from dicej/werror
disable -Werror by default (but still use it for continuous integration)
2016-02-15 23:38:46 +00:00
Joel Dice
3247093b10 disable -Werror by default (but still use it for continuous integration)
Since we can't predict what warnings future compilers will emit, and
most people just want to build Avian without some new warning tripping
it up, we now omit -Werror unless requested via the "use-werror=true"
option to make.  Note that we pass "use-werror=true" in test/ci.sh to
ensure Travis alerts us to new warnings as they appear.

BTW, sorry about the unrelated whitespace changes in this patch; I've
got Emacs set up to fix whitespace "problems" on save, and those are
what it found.
2016-02-15 15:48:30 -07:00
Joshua Warner
ee7da77c70 Merge pull request #475 from dicej/static-synchronized
synchronize on Java class rather than VM class in static synchronized…
2016-01-16 18:46:34 +00:00
Joel Dice
ba101699a7 fix bootimage regression 2016-01-16 10:20:10 -07:00
Joel Dice
b5308c4866 synchronize on Java class rather than VM class in static synchronized methods
Previously, the following code would throw an IllegalMonitorStateException:

public class Test {
  public static synchronized void main(String[] args) {
    Test.class.notify();
  }
}

The problem stems from the fact that for a long time Avian has had two
representations of a given class: avian.VMClass and java.lang.Class.
It used to be that there was only one, java.lang.Class, but that
didn't play nicely with OpenJDK's class library, so we split it into
two.  Unfortunately, we forgot to update the JIT and interpreter
accordingly, so a static synchronized method would acquire the
avian.VMClass instance, whereas Foo.class.notify() would be invoked on
the java.lang.Class instance.

This commit fixes it.
2016-01-16 08:34:30 -07:00
Joel Dice
451700fad7 Merge pull request #473 from joshuawarner32/master
disable Trace test for PR builds, since it fails so often (and we haven't gotten around to debugging it)
2016-01-13 15:12:28 -07:00
Joshua Warner
be84e421ee Merge pull request #472 from dicej/windows-openjdk
fix openjdk/openjdk-src builds for latest JDKs 7 and 8
2016-01-13 20:23:36 +00:00
Joshua Warner
c1b5104e79 disable Trace test for PR builds, since it fails so often (and we haven't gotten around to debugging it) 2016-01-13 20:23:15 +00:00
Joel Dice
dab9bb7d1f replace preprocessor __try/__except hack with patch 2016-01-13 09:47:52 -08:00
Joel Dice
10eecce9cf add OSX 10.10 and 10.11 to SDK search list 2016-01-13 09:03:48 -07:00
Joel Dice
e169d683c4 fix Linux openjdk build regression 2016-01-13 08:14:22 -07:00
Joel Dice
80dc32094f fix openjdk/openjdk-src builds for latest JDKs 7 and 8
The tower of patches and hacks grows higher.  Ideally, we'll just drop
support for JDK 7 soon and clean this mess up a bit, but TravisCI
still hasn't gotten the memo that it's dead, so we muddle onward.

I've tested this on Windows, but not yet Linux or OS X.  Wanted to get
a PR before I move on to that.
2016-01-12 16:37:03 -08:00
Joshua Warner
505c2b8d93 Merge pull request #471 from lwahlmeier/master
Added missing apis to ByteBuffer
2016-01-11 01:02:01 +00:00
Luke Wahlmeier
62a03898c3 Merge remote-tracking branch 'rt/master' 2016-01-10 12:10:47 -07:00
Luke Wahlmeier
9d87e3b2a7 added get/put float/double to ByteBuffers, as well as duplicate 2016-01-10 03:03:03 -07:00
Joshua Warner
15b3a8289a Merge pull request #469 from keinhaar/master
Added support for HTTP URL connections, and fixed SocketInputStream and BufferedInputStream.
2015-12-28 18:21:45 +00:00
keinhaar
524f034bac Added support for HTTP URL connections, and fixed SocketInputStream and BufferedInputStream.
Did some cleanup as proposed by the main developers.
- Bigger HTTP Header Buffer
- Exception if Header is anyway exceeded.
- Linebreaks on HTTP Request fixed to standard.
- Only stop header reading on \r\n\r\n and no longer on \n\n\n\n
- Simplyfied the code to stop if buffer could not be filled.
- Handle special case if buffer has length 0, like specified in the Java API
- Socket will no longer fill the buffer completely
2015-12-26 11:58:40 +01:00
Joshua Warner
2d7347166c Merge pull request #470 from Xtansia/patch-1
Change Avian src volume path to match Dockerfile
2015-12-24 15:17:28 +00:00
Thomas Farr
d9f6cabcf6 Change Avian src volume path to match Dockerfile 2015-12-22 20:36:50 +13:00
Joshua Warner
0c71ba0763 Merge pull request #465 from dicej/no-mo-oss
update README to remove references to oss.readytalk.com
2015-11-10 03:48:25 +00:00
Joel Dice
19945346fc update README to remove references to oss.readytalk.com 2015-11-09 16:33:01 -07:00
Joel Dice
aeaf4c1f28 Merge pull request #464 from benstadin/master
- fixed building for iOS 9
2015-11-03 11:59:23 -07:00
Benjamin Stadin
dc010f9a92 - fixed building for iOS 9
- handle sim flag to better distinguish between ios simulator / ios
- added ios_deployment_target to set ios min version
- default to 64 bit build for iOS
2015-11-01 20:36:47 +01:00
Joshua Warner
7cc9f160f2 Merge pull request #459 from dicej/bootimage-test
add bootimage-test option to makefile
2015-10-20 17:33:58 +00:00
Joel Dice
b351c9d961 exit with error if bootimage-test=true specified without bootimage=true 2015-10-20 09:40:26 -06:00
Joel Dice
9abba8fe24 add bootimage-test option to makefile
This option specifies that the test classes should be AOT-compiled
along with the class library, which allows us to test that everything
works in AOT-compiled form as well as JIT-compiled form.  This is
primarily motivated by the need to test d906db6 (support for
AOT-compilation of Java 8 lambda expressions).

Note that I had to tweak Misc because it tested something that
couldn't be done in an AOT build without a lot of extra work, and
SystemClassLoader.getPackage because it was returning null when the
requested package could not be populated with JAR manifest metadata.
Technically, we probably *should* return null for packages that don't
exist at all (in the sense that no classes have been loaded from such
a package), but tracking that kind of thing seems like more trouble
than it's worth unless someone complains about it.
2015-10-19 15:10:53 -06:00
Joshua Warner
38731b28bf Merge pull request #457 from dicej/no-artifacts
disable TravisCI artifact publication
2015-10-12 12:49:37 -06:00
Joel Dice
5399c6bdbb disable TravisCI artifact publication
This stopped working recently, apparently due to obsolete jfrog.org
credentials.  Since no-one is actually using these artifacts as far as
we are aware, I'm just disabling the task so the build doesn't
continue to fail.
2015-10-12 12:31:45 -06:00
Joel Dice
126e3e4bac Merge pull request #456 from joshuawarner32/master
reorganize docker files, upgrade to java 8, gcc 4.9
2015-09-28 15:54:00 -06:00
Joshua Warner
d906db633c Merge pull request #454 from dicej/aot-lambda
support AOT-compilation of Java 8 lambda expressions
2015-09-28 07:44:51 -06:00
Joshua Warner
809feace0f reorganize docker files, upgrade to java 8, gcc 4.9 2015-09-28 02:18:01 +00:00
Joel Dice
d5a5b5309a support AOT-compilation of Java 8 lambda expressions
These expressions are tricky because they rely on invokedynamic, which
normally implies runtime code generation.  However, since lambdas
don't actually use the "dynamicness" of invokedynamic, we can convert
them into static calls to synthetic classes at compile time.

Since I had already written code to synthesize such classes in Java
and I didn't want to rewrite it in C++, I needed to add support for
running Java code to the bootimage generator.  And since the primary
VM used by the generator is purpose-built to generate AOT-compiled
code for a specific target architecture and is not capable of
generating or running JIT-compiled code for the host architecture, I
added support for loading a second, independent, host-specific VM for
running Java code.

The rest of the patch handles the fact that each method compilation
might cause new, synthetic classes to be created, so we need to make
sure those classes and their methods are included in the final heap
and code images.  This required breaking some giant code blocks out of
makeCodeImage into their own methods, which makes the diff look
scarier than it really is.
2015-09-13 14:21:24 -06:00
Joel Dice
c1df8b949c Merge pull request #446 from bgould/master
Added targets for Eclipse environment descriptor.
2015-09-13 14:15:18 -06:00
Joel Dice
bedf4d86db Merge pull request #453 from joshuawarner32/master
ignore leading / for files on Windows (fixes #452)
2015-09-13 14:14:32 -06:00
Joel Dice
763aada4b0 optionally specify reentrancy when creating a System object
This allows multiple Avian VMs to share the same process space,
provided they don't try to use functionality that involves global
shared resources (e.g. signal handling).
2015-09-12 20:08:54 -06:00
Joel Dice
9b2a02e92b avoid calling unrelated JNI methods during class initialization
The main goal here is to avoid making JNI calls from code that really
shouldn't need JNI (e.g. before this patch, ArrayList.add called
Math.max, which called Math.<clinit>, which called Random.<init>,
which called System.currentTimeMillis).

Besides following the "pay for only what you need" principle, this
change ensures we can call LambdaMetaFactory methods during AOT
compilation with a minimal VM (i.e. without compiling in JNI methods
we don't need).
2015-09-12 19:58:50 -06:00
Joshua Warner
e2f2ed68f0 ignore leading / for files on Windows (fixes #452) 2015-09-02 08:31:30 -06:00
Joshua Warner
9f70aa753e Merge pull request #451 from dicej/invoke-dynamic-stub
implement basic Java 8 lambda support
2015-08-18 12:53:16 -06:00
Joel Dice
03cf4f98a1 remove invoke.sh
This wasn't meant to be checked in long-term.
2015-08-07 20:49:50 -06:00
Joel Dice
549810deba allow building with Java 7 2015-08-06 17:23:14 -06:00
Joel Dice
66712a8cff add invokedynamic support to interpreter 2015-08-06 17:22:14 -06:00
Joel Dice
8a7944d25c add support for openjdk=$JDK8_HOME
All tests pass for the process=compile build.  Next step: process=interpret.
2015-08-06 13:30:18 -06:00
Joel Dice
2465459079 implement basic Java 8 lambda support
The two big pieces here are basic invokedynamic support and a working
version of LambdaMetaFactory.metafactory.  The latter works by
dynamically building a synthetic class with three methods: a static
factory method, a constructor for the factory method to call, and a
method to satisfy the requested interface which defers to the
specified MethodHandle.

This work relies heavily on Avian's specific MethodType and
MethodHandle implementations, which provide extra, non-standard
features to make code generation easier.  That means we'll probably
need to use Avian's versions of java.lang.invoke.* even when building
with the OpenJDK or Android class libraries.
2015-08-06 13:30:18 -06:00
joshuawarner32@gmail.com
792684b935 first pass at minimal invokedynamic support for Java 8 lambdas
This is a bunch of commits squashed into one per Josh's request.

add dynamicTable field

add invokedynamic instruction

add defaultDynamic bootimage field

add dummy invokedynamic support in bootimage-generator

add defaultDynamic thunk

check dynamicTable offset

comment defaultDynamicThunk to fix unused function

comment defaultDynamicThunk to fix unused function

add dynamicTable / dynamicIndex stuff

comment dynamicIndex and dynamicTable

add invokedynamic instruction impl

stub out addDynamic

unstub addDynamic

don't allow tail calls in invokedynamic

implement stub JVM_GetTemporaryDirectory method

(build broken) begin add InvokeDynamicTest

Revert "(build broken) begin add InvokeDynamicTest"

This reverts commit 77f9c54e32ac66d0803eeab93e4a10d3541987a8.

add InternalError

add URLClassPath.c for openjdk-src builds

implement stub JVM_KnownToNotExist and JVM_GetResourceLookupCache methods

intercept open0 / open for openjdk

add basic java/lang/invoke stubs

remove non-public java/lang/invoke classes

fix invokedynamic example building

<wip debugging>
2015-08-06 13:30:05 -06:00