Commit Graph

9 Commits

Author SHA1 Message Date
Tom Tromey 0b9309b6e4 resolve.cc (StringClass): Removed.
* resolve.cc (StringClass): Removed.
	* defineclass.cc (StringClass): Removed.

From-SVN: r31539
2000-01-20 17:32:26 +00:00
Tom Tromey 7c734b1758 * All files: Updated copyright to reflect Cygnus purchase.
From-SVN: r31504
2000-01-19 18:39:27 +00:00
Tom Tromey 0f918fea8b [multiple changes]
2000-01-04  Tom Tromey  <tromey@cygnus.com>

	* java/lang/reflect/natConstructor.cc (newInstance): Pass
	declaring class as return_type argument to
	_Jv_CallNonvirtualMethodA.
	* java/lang/reflect/natMethod.cc (_Jv_CallNonvirtualMethodA): In
	constructor case, create object and use it as `this' argument.
	* java/lang/Class.h (_getConstructors): Declare.
	(_getFields): Declare.
	* java/lang/Class.java (getConstructors): Wrote.
	(_getConstructors): New native method.
	(getDeclaredConstructors): Wrote.
	(_getFields): Declare new native method.
	* java/lang/natClass.cc (_Jv_LookupInterfaceMethod): Removed
	incorrect comment.
	(getMethod): Work correctly when class is primitive.
	(getDeclaredMethods): Likewise.  Compute offset using `method',
	not `mptr'.
	(getDeclaredMethod): Likewise.
	(getConstructor): Wrote.
	(ConstructorClass): New define.
	(getDeclaredConstructor): Wrote.
	(_getConstructors): New method.
	(_getFields): New method.
	(getFields): Wrote.

	* Makefile.in: Rebuilt.
	* Makefile.am (AM_CXXFLAGS): Added -D_GNU_SOURCE.

	* prims.cc: Remove `#pragma implementation'.
	* gcj/array.h: Remove `#pragma interface'.

	* prims.cc (_Jv_equaln): New function.
	* java/lang/Class.java (getSignature): Declare.
	* resolve.cc (_Jv_LookupDeclaredMethod): Moved to natClass.cc.
	* java/lang/natClass.cc (_Jv_LookupDeclaredMethod): Moved from
	resolve.cc.
	(getSignature): New method.
	(getDeclaredMethod): Wrote.
	(getMethod): Wrote.
	Include StringBuffer.h.
	* java/lang/Class.h (Class): Added _Jv_FromReflectedConstructor
	as a friend.  Unconditionally declare _Jv_LookupDeclaredMethod as
	a friend.
	(getSignature): Declare.
	* include/jvm.h (_Jv_GetTypesFromSignature): Declare.
	(_Jv_equaln): Declare.
	(_Jv_CallNonvirtualMethodA): Declare.
	* Makefile.in: Rebuilt.
	* Makefile.am (nat_source_files): Added natConstructor.cc.
	(java/lang/reflect/Constructor.h): New target.
	* java/lang/reflect/natConstructor.cc: New file.
	* java/lang/reflect/Constructor.java (newInstance): Now native.
	(declaringClass): Renamed from decl_class.
	(offset): Renamed from index.
	(getType): New native method.
	(getModifiers): Now native.
	(getParameterTypes): Call getType if required.
	(hashCode): Include hash code from declaring class.
	(modifiers): Removed.
	(toString): Call getType if required.
	* gcj/method.h (_Jv_FromReflectedConstructor): New function.
	* java/lang/reflect/natMethod.cc (hack_call): New method.
	Removed `#if 0' around FFI code.
	Include <gnu/gcj/RawData.h>.
	(invoke): Use _Jv_CallNonvirtualMethodA.  Throw
	IllegalArgumentException when argument object and class disagree.
	(_Jv_GetTypesFromSignature): New function.
	(getType): Use it.
	(ObjectClass): New define.
	(_Jv_CallNonvirtualMethodA): New function.
	* java/lang/reflect/Method.java (hack_trampoline): New method.
	(hack_call): New native method.

1999-12-21  Per Bothner  <per@bothner.com>

	* java/lang/natClass.cc (getDeclaredMethods): Correctly compute
	offset in new Method.

