Skip to content
Snippets Groups Projects
  1. Jan 04, 2013
  2. Apr 23, 2012
  3. Sep 23, 2008
    • Andrew Haley's avatar
      re PR libgcj/8995 (race cases in interpreter) · f0580031
      Andrew Haley authored
      2008-09-17  Andrew Haley  <aph@redhat.com>
      
              PR libgcj/8995:
      
              * defineclass.cc (_Jv_ClassReader::handleCodeAttribute):
              Initialize thread_count.
              * include/java-interp.h (_Jv_InterpMethod::thread_count): New
              field.
               (_Jv_InterpMethod::rewrite_insn_mutex): New mutex.
              (_Jv_InterpFrame:: _Jv_InterpFrame): Pass frame_type.
              * interpret.cc
              (ThreadCountAdjuster): New class.
              (_Jv_InterpMethod::thread_count): New field.
              (_Jv_InitInterpreter): Initialize rewrite_insn_mutex.
              Increment and decrement thread_count field in methods.
              * interpret-run.cc (REWRITE_INSN): Check thread_count <= 1.
              (REWRITE_INSN): Likewise.
              Declare a ThreadCountAdjuster.
              * java/lang/reflect/natVMProxy.cc (run_proxy): Initialize frame
              type as frame_proxy.
      
      From-SVN: r140593
      f0580031
  4. Sep 17, 2007
  5. Jun 15, 2007
    • Keith Seitz's avatar
      java-interp.h (_Jv_LocalVarTableEntry): Add union for bytecode_pc and direct-threaded pc. · 7dace0ca
      Keith Seitz authored
              * include/java-interp.h (_Jv_LocalVarTableEntry): Add union
              for bytecode_pc and direct-threaded pc.
              Add field descriptions inline.
              * defineclass.cc (read_one_code_attribute): Change from
              bytecode_start_pc to bytecode_pc.
              Remove unused variable "len".
              * interpret.cc (compile): Remap the variable table, too.
              (get_local_var_table) [DIRECT_THREADED]: Use insn_index on the
              start location to map from pc_t to code index.
      
      From-SVN: r125734
      7dace0ca
  6. Mar 07, 2007
    • Alexandre Oliva's avatar
      ffi.h.in (ffi_closure_alloc, [...]): New. · 18fa3240
      Alexandre Oliva authored
      libffi/ChangeLog:
      * include/ffi.h.in (ffi_closure_alloc, ffi_closure_free): New.
      (ffi_prep_closure_loc): New.
      (ffi_prep_raw_closure_loc): New.
      (ffi_prep_java_raw_closure_loc): New.
      * src/closures.c: New file.
      * src/dlmalloc.c [FFI_MMAP_EXEC_WRIT] (struct malloc_segment):
      Replace sflags with exec_offset.
      [FFI_MMAP_EXEC_WRIT] (mmap_exec_offset, add_segment_exec_offset,
      sub_segment_exec_offset): New macros.
      (get_segment_flags, set_segment_flags, check_segment_merge): New
      macros.
      (is_mmapped_segment, is_extern_segment): Use get_segment_flags.
      (add_segment, sys_alloc, create_mspace, create_mspace_with_base,
      destroy_mspace): Use new macros.
      (sys_alloc): Silence warning.
      * Makefile.am (libffi_la_SOURCES): Add src/closures.c.
      * Makefile.in: Rebuilt.
      * src/prep_cif [FFI_CLOSURES] (ffi_prep_closure): Implement in
      terms of ffi_prep_closure_loc.
      * src/raw_api.c (ffi_prep_raw_closure_loc): Renamed and adjusted
      from...
      (ffi_prep_raw_closure): ... this.  Re-implement in terms of the
      renamed version.
      * src/java_raw_api (ffi_prep_java_raw_closure_loc): Renamed and
      adjusted from...
      (ffi_prep_java_raw_closure): ... this.  Re-implement in terms of
      the renamed version.
      * src/alpha/ffi.c (ffi_prep_closure_loc): Renamed from
      (ffi_prep_closure): ... this.
      * src/pa/ffi.c: Likewise.
      * src/cris/ffi.c: Likewise.  Adjust.
      * src/frv/ffi.c: Likewise.
      * src/ia64/ffi.c: Likewise.
      * src/mips/ffi.c: Likewise.
      * src/powerpc/ffi_darwin.c: Likewise.
      * src/s390/ffi.c: Likewise.
      * src/sh/ffi.c: Likewise.
      * src/sh64/ffi.c: Likewise.
      * src/sparc/ffi.c: Likewise.
      * src/x86/ffi64.c: Likewise.
      * src/x86/ffi.c: Likewise.
      (FFI_INIT_TRAMPOLINE): Adjust.
      (ffi_prep_raw_closure_loc): Renamed and adjusted from...
      (ffi_prep_raw_closure): ... this.
      * src/powerpc/ffi.c (ffi_prep_closure_loc): Renamed from
      (ffi_prep_closure): ... this.
      (flush_icache): Adjust.
      boehm-gc/ChangeLog:
      * include/gc.h (GC_REGISTER_FINALIZER_UNREACHABLE): New.
      (GC_register_finalizer_unreachable): Declare.
      (GC_debug_register_finalizer_unreachable): Declare.
      * finalize.c (GC_unreachable_finalize_mark_proc): New.
      (GC_register_finalizer_unreachable): New.
      (GC_finalize): Handle it.
      * dbg_mlc.c (GC_debug_register_finalizer_unreachable): New.
      (GC_debug_register_finalizer_no_order): Fix whitespace.
      libjava/ChangeLog:
      * include/jvm.h (_Jv_ClosureListFinalizer): New.
      (_Jv_Linker::create_error_method): Adjust.
      * boehm.cc (_Jv_ClosureListFinalizer): New.
      * nogc.cc (_Jv_ClosureListFinalizer): New.
      * java/lang/Class.h (class _Jv_ClosureList): New.
      (class java::lang::Class): Declare it as friend.
      * java/lang/natClass.cc (_Jv_ClosureList::releaseClosures): New.
      (_Jv_ClosureList::registerClousure): New.
      * include/execution.h (_Jv_ExecutionEngine): Add get_closure_list.
      (_Jv_CompiledEngine::do_get_closure_list): New.
      (_Jv_CompiledEngine::_Jv_CompiledEngine): Use it.
      (_Jv_IndirectCompiledClass): Add closures.
      (_Jv_IndirectCompiledEngine::get_aux_info): New.
      (_Jv_IndirectCompiledEngine::do_allocate_field_initializers): Use
      it.
      (_Jv_IndirectCompiledEngine::do_get_closure_list): New.
      (_Jv_IndirectCompiledEngine::_Jv_IndirectCompiledEngine): Use it.
      (_Jv_InterpreterEngine::do_get_closure_list): Declare.
      (_Jv_InterpreterEngine::_Jv_InterpreterEngine): Use it.
      * interpret.cc (FFI_PREP_RAW_CLOSURE): Use _loc variants.
      (node_closure): Add closure list.
      (_Jv_InterpMethod::ncode): Add jclass argument.  Use
      ffi_closure_alloc and the separate code pointer.  Register the
      closure for finalization.
      (_Jv_JNIMethod::ncode): Likewise.
      (_Jv_InterpreterEngine::do_create_ncode): Pass klass to ncode.
      (_Jv_InterpreterEngine::do_get_closure_list): New.
      * include/java-interp.h (_Jv_InterpMethod::ncode): Adjust.
      (_Jv_InterpClass): Add closures field.
      (_Jv_JNIMethod::ncode): Adjust.
      * defineclass.cc (_Jv_ClassReader::handleCodeAttribute): Adjust.
      (_Jv_ClassReader::handleMethodsEnd): Likewise.
      * link.cc (struct method_closure): Add closure list.
      (_Jv_Linker::create_error_method): Add jclass argument.  Use
      ffi_closure_alloc and the separate code pointer.  Register the
      closure for finalization.
      (_Jv_Linker::link_symbol_table): Remove outdated comment about
      sharing of otable and atable.  Adjust.
      * java/lang/reflect/natVMProxy.cc (ncode_closure): Add closure
      list.
      (ncode): Add jclass argument.  Use ffi_closure_alloc and the
      separate code pointer.  Register the closure for finalization.
      (java::lang::reflect::VMProxy::generateProxyClass): Adjust.
      * testsuite/libjava.jar/TestClosureGC.java: New.
      * testsuite/libjava.jar/TestClosureGC.out: New.
      * testsuite/libjava.jar/TestClosureGC.xfail: New.
      * testsuite/libjava.jar/TestClosureGC.jar: New.
      
      From-SVN: r122652
      18fa3240
  7. Feb 15, 2007
    • Kyle Galloway's avatar
      defineclass.cc (_Jv_ClassReader::read_one_code_attribute): Added... · fe60528e
      Kyle Galloway authored
      defineclass.cc (_Jv_ClassReader::read_one_code_attribute): Added LocalVariableTable attribute handling.
      
      2007-02-15  Kyle Galloway  <kgallowa@redhat.com>
      
      	* defineclass.cc (_Jv_ClassReader::read_one_code_attribute):
          Added LocalVariableTable attribute handling.
          (_Jv_ClassReader::pool_Utf8_to_char_arr): New method.
          * jvmti.cc (_Jv_JVMTI_GetLocalVariableTable): New method.
          * include/java-interp.h: Added local_var_table and
          local_var_table_len fields to _Jv_InterpMethod.
          (_Jv_InterpMethod::get_local_var_table): New method.
          * testsuite/libjava.jvmti/interp/getlocalvartable.java: New
          test.
          * testsuite/libjava.jvmti/interp/getlocalvartable.jar: New test.
          * testsuite/libjava.jvmti/interp/getlocalvartable.out: Output
          for new test.
          * testsuite/libjava.jvmti/interp/getlocalvartable.h: New test.
          * testsuite/libjava.jvmti/interp/natgetlocalvartable.cc: New
          test.
      
      From-SVN: r121999
      fe60528e
  8. Jan 09, 2007
  9. Feb 08, 2006
    • Bryce McKinlay's avatar
      link.cc (_Jv_Linker::print_class_loaded): Declare string constants as "const char *". · 2cf94e58
      Bryce McKinlay authored
      2006-02-08  Bryce McKinlay  <mckinlay@redhat.com>
      
      	* link.cc (_Jv_Linker::print_class_loaded): Declare string constants
      	as "const char *".
      	* verify.cc (verify_fail): Likewise.
      	* gnu/classpath/natSystemProperties.cc (file_encoding): Likewise.
      	* interpret.cc (throw_internal_error, throw_class_format_error):
      	Likewise.
      	* gcj/javaprims.h (_Jv_hashUtf8String, _Jv_Utf8Const::space_needed, 
      	_Jv_Utf8Const::init, _Jv_makeUtf8Const): Likewise.
      	* java/lang/Class.h (_Jv_InitPrimClass): Likewise.
      	* include/jvm.h (_Jv_strLengthUtf8, _Jv_makeUtf8Const): Likewise.
      	* defineclass.cc (throw_internal_error, throw_no_class_def_found_error,
      	is_attribute_name): Likewise.
      	* prims.cc (_Jv_strLengthUtf8, _Jv_hashUtf8String, _Jv_Utf8Const::init,
      	_Jv_makeUtf8Const, _Jv_InitPrimClass): Likewise.
      
      From-SVN: r110767
      2cf94e58
    • Tom Tromey's avatar
      PR libgcj/26063, PR libgcj/17978, PR libgcj/10598: · 8b1753e3
      Tom Tromey authored
      	* defineclass.cc (parse): Use _Jv_AllocRawObj.
      	(read_constpool): Likewise.
      	(read_one_code_attribute): Use internal function name.
      	(handleConstantPool): Use _Jv_AllocRawObj.
      	(handleInterfacesBegin): Likewise.
      	(handleFieldsBegin): Likewise.
      	(handleMethodsBegin): Likewise.
      	(handleCodeAttribute): Likewise.
      	(handleMethodsEnd): Likewise.
      	* include/jvm.h (new_vtable): Use _Jv_AllocRawObj.
      	* interpret.cc (do_allocate_static_fields): Use _Jv_AllocRawObj.
      	Allocate reference fields separately.
      	* link.cc (prepare_constant_time_tables): Use _Jv_AllocRawObj.
      	(add_miranda_methods): Likewise.
      	(generate_itable): Use _Jv_AllocBytes.
      	(find_iindex): Likewise.
      	(struct method_closure): New structure.
      	(create_error_method): Use struct method_closure; allocate with
      	_Jv_AllocBytes.
      	(ensure_fields_laid_out): Separate reference fields from
      	non-reference fields.
      	* boehm.cc (_Jv_MarkObj): Mark vtable.  Only mark direct fields
      	of Class.
      	(_Jv_MarkArray): Mark vtable.
      	(_Jv_AllocRawObj): Don't allocate objects of size 0.
      	* include/execution.h
      	(_Jv_ExecutionEngine::allocate_static_fields): Added 'int'
      	parameter.
      	(struct _Jv_CompiledEngine): Updated.
      	(class _Jv_InterpreterEngine): Updated.
      
      From-SVN: r110763
      8b1753e3
  10. Sep 15, 2005
    • Tom Tromey's avatar
      re PR libgcj/16032 (libgcj should reject class files with incorrect version numbers) · a022cd59
      Tom Tromey authored
      	PR libgcj/16032:
      	* interpret.cc (AVAL1U): Resolve pool entry when not direct
      	threaded.
      	(AVAL2U): Likewise.
      	(compile): Handle 'ldc class' specially.
      	(_Jv_InterpMethod::run): Added special 'ldc class' instruction.
      	* verify.cc (check_constant): Handle 'ldc class' for 1.5 classes.
      	* defineclass.cc (handleCodeAttribute): Set new field.
      	(MAJOR_1_1, MINOR_1_1, MAJOR_1_2, MINOR_1_2, MAJOR_1_3, MINOR_1_3,
      	MAJOR_1_4, MINOR_1_4, MAJOR_1_5, MINOR_1_5): New defines.
      	(parse): Check version numbers.
      	(_Jv_ClassReader::is_15): New field.
      	(_Jv_ClassReader): Initialize it.
      	* include/java-interp.h (_Jv_InterpMethod::is_15): New field.
      
      From-SVN: r104325
      a022cd59
  11. Jul 17, 2005
  12. Jun 24, 2005
    • Tom Tromey's avatar
      natClassLoader.cc (_Jv_UnregisterClass): Handle case where class' name is NULL. · 42c51695
      Tom Tromey authored
      	* java/lang/natClassLoader.cc (_Jv_UnregisterClass): Handle case
      	where class' name is NULL.
      	(_Jv_FindClass): Don't wait for class state.
      	* java/lang/natVMClassLoader.cc (defineClass): Only unregister if
      	name found.
      	* include/java-interp.h (_Jv_DefineClass): Updated.
      	* defineclass.cc (_Jv_DefineClass): Added 'name_result' argument.
      	(struct _Jv_ClassReader): Likewise.
      	(found_name): New field.
      	(handleClassBegin): Set *found_name.
      	(_Jv_VerifyMethodSignature): Handle case where ptr==NULL.
      	(handleClassBegin): Throw error if super class not set.
      	(read_methods): Correctly call check_tag and prepare_pool_entry.
      
      From-SVN: r101301
      42c51695
  13. Jun 15, 2005
    • Tom Tromey's avatar
      re PR libgcj/21906 (hang when invoking abstract method) · fbb4c46b
      Tom Tromey authored
      gcc/java/:
      	PR libgcj/21906:
      	* class.c (make_method_value): Use soft_abstractmethod_node for
      	abstract method.
      	* java-tree.h (soft_abstractmethod_node): New define.
      	(JTI_SOFT_ABSTRACTMETHOD_NODE): New enum constant.
      	* decl.c (java_init_decl_processing): Initialize
      	soft_abstractmethod_node.
      libjava/:
      	PR libgcj/21906:
      	* defineclass.cc (handleMethodsEnd): Set ncode for abstract
      	methods.
      	* include/jvm.h (_Jv_ThrowAbstractMethodError): Declare.
      	* link.cc (_Jv_ThrowAbstractMethodError): Renamed.  No longer
      	static.
      	(append_partial_itable): Use it.
      	(set_vtable_entries): Likewise.
      
      From-SVN: r100992
      fbb4c46b
  14. Mar 10, 2005
    • Bryce McKinlay's avatar
      New Stack Trace infrastructure. · 18744d9b
      Bryce McKinlay authored
      2005-03-10  Bryce McKinlay  <mckinlay@redhat.com>
      
      	New Stack Trace infrastructure.
      	* Makefile.am (libgcj0_convenience_la_SOURCES): Add stacktrace.cc.
      	(gnu/gcj/runtime/StackTrace.lo): Removed.
      	(ordinary_java_source_files): Remove obsolete files.
      	(nat_source_files): Remove obsolete files. Add natVMThrowable.cc.
      	* configure.host (fallback_backtrace_h): Set backtrace header
      	for mingw and cygwin targets.
      	* configure.ac: Make symlink for fallback backtrace headers.
      	* Makefile.in, configure: Rebuilt.
      	* defineclass.cc (_Jv_ClassReader::read_one_code_attribute):
      	Read 'LineNumberTable' attribute.
      	(_Jv_ClassReader::read_one_class_attribute): Read 'SourceFile'
      	attribute.
      	(_Jv_ClassReader::handleCodeAttribute): Initialize method line
      	table fields.
      	* exception.cc: Remove unused include.
      	* interpret.cc (DIRECT_THREADED, insn_slot): Moved to java-interp.h.
      	(SAVE_PC): New macro. Save current PC in the interpreter frame.
      	(NULLCHECK, NULLARRAYCHECK): Use SAVE_PC.
      	(_Jv_InterpMethod::compile): Translate bytecode PC values in the line
      	table to direct threaded instruction values.
      	(_Jv_StartOfInterpreter, _Jv_EndOfInterpreter): Removed.
      	(_Jv_InterpMethod::run): No longer member function. All
      	callers updated. Remove _Unwind calls. Call SAVE_PC whenever a call
      	is made or where an instruction could throw.
      	(_Jv_InterpMethod::get_source_line): New. Look up source line numbers
      	in line_table.
      	* prims.cc (catch_segv): Construct exception after MAKE_THROW_FRAME.
      	(catch_fpe): Likewise.
      	* stacktrace.cc: New file. Stack trace code now here.
      	* gnu/gcj/runtime/MethodRef.java:
      	* gnu/gcj/runtime/NameFinder.java: Mostly reimplemented. Now simply
      	calls addr2line to look up PC addresses in a given binary or shared
      	library.
      	* gnu/gcj/runtime/StackTrace.java, gnu/gcj/runtime/natNameFinder.cc,
      	gnu/gcj/runtime/natStackTrace.cc: Removed.
      	* gnu/java/lang/MainThread.java (call_main): Add comment warning that
      	this function name is specially recognised by the stack trace code
      	and shouldn't be changed.
      	* include/java-interp.h (DIRECT_THREADED, insn_slot): Moved here.
      	(struct  _Jv_LineTableEntry, line_table, line_table_len): New.
      	(_Jv_InterpMethod::run): Update declaration.
      	(_Jv_StackTrace_): New friend. NameFinder and StackTrace no longer
      	friends.
      	(_Jv_InterpFrame): Renamed from _Jv_MethodChain. Add PC field.
      	* include/java-stack.h: New file. Declarations for stack tracing.
      	* include/jvm.h (_Jv_Frame_info): Removed.
      	* java/lang/Class.h: Update friend declarations.
      	* java/lang/VMClassLoader.java (getSystemClassLoader): Simplify
      	exception message.
      	* java/lang/VMThrowable.java (fillInStackTrace): Now native.
      	(getStackTrace): Now native.
      	(data): New RawDataManaged field.
      	* java/lang/natClass.cc: Update includes.
      	(forName): Use _Jv_StackTrace::GetCallingClass for
      	calling-classloader check.
      	(getClassLoader): Likewise.
      	* java/lang/natRuntime.cc: Update includes.
      	(_load): Use _Jv_StackTrace::GetFirstNonSystemClassLoader.
      	* java/lang/natVMSecurityManager.cc: Update includes.
      	(getClassContext): Use _Jv_StackTrace::GetClassContext.
      	* java/lang/natVMThrowable.cc: New file. Native methods for
      	VMThrowable.
      	* java/lang/reflect/natArray.cc: Update includes.
      	(newInstance): Use _Jv_StackTrace::GetCallingClass to implement
      	accessibility check.
      	* java/lang/reflect/natConstructor.cc: Update includes.
      	(newInstance): Use _Jv_StackTrace::GetCallingClass to implement
      	accessibility check.
      	* java/lang/reflect/natField.cc: Update includes.
      	(getAddr): Use _Jv_StackTrace::GetCallingClass to implement
      	accessibility check.
      	* java/lang/reflect/natMethod.cc: Update includes.
      	(invoke): Use _Jv_StackTrace::GetCallingClass to implement
      	accessibility check.
      	* java/util/natResourceBundle.cc: Update includes.
      	(getCallingClassLoader): Use _Jv_StackTrace::GetCallingClass.
      	* java/util/logging/natLogger.cc: Update includes. Use
      	_Jv_StackTrace::GetCallerInfo to get call-site info.
      	* sysdep/generic/backtrace.h: Fallback backtrace code. Stub
      	implementation.
      	* sysdep/i386/backtrace.h: New. Fallback backtrace code. i386
      	implementation.
      
      From-SVN: r96253
      18744d9b
  15. Feb 07, 2005
    • Tom Tromey's avatar
      defineclass.cc (handleClassBegin): Use _Jv_RegisterInitiatingLoader. · f55db9c2
      Tom Tromey authored
      	* defineclass.cc (handleClassBegin): Use
      	_Jv_RegisterInitiatingLoader.
      	* java/lang/Class.h (_Jv_UnregisterInitiatingLoader): Declare.
      	* java/lang/natVMClassLoader.cc (resolveClass): Don't register
      	class.  Use _Jv_UnregisterInitiatingLoader.
      	* java/lang/natClassLoader.cc (_Jv_UnregisterInitiatingLoader):
      	New function.
      
      From-SVN: r94717
      f55db9c2
  16. Jan 10, 2005
    • Tom Tromey's avatar
      PR libgcj/12016, PR libgcj/18405, PR libgcj/17738: · 3fd80100
      Tom Tromey authored
      	* java/lang/Package.java (getPackages): Use VMClassLoader when
      	appropriate.
      	(getPackage): Likewise.
      	* prims.cc (_Jv_CreateJavaVM): Call
      	_Jv_RegisterBootstrapPackages.
      	* include/jvm.h (_Jv_RegisterBootstrapPackages): Declare.
      	* java/lang/VMClassLoader.java (getPackage): Rewrote.
      	(getPackages): Likewise.
      	(definedPackages): New field.
      	(definePackageForNative): New method.
      	* java/lang/Class.h (_Jv_FindClassInCache): Updated.
      	* java/lang/natVMClassLoader.cc (loadClass): Updated.
      	* defineclass.cc (handleClassBegin): Use
      	ClassLoader.findLoadedClass.
      	* java/lang/natClassLoader.cc (_Jv_RegisterInitiatingLoader):
      	Rewrote.
      	(struct _Jv_LoaderInfo): Removed.
      	(initiated_classes): Likewise.
      	(_Jv_UnregisterClass): Don't use initiated_classes.
      	(_Jv_FindClassInCache): Likewise.  Removed 'loader' argument.
      	(_Jv_FindClass): Register classes found during boostrap.
      	(BOOTSTRAP_CLASS_LIST_SIZE): New define.
      	(bootstrap_class_list): New global.
      	(bootstrap_index): Likewise.
      	(_Jv_RegisterBootstrapPackages): New function.
      	* gnu/gcj/runtime/natVMClassLoader.cc (findClass): Call
      	definePackageForNative.
      	(findClass): Updated.
      	* gnu/gcj/runtime/VMClassLoader.java (definePackageForNative):
      	New method.
      
      From-SVN: r93155
      3fd80100
  17. Nov 25, 2004
  18. Aug 23, 2004
  19. Aug 13, 2004
  20. 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
  21. Jul 19, 2004
    • Per Bothner's avatar
      Print -verbose:message on "loading", not initialization. · 963ddbd5
      Per Bothner authored
      	* java/lang/Class.h (JV_STATE_LOADED, JV_STATE_COMPILED):  Swap order.
      	* defineclass.cc (_Jv_ClassReader::parse):  Print message if
      	gcj::verbose_class_flag.
      	* java/lang/natClass.cc (initializeClass):  Don't print message here.
      	* java/lang/natClassLoader.cc (_Jv_WaitForState):  If state was
      	_JV_STATE_COMPILED, set to JV_STATE_LOADED and may print message.
      	(_Jv_PrepareCompiledClass):  Likewise.
      
      From-SVN: r84926
      963ddbd5
  22. May 06, 2004
    • Bryce McKinlay's avatar
      defineclass.cc (_Jv_ClassReader::prepare_pool_entry): Use... · e51f7aeb
      Bryce McKinlay authored
      defineclass.cc (_Jv_ClassReader::prepare_pool_entry): Use verify_field_signature and verify_method_signature...
      
      	* defineclass.cc (_Jv_ClassReader::prepare_pool_entry): Use
      	verify_field_signature and verify_method_signature, not
      	_Jv_VerifyFieldSignature and _Jv_VerifyMethodSigntature.
      	(_Jv_ClassReader::handleField): Likewise.
      	(_Jv_ClassReader::handleMethod): Likewise.
      
      From-SVN: r81563
      e51f7aeb
  23. 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
  24. 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
  25. Jul 29, 2003
  26. 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
  27. 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
  28. 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
  29. Sep 25, 2002
    • 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
  30. Jun 24, 2002
    • Tom Tromey's avatar
      verify.cc (branch_prepass): Updated for change to exception handler type. · fdae83ab
      Tom Tromey authored
      	* verify.cc (branch_prepass): Updated for change to exception
      	handler type.
      	(verify_instructions_0): Likewise.
      	* defineclass.cc (handleCodeAttribute): Initialize `prepared'.
      	(handleExceptionTableEntry): Updated for change to exception
      	handler type.
      	* java/lang/Class.h (Class): Removed _Jv_InterpMethodInvocation.
      	* include/java-interp.h (_Jv_InterpMethodInvocation): Removed.
      	(union _Jv_InterpPC): New.
      	(class _Jv_InterpException): Changed types to _Jv_InterpPC.
      	(class _Jv_InterpMethod): Added new `prepared' field.
      	(class _Jv_InterpMethod): Added `compile' method.  Removed
      	`continue1' and `find_exception'.  Changed arguments to `run'.
      	* interpret.cc (union insn_slot): New.
      	(find_exception): Removed.
      	(run_normal): Removed most logic.
      	(run_synch_object): Likewise; also, use JvSynchronize.
      	(run_synch_class): Likewise.
      	(run): Removed.
      	(continue1): Renamed as `run'.  Compile bytecode if required.
      	Add new code to allow refinement of direct-threaded code at
      	runtime.  Handle exceptions.
      	(SAVE_PC): Removed.
      	(compile): New method.
      	(SET_ONE, SET_INSN, SET_INT, SET_DATUM): New defines.
      	(NULLARRAYCHECK): Don't use SAVE_PC.
      	(pc_t): New typedef.
      	(TAKE_GOTO, GET1S, GET1U, GET2U, AVAL1U, AVAL2U, AVAL2UP,
      	SKIP_GOTO, GOTO_VAL, PCVAL, AMPAMP): New macros.
      
      From-SVN: r54968
      fdae83ab
  31. 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
  32. 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
  33. Dec 05, 2001
    • Tom Tromey's avatar
      defineclass.cc (character): Removed. · 82ae7822
      Tom Tromey authored
      	* defineclass.cc (character): Removed.
      	(prepare_character): Removed.
      	(is_identifier_start): Use Character, not character.
      	(is_identifier_part): Likewise.
      
      From-SVN: r47684
      82ae7822
  34. Dec 04, 2001
    • Tom Tromey's avatar
      defineclass.cc (read_one_method_attribute): `end_pc' for an exception can be equal to code length. · ef9f3bc4
      Tom Tromey authored
      	* defineclass.cc (read_one_method_attribute): `end_pc' for an
      	exception can be equal to code length.
      	* verify.cc (_Jv_BytecodeVerifier::verify_instructions_0): Removed
      	`start_PC' from error invocation where it didn't make sense, and
      	updated error message.  Use `copy' to copy a state.  Only try to
      	merge current state with saved state when we've fallen through
      	from the previous instruction.
      	(_Jv_BytecodeVerifier::pop_ref_or_return): New method.
      	(_Jv_BytecodeVerifier::verify_instructions_0) [op_astore_0]: Use
      	pop_ref_or_return.
      	(_Jv_BytecodeVerifier::verify_instructions_0) [op_astore]:
      	Likewise.
      	(_Jv_BytecodeVerifier::push_jump_merge): Pass max_locals, not
      	max_stack, to merge.
      	(_Jv_BytecodeVerifier::verify_instructions_0): Likewise.
      	(_Jv_BytecodeVerifier::push_jump_merge): Merge from new state into
      	state at branch target, not vice versa.
      	(_Jv_BytecodeVerifier::branch_prepass): Allow end of exception to
      	be equal to code length.  Removed redundant test to see if
      	exception start is after exception end.
      	(_Jv_BytecodeVerifier::verify_instructions_0): Type of argument to
      	`finally' is Throwable.
      
      From-SVN: r47623
      ef9f3bc4
    • Tom Tromey's avatar
      defineclass.cc (handleMethodsEnd): Invoke verifier here... · 64d3a1b4
      Tom Tromey authored
      	* defineclass.cc (handleMethodsEnd): Invoke verifier here...
      	(handleCodeAttribute): ... not here.
      	* verify.cc (_Jv_BytecodeVerifier::state::state): Use `copy', not
      	structure assignment.
      
      From-SVN: r47591
      64d3a1b4
  35. Nov 26, 2001
    • Tom Tromey's avatar
      Fix for PR libgcj/2024, plus other class name cleanups: · bea31ffb
      Tom Tromey authored
      	* include/jvm.h (_Jv_VerifyFieldSignature,
      	_Jv_VerifyMethodSignature, _Jv_VerifyClassName,
      	_Jv_VerifyIdentifier, _Jv_ClassNameSamePackage): Moved from ...
      	* include/java-interp.h: ... here.
      	* defineclass.cc (UTF8_PEEK): No longer conditional on
      	interpreter.
      	(_Jv_VerifyOne): Likewise.
      	(_Jv_VerifyFieldSignature): Likewise.
      	(_Jv_VerifyMethodSignature): Likewise.
      	(is_identifier_start): Likewise.
      	(is_identifier_part): Likewise.
      	(_Jv_VerifyIdentifier): Likewise.
      	(_Jv_VerifyClassName): Likewise.
      	(_Jv_VerifyClassName): Likewise.
      	(_Jv_ClassNameSamePackage): Likewise.
      	(_Jv_VerifyClassName): Fail if class name is too long.
      	* java/lang/natClassLoader.cc (_Jv_NewArrayClass): Disallow array
      	of void.
      	* java/lang/natClass.cc (forName): Check syntax of class name.
      	Include IllegalArgumentException.h.
      
      From-SVN: r47334
      bea31ffb
  36. 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
  37. Nov 04, 2001
  38. 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
Loading