Commit Graph

67 Commits

Author SHA1 Message Date
Keith Seitz 05ee9ca08f java-interp.h (_Jv_InterpMethod::get_insn): Declare.
* include/java-interp.h (_Jv_InterpMethod::get_insn): Declare.
        (_Jv_InterpMethod::set_insn): Declare.
        * interpret.cc (_Jv_InterpMethod::get_insn): New method.
        (_Jv_InterpMethod::get_insn): New method.

From-SVN: r117614
2006-10-10 20:15:51 +00:00
Keith Seitz 19add4f7e4 java-interp.h (prepared): Change type to pc_t.
* include/java-interp.h (prepared): Change type to pc_t.
        (insn_index): Define for both DIRECT_THREADED and bytecode interpreters.
        * interpret.cc [!DIRECT_THREADED] (POKEI): Fix typo.
        (insn_index): Implement for bytecode interpreter.
        * interpret-run.cc [!DIRECT_THREADED] (AVAL1U): Add _Jv_Linker class
        qualifier to resolve_pool_entry.
        [!DIRECT_THREADED] (AVAL2U): Likewise.
        [!DIRECT_THREADED] bytecode() cannot be called without an object.
        Changed all typos.
        [!DIRECT_THREADED] Likewise for defining_class.

From-SVN: r117333
2006-09-30 19:20:16 +00:00
Kyle Galloway 50ac25005f java-interp.h (_Jv_InterpMethod::run_debug): New method.
2006-08-15  Kyle Galloway  <kgallowa@redhat.com>

  * include/java-interp.h (_Jv_InterpMethod::run_debug): New method.
  * interpret.cc: Added placeholder for debug variable type info to STORE*
  macros.
  (_Jv_InterpMethod::run_debug): New method.
  (_Jv_InterpMethod::run_sync_object_debug): New method.
  (_Jv_InterpMethod::run_sync_class_debug): New method.
  (_Jv_InterpMethod::run_normal_debug): New method.
  (_Jv_InterpMethod::run_class_debug): New method.
  (_Jv_InterpMethod::ncode ()): Changed to select either debug or normal
  versions of these functions.
  * interpret-run.cc: New file, holds contents of old 	
  _Jv_InterpMethod::run method.
  * stacktrace.cc (_Jv_StackTrace::UnwindTraceFn): Changed to select
  appropriate function for debug or normal mode.

From-SVN: r116167
2006-08-15 20:40:10 +00:00
Bryce McKinlay b369a1989c interpret.cc (_Jv_InterpMethod::run): Don't SAVE_PC for fdiv.
2006-07-13  Bryce McKinlay  <mckinlay@redhat.com>

	* interpret.cc (_Jv_InterpMethod::run): Don't SAVE_PC for fdiv.

From-SVN: r115431
2006-07-14 01:52:18 +01:00
Bryce McKinlay 43e6b77cbb interpret.cc (_Jv_InterpMethod::compile): Add FIXME comment.
2006-07-13  Bryce McKinlay  <mckinlay@redhat.com>

	* interpret.cc (_Jv_InterpMethod::compile): Add FIXME comment.
	(_Jv_InterpMethod::run): SAVE_PC before executing any instruction 
	using resolve_pool_entry, as it can throw. Likewise for div/rem ops
	that can throw ArithmeticException.

From-SVN: r115422
2006-07-13 22:13:12 +01:00
Tom Tromey a7285117b4 re PR libgcj/26861 (VirtualMachineError in interperter.)
PR libgcj/26861:
	* interpret.cc (run) <insn_getfield>: Removed 0xffff check.
	<insn_putfield>: Likewise.
	(NULLCHECK): Define unconditionally.
	* link.cc (ensure_class_linked): Removed dead code.

