Commit Graph

57 Commits

Author SHA1 Message Date
3dccd68fe7 Implement the Field#set<PrimitiveType> method family
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-11-06 09:10:50 -06:00
2904dd738e Fix java.lang.reflect.Field.getLong()
The bug was that the long was cast to an int, cutting off the most
significant bytes.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-11-06 09:10:50 -06:00
526dd574d9 Add the Method#isVarArgs method
Required by bleeding-edge Beanshell...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-10-25 15:32:33 -05:00
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
b4c3eea0f1 set InvocationTargetException target
When using the OpenJDK classpath, the target exception and the
Throwable cause are two different fields; we must set them both.
2013-04-18 11:23:59 -06:00
8546ca5670 fix Avian classpath build 2013-02-22 11:55:01 -07:00
42d39b1af1 more Android class library work 2013-02-21 15:37:17 -07:00
a5c9dd6f24 Fixing some issues with runtime annotations within avian.
We were not properly converting dots to slashes internally for package names
and we did not properly handle Method.getAnnotations and
Method.getAnnotation(Class<T>) on methods without any annotations.

Added some tests to cover these cases.
2012-05-22 14:02:51 -06:00
0addd8c814 update copyright years 2012-05-11 17:43:27 -06:00
794a45cb79 fix various ObjectOutputStream/ObjectInputStream bugs 2011-07-01 08:43:43 -06:00
c743140e08 add new subroutine test
This test covers the case where a local stack slot is first used to
store an object reference and later to store a subroutine return
address.  Unfortunately, this confuses the VM's stack mapping code;
I'll be working on a fix for that next.

The new test requires generating bytecode from scratch, since there's
no reliable way to get javac to generate the code we want.  Since we
already had primitive bytecode construction code in Proxy.java, I
factored it out so we can reuse it in Subroutine.java.
2011-02-16 11:41:33 -07:00
a5742f5985 update copyright years 2010-12-05 20:21:09 -07:00
c1c9d2111b remove GNU Classpath and Apache Harmony compatibility code
Rather than try to support mixing Avian's core classes with those of
an external class library -- which necessitates adding a lot of stub
methods which throw UnsupportedOperationExceptions, among other
comprimises -- we're looking to support such external class libraries
in their unmodified forms.  The latter strategy has already proven
successful with OpenJDK's class library.  Thus, this commit removes
the stub methods, etc., which not only cleans up the code but avoids
misleading application developers as to what classes and methods
Avian's built-in class library supports.
2010-09-27 15:58:02 -06:00
d819a75f36 more work towards OpenJDK classpath support
The biggest change in this commit is to split the system classloader
into two: one for boot classes (e.g. java.lang.*) and another for
application classes.  This is necessary to make OpenJDK's security
checks happy.

