Commit Graph

4704 Commits

Author SHA1 Message Date
Joel Dice
575f595292 add support for iOS/x86_64 2015-03-16 11:39:08 -06:00
Joshua Warner
ad75d4ae22 Merge pull request #423 from dicej/clean
delete lib dir in clean target
2015-03-16 11:19:38 -06:00
Joel Dice
93a4702de9 delete lib dir in clean target 2015-03-16 10:39:11 -06:00
Joshua Warner
8b20e89a3d Merge pull request #422 from dicej/clean
expand clean target and disable jdk tests when alternative arch specified
2015-03-16 08:59:37 -06:00
Joshua Warner
1fd0833a0c Merge pull request #421 from dicej/copyright
update copyright years
2015-03-13 17:08:36 -06:00
Joel Dice
d6c9d3c2d0 disable openjdk=... and jdk tests if arch flag specified
These combinations generally won't work, since the JAVA_HOME JDK will
tend to match the native, default architecture, not the one specified.
2015-03-13 15:28:14 -06:00
Joel Dice
b35f236066 delete cmake-build and distrib in clean target 2015-03-13 15:21:29 -06:00
Joel Dice
cbde34620c update copyright years 2015-03-13 12:52:59 -06:00
Joshua Warner
7a74c2c168 Merge pull request #419 from dicej/type-generator-limit
handle arbitrary class sizes in type-generator/main.cpp
2015-03-12 13:33:42 -06:00
Joel Dice
dc7e68708f add JVM_GetResourceLookupCacheURLs
This improves support for building with openjdk=$jdk8.  Note, however,
that the Processes test does not pass, since JDK 8's
java.lang.UNIXProcess uses invokedynamic, which Avian does not yet
support.
2015-03-12 10:52:17 -06:00
Joel Dice
6c7ff9874e handle arbitrary class sizes in type-generator/main.cpp
OpenJDK 8 includes a core class (java.lang.Thread) which so many
fields that it exceeds the class size limit in type-generator dictated
by the logic responsible for calculating each class's GC object mask,
at least on 32-bit systems.  There was no fundamental need for this
limit -- it just made the code simpler.

This commit removes the above limit at the cost of slightly more
complicated code.  The original motivation for this change is that the
platform=macosx arch=i386 openjdk=$jdk8 build was failing.  However,
there doesn't seem to be a prebuild JDK 8 for 32-bit OS X anywhere on
the Internet, nor is there any obvious way to build one on a modern
Mac, so it's safe to say we won't be supporting this combination
anyway.  The problem also occurs on Linux and Windows, though,
so it needs to be fixed.
2015-03-12 10:50:03 -06:00
Joel Dice
795604bbc4 Merge pull request #417 from ReadyTalk/repatch-windows-file-delete
repatch windows file delete
2015-03-06 15:39:20 -07:00
Brandon Craig
9928597543 repatch windows file delete 2015-03-06 14:37:06 -07:00
Joshua Warner
1f8f0b2194 Merge pull request #415 from dicej/openjdk8
fix OpenJDK 8 class library build
2015-02-27 14:14:53 -07:00
Joel Dice
02cfe06850 fix OpenJDK 8 class library build 2015-02-27 13:59:06 -07:00
Joshua Warner
09833801c8 Merge pull request #414 from ReadyTalk/fix-delete-windows
fix java.io.File.delete() implementation for windows
2015-02-19 15:24:46 -07:00
Brandon Craig
a188b15f2e fix java.io.File.delete() implementation for windows 2015-02-19 14:55:48 -07:00
Joshua Warner
b959a2a2f9 Merge pull request #407 from dicej/master
load bootstrap classes in findInterfaceMethod
2015-02-09 10:21:26 -07:00
Joshua Warner
f05f116c3f Merge pull request #409 from marcinolawski/master
Added missing methods to ByteArrayOutputStream, Modifier and UTFDataFormatException.
2015-02-08 17:49:50 -07:00
Marcin Olawski
a5ff62fbad Swap the directionality of the links in Cell. 2015-02-08 22:38:56 +01:00
Marcin Olawski
0537cb4775 Add ByteArrayOutputStream.writeTo(OutputStream), UTFDataFormatException and Modifier.isTransient(int). 2015-02-08 16:09:08 +01:00
Joshua Warner
3441e6f5aa Merge pull request #408 from marcinolawski/master
Missing methods in Arrays, ArrayIndexOutOfBoundsException and ClassNotFoundException.
2015-02-07 18:38:04 -07:00
Marcin Olawski
ff17455baa Add Arrays.fill(* a,int start,int stop,* value). 2015-02-07 21:12:48 +01:00
Marcin Olawski
6462c159aa Add ArrayIndexOutOfBoundsException(int) and ClassNotFoundException.getException(). 2015-02-07 21:12:04 +01:00
Joel Dice
7a4cae0dde load bootstrap classes in findInterfaceMethod
In afbd4ff, I made a low-risk, but very specific fix for a more
general problem: "bootstrap" classes (i.e. classes which the VM has
built-in knowledge of) need to be loaded from the classpath before any
of their methods are called.  Based on recent testing, I found there were
more cases than I previously thought where the VM tries to call methods on
"unloaded" bootstrap classes, so we needed a more general solution to
the problem.