From-SVN: r113531
2006-05-04 17:35:05 +00:00
Bryce McKinlay 23bc3a894d link.cc (_Jv_Linker::resolve_pool_entry): Don't pass vtable_index to resolve_method.
2006-04-28  Bryce McKinlay  <mckinlay@redhat.com>

	* link.cc (_Jv_Linker::resolve_pool_entry): Don't pass vtable_index
	to resolve_method.
	* interpret.cc (insn_invokevirtual): Use method->index, not
	vtable_index. Check accflag FINAL to determine finals. Only do
	explicit null check if calling a final method. Use
	throw_null_pointer_exception.
	(invokevirtual_resolved): Likewise.
	(null_pointer_exc): Remove static field.
	(throw_null_pointer_exception): Always define. Throw a new
	NullPointerException every time.
	* include/java-interp.h (_Jv_ResolvedMethod): Remove vtable_index
	field.
	* include/execution.h (resolve_method): Remove vtable_index argument.

From-SVN: r113370
2006-04-29 02:35:50 +01:00
Tom Tromey d07548f9ca * interpret.cc (do_allocate_static_fields): Added comment.
From-SVN: r111683
2006-03-03 18:32:22 +00:00
Bryce McKinlay 1349c68851 re PR libgcj/25187 (dereferencing type-punned pointer warnings while building libgcj)
2006-02-08  Bryce McKinlay  <mckinlay@redhat.com>

        PR libgcj/25187:
        * gnu/gcj/io/natSimpleSHSStream.cc
        (gnu::gcj::io::SimpleSHSStream::shsFinal): Remove bogus cast.
        * interpret.cc (_Jv_InterpMethod::run): Simplify arguments to
        _Jv_InterpFrame().
        * boehm.cc: #undef some autoconf macros before including gc-config.h.
        (_Jv_MarkObject): Don't mark the class, it is reachable via the vtable.
        (_Jv_MarkArray): Likewise.
        * java/lang/ref/natReference.cc (java::lang::ref::Reference::create):
        Simplify _Jv_GCRegisterDisappearingLink() call.
        * java/lang/Class.h (getComponentType): Use element_type.
        (element_type): New field declaration, as a union with "methods".
        * java/lang/natClassLoader.cc (_Jv_NewArrayClass): Use "element_type".
        * java/net/natVMNetworkInterfacePosix.cc
        (java::net::VMNetworkInterface::getInterfaces): Add "int" cast to
        avoid sign comparison warning.
        * include/java-interp.h (_Jv_InterpFrame): Take thread as second
        argument, not parent call frame.
        * include/x86_64-signal.h (MAKE_THROW_FRAME): Use "gregs" directly,
        without a cast.
        (restore_rt): Declare with hidden visibility, not "static".
        * posix.cc (_Jv_platform_initProperties): Make "tmpdir" a string
        constant.
        * jni.cc (_Jv_JNI_DestroyJavaVM): Use a union to avoid strict alias
        warning

From-SVN: r110783
2006-02-09 01:35:33 +00:00
Bryce McKinlay 2cf94e58cb link.cc (_Jv_Linker::print_class_loaded): Declare string constants as "const char *".
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
2006-02-08 20:38:13 +00:00
Tom Tromey 8b1753e3ec PR libgcj/26063, PR libgcj/17978, PR libgcj/10598:
* 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
2006-02-08 20:07:29 +00:00
Keith Seitz e939885ff5 java-interp.h (insn_index): New declaration.
* include/java-interp.h (insn_index): New declaration.
        (num_insn_slots): New private variable.
        (get_line_table): New declaration.
        * interpret.cc (insn_index): New function.
        (get_line_table): New function.

From-SVN: r110411
2006-01-30 21:20:40 +00:00
Keith Seitz d0f4aa53e0 java-interp.h (_Jv_CompileMethod): Add declaration.
* include/java-interp.h (_Jv_CompileMethod): Add declaration.
        (class _Jv_InterpMethod): Add _Jv_CompileMethod as a friend.
        * interpret.cc (_Jv_CompileMethod): New function.
        (run):  Massage code to allow for NULL args.
        Update comments to explain NULL args.
        Return if compiling the method and args is NULL.