From-SVN: r31199
2000-01-04 08:46:52 +00:00
Tom Tromey 27e934d8ba configure: Rebuilt.
* configure: Rebuilt.
	* configure.in: Build include/Makefile.
	* Makefile.in: Rebuilt.
	* Makefile.am (SUBDIRS): Added gcj and include.
	(install-data-local): New target.
	(extra_headers): New macro.
	* include/Makefile.in: New file.
	* include/Makefile.am: New file.

	* interpret.cc: Don't include gcj/field.h or gcj/cni.h.
	* java/lang/reflect/natField.cc: Don't include gcj/field.h or
	gcj/cni.h.
	* boehm.cc: Don't include java-threads.h or gcj/field.h.
	* resolve.cc: Include config.h.
	* defineclass.cc: Include config.h.
	* include/java-interp.h: Don't include config.h.
	* include/jvm.h: Include java-threads.h, Object.h, java-gc.h,
	cni.h.

	* gcj/javaprims.h: Regenerated namespace decls.
	* classes.pl (scan): Don't put `;' after closing brace.

	* Makefile.in: Rebuilt.
	* Makefile.am (INCLUDES): Added -I for top_srcdir.
	* configure.in: Create gcj/Makefile.
	* gcj/Makefile.in: New file.
	* gcj/Makefile.am: New file.
	* java/lang/Object.h: Don't include any other headers.
	* gcj/array.h: Renamed from include/java-array.h.
	* gcj/field.h: Renamed from include/java-field.h.
	* gcj/method.h: Renamed from include/java-method.h.
	* gcj/cni.h, gcj/javaprims.h: Moved from include/.
	Updated all files to reflect new include structure.

From-SVN: r29278
1999-09-10 22:03:10 +00:00
Tom Tromey e409a2c8f4 Modifier.java (ALL_FLAGS): New constant.
* java/lang/reflect/Modifier.java (ALL_FLAGS): New constant.
	* resolve.cc: Removed constants defined by
	java.lang.reflect.Modifier.
	Include <java/lang/reflect/Modifier.h>.
	(_Jv_ResolvePoolEntry): Use values from Modifier.
	(_Jv_DetermineVTableIndex): Likewise.
	(_Jv_PrepareClass): Likewise.
	(ncode): Likewise.
	* defineclass.cc (_Jv_ClassReader): Removed constants defined by
	java.lang.reflect.Modifier.
	Include <java/lang/reflect/Modifier.h>.
	(checkExtends): Use values from Modifier.
	(checkImplements): Likewise.
	(handleField): Likewise.
	(handleConstantValueAttribute): Likewise.
	(handleFieldsEnd): Likewise.
	(handleMethod ): Likewise.
	(handleMethodsEnd): Likewise.
	(handleClassBegin): Likewise.
	* interpret.cc: Removed constants defined by
	java.lang.reflect.Modifier.
	(continue1): Use values from Modifier.
	* java/lang/natClassLoader.cc: Removed constants defined by
	java.lang.reflect.Modifier.

From-SVN: r29037
1999-09-01 22:02:20 +00:00
Kresten Krab Thorup eb4534a636 natClassLoader.cc (_Jv_PrepareCompiledClass): Renamed from _Jv_InternClassStrings.
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Renamed
	from _Jv_InternClassStrings.

	* prims.cc (_Jv_RunMain): New function.
	(JvRunMain): Remove gij-support.

	* gij.cc (main): Use _Jv_RunMain.

	* java/util/zip/ZipFile.java: Call readDirectory in constructor.

	* interpret.cc (PUSHA, PUSHI, PUSHF, PUSHL, PUSHD): Don't store
	argument in temp variable.
	(continue1): For all op_x2y insns, use temp variable for
	intermediate value.  Also remove some comments.

	* java/lang/natClass.cc (newInstance): Call _Jv_InitClass.
	(forName): Don't call _Jv_InitClass.

	* java/lang/Class.java (getResource,getResourceAsStream): Implement.

	* java/util/zip/ZipEntry.java (ZipEntry(ZipEntry)): New construcor.

	* java/util/jar/JarInputStream.java: New file.

	* java/util/jar/JarEntry.java: New file.

	* java/util/jar/JarFile.java: New file.

	* java/net/URLClassLoader.java: New file.

	* java/net/JarURLConnection.java: New file.

	* gnu/gcj/protocol/jar/Handler.java: New file.

	* gnu/gcj/protocol/jar/Connection.java: New file.

	* java/security/SecureClassLoader.java: New file.

	* java/lang/ClassLoader.java (parent): New variable.
	(ClassLoader (ClassLoader)): new constructor.
	(findClass): New method.
	(loadClass): Add default 1.2 implementation.
	(getSystemResourceAsBytes, getResourceAsBytes): Removed.
	(readfully): Removed.

	* gnu/gcj/runtime/VMClassLoader.java: Moved from java/lang.
	(findSystemClass): New method.
	(VMClassLoader): Constructor rewritten.
	(init): New method.
	All other methods removed.

	* java/lang/natClassLoader.cc: Change use of java::lang::VMClassLoader
	to gnu::gcj::runtime::VMClassLoader.
	(_Jv_InternClassStrings): Use _Jv_ResolvePoolEntry.  Also handle
	class entries.
	(VMClassLoader::findSystemClass): renamed from findBootClass.

	* Makefile.am: Add new files.
	(FirstThread.h, ThreadGroup.h): Add _Jv_Main friend.

	* Makefile.in: Rebuilt.