This commit addresses it by closing the last (known) loophole by which
methods might be called on bootstrap classes: invokeinterface, and its
helper method findInterfaceMethod.  The fix is to check for bootstrap
classes in findInterfaceMethod and load the full versions if
necessary.  This process may lead to garbage collection and/or thrown
exceptions, which made me nervous about cases of direct or indirect
calls to findInterfaceMethod not expecting those events, which is why
I hadn't used that approach earlier.  However, it turns out there were
only a few places that made non-GC-safe calls to findInterfaceMethod,
and a bit of code rearrangement fixed that.
2015-02-06 13:51:32 -07:00
Joshua Warner
21e6bd8598 Merge pull request #406 from marcinolawski/master
I added 2 missing method to java.lang.Character.
2015-02-06 12:49:44 -07:00
Marcin Olawski
6f8a8b9436 Added Character.isJavaIdentifierStart(int), isJavaIdentifierPart(int) and made isJavaIdentifierStart(char), isJavaIdentifierPart(char) more compact. 2015-02-06 20:07:51 +01:00
Marcin Olawski
ab3ee4c6e2 Add Character.isJavaIdentifierStart(char ch) and isJavaIdentifierPart(char ch) 2015-02-06 15:26:40 +01:00
Joshua Warner
4d91110fe7 Merge pull request #405 from dicej/master
fix ARM64 iOS JNI crashes
2015-02-05 19:03:49 -07:00
Joel Dice
c2a0210c7b fix ARM64 iOS JNI crashes
As documented at
https://developer.apple.com/library/ios/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html,
the ARM64 iOS ABI differs from the generic ABI in a few important
ways.  Specifically, arguments passed via the stack are aligned
according to their natural alignment instead of 8 bytes.  The VM's
dynamic call code was aligning each argument to 8 bytes, so native JNI
code couldn't find them in their expected places.