The rest of the changes include bugfixes and additional JVM method
implementations in classpath-openjdk.cpp.
2010-09-14 10:49:41 -06:00
cddea7187d preliminary support for using OpenJDK's class library
Whereas the GNU Classpath port used the strategy of patching Classpath
with core classes from Avian so as to minimize changes to the VM, this
port uses the opposite strategy: abstract and isolate
classpath-specific features in the VM similar to how we abstract away
platform-specific features in system.h.  This allows us to use an
unmodified copy of OpenJDK's class library, including its core classes
and augmented by a few VM-specific classes in the "avian" package.
2010-09-10 15:05:29 -06:00
17c1a552d5 break each Class, Field, and Method into separate classes
In order to facilitate making the VM compatible with multiple class
libraries, it's useful to separate the VM-specific representation of
these classes from the library implementations.  This commit
introduces VMClass, VMField, and VMMethod for that purpose.
2010-09-01 10:13:52 -06:00
a650f1affa provide more useful message when throwing exception from Field.set 2010-03-07 12:03:17 -07:00
f588a62ae3 fix Classpath 0.98 compatibility issues 2009-12-22 21:34:04 -07:00
70da0df46b add Class.getExceptionTypes method 2009-12-15 10:04:51 -07:00
6118792ffd update copyright years 2009-12-02 19:08:29 -07:00
1faf93c163 fix typo in Proxy.makeInvokeCode 2009-09-19 16:27:28 -06:00
953cb69e5e move proxy and annotation code from C++ to Java
This allows code shrinkers to remove it if it's not used by the application.
2009-09-19 16:21:15 -06:00
7aa906d97b support runtime-visible annotations and java.lang.reflect.Proxy 2009-09-18 18:01:54 -06:00
9553d56977 add AccessibleObject.setAccessible(AccessibleObject[],boolean) 2009-08-13 09:03:44 -06:00
df1aee5981 replace slashes with dots in class name passed to Class.forName in Method.getParameterTypes 2009-08-11 09:25:05 -06:00
58c3a37277 specify classloader when calling Class.forCanonicalName in Field and Method; tolerate null argument array in Method.invoke 2009-08-10 07:48:44 -06:00
1a2deff97d Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-08-09 14:43:53 -06:00
2de750768b add java.lang.reflect.Modifier.isInterface 2009-08-05 14:14:45 +00:00
e18ab49f4d always pass null instance to native version of Method.invoke when invoking static methods 2009-08-04 18:30:16 -06:00
0615b8a09f add classes and methods needed for GNU Classpath compatibility
Most of these methods are stubs which throw
UnsupportedOperationExceptions for now.
2009-06-02 17:14:38 -06:00
20cf42c5e4 more work on boot image creation 2008-11-23 16:58:01 -07:00
6a5116e7a7 implement primitive heap dump facility for memory profiling, accessible via Runtime.dumpHeap
The proper way to do this is to implement a subset of JVMTI, but this
will do the job for now.
2008-10-21 17:38:20 -06:00
c8cc7d931b maintain a table to look up methods called via JNI
This simplifies the JNI implementation for looking up methods.  It also
fixes a bug where an applications calls GetStaticMethodID with class A
and then calls CallStatic<Type>Method with class B which extends A.  The
old code would look in the wrong method table and thus call the wrong
method.
2008-08-15 12:32:33 -06:00
c9ef443944 add Modifier.isNative and isAbstract 2008-04-01 16:42:50 -06:00
2edaa82801 prepend copyright notice and license to all source files; add license.txt and readme.txt 2008-02-19 11:06:52 -07:00
6fe0c4636f various bugfixes and tweaks in reflection 2007-11-20 13:40:07 -07:00
7dfbd87a40 bugfixes 2007-11-02 15:42:19 -06:00
e820b6a8a4 sketch of singleton support 2007-11-02 15:08:14 -06:00
b71d5104ba snapshot 2007-11-01 13:24:09 -06:00
404d996c1e snapshot 2007-10-03 18:41:54 -06:00
2f3f97d550 clean up compile.cpp and support both x86_64 and i386; further refactoring to support JIT 2007-09-26 17:23:03 -06:00
1207989f72 fix build and runtime bugs introduced in last commit 2007-09-26 08:43:40 -06:00
5e42158f4b add misc methods to classpath 2007-09-13 20:19:44 -06:00
7cb3a30a91 sketch of Runtime.exec() and Calendar; misc bugfixes 2007-09-12 18:21:37 -06:00
e2f3e80bdf heap o' bugfixes 2007-08-19 20:57:32 -06:00
aa5e751e69 clean up Array.get(), Array.set(), and Method.invoke() implementations 2007-08-18 11:53:30 -06:00
d169e4eadf clean up Field.get() and Field.set() implementations 2007-08-18 11:15:03 -06:00
ab3ca38580 various bugfixes 2007-08-13 18:37:00 -06:00
c20219df19 flesh out serialization/deserialization code and fix build 2007-08-12 18:50:25 -06:00
38d4ee6e07 flesh out ClassLoader, etc. 2007-07-30 17:19:05 -06:00