From-SVN: r109918
2006-01-18 21:52:45 +00:00
Tom Tromey a022cd5969 re PR libgcj/16032 (libgcj should reject class files with incorrect version numbers)
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
2005-09-15 22:02:13 +00:00
Colin Walters 3ffa3729c0 verify.cc (class _Jv_BytecodeVerifier): Don't check for abstract classes or interfaces here...
2005-07-06  Colin Walters  <walters@verbum.org>

	* verify.cc (class _Jv_BytecodeVerifier) <op_new>: Don't
	check for abstract classes or interfaces here; JVM spec
	says it should throw an exception, so we'll do so later.
	* interpret.cc (run): Throw an InstantiationException for
	abstract classes and interfaces.

From-SVN: r101788
2005-07-08 19:13:30 +00:00
Tom Tromey 9cc2dc63bb interpret.cc (run): Use _Jv_CheckCast.
* interpret.cc (run) <insn_checkcast, checkcast_resolved>: Use
	_Jv_CheckCast.

From-SVN: r101427
2005-06-29 16:18:53 +00:00
Tom Tromey 6a05987083 interpret.cc (compile): Handle case where table entry is outside of PC range.
* interpret.cc (compile): Handle case where table entry is
	outside of PC range.

From-SVN: r101298
2005-06-24 22:04:11 +00:00
Anthony Green f00fac9d2f jni.cc (natrehash): Don't bother clearing memory again.
2005-04-22  Anthony Green  <green@redhat.com>

        * jni.cc (natrehash): Don't bother clearing memory again.
        * interpret.cc (do_allocate_static_fields): Ditto.
        * java/lang/natString.cc (rehash): Ditto.

From-SVN: r98583
2005-04-22 19:02:41 +00:00
Bryce McKinlay 18744d9b72 New Stack Trace infrastructure.
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
2005-03-10 19:02:21 +00:00
Tom Tromey a8182d3719 re PR libgcj/15719 (GIJ Interpeter: Problem with NaN / infinity comparisons)
PR libgcj/15719:
	* interpret.cc (run) <insn_dcmpl, insn_dcmpg>: Set tmpval
	correctly.

From-SVN: r92966
2005-01-05 19:03:10 +00:00
Tom Tromey 367390404d * Merged gcj-abi-2-dev-branch to trunk.
(Actual changes too large to list in the commit message;
see ChangeLog.)

From-SVN: r91270
2004-11-25 03:47:08 +00:00
Andrew Haley 180a373d0d interpret.cc (_Jv_InterpMethod::run): Initialize _Jv_StartOfInterpreter.
2004-10-13  Andrew Haley  <aph@redhat.com>

        * interpret.cc (_Jv_InterpMethod::run): Initialize
        _Jv_StartOfInterpreter.
        (_Jv_StartOfInterpreter, _Jv_EndOfInterpreter): Functions removed.
        (_Jv_StartOfInterpreter, _Jv_EndOfInterpreter): New variables.
        * gnu/gcj/runtime/natStackTrace.cc (fillInStackTrace): Use
        _Unwind_FindEnclosingFunction to discover whether PC is within the
        interpreter.

From-SVN: r89037
2004-10-14 15:21:13 +00:00
Ulrich Weigand 5549179ffb interpret.cc (run): Correctly access libffi return values of integral smaller-than-int type...
* interpret.cc (run): Correctly access libffi return values of
	integral smaller-than-int type; these are implicitly promoted.