Also, we weren't setting the "os.arch" system property on ARM64, so I
fixed that too.
2015-02-05 17:20:53 -07:00
Joshua Warner
a13e97ddf7 Merge pull request #403 from dicej/getDeclaredMethods
fix crash when calling Class.getDeclaredMethods using the OpenJDK class ...
2015-01-22 13:38:54 -07:00
Joshua Warner
7fe6f015fd Merge pull request #402 from dicej/master
fix Cygwin build
2015-01-22 13:30:43 -07:00
Joel Dice
afbd4ff303 fix crash when calling Class.getDeclaredMethods using the OpenJDK class library
This method ends up defering to JVM_GetClassDeclaredMethods, which
creates an array of java.lang.reflect.Method instances and then
calling getName on each one through the java.lang.reflect.Member
interface.  However, Method is a "bootstrap" class, meaning the VM has
built-in knowledge of it and includes a tentative version built-in but
must load the real version from the classpath at runtime before
invoking methods on it.  Normally this happens naturally when Method
instances are created in Java code, but here we're creating them in
the VM instead, which doesn't automatically cause the real class to be
loaded.  So we must do so explicitly.
2015-01-22 12:02:28 -07:00
Joel Dice
b777f0b4a2 fix Cygwin build
80ce92a introduced a regression which caused the Cygwin build to fail,
since it tried to set platform=$(build-platform) when calling make
recursively, and platform=cygwin is rejected by the makefile.
Instead, we need to use $(bootimage-platform), which normalizes
"cygwin" and "mingw32" to "windows".
2015-01-22 09:57:15 -07:00
Joshua Warner
5def0e4658 Merge pull request #401 from dicej/master
align stack size for vmNativeCall to 16 on ARM
2015-01-21 14:51:32 -07:00
Joel Dice
bbd4c58f91 align stack size for vmNativeCall to 16 on ARM
The ARM64 ABI(s) require this, and it doesn't hurt to do it on 32-bit
ARM as well.
2015-01-21 14:10:25 -07:00
Joshua Warner
bd22daccff Merge pull request #400 from dicej/master
use unconditional branch to stack overflow thunk on ARM64
2015-01-21 08:28:42 -07:00
Joel Dice
df0085ada5 use unconditional branch to stack overflow thunk on ARM64
On ARM64, conditional branches to immediate offsets can span no more
than 2^19 instructions.  In the case of the stack overflow check,
which wants to do a conditional branch from every non-leaf method to a
handler, this can be a problem, especially when compiled code grows
large as with a bootimage=true build against the OpenJDK class
library.  Therefore, we use an unconditional branch to reach the
handler on this platform.
2015-01-20 16:54:29 -07:00
Joel Dice
6b12c87e52 Merge pull request #399 from bigfatbrowncat/avian-pack
Added okhttp and Bouncy Castle libraries back #2
2015-01-19 10:05:42 -07:00
Ilya Mizus
aeb87ffd12 Instructions for Building with Android classpath 2015-01-17 18:54:24 +03:00
Ilya Mizus
89ab73c7e2 Merge branch 'master' of https://github.com/ReadyTalk/avian into avian-pack 2015-01-17 18:34:21 +03:00
Joshua Warner
5a87455e64 Merge pull request #397 from dicej/master
fix broken interpreter build due to out-of-order class initialization
2015-01-15 18:19:44 -07:00
Joel Dice
8ee7e8124a fix broken interpreter build due to out-of-order class initialization
When we initialize the vtables for bootstrap Java classes such as
java.lang.NullPointerException (i.e. classes which the VM has built-in
knowledge of), we assign the superclass's vtable to any class which
has no declared virtual methods of its own.  However, that vtable will
be null if we haven't initialized the superclass yet.  Therefore, we
must order this process such that no class is initialized until after
all its superclasses.
2015-01-15 17:13:46 -07:00
Joshua Warner
5f59529286 Merge pull request #394 from dicej/master
fix method interception bug
2015-01-12 10:33:11 -07:00
Joel Dice
4509e29abb fix method interception bug
When we intercept a method (i.e. when the VM wants to run its own code
instead of whatever the classpath provides for that method), we make a
clone of the original method so we can later call it from the
intercepting code if appropriate.  We also set the ACC_NATIVE flag on
the original method to ensure that our intercepting code is always
used in preference to the classpath version.  However, we need to set
that flag *after* we make the clone, or else the clone will also have
the ACC_NATIVE flag set, which is not what we want.

We never noticed this before because classpath versions of all the
methods we intercept as of Java 7 are either native or are never
called from their VM-specified replacements.  However, some of those
native methods are non-native in later versions of Java, so the bug
has become apparent.
2015-01-12 09:54:11 -07:00
Joshua Warner
f6e7a29f09 Merge pull request #392 from lostdj/patch-10
classpath-openjdk: Fix freeZipFileEntry()
2015-01-11 13:05:32 -07:00
Timofey Lagutin
da01d20c19 classpath-openjdk: Fix freeZipFileEntry()
Those ZipFile::Entries are part of ZipFile instance itself and will fail to free(). See :1504 and :1520 in openZipFile().
2015-01-11 22:49:15 +03:00
Joshua Warner
5186f1486a Merge pull request #390 from lostdj/patch-9
classpath-openjdk: Fix getZipFileEntry()
2015-01-11 12:08:06 -07:00
Timofey Lagutin
97734af72d classpath-openjdk: Fix getZipFileEntry()
'addSlash' argument was incorrectly understood: it is supposed to add slash only on retry (see ZIP_GetEntry2() zip_util.c in OpenJDK).
2015-01-11 21:44:41 +03:00
Seth Goings
394c5cacce Adjust publish logic to adhere to Travis spec
See the specifics here: http://docs.travis-ci.com/user/ci-environment/#Environment-variables
2015-01-10 16:53:52 -07:00