Commit Graph

3486 Commits

Author SHA1 Message Date
Joel Dice
c0c2b75be1 change expat URL in README.md
Apparently we have readytalk.github.io set up to 301 redirect all URLs
to oss.readytalk.com, which confuses curl.  Rather than figure out how
to make curl do the right thing, I've just changed the URL to point to
oss.readytalk.com.
2013-07-31 15:17:24 -07:00
Joshua Warner
cfa62d8d2f Merge pull request #75 from frustaci/patch-1
Fix 16-byte boundary in Linux x86
2013-07-29 07:54:18 -07:00
frustaci
a6440375ca Update x86.S
GCC now assumes by default that the stack is aligned to a 16-byte boundary in Linux x86, so let's do our part to honour that. :)
Otherwise native code that depends on the stack to be aligned to 16 bytes would seg fault (like SSE).
https://groups.google.com/forum/#!topic/avian/SyCl-Jfw2U8
2013-07-28 10:39:55 -03:00
Joshua Warner
c09f329728 Merge pull request #71 from jentfoo/issue70
Fix ClassCastException in UnmodifiableMap as well as fix modifying unmodifiable structures through iterators
2013-07-17 12:00:19 -07:00
Mike Jensen
2e921b803d Added a simple test to show the original issue 2013-07-17 11:53:35 -06:00
Mike Jensen
bfe7b9110a Removed exception message based on Josh's recommendation 2013-07-17 11:52:48 -06:00
Mike Jensen
7da59277e5 This solves a class cast exception from a call to .values() from an UnmodifiableMap. It also solves an issue where you can modify an unmodifiable collection through the Iterator or ListIterator (depending on the structure type). 2013-07-15 08:54:44 -06:00
Mike Jensen
bdcec728f7 Merge pull request #2 from ReadyTalk/master
Update personal avian to current readytalk/avian
2013-07-15 07:31:26 -07:00
Mike Keesey
aab1b6e087 Adding another possible case for addThread to expect. One common case that triggers is is when both arguments to addThread are the same thread (such as the call from attachThread). SWT on darwin seems to do this for dialog boxes. 2013-07-14 15:59:43 -06:00
Joel Dice
ccebdb2107 Merge remote-tracking branch 'jet/master' 2013-07-09 10:04:50 -06:00
JET
1b6d8e1085 Added native Math.exp() implementation. 2013-07-09 08:31:48 -06:00
Joel Dice
3058e4254d only use librt on Linux; OS X doesn't have or need it 2013-07-07 11:35:20 -06:00
Joel Dice
82577d742f fix Android classpath build
Hopefully it will stay fixed this time, since we now specify commit
hashes for each dependency which are known to work.
2013-07-05 14:36:16 -06:00
Joel Dice
a9d9bc5d20 fix Clang warnings 2013-07-03 13:33:46 -07:00
Joel Dice
87b02eb949 update copyright years
Previously, I used a shell script to extract modification date ranges
from the Git history, but that was complicated and unreliable, so now
every file just gets the same year range in its copyright header.  If
someone needs to know when a specific file was modified and by whom,
they can look at the Git history themselves; no need to include it
redundantly in the header.
2013-07-02 20:52:38 -06:00
Joel Dice
c5d2cb007c tweaks to prepare for 0.7 release 2013-07-02 14:39:20 -06:00
JET
b66d8b9fbf Expanded DatagramChannel and corrected blocking configuration in connect(). 2013-07-02 10:10:05 -06:00
Edison
e07a1e2f57 FIX : To run embeded application, it complains for missing libgcc_s_dw2-1.dll and libstdc++-6.dll.(#60) 2013-06-15 19:04:29 +08:00
Joel Dice
b3cb20d6eb JVM_GetDeclaredClasses and JVM_GetClassInterfaces should return instances of Class[], not Object[] 2013-06-06 18:37:05 -06:00
Joshua Warner
de21913d13 fix linux->darwin cross-compile
There were two issues: the linux->darwin cross compiler is more stringent
about unused variables, and the makefile specified flags for building ON
darwin that were actually applicable whenever we are building FOR darwin.
2013-06-04 13:32:22 -06:00
Joshua Warner
cb11e21f95 force unicode support in java-io.cpp when including windows.h 2013-06-04 11:52:18 -06:00
Joshua Warner
8df12d5003 Use native windows APIs for File.exists()
On windows, there are obscure cases where _wstat can return non-zero for a path that
actually exists, but the native GetFileAttributes returns valid attributes.  This is
the case in particular when the user or process doesn't have permissions to access
the directory (for instance, anything outside of %temp%\Low, when running as a
low-integrity process).

This was causing problems with .mkdirs() - which first tries to check if the parent
exists, and creates it if it doesn't. In our particular case, the exists() was
returning false for the parent, even though it exists, and .mkdir() works fine,
mkdirs() fails for the same directory.
2013-05-31 11:17:21 -06:00
Joel Dice
84e23659f9 remove unecessary PROTECT statements
Since there's no possibility of garbage collection during the
lifetimes of these local variables, there's no need to protect the
references.
2013-05-14 14:33:37 -06:00
Simon Ochsenreither
e088fa07ae Make exception messages match the ones from OpenJDK/Android
This commit changes the exception message format of
ClassCastException and CloneNotSupportedException.
2013-05-14 15:04:34 +02:00
Joel Dice
4a69496ab4 perform any necessary argument conversion in JVM_NewInstanceFromConstructor
We must use the same utility function as JVM_InvokeMethod to ensure
that primitive arguments are unboxed when necessary.
2013-05-13 14:27:39 -06:00
Joel Dice
4b0bbd85e8 fix sun.misc.Unsafe.arrayIndexScale implementation
The original implementation was based on the assumption that the
passed class would be the array element type, whereas it is actually
the array type itself.
2013-05-13 14:25:59 -06:00
Joel Dice
6507150246 wait until all non-daemon threads exit before invoking the class library shutdown method
Running the shutdown method prematurely can cause deadlock in
OpenJDK's AWT implementation and may have other nasty effects besides
that.
2013-05-13 13:17:42 -06:00
Joel Dice
fcfdd6be3a initialize the class if necessary when the "new" operator is invoked
This is one of the conditions specified in
http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.4.1,
which I had forgotten about.
2013-05-13 13:12:58 -06:00
Joel Dice
7e2d265fb9 filter flags argument to JVM_Open
The class library may pass non-standard flags to JVM_Open which will
confuse the OS if we pass them through, so we must filter them out.
2013-05-13 13:11:12 -06:00
Joel Dice
6d5fbdeb7b provide stub for JVM_UnloadLibrary
It may leak file handles under certain circumstances to do nothing in
JVM_UnloadLibrary, but, for now, an empty implementation is more
useful than one that aborts the process.
2013-05-13 13:08:40 -06:00
Joel Dice
419ac24963 don't load libmawt ahead of time when starting the VM
At one point, loading libmawt ahead of time was necessary to make AWT
work, but recent versions of OpenJDK seem to take care this from Java
code, in which case loading it ahead of time causes trouble, so we
comment it out for now until we exactly when it's needed.
2013-05-13 13:05:13 -06:00
Joel Dice
435dbbc874 add stub implementation of JVM_CurrentClassLoader 2013-05-10 11:29:20 -06:00
Joel Dice
6b3a352b38 Merge remote-tracking branch 'origin/master' 2013-04-30 23:08:18 -06:00
Joel Dice
529c7a17fb add support for the RuntimeVisibleParameterAnnotations attribute 2013-04-30 22:55:59 -06:00
Joel Dice
b1840a297d implement Unsafe.{put|get}Char 2013-04-30 22:54:45 -06:00
Joel Dice
af9e162827 fix OpenJDK build regression due to recent Android classpath refactoring 2013-04-30 22:53:56 -06:00
Joel Dice
bbc5d7fb50 only initialize class when necessary to avoid deadlock
Previously, we would attempt to initialize a class (e.g. call its
static initializer) whenever a method in that class was called, as
well as in any of the cases listed in
http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.4.

However, the above approach may lead to deadlock in an app which
relies on being able to call non-static methods in parallel with a
static initializer invocation in the same class.  Thus, this commit
ensures that we initialize classes only in the cases defined by the
standard.
2013-04-30 22:48:43 -06:00
Joel Dice
ed96693166 do not clear interrupted flag in Unsafe.park
Since park does not throw InterruptedException, we must leave the flag
set if we are interrupted while parked so that
e.g. AbstractQueuedSynchronizer can itself throw an exception if
appropriate.
2013-04-30 22:45:08 -06:00
Mike Jensen
f052c7780f Merge pull request #55 from jentfoo/master
Added more to the avian classpath for the collection interface as well as the list interface
2013-04-29 10:46:09 -07:00
Mike Jensen
bd2ebfce07 Merge branch 'master' of https://github.com/ReadyTalk/avian 2013-04-29 11:45:32 -06:00
Mike Jensen
a41f8c0103 Added more to the avian classpath for the collection interface as well as the list interface
Added to collection:
public boolean containsAll(Collection<?> c);
public boolean removeAll(Collection<?> c);

Added to list:
public boolean addAll(int startIndex, Collection<? extends T> c);

Also where possible for inner classes I made them extend the abstract version instead of just implement the interface.  This helps reduce code duplication where possible.

These changes were necessary to support protobuf 2.5.0
2013-04-29 11:32:56 -06:00
Joel Dice
4e12847858 code rearrangment to improve state of Android libcore tests
This mainly moves several sun.misc.Unsafe method implementations from
classpath-openjdk.cpp to builtin.cpp so that the Avian and Android
builds can use them.

It also replaces FinalizerReference.finalizeAllEnqueued with a no-op,
since the real implementations assumes too much about how the VM
handles (or delegates) finalization.
2013-04-23 13:47:15 -06:00
Joel Dice
dfdd1f6e6c move call to Classpath::shutDown
We must be in the Active state, not the Exclusive state when calling
this method since it may execute arbitrary Java code.  This fixes an
assertion failure in makeNew.
2013-04-22 21:52:27 -06:00
Joel Dice
8995db69d2 fix element spec calculation for multidimensional primitive arrays
The element class for e.g. [[[I should be [[I, not [I.
2013-04-22 21:28:25 -06:00
Joel Dice
023787d121 fix special case of exception handler table translation
scalac may generate bytecode such that an exception is thrown within
the bounds of a handler for that exception such that the throw is the
last instruction in the method, which we weren't handling properly.
2013-04-22 21:25:15 -06:00
Joel Dice
a18452f6c9 implement JVM_ConstantPoolGetFloatAt
This commit also simplifies JVM_ConstantPoolGetDoubleAt, which cannot
throw an exception and thus need not go through vmRun.
2013-04-22 21:23:32 -06:00
Joel Dice
e3fe9099a2 filter InnerClasses attribute for relevant classes in JVM_GetDeclaredClasses
The InnerClasses attribute may have entries for classes declared
inside classes we don't care about, so we must check each entry's
outer class reference and make sure it matches the one we do care
about.
2013-04-22 21:20:21 -06:00
Joel Dice
63ee3ab0a2 throw CloneNotSupportedException if Object.clone called on non-Cloneable 2013-04-22 21:19:01 -06:00
Joel Dice
e0ceaa5f43 avoid allocating new memory in hashMapRemove when GCing
This ensures that we don't abort when running an internal finalizer
that removes from a hash map.
2013-04-22 21:17:31 -06:00
Joel Dice
68c3b241ce handle sign extension of constants of various lengths
This is a generalization of 9918ea6 which handles 8-bit and 16-bit as
well as 32-bit values.
2013-04-22 21:15:49 -06:00