Commit Graph

4710 Commits

Author SHA1 Message Date
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
BCG
4093036e6f Closeable extends AutoCloseable; RandomAccessFile implements DataInput 2015-08-06 13:28:47 -06:00
Joshua Warner
82fd3a8dcb fix #447: leak in compile.cpp (thanks, @mretallack!) 2015-08-06 13:28:47 -06:00
Joshua Warner
7e4bd18742 Merge pull request #450 from bgould/io-enhancements
Closeable extends AutoCloseable; RandomAccessFile implements DataInput
2015-07-29 08:24:32 -06:00
Joshua Warner
1c039c5258 Merge pull request #449 from bgould/printf-fix
Fixed method signatures on format() methods to return PrintStream as in OpenJDK
2015-07-29 07:53:09 -06:00
BCG
7013dbacfd Closeable extends AutoCloseable; RandomAccessFile implements DataInput 2015-07-28 23:11:22 -04:00
BCG
b766193966 Fixed method signatures on format() methods to return PrintStream as in OpenJDK 2015-07-28 22:41:40 -04:00
Joshua Warner
38e66d80c8 fix #447: leak in compile.cpp (thanks, @mretallack!) 2015-07-18 08:44:15 -06:00
BCG
bbcb4cb119 Fixed src symlink in eclipse config to actually point to source. 2015-07-16 23:59:27 -04:00
BCG
0a11724f15 Added targets for Eclipse environment descriptor.
Someone on the Google Groups site asked how to set up an Eclipse
project with Avian classpath. This patch creates the descriptor
that you can you use to do that at `$(build)/eclipse/jdk/avian.ee`.
The descriptor includes the Avian version, platform, architecture,
and build options to allow for multiple versions to exist side by
side.  Users can import the descriptor into Eclipse via:

    Window >> Preferences >> Java >> Installed JREs >> Add >> Execution
    Environment Description

Once the descriptor is imported, Avian can be used just like any other
JVM installation for Eclipse projects. Personally I use this in
conjunction with Eclim to gain code completion for Avian in vim.

The new targets also create symlinks to loosely mimic OpenJDK's
filenames and folder layout:

    build/linux-x86_64-tails-continuations/eclipse/jdk/
    ├── avian.ee
    ├── bin
    │   └── java -> ../../../avian
    ├── jre
    │   └── lib
    │       └── rt.jar -> ../../../../classpath.jar
    └── src -> ../../classpath

Annoyingly, Eclipse for some reason expects this layout to exist
even though the descriptor format has required parameters for
specifying these locations. I suppose that other software may
look for this "standard" layout in a JVM installation so it may be
generally useful.

These artifacts are only built if the platform is one of `windows`,
`linux`, or `macosx`. The symlinks might not actually work at all on
Windows, I'm not sure how things like cygwin/msys handle that and I
do not have the means to test it. If they do not work a fallback
for windows might be to actually copy the files instead of symlinking.

I realize this can be done outside of the makefile but it seemed
useful to put it here to gain access to the information about the
build location, platform, architecture, and other build options.

For the record, this contribution is my original work and is released
under the same license that Avian uses, found in the license.txt
file in this repository.
2015-07-16 11:00:26 -04:00
Joshua Warner
e7dbe89c74 Merge pull request #444 from dicej/immortal-fixies
fix GC crash for bootimage builds
2015-07-07 21:31:32 -06:00
Joel Dice
630d9a165e fix GC crash for bootimage builds
In a bootimage=true build, we create allocate certain objects as
"immortal fixies", which means they will never been deallocated at
runtime and should only be visited if/when they point to objects which
might move during garbage collection.  However, there was a bug in the
following case:

 1. immortal fixie F is updated to point to a movable object M and
 thus F is added to the list of fixies to visit during the next minor
 collection (but not the next major one, since all reachable objects
 are visited during a major collection, and there's no point in
 visiting an unreachable object, whereas during a minor collection we
 have to visit F because we don't know if it's reachable or not)

 2. a major collection occurs, but F is not reachable and thus is not
 visited, whereas M is moved

 3. a minor collection occurs, and since F is still in the list, it is
 visited, but since it contains a stale pointer to M's old location,
 we crash