From-SVN: r84645
2004-07-13 21:06:33 +00:00
Bryce McKinlay 6187fd28ad re PR libgcj/7587 (direct threaded interpreter not thread-safe)
2004-07-13  Bryce McKinlay  <mckinlay@redhat.com>

	PR libgcj/7587
	* interpret.cc (compile_mutex): New.
	(_Jv_InitInterpreter): New. Initialize compile_mutex.
	(run): Lock compile_mutex before calling compile() if compilation is
	required.
	* prims.cc (_Jv_CreateJavaVM): Call _Jv_InitInterpreter().
	* include/java-interp.h (_Jv_InitInterpreter): Declare.

From-SVN: r84644
2004-07-13 22:03:03 +01:00
Bryce McKinlay 7a1c3d48ab re PR libgcj/15713 (compile interpret.cc with -fno-strict-aliasing)
2004-07-12  Bryce McKinlay  <mckinlay@redhat.com>

	PR libgcj/15713
	* include/jvm.h (_Jv_value): New union type.
	* gcj/field.h (_Jv_Field): Add new _addr union field variants
	* interperet.cc (run): Use _Jv_value union type and *_addr _Jv_Field
	union members.

From-SVN: r84596
2004-07-13 02:04:47 +01:00
Tom Tromey 618df7453e * interpret.cc (run): Handle wide fload.
From-SVN: r82889
2004-06-10 06:18:18 +00:00
Bryce McKinlay bf7ad40253 interpret.cc (_Jv_InterpMethod::run): Update _Jv_AllocObject arguments to match new signature.
2004-04-16  Bryce McKinlay  <mckinlay@redhat.com>

	* interpret.cc (_Jv_InterpMethod::run): Update _Jv_AllocObject
	arguments to match new signature. Remove FIXME comments.

From-SVN: r80766
2004-04-16 20:38:27 +01:00
Paolo Bonzini 415c96ca6a interpret.cc (_Jv_InterpMethod::run): Don't use libffi types, they were meant to be internal.
2003-10-14  Paolo Bonzini  <bonzini@gnu.org>

	* interpret.cc (_Jv_InterpMethod::run): Don't
	use libffi types, they were meant to be internal.
	* gcj/javaprims.h (_Jv_ulong): New typedef.

From-SVN: r72482
2003-10-14 17:53:42 +00:00
Tom Tromey 4c98b1b078 defineclass.cc (handleMethodsEnd): Precompute code for static method.
* 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
2003-01-24 19:58:21 +00:00
Mark Mitchell dfe5a36e95 boehm.cc: Remove stray semicolon.
* boehm.cc: Remove stray semicolon.
	* interpret.cc: Likewise.
	* prims.cc: Likewise.
	* verify.cc (_Jv_BytecodeVerifier::verify_fail): Move definition
	earlier to ensure default arguments are processed.
	* gcj/array.h (JArray): Add forward declaration.
	(elements): Likewise.
	* gcj/javaprim.h: Remove stray semicolons.
	* include/bohm-gc.h: Likewise.
	* include/jni.h: Likewise.
	* include/jvm.h: Likewise.
	* java/lang/Class.h (_Jv_GetArrayClass): Declare _Jv_NewArrayClass.