From-SVN: r28748
1999-08-18 14:16:42 +00:00
Per Bothner efc3b511cb resolve.cc (_Jv_PrepareClass): Use ClassLoader::resolveClass0.
1999-08-14  Per Bothner  <per@bothner.com>

	* resolve.cc (_Jv_PrepareClass): Use ClassLoader::resolveClass0.
	* java/lang/natClass.cc (initializeClass): Likewise.
	* java/lang/ClassLoader.java (resolveClass0): New static method.
	(resolveClass): Call resolveClass0.
	(findSystemClass): No longer static.

From-SVN: r28711
1999-08-14 19:49:06 +00:00
Anthony Green 7941ceabf0 [multiple changes]
Mon Aug  9 18:33:38 1999  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

        * Makefile: Rebuilt.
	* Makefile.am (toolexeclibdir): Add $(MULTISUBDIR) even for native
	builds.

	* java/net/natPlainSocketImpl.cc: Include <sys/select.h> only if
	present.

	* configure: Rebuilt.
	* configure.in: Properly align --help output, fix capitalization
	and punctuation.
	* acinclude.m4: Likewise.

1999-08-09  Kresten Krab Thorup  <krab@gnu.org>

	* include/javaprims.h (_Jv_word, _Jv_word2): New types.

	* include/java-interp.h (_Jv_InterpMethodInvocation): Use _Jv_word.
	(_Jv_callInterpretedMethod): Unused. Remove.
	(_Jv_InterpMethod::run,run_normal,run_synch_object,run_synch_class):
	Use ffi_raw.
	* include/java-cpool.h (_Jv_get, _Jv_put): Remove.
	(_Jv_{store,load}{Indexes,Int,Float,Long,Double}): Use _Jv_word.
	* boehm.cc (_Jv_MarkObj): Use _Jv_word.
	* interpret.cc: use _Jv_word.
	* defineclass.cc: use_Jv_word.
	* resolve.cc: Use _Jv_word.
	(_Jv_ResolvePoolEntry): Return _Jv_word.
	* java/lang/Class.h (_Jv_Constants): Use _Jv_word for cpool.
	* java/lang/natClassLoader.cc (_Jv_InternClassStrings): Use _Jv_word.

	* interpret.cc (gnu::gcj::runtime::MethodInvocation::continue1):
	Change comment.

From-SVN: r28641
1999-08-10 05:32:23 +00:00
Anthony Green 58eb6e7cef [multiple changes]
1999-08-09  Anthony Green  <green@cygnus.com>

        * gij.cc: New file.

        * include/config.h.in: Rebuilt.
        * acconfig.h: Add INTERPRETER.

        * configure: Rebuilt.

        * Makefile.in: Rebuilt.
        * Makefile.am (libffi_files): Identify the libffi object files for
        inclusion in libgcj.
        (LIBFFIINCS): Define.

        * interpret.cc (gnu::gcj::runtime::MethodInvocation::continue1):
        Dummy definition for configurations without an interpreter.

        * java/net/natPlainSocketImpl.cc (getOption): Disamiguate call to
        java::lang::Boolean constructor.

        * include/java-interp.h: Always include java-cpool.h.

        * java/lang/natClassLoader.cc (getVMClassLoader0): Always return 0
        when INTERPRETER not defined.

        * java/lang/Class.h (finalize): Define.

        * gnu/gcj/util/path/DirectoryPathEntry.java (getURL): Catch
        IOException from File.getCanonicalPath.
        (getStream): Likewise.

        * NEWS: More news.
        * THANKS: More thanks.

1999-08-09  Kresten Krab Thorup  <krab@gnu.org>

        * resolve.cc (get_ffi_type_from_signature): Generate uint16 for
        jchar type.
        (_Jv_PrepareClass): Allow non-abstract classes to
        have abstract subclasses.
        (_Jv_ResolvePoolEntry): Revert subclass check for protected
        fields and methods.
        * interpret.cc (continue1/perform_invoke): Don't sign extend
        uint16 return val.
        (continue1/lshl,lshr): Push long, not int.
        (continue1/ulshr): Use UINT64, not long long.
        * defineclass.cc (handleFieldsEnd): Handle case when all fields
        are static.
        * java/lang/natClass.cc (forName): Add call to _Jv_InitClass.
        * java/lang/FirstThread.java (run): Add top-level exception
        handler.
        (run0): Renamed from run.