The solution is to ensure unreachable immortal fixies are removed from
the above list after each major collection, thus guaranteeing they
won't be visited on any subsequent collection.
2015-07-07 17:28:32 -06:00
Joshua Warner
ebd6bb2e6d Merge pull request #442 from dicej/master
fix GCC 5.1 compiler warnings/errors
2015-06-25 12:33:27 -07:00
Joel Dice
0797665859 Merge pull request #441 from bigfatbrowncat/cp_fix2
fixed abs() compilation for Android classpath on OSX
2015-06-24 11:23:42 -06:00
Ilya Mizus
2c7e3960d6 llabs call fixed 2015-06-24 17:49:56 +03:00
Joel Dice
1aaef6ce88 fix GCC 5.1 compiler warnings/errors
GCC is a lot more sensitive about -Werror=unused-variable, to the
point that stuff declared in header files but unused in a given
compilation unit is flagged.  This may be due to the way we're
here's the fix.
2015-06-23 14:07:48 -06:00
Ilya Mizus
fe6f72d16e fixed abs() compilation for Android classpath on OSX 2015-06-23 16:04:42 +03:00
Joshua Warner
6ace3b655c Merge pull request #438 from tarotanaka0/jnifix
fix JNI stack alignment (for #436)
2015-06-05 16:30:17 +00:00
tarotanaka0
85463c693e fix for -Wunused-parameters 2015-06-04 23:01:19 +09:00
tarotanaka0
7e1debef44 fix JNI stack alignment 2015-06-04 16:02:29 +09:00
Joshua Warner
6c07b1c8ae Merge pull request #437 from bigfatbrowncat/avian-pack-new
Some small tunes for avian-pack #2
2015-06-02 21:33:52 +00:00
Ilya Mizus
0f40ac78a8 Fixes for avian-pack 2015-06-03 00:01:03 +03:00
Joshua Warner
b6ed0e9473 Merge pull request #428 from ReadyTalk/sgoings
add support for LZMA-enabled artifacts
2015-06-02 15:23:19 +00:00
Joel Dice
27f29f5869 fix incorrectly specified extensions for binaryToObject and lzma 2015-05-12 11:19:08 -06:00
Joel Dice
98fbb2db87 add .exe suffix to binaryOption and lzma tools on Windows 2015-05-12 10:46:47 -06:00
Joel Dice
d42a354f7d Merge pull request #434 from joshuawarner32/master
fix concurrency bugs on ios+arm64 in `enter`
2015-05-08 15:48:39 -06:00
Joshua Warner
ba9b85f7c3 fix concurrency bugs on ios+arm64 in enter
At first, it might look like the atomicIncrement operations here,
since they resolve to OSAtomicCompareAndSwap32Barrier, ought to
provide all the memory barrier guarantees we need; however, it turns
out it's not quite sufficient.

Here's why: Apple's OSAtomic*Barrier operations guarantee that memory
operations *before* the atomic op won't be reordered with memory
operations *after* the atomic op - but makes no guarantee that the
atomic op itself won't be reordered with other operations before or
after it.  The key is that the atomic operation is not really atomic,
but rather consists of separate read, check and write steps - in a
loop, no less.  Here, presumably, the read of t->m->exclusive is
hoisted by the out-of-order processor to between the read and write
steps of the "atomic" increment of t->m->activeCount.

Longer term, it probably makes sense to replace this with the c11
<stdatomic.h> operations or the c++11 <atomic> types.  We ought to
actually use the atomic increment operations provided there.  As it
is, our atomicIncrement looks substantially less efficient than those,
since it's actually implemented on arm64 as two nested loops (one in
atomicIncrement and one in the compare-and-swap) instead of one.  We
should also evaluate whether the various instances of atomic
operations actually need as strong of barriers as we're giving them.

FWIW, the gcc __sync_* builtins seem to have the same problem, at
least on arm64.
2015-05-07 13:25:07 -06:00
Joshua Warner
7be8d8551a Merge pull request #433 from dicej/size_t
fix unsigned->size_t build regression
2015-05-04 10:41:15 -06:00
Joel Dice
1127cb6452 fix unsigned->size_t build regression 2015-05-04 09:59:49 -06:00
Joel Dice
3b9089e265 Merge pull request #431 from joshuawarner32/all-heapdump
Always include heapdump code
2015-05-04 08:01:03 -06:00
Joel Dice
a24a1f9b90 Merge pull request #432 from joshuawarner32/master
Fix openjdk-src build after #425
2015-05-04 07:45:47 -06:00
joshuawarner32@gmail.com
1f6e7be3b0 fix openjdk build after finder size_t change
I'm not sure how we didn't catch this when merging #425, but there you are.
2015-05-03 13:25:22 -06:00
joshuawarner32@gmail.com
1aca664d67 remove unused AVIAN_PROCESS preprocessor define 2015-05-03 13:25:21 -06:00
joshuawarner32@gmail.com
6be30bdaf6 always include heapdump code, to eliminate one dimension of the build matrix 2015-05-01 20:11:11 -06:00
Joel Dice
601546efb7 Merge pull request #430 from joshuawarner32/master
Fixes for arm64, new clang, new ios SDK
2015-05-01 16:54:33 -06:00
Joshua Warner
fa63bce14d don't use x18 on arm64, where it's a reserved 'platform' register 2015-05-01 13:44:44 -06:00
Joshua Warner
1290fda6a8 fix new clang warnings (from upgrading clang) 2015-05-01 13:44:21 -06:00
Joshua Warner
b950d8eea8 add sdk 8.3 support 2015-05-01 13:02:52 -06:00
Joel Dice
62570109f2 fix windows publish regression 2015-04-07 17:09:22 -06:00
Joel Dice
8022bd9733 expand support for publishing LZMA artifacts 2015-04-07 16:55:45 -06:00
Seth Goings
e60f53db73 Add lzma support 2015-04-07 11:08:50 -06:00
Joel Dice
4bacddb20a Merge pull request #427 from bgould/master
Added java.util.Formatter implementation. Basic/common formats work,
2015-03-19 14:50:50 -06:00
BCG
5bd8d2759e Switched test harness from calling avian.FormatString to use java.lang.String.format() instead 2015-03-17 12:34:45 -04:00
BCG
a8bed52097 Added java.util.Formatter implementation. Basic/common formats work,
such as %s, %d, %x... also width, left justify, zerofill flags are
implemented. Many of the other formats do not work, see the comments in
avian.FormatString javadoc and look for FIXME and TODO items for more
information on features that are known to not work correctly.
2015-03-17 01:08:07 -04:00
Joshua Warner
cacc099987 Merge pull request #426 from dicej/ci-error
ensure ci.sh exits with error when any test fails
2015-03-16 17:19:22 -06:00