2007-12-06 David Daney <ddaney@avtrex.com>
* include/ffi.h.in (FFI_SIZEOF_JAVA_RAW): Define if not already
defined.
(ffi_java_raw): New typedef.
(ffi_java_raw_call, ffi_java_ptrarray_to_raw,
ffi_java_raw_to_ptrarray): Change parameter types from ffi_raw to
ffi_java_raw.
(ffi_java_raw_closure) : Same.
(ffi_prep_java_raw_closure, ffi_prep_java_raw_closure_loc): Change
parameter types.
* src/java_raw_api.c (ffi_java_raw_size): Replace FFI_SIZEOF_ARG with
FFI_SIZEOF_JAVA_RAW.
(ffi_java_raw_to_ptrarray): Change type of raw to ffi_java_raw.
Replace FFI_SIZEOF_ARG with FFI_SIZEOF_JAVA_RAW. Use
sizeof(ffi_java_raw) for alignment calculations.
(ffi_java_ptrarray_to_raw): Same.
(ffi_java_rvalue_to_raw): Add special handling for FFI_TYPE_POINTER
if FFI_SIZEOF_JAVA_RAW == 4.
(ffi_java_raw_to_rvalue): Same.
(ffi_java_raw_call): Change type of raw to ffi_java_raw.
(ffi_java_translate_args): Same.
(ffi_prep_java_raw_closure_loc, ffi_prep_java_raw_closure): Change
parameter types.
* src/mips/ffitarget.h (FFI_SIZEOF_JAVA_RAW): Define for N32 ABI.
2007-12-06 David Daney <ddaney@avtrex.com>
* interpret.cc: Replace ffi_raw with INTERP_FFI_RAW_TYPE throughout.
(ncode_closure, ffi_closure_fun): Define versions for
non-FFI_NATIVE_RAW_API case.
* include/java-interp.h (INTERP_FFI_RAW_TYPE): Define and use to
replace ffi_raw throughout.
* jni.cc, interpret-run.cc: Replace ffi_raw with INTERP_FFI_RAW_TYPE
throughout.
From-SVN: r130660
* configure.ac (INTERPRETER): New AM_CONDITIONAL.
* scripts/makemake.tcl (package_map): Mark jdwp and jvmti packages
as being for interpreter only. Place interpreter related files in
'if INTERPRETER' block.
(interpreter_package_files): New list.
(interpreter_header_vars): Ditto.
(emit_package_rule_to_list): Renamed from emit_package_rule with
new target list parameter.
(emit_package_rule): Rewritten to call emit_package_rule_to_list.
(emit_interpreter_rule): New function.
(emit_source_var): Place interpreter related files in
interpreter_header_vars.
* Makefile.am (ACLOCAL_AMFLAGS): Add -I libltdl.
(libgcj_interpret_source_files): New variable.
(libgcj_la_SOURCES): Move jvmti.cc and interpret.cc to
libgcj_interpret_source_files and include
libgcj_interpret_source_files.
(nat_jdwp_source_files): New variable.
(nat_jvmti_source_files): Ditto.
(nat_source_files): Move jdwp and jvmti related files to
nat_jdwp_source_files and nat_jvmti_source_files and include
nat_jdwp_source_files and nat_jvmti_source_files.
* Makefile.in: Regenerate.
* include/Makefile.in: Ditto.
* testsuite/Makefile.in: Ditto.
* gcj/Makefile.in: Ditto.
* sources.am: Ditto.
* configure: Ditto.
* include/config.h.in: Ditto.
* interpret.cc: Remove #ifdef INTERPRETER block.
* stacktrace.cc (UnwindTraceFn): Do not handle proxy frames if
interpreter disabled.
* include/java-interp.h (_Jv_FrameType): Move outside of
#ifdef INTERPRETER block.
* include/execution.h (_Jv_IndirectCompiledEngine::do_get_closure_list,
_Jv_InterpreterEngine, _Jv_soleInterpreterEngine): Place in
#ifdef INTERPRETER block.
* jni.cc (jvmti.h, jvmti-int.h): Only include if INTERPRETER is
defined.
(_Jv_JNI_PopSystemFrame, _Jv_JNI_GetEnv): Only do jvmti processing
if INTERPRETER is defined.
* prims.cc (jvmti.h, jvmti-int.h, Jdwp.h, VMVirtualMachine.h): Only
include if INTERPRETER is defined.
(defaultJdwpOptions, jdwpOptions, jvmti_agent_onload_func,
jvmti_agent_onunload_func, jvmti_agentonload, jvmti_agentonunload,
jvmti_agent_opts, load_jvmti_agent): Only define if INTERPRETER is
defined.
(parse_x_arg): Only process 'runjdwp:' if INTERPRETER is defined.
(parse_init_args): Only process jvmti related options if
INTERPRETER is defined.
(_Jv_CreateJavaVM): Only call _Jv_JVMTI_Init if INTERPRETER is
defined.
(_Jv_RunMain): Only do jvmti and jdwp processing if INTERPRETER is
defined.
* link.cc (jvmti.h, jvmti-int.h): Only include if INTERPRETER is
defined.
(_Jv_ThrowNoClassDefFoundError, _Jv_Linker::create_error_method):
Define if if INTERPRETER is not defined.
(_Jv_Linker::wait_for_state): Only do jvmti proccessing if
INTERPRETER is defined.
* boehm.cc (closure_list_pointer, finalize_closure_list,
_Jv_ClosureListFinalizer): Only define if INTERPRETER is
defined.
* java/lang/natThread.cc (jvmti.h, jvmti-int.h): Only include if
INTERPRETER is defined.
(finish_, _Jv_NotifyThreadStart): Only do jvmti proccessing if
INTERPRETER is defined.
* java/lang/Class.h (_Jv_InterpreterEngine): Move declaration
and friend declaration inside #ifdef INTERPRETER block.
* java/lang/natClass.cc (_Jv_ClosureList::releaseClosures,
_Jv_ClosureList::registerClosure, _Jv_GetInterpClassSourceFile):
Only define if INTERPRETER is defined.
* java/lang/reflect/natVMProxy.cc (UnsupportedOperationException.h):
Include.
(generateProxyClass): Throw UnsupportedOperationException unless
INTERPRETER is defined.
From-SVN: r127097
* 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
* include/java-interp.h (_Jv_InterpFrame::get_pc): Only deduct
one when pc_ptr is non-NULL.
* prims.cc (parse_init_args): Enable JVMTI with agentlib
and agentpath options.
* testsuite/lib/libjava.exp (exec_gij): Add new addl_flags
parameter.
* testsuite/libjava.jvmti/jvmti-interp.exp (gij_jvmti_test_one):
Pass '-agentlib:dummyagent' when executing gij.
(gij_jvmti_run): Build dummy JVMTI agent before running tests,
and remove it when finished.
* testsuite/libjava.jvmti/dummyagent.c: New file.
From-SVN: r125040
* include/java-interp.h (breakpoint_at): Declare.
* interpret.cc (breakpoint_at): New function.
* gnu/classpath/jdwp/VMVirtualMachine.java (_event_list):
New member.
* gnu/classpath/jdwp/natVMVirtualMachine.cc (initialize):
Initialize _event_list.
(handle_single_step): If there is a breakpoint at the
location at which we are stopping, do not send the notification.
Instead add the event to a list of events that occur at this
location.
(jdwpBreakpointCB): If the event list is not empty, send
whatever events are in it and the breakpoint event in a single
notification.
Mark parameter jni_env as MAYBE_UNUSED.
* classpath/lib/gnu/classpath/jdwp/VMVirtualMachine.class:
Regenerated.
* gnu/classpath/jdwp/VMVirtualMachine.h: Regenerated.
From-SVN: r124777
* interpret-run.cc (NEXT_INSN)[DEBUG]: Advance PC before
executing the instruction.
* include/java-interp.h (_Jv_InterpFrame::get_pc): Subtract
one insn from the frame's PC. _Jv_InterpMethod::run et al
will advance the PC before executing the instruction.
From-SVN: r124313
2007-04-23 Kyle Galloway <kgallowa@redhat.com>
* include/java-interp.h (_Jv_InterpFrame): Add pointer to the
interpreter PC.
(<init>): Add a pointer to the interpreter PC as a parameter with
default value NULL.
(get_pc): New method.
* interpret-run.cc: If debugging, pass a pointer to the PC when
creating the stack frame.
* jvmti.cc (_Jv_JVMTI_GetStackTrace): Call _Jv_InterpFrame::get_pc
to get the PC.
From-SVN: r124076
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
2007-02-06 Kyle Galloway <kgallowa@redhat.com>
* include/java-interp.h (_Jv_InterpFrame): obj_ptr field added
to hold "this" pointer for frame.
(_Jv_InterpFrame::get_this_ptr): New method.
* interpret-run.cc: Copy the "this" pointer into obj_ptr.
From-SVN: r121717
2007-01-29 Kyle Galloway <kgallowa@redhat.com>
* include/java-interp.h: Added _Jv_Frame class and its two
subclasses _Jv_InterpFrame and _Jv_NativeFrame. Also moved
_Jv_FrameType from java-stack.h.
* include/java-stack.h: Removed _Jv_FrameType.
* java/lang/Thread.java: Added frame member to hold new
composite frame stack.
* java/lang/Thread.h: Regenerated.
* java/lang/Thread.class: Rebuilt.
* jni.cc (_Jv_JNIMethod::call): Push a frame onto the stack when
calling a JNI method.
* jvmti.cc (_Jv_JVMTI_GetStackTrace): New Method.
(_Jv_JVMTI_GetFrameCount): New method.
* stacktrace.cc (UnwindTraceFn): Modified to use new _Jv_Frame
classes.
* testsuite/libjava.jvmti/interp/getstacktrace.jar: New test.
* testsuite/libjava.jvmti/interp/natgetstacktrace.cc: New test.
* testsuite/libjava.jvmti/interp/getstacktrace.h: New test.
* testsuite/libjava.jvmti/interp/getstacktrace.jar: New test.
* testsuite/libjava.jvmti/interp/getstacktrace.out: Output file
for test.
From-SVN: r121314
* 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-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-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-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
* 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
* 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
* 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
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
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
* 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
2002-12-03 Andrew Haley <aph@redhat.com>
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Call
_Jv_PushClass.
(_Jv_InitNewClassFields): Set protectionDomain and chain = NULL.
(_Jv_PopClass): New.
(_Jv_PushClass): New.
* java/lang/natClass.cc (forName (jstring)): Use a StackTrace to
discover the ClassLoader of our caller.
(_Jv_CheckArrayStore): Don't check that a class is assignment
compatible with Object.
* java/lang/natVMTHrowable.cc: Delete.
* gnu/gcj/runtime/StackTrace.java: New, partly copied from
java.lang.VMThrowable.
(StackTrace(), StackTrace(int)): New constructors.
(classAt, methodAt, update, methodAtAddress): New methods.
(map): New field.
* java/lang/VMThrowable.java: Use StackTrace instead of
natVMTHrowable.
* java/lang/Class.h (getClassLoaderInternal): New.
(class Class): Be friendly with _Jv_PopClass and _Jv_PushClass.
Be friendly with gnu::gcj::runtime::StackTrace.
(Object.chain): New field.
* include/java-interp.h (class _Jv_InterpMethod): Be friendly with
gnu::gcj::runtime::StackTrace.
* prims.cc (_Jv_NewObjectArray): Use getClassLoaderInternal()
instead of getClassLoader().
* verify.cc (class _Jv_BytecodeVerifier): Likewise.
java::lang::VMThrowable.
* Makefile.am (core_java_source_files): Add MethodRef.java,
StackTrace.java.
(nat_source_files): Remove natVMThrowable.cc; add natStackTrace.cc.
* Makefile.in: Rebuild.
2002-12-03 Andrew Haley <aph@redhat.com>
* class.c (make_class_data): New field, "chain".
* decl.c (java_init_decl_processing): Likewise.
From-SVN: r59769
* 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
* All files: Updated copyright information.
* COPYING: New file.
* COPYING.LIB: Removed.
* LIBGCJ_LICENSE: We now use GPL + special exception.
From-SVN: r32387
* include/jvm.h (_Jv_GetJavaVM): Declare.
* include/java-interp.h (_Jv_GetFirstMethod): New function.
(_Jv_MethodBase::get_method): New method.
(_Jv_JNIMethod::set_function): New method.
* jni.cc (_Jv_JNI_UnregisterNatives): New function.
(_Jv_JNI_RegisterNatives): New function.
(_Jv_JNIFunctions): Updated for new functions.
(_Jv_GetJavaVM): New function.
(_Jv_JNI_GetJavaVM): Use it. Now static.
(_Jv_JNI_AttachCurrentThread): Create a new JNIEnv if this thread
is already a Java thread but does not have a JNIEnv yet.
* java/lang/natRuntime.cc (_load): Pass the JavaVM to the onload
function.
From-SVN: r32056