1999-08-08  Kresten Krab Thorup  <krab@gnu.org>

        * configure.in (--with-interpreter): Added.
        * include/config.h.in (INTERPRETER): Added.

        * java/lang/ClassLoader.java: File replaced.
        * java/lang/VMClassLoader.java: New file.
        * java/lang/natClassLoader.cc: New file.
        * gnu/gcj/runtime/MethodInvocation.java: New file.
        * gnu/gcj/util/path/SearchPath.java: New file.
        * gnu/gcj/util/path/PathEntry.java: New file.
        * gnu/gcj/util/path/DirectoryPathEntry.java: New file.
        * gnu/gcj/util/path/ZipPathEntry.java: New file.
        * gnu/gcj/util/path/URLPathEntry.java: New file.
        * gnu/gcj/util/path/CacheEntry.java: New file.
        * include/java-interp.h: New file.
        * include/java-cpool.h: New file.
        * include/java-insns.h: New file.
        * defineclass.cc: New file.
        * interpret.cc: New file.
        * resolve.cc: New file.

        * java/lang/natClass.cc (loaded_classes, _Jv_RegisterClass,
        _Jv_RegisterClasses, _Jv_FindClassInCache, _Jv_FindClass,
        _Jv_NewClass, _Jv_FindArrayClass): Moved to natClassLoader.cc.
        (finalize): New.
        (STATE_NOTHING, STATE_RESOLVED, STATE_IN_PROGRESS, STATE_DONE,
        STATE_ERROR): Moved to java/lang/Class.h and renamed with JV_
        prefix.
        (initializeClass): Use new JV_ prefixed names.  Also, call
        ClassLoader::resolveClass instead of _Jv_ResolveClass.

        * java/lang/Class.h (JV_STATE_PRELOADING, JV_STATE_LOADING,
        JV_STATE_LOADED, JV_STATE_COMPILED, JV_STATE_PREPARED,
        JV_STATE_LINKED): New.
        (_Jv_WaitForState, _Jv_RegisterInitiatingLoader,
        _Jv_UnregisterClass, _Jv_InternClassStrings): New friends.
        (_Jv_IsInterpretedClass, _Jv_InitField, _Jv_LookupDeclaredMethod,
        _Jv_DetermineVTableIndex, _Jv_ResolvePoolEntry, _Jv_PrepareClass,
        _Jv_ClassReader, _Jv_InterpClass, _Jv_InterpMethod,
        _Jv_InterpMethodInvocation): New friends for interpreter.
        (finalize): New.
        (CONSTANT_Class, CONSTANT_String, etc.): Moved to
        include/java-cpool.h and renamed with JV_ prefix.

        * include/jvm.h (_Jv_makeUtf8Const, _Jv_makeUtf8TypeConst): New
        decls.
        (_Jv_UnregisterClass): New decl.

        * java/lang/natClassLoader.cc (_Jv_FindArrayClass): Added
        class loader argument.
        (_Jv_FindClass): Use class loader.

        * prims.cc (_Jv_makeUtf8Const): New function.
        (_Jv_NewObjectArray): Change use of _Jv_FindArrayClass.
        (_Jv_NewPrimArray): Ditto.
        (_Jv_FindClassFromSignature): Ditto.
        * java/lang/reflect/natArray.cc (newInstance): Ditto.
        * java/lang/reflect/natMethod.cc (getType): Ditto.

        * include/java-field.h (_Jv_Field::isRef): Make robust for
        non-resolved contexts.

        * boehm.cc (_Jv_MarkObj): Mark interpreter-related fields.
        Also, don't mark class->next field.

        * java/lang/VirtualMachineError.java: Added FIXME note.

        * configure.in (INTERPSPEC): New spec.
        * libgcj.spec.in: Added INTERPSPEC.
        * Makefile.am: Added gcjh friends for java/lang/VMClassLoader and
        gnu/gcj/runtime/MethodInvocation.
        (libgcj_la_SOURCES): Added resolve.cc defineclass.cc interpret.cc.
        (ordinary_java_source_files): Added above mentioned java classes.

        * configure: Rebuilt.
        * Makefile.in: Rebuilt.

From-SVN: r28597
1999-08-08 14:06:23 +00:00