Skip to content
Snippets Groups Projects
  1. Aug 12, 2004
    • Per Bothner's avatar
      javaprims.h (_Jv_Utf8Const): Change struct to a class, with private fields and access methods. · b4d49f49
      Per Bothner authored
      	* gcj/javaprims.h (_Jv_Utf8Const): Change struct to a class,
      	with private fields and access methods.
      	(_Jv_NewStringUTF, _Jv_hashUtf8String): New function declarations.
      	* gcj/cni.h (_Jv_NewStringUTF): Move to javaprims.h.
      	* prims.cc (_Jv_Utf8COnst::init): New method implementation.
      	( _Jv_makeUtf8Const): Rewrite using new constructors.
      	(hashUtf8String): Rename to +_Jv_hashUtf8String and make non-static.
      	* defineclass.cc: Use new _Utf8Const access/convenience methods.
      	* jni.cc: Likewise.
      	* resolve.cc: Likewise.
      	* gcj/field.h: Likewise.
      	* include/jvm.h: Likewise.
      	* java/lang/Class.h: Likewise.
      	* java/lang/natClass.cc: Likwise.
      	* java/lang/natClassLoader.cc: Likewise
      	* java/lang/reflect/natMethod.cc: Likewise
      	* verify.cc: Likewise.
      	(_Jv_BytecodeVerifier::make_utf8_const):  Optimize.
      	(~_Jv_BytecodeVerifier):  Don't need second _Jv_Free call.
      
      From-SVN: r85854
      b4d49f49
  2. Apr 20, 2004
    • Bryce McKinlay's avatar
      class.c (make_class_data): Add new field aux_info. · f5310108
      Bryce McKinlay authored
      2004-04-19  Bryce McKinlay  <mckinlay@redhat.com>
      
      	* class.c (make_class_data): Add new field aux_info.
      	* decl.c (java_init_decl_processing): Push type and decl for
      	`aux_info'.
      
      2004-04-19  Bryce McKinlay  <mckinlay@redhat.com>
      
      	* gcj/cni.h (JvAllocObject): Remove these obsolete,
      	undocumented CNI calls.
      	* include/java-interp.h (_Jv_InterpClass): No longer
      	extends java.lang.Class.
      	* java/lang/Class.h (Class): Add new field `aux_info'.
      	* boehm.cc (_Jv_MarkObj): Update java.lang.Class marking.
      	* defineclass.cc: Remove Class<->_Jv_InterpClass casts.
      	Use Class->aux_info instead.
      	* jni.cc (_Jv_JNI_AllocObject): Use _Jv_AllocObject.
      	* resolve.cc: Remove Class<->_Jv_InterpClass casts.
      	Use Class->aux_info instead.
      	* java/io/natObjectInputStream.cc (allocateObject): Use
      	_Jv_AllocObject.
      	* java/lang/natClass.cc (newInstance): Likewise.
      	* java/lang/natClassLoader.cc (_Jv_NewClass): Likewise.
      	* java/lang/natObject.cc (clone): Likewise.
      	* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Likewise.
      	* java/lang/natVMClassLoader.cc (defineClass): Don't use
      	JvAllocObject. Allocate klass->aux_info here for interpreted
      	class.
      
      From-SVN: r80875
      f5310108
  3. Apr 01, 2004
  4. Oct 24, 2003
    • Andrew Haley's avatar
      lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): New. · 90471585
      Andrew Haley authored
      2003-10-22  Andrew Haley  <aph@redhat.com>
      
              * lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): New.
              (java_get_callee_fndecl): New.
      
              * jcf-parse.c (java_parse_file): Call emit_catch_table().
      
              * java-tree.h (ctable_decl): New.
              (catch_classes):  New.
              (java_tree_index): Add JTI_CTABLE_DECL, JTI_CATCH_CLASSES.
      
              * decl.c (java_init_decl_processing): Add catch_class_type.
              Add ctable_decl.
              Add catch_classes field.
      
              * class.c (build_indirect_class_ref): Break out from
              build_class_ref.
              (make_field_value): Check flag_indirect_dispatch.
              (make_class_data): Ditto.
              Tidy uses of PUSH_FIELD_VALUE.
              Add field catch_classes.
              (make_catch_class_record): New.
      
              * java-tree.h (PUSH_FIELD_VALUE): Tidy.
      
      2003-10-22  Andrew Haley  <aph@redhat.com>
      
              * java/lang/natClass.cc (initializeClass): Call
              _Jv_linkExceptionClassTable.
              (_Jv_LinkSymbolTable): Call )_Jv_ThrowNoSuchMethodError.  Call
              _Jv_Defer_Resolution on a method whose ncode is NULL.
              (_Jv_linkExceptionClassTable): New function.
              (_Jv_LayoutVTableMethods): If superclass looks like a constant pool
              entry, look it up.
              * java/lang/Class.h (struct _Jv_CatchClass): New.
              (_Jv_linkExceptionClassTable): New friend.
              (_Jv_Defer_Resolution): New friend.
              (class Class.catch_classes): New field.
              * include/java-interp.h (Jv_Defer_Resolution): New method.
              (_Jv_PrepareClass): Make a friend of _Jv_MethodBase.
              (_Jv_MethodBase.deferred): New field.
              (_Jv_Defer_Resolution): New function.
              * resolve.cc (_Jv_PrepareClass): Resolve deferred handlers.
              * exception.cc (get_ttype_entry): Change return type to void**.
              (PERSONALITY_FUNCTION): Remove all code related to using a
              Utf8Const* for a match type.  Change match type to be a pointer to
              a pointer, rather than a pointer to a Class.
              * defineclass.cc (handleCodeAttribute): Initialize
              method->deferred.
              (handleMethodsEnd): Likewise.
      
      From-SVN: r72886
      90471585
  5. Sep 25, 2003
    • Tom Tromey's avatar
      Proxy.java (generate): Uncomment protection domain code. · b9f42bb0
      Tom Tromey authored
      	* java/lang/reflect/Proxy.java (generate): Uncomment protection
      	domain code.
      	* java/lang/natClassLoader.cc (defineClass): Added `loader'
      	argument.
      	(linkClass0): Now in VMClassLoader.
      	(markClassErrorState0): Likewise.
      	(getSystemClassLoaderInternal): New method.
      	* java/lang/natClass.cc (initializeClass): Use
      	VMClassLoader::resolveClass.
      	* java/lang/ClassLoader.java: New version, from Classpath.
      	* java/lang/Class.java (getProtectionDomain):
      	protectionDomainPermission and unknownProtectionDomain now in
      	VMClassLoader.
      	* java/lang/Class.h: VMClassLoader now a friend class.
      	* gnu/gcj/runtime/VMClassLoader.java (instance): Now
      	package-private.
      	* gcj/javaprims.h: Regenerated class list.
      	* resolve.cc (_Jv_PrepareClass): Use VMClassLoader::resolveClass.
      	* java/lang/VMClassLoader.java: New version from Classpath;
      	modified for libgcj use.
      
      From-SVN: r71765
      b9f42bb0
  6. Jul 21, 2003
    • Tom Tromey's avatar
      Runtime.java: Comment fix. · ffd94572
      Tom Tromey authored
      	* java/lang/Runtime.java: Comment fix.
      	* java/lang/ClassLoader.java (isAncestorOf): New method.
      	(getParent): Uncommented security check.  Use isAncestorOf.
      	* include/jvm.h (_Jv_CheckAccess): Declare.
      	* java/lang/reflect/natConstructor.cc (newInstance): Perform
      	access check.
      	Include IllegalAccessException.h, ArrayIndexOutOfBoundsException.h.
      	* java/lang/reflect/natArray.cc (newInstance): Pass caller's
      	class loader to _Jv_GetArrayClass.
      	Include ArrayIndexOutOfBoundsException.h.
      	* java/lang/reflect/Field.java: Update comment to reflect status.
      	(equals): Fixed indentation.
      	* java/lang/Class.h (Class): Declare memberAccessCheck, not
      	checkMemberAccess.  Make _Jv_CheckAccess a friend.
      	* java/lang/Class.java (memberAccessCheck): New method from
      	Classpath.
      	(checkMemberAccess): Removed.
      	(getDeclaredMethod): Use memberAccessCheck.
      	(getField): Likewise.
      	(getMethod): Likewise.
      	* resolve.cc (_Jv_ResolvePoolEntry): Use _Jv_CheckAccess.
      	(_Jv_SearchMethodInClass): Likewise.
      	* prims.cc (_Jv_CheckAccess): New function.
      	* jni.cc (_Jv_JNI_FindClass): Use getClassLoaderInternal.
      	(_Jv_JNI_GetAnyFieldID): Likewise.
      	* java/lang/natClass.cc (forName): Use getClassLoaderInternal.
      	(getClassLoader): Added security check.
      	(getConstructor): Call memberAccessCheck.
      	(getDeclaredClasses): Likewise.
      	(getDeclaredField): Likewise.
      	(getDeclaredFields): Likewise.
      	(_getConstructors): Likewise.
      	(getDeclaredConstructor): Likewise.
      	(getDeclaredMethods): Likewise.
      	(getFields): Likewise.
      	(getMethods): Likewise.
      	(newInstance): Likewise.
      	(_Jv_MakeVTable): Put method name in exception.
      	* java/lang/reflect/natMethod.cc (getType): Use
      	getClassLoaderInternal.
      	(_Jv_GetTypesFromSignature): Likewise.
      	(invoke): Perform access check.
      	(_Jv_CallAnyMethodA): Removed old FIXME comments.
      	Include ArrayIndexOutOfBoundsException.h.
      	* java/lang/reflect/natField.cc (getType): Use
      	getClassLoaderInternal.
      	(_Jv_CheckFieldAccessibility): Removed.
      	(getAddr): Use _Jv_CheckAccess; find caller.
      	Include ArrayIndexOutOfBoundsException.h.
      
      From-SVN: r69621
      ffd94572
  7. Apr 23, 2003
  8. Apr 15, 2003
  9. Mar 17, 2003
    • Tom Tromey's avatar
      resolve.cc (ncode): Use _Jv_platform_ffi_abi. · 2b7f1f8f
      Tom Tromey authored
      	* resolve.cc (ncode): Use _Jv_platform_ffi_abi.
      	Include platform.h.
      	* java/lang/natRuntime.cc (insertSystemProperties): Use
      	_Jv_platform_path_separator.
      	(nativeGetLibname): Use _Jv_platform_file_separator.
      	(_load): Use _Jv_platform_onload_names.
      	(onload_names): New global.
      	* include/win32.h (_Jv_platform_file_separator): New define.
      	(_Jv_platform_path_separator): Likewise.
      	(_Jv_platform_onload_names): Likewise.
      	(_Jv_platform_ffi_abi): Likewise.
      	* include/posix.h (_Jv_platform_file_separator): New define.
      	(_Jv_platform_path_separator): Likewise.
      	(_Jv_platform_onload_names): Likewise.
      	(_Jv_platform_ffi_abi): Likewise.
      
      From-SVN: r64461
      2b7f1f8f
  10. Feb 03, 2003
  11. Jan 24, 2003
    • Tom Tromey's avatar
      defineclass.cc (handleMethodsEnd): Precompute code for static method. · 4c98b1b0
      Tom Tromey authored
      	* defineclass.cc (handleMethodsEnd): Precompute code for static
      	method.
      	(handleCodeAttribute): Likewise.
      	* resolve.cc (ncode): Use run_class for unsynchronized static
      	methods.
      	* include/java-interp.h (class _Jv_InterpMethod): Declare
      	run_class.
      	* interpret.cc (run_synch_class): Initialize class.
      	(run) [insn_invokestatic]: Don't initialize class.
      	[insn_anewarray]: Likewise.
      	[insn_multianewarray]: Likewise.
      	(run_class): New function.
      
      From-SVN: r61727
      4c98b1b0
  12. Dec 19, 2002
    • Tom Tromey's avatar
      natClassLoader.cc (defineClass0): Removed erroneous comment. · a1aba4f9
      Tom Tromey authored
      	* java/lang/natClassLoader.cc (defineClass0): Removed erroneous
      	comment.
      	* java/lang/ClassLoader.java (defineClass): Use chained
      	exception when rethrowing.
      	* defineclass.cc (handleClassBegin): Mark class as interpreted.
      	* java/lang/reflect/Modifier.java (INVISIBLE, INTERPRETED): New
      	constants.
      	* resolve.cc (_Jv_PrepareMissingMethods): New function.
      	(_Jv_PrepareClass): Use it.
      	* include/java-interp.h (_Jv_IsInterpretedClass): Rewrote.
      	(_Jv_InterpClass): _Jv_PrepareMissingMethods now friend.
      	* java/lang/Class.h (Class::getModifiers): Mask with ALL_FLAGS.
      	(Class): _Jv_PrepareMissingMethods now friend.
      	* java/lang/natClassLoader.cc (defineClass0): Use JvSynchronize.
      	Record `NULL' for system class loader.
      	(_Jv_RegisterInitiatingLoader): Use JvSynchronize.  Special case
      	system class loader.
      	(_Jv_FindClassInCache): Likewise.
      	(_Jv_UnregisterClass): Use JvSynchronize.  Free old loader info.
      	(_Jv_FindClass): Special case system class loader.
      	* java/lang/natClass.cc (_Jv_abstractMethodError): New function.
      	(_Jv_SetVTableEntries): Put _Jv_abstractMethodError into empty
      	vtable slots.
      	(_Jv_LayoutVTableMethods): Don't generate vtable slot for a method
      	in a final class.
      	(_getDeclaredMethod): Don't return synthetic methods.
      	(getDeclaredMethods): Likewise.
      	(_getMethod): Likewise.
      	(_getMethods): Likewise.
      
      From-SVN: r60319
      a1aba4f9
  13. Dec 05, 2002
    • Tom Tromey's avatar
      Class.h (_Jv_SetVTableEntries): Updated declaration. · eaa2834f
      Tom Tromey authored
      	* java/lang/Class.h (_Jv_SetVTableEntries): Updated declaration.
      	* resolve.cc: Don't include AbstractMethodError.h.
      	(_Jv_abstractMethodError): Removed.
      	* defineclass.cc (handleMethodsBegin): Initialize method index to
      	-1.
      	* java/lang/natClass.cc (_Jv_LayoutVTableMethods): Don't set
      	method index for "new" final method.
      	(_Jv_SetVTableEntries): Compare index against -1 instead of using
      	isVirtualMethod.  Added `flags' argument.
      	(_Jv_MakeVTable): Throw exception for abstract method in concrete
      	class.
      
      From-SVN: r59847
      eaa2834f
  14. Nov 04, 2002
    • Jeff Sturm's avatar
      resolve.cc (METHOD_NOT_THERE, [...]): Remove. · a5db0683
      Jeff Sturm authored
      	* resolve.cc (METHOD_NOT_THERE, METHOD_INACCESSIBLE): Remove.
      	(_Jv_ResolvePoolEntry): Use _Jv_Method.index, not
      	_Jv_DetermineVTableIndex, to determine vtable offset.
      	(_Jv_DetermineVTableIndex): Remove.
      	(_Jv_PrepareClass): Don't layout vtable.  Use _Jv_MakeVTable instead.
      
      	* java/lang/Class.h (friend int _Jv_DetermineVTableIndex): Remove.
      
      From-SVN: r58780
      a5db0683
  15. Sep 25, 2002
    • Jesse Rosenstock's avatar
      re PR libgcj/7709 (NullPointerException in _Jv_ResolvePoolEntry) · 8848a766
      Jesse Rosenstock authored
      2002-09-25  Jesse Rosenstock  <jmr@ugcs.caltech.edu>
      
      	* resolve.cc (_Jv_ResolvePoolEntry) [end_of_method_search]: Check
      	to see if `the_method == 0' before looking up vtable index.
      	Fixes PR libgcj/7709.
      
      From-SVN: r57517
      8848a766
    • Tom Tromey's avatar
      * java/lang/natClassLoader.cc: · 169f75f3
      Tom Tromey authored
      	(_Jv_PrepareCompiledClass): Throw NoClassDefFoundError, per spec.
      	* resolve.cc: Include NoClassDefFoundError.h, not
      	ClassNotFoundException.h.
      	(_Jv_ResolvePoolEntry): Throw NoClassDefFoundError, per spec.
      	* defineclass.cc: Don't include ClassNotFoundException.h.
      
      From-SVN: r57516
      169f75f3
    • Tom Tromey's avatar
      resolve.cc: Include StringBuffer. · fd44a92d
      Tom Tromey authored
      	* resolve.cc: Include StringBuffer.
      	(_Jv_ResolvePoolEntry): Use StringBuffer to create error string.
      
      From-SVN: r57515
      fd44a92d
  16. Jun 20, 2002
    • Tom Tromey's avatar
      For PR libgcj/7073: · 04a704a4
      Tom Tromey authored
      	* resolve.cc (_Jv_PrepareClass): Only resolve superclass if it
      	exists.
      	* defineclass.cc (handleClassBegin): Superclass for interface is
      	`null'.
      
      From-SVN: r54835
      04a704a4
  17. Jan 08, 2002
  18. Dec 10, 2001
    • Tom Tromey's avatar
      resolve.cc (_Jv_PrepareClass): Verify method here... · 6d8b1244
      Tom Tromey authored
      	* resolve.cc (_Jv_PrepareClass): Verify method here...
      	* defineclass.cc (handleMethodsEnd): ... not here.
      	* verify.cc (_Jv_BytecodeVerifier::initialize_stack): New method.
      	(_Jv_BytecodeVerifier::verify_instructions_0) [op_return]: Ensure
      	there are no uninitialized objects.
      	(_Jv_BytecodeVerifier::state::this_type): New field.
      	(_Jv_BytecodeVerifier::state::state): Initialize this_type.
      	(_Jv_BytecodeVerifier::state::copy): Copy this_type.
      	(_Jv_BytecodeVerifier::state::merge): Merge this_type.
      	(_Jv_BytecodeVerifier::state::check_no_uninitialized_objects):
      	Handle this_type.
      	(_Jv_BytecodeVerifier::state::check_this_initialized): New
      	method.
      	(_Jv_BytecodeVerifier::state::set_initialized): Handle this_type.
      	(_Jv_BytecodeVerifier::state::set_this_type): New method.
      	(_Jv_BytecodeVerifier::verify_instructions_0) [op_putfield]: Allow
      	assignment to fields of `this' before another initializer is run.
      
      From-SVN: r47826
      6d8b1244
  19. Nov 05, 2001
    • Tom Tromey's avatar
      Class.h (Class): Made _Jv_BytecodeVerifier a friend. · a12fe13d
      Tom Tromey authored
      	* java/lang/Class.h (Class): Made _Jv_BytecodeVerifier a friend.
      	* Makefile.in: Rebuilt.
      	* Makefile.am (libgcj_la_SOURCES): Added verify.cc.
      	* verify.cc: New file.
      	* include/java-interp.h (_Jv_count_arguments): Declare.
      	(_Jv_VerifyMethod): Likewise.
      	(class _Jv_InterpMethod): Made _Jv_BytecodeVerifier a friend.
      	(class _Jv_InterpException): Likewise.
      	* resolve.cc (_Jv_count_arguments): Renamed from count_arguments.
      	No longer static.  Updated callers.
      	* defineclass.cc (int_bits_to_float): Removed.
      	(long_bits_to_double): Likewise.
      	(prepare_pool_entry): Updated.
      	(handleCodeAttribute): Verify method (commented out for now).
      
      From-SVN: r46796
      a12fe13d
  20. Oct 16, 2001
    • Bryce McKinlay's avatar
      Eliminate use of C++ static constructors. · 107abb2f
      Bryce McKinlay authored
      	* interpret.cc: Remove static Utf8Consts. Use namespace gcj.
      	* jni.cc: Likewise.
      	* resolve.cc: Likewise.
      	* defineclass.cc: Likewise.
      	(_Jv_ClassReader::handleClassBegin): Synchronize call to
      	_Jv_RegisterClass.
      	* include/jvm.h (void_signature, clinit_name, init_name, finit_name):
      	Declare in namespace gcj.
      	* java/lang/Class.h (Class): Remove initialization for primitive
      	types.
      	(friend void _Jv_InitPrimClass): This is in prims.cc.
      	* prims.cc (_Jv_InitPrimClass): Do primitive type initialization
      	here instead.
      	(void_signature, clinit_name, init_name, finit_name): Define in
      	namespace gcj.
      	(_Jv_CreateJavaVM): Call _Jv_InitThreads, _Jv_InitGC, and
      	_Jv_InitializeSyncMutex from here. Initialize Utf8 constants.
      	Initialize primitive types.
      	* java/lang/natClassLoader.cc (_Jv_RegisterClasses): Don't call
      	initialization routines. Don't synchronize.
      	* java/lang/natRuntime.cc (_load): Synchronize on java.lang.Class
      	across dlopen call.
      
      From-SVN: r46282
      107abb2f
  21. Oct 03, 2001
  22. Sep 21, 2001
    • Richard Henderson's avatar
      jvm.h (_Jv_VTable): Handle function descriptors for ia64... · f5ddf154
      Richard Henderson authored
              * include/jvm.h (_Jv_VTable): Handle function descriptors for ia64;
              add get_method, set_method, vtable_elt_size, new_vtable.
              (_Jv_ArrayVTable): Derive from _Jv_VTable.
              * resolve.cc (_Jv_PrepareClass): Use new _Jv_VTable methods.
              * interpret.cc (_Jv_InterpMethod::continue1): Likewise.
              * java/lang/natClassLoader.cc (_Jv_NewArrayClass): Likewise.
      
      From-SVN: r45734
      f5ddf154
  23. May 24, 2001
    • Tom Tromey's avatar
      [multiple changes] · 3610e0d5
      Tom Tromey authored
      2001-05-23  Tom Tromey  <tromey@redhat.com>
      
      	* posix-threads.cc (_Jv_self_cache): Renamed from self_cache.
      	* gcj/Makefile.in: Rebuilt.
      	* gcj/Makefile.am (gcj_HEADERS): Added libgcj-config.h.
      	* gcj/javaprims.h: Include gcj/libgcj-config.h.
      	* gcj/libgcj-config.h.in: New file.
      	* libgcj.spec.in (*jc1): Added @HASH_SYNC_SPEC@.
      	* configure: Rebuilt.
      	* configure.in: Enable hash synchronization by default on some
      	platforms.
      	(HASH_SYNC_SPEC): New subst.
      	(AC_CONFIG_HEADER): Added gcj/libgcj-config.h.
      	Correctly use `test -z' instead of `test -n' in a couple places.
      	(JV_HASH_SYNCHRONIZATION): Use AC_DEFINE; don't add to
      	LIBGCJ_CXXFLAGS.
      	* configure.host (enable_java_net_default): Initialize.
      	(enable_hash_synchronization_default): New variable.
      
      2001-05-23  Hans Boehm <Hans_Boehm@hp.com>
      
      	* boehm.cc (_Jv_MarkObj): Don't mark sync_info when hash
      	synchronization in use.
      	(_Jv_MarkArray): Likewise.
      	(_Jv_AllocBytes): Don't check return result.
      	(handle_out_of_memory): New function.
      	(_Jv_InitGC): Set GC_oom_fn.
      	(trace_one_vtable): New global.
      	(_Jv_AllocTraceOne): New function.
      	* configure.in: Added --enable-hash-synchronization.
      	* defineclass.cc, prims.cc, resolve.cc, java/lang/natString.cc,
      	java/net/natInetAddress.cc: Remove _Jv_AllocBytesChecked.
      	* nogc.cc (_Jv_AllocObj): Throw out-of-memory.
      	(_Jv_AllocArray): Likewise.
      	(_Jv_AllocBytes): Likewise.
      	(_Jv_AllocPtrFreeObject): New function.
      	(_Jv_AllocTraceOne): Likewise.
      	* posix-threads.cc (_Jv_ThreadRegister): Handle slow
      	pthread_self().
      	(self_cache): New global.
      	(_Jv_ThreadSelf_out_of_line): New function.
      	* prims.cc (_Jv_AllocBytesChecked): Removed.
      	(_Jv_ThrowNoMemory): New function.
      	(_Jv_AllocObject): Don't check for null return from allocator.
      	(_Jv_NewObjectArray): Likewise.
      	(_Jv_AllocPtrFreeObject): New function.
      	(_Jv_NewPrimArray): Allocate pointer-free object if possible.
      	* include/javaprims.h (_Jv_AllocPtrFreeObject): Declare.
      	(_Jv_MonitorEnter, _Jv_MonitorExit): Don't return value.
      	* include/boehm-gc.h (_Jv_AllocObj): Define.
      	(_Jv_AllocPtrFreeObj): Define.
      	* include/jvm.h (_Jv_AllocPtrFreeObj): Declare.
      	(_Jv_ThrowNoMemory): Declare.
      	(_Jv_AllocTraceOne): Declare.
      	(_Jv_AllocBytesChecked): Removed.
      	* include/posix-threads.h (_Jv_MutexInit, _Jv_MutexLock,
      	_Jv_MutexUnlock): Handle LOCK_DEBUG.
      	(_Jv_ThreadSelf): Handle case where system pthread_self() is
      	slow.
      	* java/lang/Class.h (Class): Declare _Jv_AllocPtrFreeObj as
      	friend.
      	* java/lang/Object.h (sync_info): Conditional upon presence of
      	hash synchronization.
      	* java/lang/natObject.cc: Much new code to handle thin locks and
      	hash synchronization.
      	* java/lang/natString.cc (_Jv_AllocString): Allocate pointer-free
      	object if possible.
      
      From-SVN: r42519
      3610e0d5
  24. Mar 26, 2001
    • Richard Henderson's avatar
      exception.cc (java_eh_info): Make value type jthrowable. · b3208f56
      Richard Henderson authored
      	* exception.cc (java_eh_info): Make value type jthrowable.
      	(_Jv_type_matcher): Remove now unneeded cast.
      	(_Jv_Throw): Make argument type jthrowable.  Munge name
      	for SJLJ_EXCEPTIONS here ...
      	* gcj/cni.h: ... not here.
      	(JvThrow): Remove.
      	* gcj/javaprims.h (_Jv_Throw, _Jv_Sjlj_Throw): Update declarations.
      
      	* defineclass.cc, interpret.cc, jni.cc, posix-threads.cc,
      	prims.cc, resolve.cc, gnu/gcj/runtime/natFirstThread.cc,
      	gnu/gcj/xlib/natDrawable.cc, gnu/gcj/xlib/natFont.cc,
      	gnu/gcj/xlib/natWMSizeHints.cc, gnu/gcj/xlib/natWindowAttributes.cc,
      	gnu/gcj/xlib/natXImage.cc, java/io/natFile.cc,
      	java/io/natFileDescriptorEcos.cc, java/io/natFileDescriptorPosix.cc,
      	java/io/natFileDescriptorWin32.cc, java/io/natFileWin32.cc,
      	java/lang/natClass.cc, java/lang/natClassLoader.cc,
      	java/lang/natDouble.cc, java/lang/natObject.cc,
      	java/lang/natPosixProcess.cc, java/lang/natRuntime.cc,
      	java/lang/natString.cc, java/lang/natSystem.cc,
      	java/lang/natThread.cc, java/lang/reflect/natArray.cc,
      	java/lang/reflect/natConstructor.cc, java/lang/reflect/natField.cc,
      	java/lang/reflect/natMethod.cc, java/util/zip/natDeflater.cc,
      	java/util/zip/natInflater.cc:
      	Use throw, not JvThrow or _Jv_Throw.
      
      From-SVN: r40838
      b3208f56
  25. Mar 23, 2001
    • Tom Tromey's avatar
      jni.cc (_Jv_JNI_GetAnyFieldID): Handle unresolved fields. · 83c64db6
      Tom Tromey authored
      	* jni.cc (_Jv_JNI_GetAnyFieldID): Handle unresolved fields.
      	* java/lang/reflect/natField.cc (getType): Use _Jv_ResolveField
      	unconditionally.
      	* include/jvm.h (_Jv_ResolveField): Declare.
      	* include/java-interp.h (_Jv_ResolveField): Don't declare.
      	* resolve.cc (_Jv_ResolveField): No longer conditional on
      	INTERPRETER.
      
      From-SVN: r40785
      83c64db6
  26. Oct 06, 2000
    • Tom Tromey's avatar
      natField.cc (BooleanClass): Don't define. · 1d336a09
      Tom Tromey authored
      	* java/lang/reflect/natField.cc (BooleanClass): Don't define.
      	* java/lang/reflect/natArray.cc (BooleanClass): Don't define.
      	* java/lang/Class.h (Object): Added `class$' field.
      	* java/lang/Object.h (Object): Added `class$' field.
      	* defineclass.cc (ClassClass): Use `class$' form.
      	(ClassObject): Likewise.
      	* resolve.cc (ClassObject): Use `class$' form.
      	(ObjectClass): Likewise.
      	* interpret.cc (ClassError): Removed.
      	* java/net/natPlainDatagramSocketImpl.cc (BooleanClass): Use
      	`class$' form.
      	(IntegerClass): Likewise.
      	* java/net/natPlainSocketImpl.cc (BooleanClass): Use `class$'
      	form.
      	* java/lang/natClassLoader.cc (CloneableClass): Use `class$' form.
      	(ObjectClass, ClassClass, VMClassLoaderClass, ClassLoaderClass,
      	SerializableClass): Likewise.
      	Include Serializable.h, Cloneable.h.
      	* java/lang/natSystem.cc (SystemClass): Removed.
      	(init_properties): Use `class$' form.
      	* java/lang/natObject.cc (CloneableClass): Removed.
      	(clone): Use `class$' form.
      	* java/lang/natClass.cc (CloneableClass): Use `class$' form.
      	(ObjectClass, ErrorClass, ClassClass, MethodClass, FieldClass,
      	ConstructorClass): Likewise.
      	* java/lang/reflect/natMethod.cc (ObjectClass): Use `class$' form.
      	(ClassClass, VoidClass, ByteClass, ShortClass, CharacterClass,
      	IntegerClass, LongClass, FloatClass, DoubleClass): Likewise.
      	* java/io/natObjectInputStream.cc (ObjectClass): Use `class$'
      	form.
      	(ClassClass): Likewise.
      	* include/jvm.h (StringClass): Use `class$' form.
      	* prims.cc (ObjectClass): Removed.
      	(_Jv_RunMain): Use `class$' form.
      	(_Jv_AllocObject): Likewise.
      	* jni.cc (ClassClass): Use `class$' form.
      	(ThrowableClass): Likewise.
      	(ObjectClass): Likewise.
      	(MethodClass): Likewise.
      	(ThreadGroupClass): Likewise.
      	(NativeThreadClass): Likewise.
      	* boehm.cc (ObjectClass): Removed.
      	(ClassClass): Removed.
      	(_Jv_MarkObj): Use `class$' form.
      	* gcj/field.h (JvFieldIsRef): Use `class$' form.
      	Include RawData.h.
      
      From-SVN: r36740
      1d336a09
  27. Sep 30, 2000
    • Hans Boehm's avatar
      Implement bitmap descriptor based marking for Boehm GC. · bf3b8e42
      Hans Boehm authored
      
      2000-09-30  Hans Boehm  <boehm@acm.org>
      	    Bryce McKinlay  <bryce@albatross.co.nz>
      
      	Implement bitmap descriptor based marking for Boehm GC.
      
      	* configure.in: Define JC1GCSPEC. Set it if boehm-gc is used.
      	* configure: Rebuilt.
      	* libgcj.spec.in: Pass JC1GCSPEC to jc1.
      	* include/jvm.h (struct _Jv_VTable): New field `gc_descr'. New inline
      	method get_finalizer().
      	(struct _Jv_ArrayVTable): Ditto. Declare method array with
      	NUM_OBJECT_METHODS elements instead of NUM_OBJECT_METHODS + 1.
      	(_Jv_AllocObj): Add new jclass parameter.
      	(_Jv_AllocArray): Ditto.
      	(_Jv_BuildGCDescr): New prototype.
      	* prims.cc (_Jv_AllocObject): Rename parameter `c' to `klass'. Pass
      	`klass' to _Jv_AllocObj. Don't set the new object's vtable. Use
      	get_finalizer() instead of direct finalizer vtable offset.
      	(_Jv_NewObjectArray): Rename parameter `clas' to `klass'. Pass
      	`klass' to _Jv_AllocArray. Don't set the new array's vtable.
      	(_Jv_NewPrimArray): Call _Jv_FindArrayClass before _Jv_AllocObj.
      	Pass `klass' to _Jv_AllocObj. Don't set the new array's vtable.
      	* resolve.cc (METHOD_NOT_THERE, METHOD_INACCESSIBLE): New #defines.
      	(_Jv_ResolvePoolEntry): Use METHOD_NOT_THERE and METHOD_INACCESSIBLE.
      	(_Jv_DetermineVTableIndex): Ditto.
      	(_Jv_PrepareClass): Ditto. Remove offset-by-one adjustments from vtable
      	calculations to account for new gc_descr field.
      	* boehm.cc: #include gc_gcj.h.
      	(obj_kind_x, obj_free_list): `#if 0'-ed away.
      	(_Jv_MarkObj): Check that vtable doesn't point to a cleared object.
      	New commentary from HB. Mark the classes vtable.
      	(_Jv_MarkArray): Check that vtable doesn't point to a cleared object.
      	(GC_DEFAULT_DESCR): New #define.
      	(_Jv_BuildGCDescr): New function. Use GC_DEFAULT_DESCR, for now.
      	(_Jv_AllocObj): New parameter `klass'. Use GC_GCJ_MALLOC ().
      	(_Jv_AllocArray): New parameter `klass'. Allocate with GC_MALLOC and
      	scan conservativly if size is less than min_heap_addr. Set vtable
      	pointer of new object before returning.
      	(_Jv_AllocBytes): Use GC_MALLOC_ATOMIC, not GC_GENERIC_MALLOC.
      	(_Jv_InitGC): Call GC_init_gcj_malloc(). Don't set up marking and
      	allocation for obj_kind_x.
      	* nogc.cc (_Jv_BuildGCDescr): New function. Return 0.
      	(_Jv_AllocObj): Set vtable on returned object.
      	(_Jv_AllocArray): Ditto.
      	* java/lang/Class.h (_Jv_NewObjectArray): No longer a friend.
      	(_Jv_NewPrimArray): Ditto.
      	(_Jv_AllocObj): Declare as a friend.
      	(_Jv_AllocArray): Ditto.
      	* java/lang/natClassLoader.cc (_Jv_FindArrayClass): Copy gc_descr
      	from &ObjectClass into new array class. Remove offset-by-one
      	adjustments from `method' size calculations to account for gc_descr
      	field.
      
      Co-Authored-By: default avatarBryce McKinlay <bryce@albatross.co.nz>
      
      From-SVN: r36679
      bf3b8e42
  28. Mar 26, 2000
    • Tom Tromey's avatar
      [multiple changes] · 99444711
      Tom Tromey authored
      2000-03-26  Tom Tromey  <tromey@cygnus.com>
      
      	* java/lang/mprec.h: Use SIZEOF_VOID_P.
      	* interpret.cc: Use SIZEOF_VOID_P.
      	* include/java-cpool.h (_Jv_storeLong): Use SIZEOF_VOID_P.
      	(_Jv_loadLong): Likewise.
      	(_Jv_storeDouble): Likewise.
      	* configure: Rebuilt.
      	* configure.in: Check size of void*.
      
      	* resolve.cc (ncode): Use FFI_PREP_RAW_CLOSURE and FFI_RAW_SIZE.
      
      2000-03-26  Hans Boehm  <boehm@acm.org>
      
      	* include/java-cpool.h (_Jv_storeLong, _Jv_loadLong,
      	_Jv_storeDouble, _Jv_loadDouble): Define differently on 64 bit
      	machine.
      	* java/lang/ieeefp.h: Define __IEEE_BIG_ENDIAN or
      	__IEEE_LITTLE_ENDIAN appropriately on IA64.
      	* java/lang/mprec.h: Don't define Pack_32 on 64 bit machine.
      	* javaprims.h (_Jv_word): Added `l' and `d' entries in 64 bit
      	case.
      	* resolve.cc (FFI_PREP_RAW_CLOSURE): New define.
      	(FFI_RAW_SIZE): Likewise.
      	(_Jv_InterpMethod::ncode): Use them.
      	* interpret.cc (PUSHL, PUSHD, POPL, POPD, LOADL, LOADD, STOREL,
      	STORED): Define differently on a 64 bit machine.
      	(continue1): Use ffi_java_raw_call when appropriate.
      
      From-SVN: r32754
      99444711
  29. Mar 07, 2000
    • Tom Tromey's avatar
      All files: Updated copyright information. · 2ba5f774
      Tom Tromey authored
      	* All files: Updated copyright information.
      	* COPYING: New file.
      	* COPYING.LIB: Removed.
      	* LIBGCJ_LICENSE: We now use GPL + special exception.
      
      From-SVN: r32387
      2ba5f774
    • Bryce McKinlay's avatar
      resolve.cc (_Jv_SearchMethodInClass): New function. · ddf0fc6c
      Bryce McKinlay authored
      2000-03-07  Bryce McKinlay  <bryce@albatross.co.nz>
      
              * resolve.cc (_Jv_SearchMethodInClass): New function.
              (_Jv_ResolvePoolEntry): Search superinterfaces for interface
              methods.
              * java/lang/Class.h (_Jv_SearchMethodInClass): New prototype.
      
      2000-03-07  Bryce McKinlay  <bryce@albatross.co.nz>
      
              * java/lang/Class.h (union _Jv_IDispatchTable): New declaration.
              (struct _Jv_ifaces): New declaration.
              JV_CLASS: New macro definition.
              (getComponentType): Relocate below isArray() for inlining.
              (getModifiers): Declare `inline'.
              (getSuperclass): Ditto.
              (isArray): Ditto.
              (isPrimitive): Ditto.
              (_Jv_IsAssignableFrom): New prototype.
              (_Jv_LookupInterfaceMethodIdx): New prototype. Predeclare with "C"
              linkage.
              (_Jv_InitClass): Move from natClass.cc. Declare `inline'.
              Check for JV_STATE_DONE before invoking initializeClass().
              (_Jv_PrepareConstantTimeTables): New prototype.
              (_Jv_GetInterfaces): Ditto.
              (_Jv_GenerateITable): Ditto.
              (_Jv_GetMethodString): Ditto.
              (_Jv_AppendPartialITable): Ditto.
              (_Jv_FindIIndex): Ditto.
              depth, ancestors, idt: New class fields.
      
              * java/lang/natClass.cc (isAssignableFrom): Move functionality to
              inline function `_Jv_IsAssignableFrom'. Use that function.
              (isInstance): Declare `inline'.
              (initializeClass): Get lock on class before checking `state'. Unlock
              before calling resolveClass0. Call _Jv_PrepareConstantTimeTables
      	with the lock held.
              (_Jv_LookupInterfaceMethod): Use _Jv_GetMessageString.
              (_Jv_IsAssignableFrom): New inline function. Test assignability
      	using class->depth and ancestor table.
              (_Jv_IsInstanceOf): Use _Jv_IsAssignableFrom.
              (_Jv_CheckCast): Move from prims.cc. Use JV_CLASS and
              _Jv_IsAssignableFrom.
              (_Jv_CheckArrayStore): Ditto.
              (_Jv_LookupInterfaceMethodIdx): New function.
              INITIAL_IOFFSETS_LEN, INITIAL_IFACES_LEN: New #defines.
              (_Jv_PrepareConstantTimeTables): New function.
              (_Jv_IndexOf): Ditto.
              (_Jv_GetInterfaces): Ditto.
              (_Jv_GenerateITable): Ditto.
              (_Jv_GetMethodString): Ditto.
              (_Jv_AppendPartialITable): Ditto.
              iindex_mutex, iindex_mutex_initialized: New static fields.
              (_Jv_FindIIndex): New function.
      
              * java/lang/natClassLoader.cc (_Jv_NewClass): Set new jclass fields.
      
              * prims.cc (_Jv_CheckCast): Moved to natClass.cc.
              (_Jv_CheckArrayStore): Ditto.
              (JvNewCharArray, JvNewBooleanArray, JvNewByteArray, JvNewShortArray,
              JvNewIntArray, JvNewLongArray, JvNewFloatArray, JvNewDoubleArray):
              Moved to gcj/array.h.
              (_Jv_Realloc): New function.
      
              * gcj/cni.h: Move _Jv_PrimClass definitions to gcj/array.h.
      
              * gcj/array.h: _Jv_PrimClass definitions moved from gcj/cni.h.
              (JvNewCharArray, JvNewBooleanArray, JvNewByteArray,
              JvNewShortArray, JvNewIntArray, JvNewLongArray, JvNewFloatArray,
              JvNewDoubleArray): Implementations moved from prims.cc and
              declared `inline'.
      
              * gcj/javaprims.h (_Jv_Realloc): Prototype.
      
              * include/jvm.h (_Jv_LookupInterfaceMethodIdx): Prototype.
      
      From-SVN: r32382
      ddf0fc6c
  30. Feb 16, 2000
    • Tom Tromey's avatar
      resolve.cc (ncode): Set args_raw_size. · d348bda4
      Tom Tromey authored
      	* resolve.cc (ncode): Set args_raw_size.  Compute jni_cif and
      	jni_arg_types.
      	(init_cif): Added `rtype_p' argument.
      	* include/java-interp.h (class _Jv_MethodBase): Added
      	args_raw_size.
      	(class _Jv_InterpMethod): Removed args_raw_size.
      	(class _Jv_JNIMethod): Added jni_cif and jni_arg_types fields.
      	* jni.cc (call): Pass JNIEnv and (for static methods only) the
      	class pointer as well as the ordinary arguments.
      
      From-SVN: r31995
      d348bda4
  31. Feb 10, 2000
    • Andrew Haley's avatar
      interpret.cc: Don't include fdlibm.h. · 715bdd81
      Andrew Haley authored
      2000-02-10  Andrew Haley  <aph@cygnus.com>
      
      	* interpret.cc: Don't include fdlibm.h.
      	Replace #if with #ifdef throughout.
      	Declare extern __ieee754_fmod.
      	(continue1): Remove op_getfield, op_getstatic, op_putfield,
      	op_putstatic insns.
      	* resolve.cc (_Jv_PrepareClass): Use imeth as method pointer.
      	Search class hierarchy for superclass vtable.
      
      	* java/lang/natClassLoader.cc (_Jv_UnregisterClass): Don't fall
      	off the end of a pointer list.
      
      	* java/lang/natThread.cc (stop): Don't abort, throw an exception
      	instead.
      	(suspend): Ditto.
      
      From-SVN: r31897
      715bdd81
  32. Feb 04, 2000
    • Tom Tromey's avatar
      defineclass.cc (handleMethodsBegin): Allocate _Jv_MethodBase pointers. · facc279f
      Tom Tromey authored
      	* defineclass.cc (handleMethodsBegin): Allocate _Jv_MethodBase
      	pointers.
      	(handleMethodsEnd): Fixed error messages.  Create a _Jv_JNIMethod
      	if the method is native.
      	* resolve.cc (ncode): Don't handle native methods.
      	(_Jv_JNIMethod::ncode): New method.
      	(_Jv_PrepareClass): Handle native methods.
      	* jni.cc (call): Renamed from _Jv_JNI_conversion_call.
      	Include AbstractMethodError.h.
      	(add_char): New function.
      	(mangled_name): Likewise.
      	* include/java-interp.h (class _Jv_JNIMethod): New class.
      	(class _Jv_MethodBase): New class.
      	(class _Jv_InterpMethod): Derive from _Jv_MethodBase.
      	(_Jv_InterpClass): Changed `interpreted_methods' field to type
      	`_Jv_MethodBase'.
      
      	* include/jvm.h (_Jv_FindSymbolInExecutable): Declare.
      	* java/lang/natRuntime.cc (libraries_size, libraries_count,
      	libraries): New globals.
      	(add_library): New function.
      	(_Jv_FindSymbolInExecutable): New function.
      
      	* java/lang/natClassLoader.cc (initiated_classes, loaded_classes):
      	Now static.
      
      From-SVN: r31790
      facc279f
  33. Feb 02, 2000
    • Tom Tromey's avatar
      java-interp.h (_Jv_JNI_conversion_call): Declare. · ee6713e7
      Tom Tromey authored
      	* include/java-interp.h (_Jv_JNI_conversion_call): Declare.
      	* resolve.cc (ncode): Use _Jv_JNI_conversion_call when
      	constructing the closure if the function is native.
      	* jni.cc (_Jv_JNI_conversion_call): Now returns `void'.  No longer
      	a template function, #if'd out, or static.
      	Include <java-interp.h>.
      
      From-SVN: r31746
      ee6713e7
  34. Jan 26, 2000
  35. Jan 20, 2000
  36. Jan 19, 2000
  37. Jan 04, 2000
    • Tom Tromey's avatar
      [multiple changes] · 0f918fea
      Tom Tromey authored
      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
      0f918fea
Loading