From-SVN: r60556
2002-12-28 06:38:52 +00:00
Tom Tromey b4d0051bd9 java-interp.h (class _Jv_InterpMethod): Added JV_MARKOBJ_DECL.
* include/java-interp.h (class _Jv_InterpMethod): Added
	JV_MARKOBJ_DECL.
	* boehm.cc (_Jv_MarkObj): Consolidated interpreter code.  Also
	mark `prepared' field of interpreted method.
	* interpret.cc (compile): Use _Jv_AllocBytes.

From-SVN: r59900
2002-12-06 23:41:38 +00:00
Tom Tromey b0fbe966b1 verify.cc (type::compatible): Check initialization status first.
* verify.cc (type::compatible): Check initialization status
	first.
	* interpret.cc (run) [insn_invokespecial, invokespecial_resolved]:
	Don't use NULLCHECK.

From-SVN: r59494
2002-11-26 06:51:14 +00:00
Ulrich Weigand b7932de6a1 interpret.cc (_Jv_InterpMethod::run): Use UINT32 instead of unsigned long temporary to implement insn_iushr shifts.
* interpret.cc (_Jv_InterpMethod::run): Use UINT32 instead of
	unsigned long temporary to implement insn_iushr shifts.

From-SVN: r57936
2002-10-08 18:12:42 +00:00
Tom Tromey 3308c46e47 jvm.h (struct _Jv_frame_info): New structure.
* include/jvm.h (struct _Jv_frame_info): New structure.
	* gnu/gcj/runtime/natNameFinder.cc: Include StringBuffer.h,
	java-interp.h.
	(lookupInterp): New method.
	(getAddrAsString): Use _Jv_frame_info.
	(dladdrLookup): Likewise.
	* gnu/gcj/runtime/NameFinder.java (lookup): Try to look up
	interpreted frame.
	(lookupInterp): Declare.
	* java/lang/natVMThrowable.cc: Include Thread.h, java-interp.h.
	(fillInStackTrace): Collect information on interpreted frames.
	Use _Jv_frame_info.
	* interpret.cc: Include Thread.h.
	(run): Create and push _Jv_MethodChain object.
	(_Jv_EndOfInterpreter): New global.
	* java/lang/Thread.java (interp_frame): New field.
	* include/java-interp.h (struct _Jv_MethodChain): New structure.
	Include NameFinder.h.

From-SVN: r56657
2002-08-29 17:53:28 +00:00
Tom Tromey fdae83abe7 verify.cc (branch_prepass): Updated for change to exception handler type.
* 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
2002-06-24 20:38:47 +00:00
Tom Tromey b446a5f169 verify.cc (construct_primitive_array_type): New case.
* verify.cc (construct_primitive_array_type) [void_type]: New
	case.
	(branch_prepass): Added dummy entries for unused instruction
	values.
	(verify_instructions_0): Likewise.
	* interpret.cc (continue1): Comment fix.
	* include/java-insns.h (op_xxxunusedxxx1): Removed.
	* Makefile.in: Rebuilt.
	* Makefile.am: Added -Wswitch-enum.

From-SVN: r52814
2002-04-26 22:39:29 +00:00
Andreas Tobler 1347adff0d interpret.cc (continue1): Use PUSHL, not PUSHI.
2002-02-10  Andreas Tobler  <toa@pop.agri.ch>

	* interpret.cc (continue1) [insn_f2l]: Use PUSHL, not PUSHI.

From-SVN: r49655
2002-02-10 18:32:48 +00:00
Tom Tromey 30d287947e interpret.cc (convert): New function.
* interpret.cc (convert): New function.
	(continue1) [insn_d2i, insn_d2l, insn_f2i, insn_f2l]: Use
	convert.
	Include Long.h.

From-SVN: r49621
2002-02-08 20:00:40 +00:00
Chris Sears cec718682b interpret.cc (NULLARRAYCHECK): New macro.
2002-01-11  Chris Sears  <cbsears_sf@yahoo.com>

	* interpret.cc (NULLARRAYCHECK): New macro.
	(SAVE_PC): Just store `pc'.
	(find_exception): Subtract one from `pc' here.
	(continue1) [insn_iaload, insn_laload, insn_faload, insn_daload,
	insn_aaload, insn_baload, insn_caload, insn_saload, insn_iastore,
	insn_lastore, insn_fastore, insn_dastore, insn_aastore,
	insn_bastore, insn_castore, insn_sastore]: Use NULLARRAYCHECK, and
	don't call SAVE_PC.
	(continue1) [insn_fdiv, insn_ddiv, insn_frem, insn_drem]: Don't
	call SAVE_PC.

From-SVN: r48787
2002-01-12 00:19:05 +00:00
Chris Sears 00cc944db9 interpret.cc (ARRAYBOUNDSCHECK): New macro.
2002-01-08  Chris Sears  <cbsears_sf@yahoo.com>

	* interpret.cc (ARRAYBOUNDSCHECK): New macro.
	(continue1) [insn_iaload, insn_laload, insn_faload, insn_daload,
	insn_aaload, insn_baload, insn_caload, insn_saload, insn_iastore,
	insn_lastore, insn_fastore, insn_dastore, insn_aastore,
	insn_bastore, insn_castore, insn_sastore]: Use it.
	(continue1) [insn_arraylength]: Check for null array.

From-SVN: r48652
2002-01-08 19:07:46 +00:00
Bryce McKinlay 107abb2f61 Eliminate use of C++ static constructors.
* 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
2001-10-16 09:35:17 +01:00
Richard Henderson f5ddf15465 jvm.h (_Jv_VTable): Handle function descriptors for ia64...
* 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
2001-09-21 09:59:12 -07:00
Richard Henderson b3208f56cb exception.cc (java_eh_info): Make value type jthrowable.
* 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
2001-03-25 23:05:32 -08:00
Anthony Green c220009946 defineclass.cc: Don't include alloca.h.
2001-02-15  Anthony Green  <green@redhat.com>

	* defineclass.cc: Don't include alloca.h.
	(prepare_pool_entry): Convert alloca to __builtin_alloca.
	* interpret.cc (run_normal): Ditto.
        (continue1): Ditto.
	* java/lang/natDouble.cc (parseDouble): Ditto.

From-SVN: r39719
2001-02-15 14:03:14 +00:00
Jeff Sturm c6b33a47ea interpret.cc (continue1): [insn_invokevirtual] Do an explicit null pointer check.
2001-02-12  Jeff Sturm  <jeff.sturm@commerceone.com>
            Tom Tromey  <tromey@redhat.com>

	* interpret.cc (continue1): [insn_invokevirtual] Do an explicit
	null pointer check.

Co-Authored-By: Tom Tromey <tromey@redhat.com>

From-SVN: r39607
2001-02-12 17:30:00 +00:00
Tom Tromey a9770f9a91 From Arno J. Klaassen:
* interpret.cc: Include <stdlib.h> for alloca.
	* defineclass.cc: Include <stdlib.h> for alloca.

From-SVN: r36986
2000-10-20 23:25:57 +00:00
Tom Tromey 1d336a099d natField.cc (BooleanClass): Don't define.
* 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
2000-10-06 01:49:32 +00:00
Alexandre Oliva e7e18a21d2 defineclass.cc: Include alloca.h only if HAVE_ALLOCA_H.
* defineclass.cc: Include alloca.h only if HAVE_ALLOCA_H.
* java/lang/natDouble.cc: Likewise.
* java/lang/reflect/natMethod.cc: Likewise.
* interpret.cc: Likewise.  Fix NULLCHECKs that tested a _Jv_word.

From-SVN: r36404
2000-09-14 07:51:56 +00:00
Bryce McKinlay 79c2c6da2c [multiple changes]
2000-08-02  Bryce McKinlay  <bryce@albatross.co.nz>

        * interpret.cc (_Jv_InterpMethod::continue1): Type of `fun' changed
	to match C declaration in ffi.h.
	* Makefile.am: Add java/awt/Button.java.
	* Makefile.in: Rebuilt.

2000-07-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Type of the
        cast of the second argument to `ffi_raw_call' changed to match
        prototype.

2000-07-26  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * jni.cc (_Jv_JNIMethod::call): Type of the cast of the second
        argument to `ffi_raw_call' changed to match prototype.

From-SVN: r35418
2000-08-02 04:25:13 +01:00
Andrew Haley 99f7658d7c interpret.cc (continue1): Insert missing break into switch.
2000-07-26  Andrew Haley  <aph@cygnus.com>

        * interpret.cc (continue1): Insert missing break into switch.

From-SVN: r35316
2000-07-28 13:11:45 +00:00