summaryrefslogtreecommitdiff
path: root/libjava/interpret.cc
Commit message (Collapse)AuthorAgeFilesLines
* 2008-09-17 Andrew Haley <aph@redhat.com>aph2008-09-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140593 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-12-06 David Daney <ddaney@avtrex.com>daney2007-12-061-20/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130660 138bc75d-0d04-0410-961f-82ee72b054a4
* * configure.ac (INTERPRETER): New AM_CONDITIONAL.daney2007-07-311-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127097 138bc75d-0d04-0410-961f-82ee72b054a4
* * interpret.cc (get_local_var_table) [DIRECT_THREADED]: Make sure thekseitz2007-07-111-1/+5
| | | | | | | | | method is compiled. * testsuite/libjava.jvmti/interp/getlocalvartable.out: Revise for compiled methods. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126556 138bc75d-0d04-0410-961f-82ee72b054a4
* * include/java-interp.h (_Jv_LocalVarTableEntry): Add unionkseitz2007-06-151-3/+25
| | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125734 138bc75d-0d04-0410-961f-82ee72b054a4
* * include/java-interp.h (breakpoint_at): Declare.kseitz2007-05-161-0/+17
| | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124777 138bc75d-0d04-0410-961f-82ee72b054a4
* * interpret.cc (STOREA): Rewrite using temporary variable tokseitz2007-05-151-44/+65
| | | | | | | | | | | | | | avoid double-macro expansion side-effects. (STOREI): Likewise. (STOREF): Likewise. (STOREL)[SIZEOF_VOID_P == 8]: Likewise. (STORED)[SIZEOF_VOID_P == 8]: Likewise. (STOREL)[SIZEOF_VOID_P != 8]: Likewise. (STORED)[SIZEOF_VOID_P != 8]: Likewise. (POKEI): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124746 138bc75d-0d04-0410-961f-82ee72b054a4
* * interpret.cc: Don't include ExceptionEvent.h.kseitz2007-05-041-1/+0
| | | | | | | | | * gnu/gcj/jvmti/natExceptionEvent.cc: Remove. * Makefile.am (nat_source_files): Remove natExceptionEvent.cc. * Makefile.in: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124407 138bc75d-0d04-0410-961f-82ee72b054a4
* * include/jvmti-int.h (_Jv_ReportJVMTIExceptionThrow):kseitz2007-05-041-5/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Declare. * interpret.cc (_Jv_ReportJVMTIExceptionThrow): New function. (find_catch_location): New function. (REPORT_EXCEPTION): New macro. (throw_internal_error): Use REPORT_EXCEPTION. (throw_incompatible_class_change_error): Likewise. (throw_null_pointer_exception): Likewise. (throw_class_format_error): Likewise. * interpret-run.cc (INTERP_REPORT_EXCEPTION)[DEBUG]: Set to REPORT_EXCEPTION. (INTERP_REPORT_EXCEPTION)[!DEBUG]: Make nop. (insn_new): Use INTERP_REPORT_EXCEPTION. (insn_athrow): Likewise. Remove previous JVMTI exception notifications. Add JVMTI ExceptionCatch notificatin. * jni.cc (_Jv_PopSystemFrame): Notify JVMTI clients of exception throw. * gnu/gcj/jvmti/ExceptionEvent.java: Removed. * gnu/gcj/jvmti/ExceptionEvent.h: Removed. * classpath/lib/gnu/gcj/jvmti/ExceptionEvent.class: Removed. * gnu/classpath/jdwp/natVMVirtualMachine.cc (jdwpExceptionCB): New function. (jdwpVMInitCB): Set Exception event handler and enable. * sources.am: Regenerated. * Makefile.in: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124406 138bc75d-0d04-0410-961f-82ee72b054a4
* libffi/ChangeLog:aoliva2007-03-071-14/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122652 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-02-16 Kyle Galloway <kgallowa@redhat.com>kgallowa2007-02-161-34/+43
| | | | | | | | | | | | | | | | | | | | | * interpret.cc: Add extra DEBUG_LOCALS_INSN calls for multi-slot variables to maintain type info. * interpret-run.cc: Add local variable info to frame in the debug interpreter. * jvmti.cc (getLocalFrame): New method. (_Jv_JVMTI_GetLocalObject): New method. (_Jv_JVMTI_GetLocallInt): New method. (_Jv_JVMTI_GetLocalFloat): New method. (_Jv_JVMTI_GetLocalLong): New method. (_Jv_JVMTI_GetLocalDouble): New method. (_Jv_JVMTI_SetLocalObject): New method. (_Jv_JVMTI_SetLocalInt): New method. (_Jv_JVMTI_SetLocalFloat): New method. (_Jv_JVMTI_SetLocalLong): New method. (_Jv_JVMTI_SetLocalDouble): New method. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122048 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-02-15 Kyle Galloway <kgallowa@redhat.com>kgallowa2007-02-161-0/+46
| | | | | | | | | | | | | | | | | | | * interpret.cc (_Jv_InterpMethod::check_handler): New method. * interpret-run.cc: Change the catch section to report exception events and to use the new check_handler method. * include/java-interp.h (_Jv_InterpMethod): Add check_handler. * gnu/gcj/jvmti/ExceptionEvent.java: New file. * gnu/gcj/jvmti/ExceptionEvent.h: New file. * gnu/gcj/jvmti/natExceptionEvent.cc: New file. * libjava/classpath/lib/gnu/gcj/jvmti/ExceptionEvent.class: New file. * sources.am: Added ExceptionEvent.java. * Makefile.am: Added natExceptionEvent.cc * Makefile.in: Regenerated. * include/Makefile.in: Regenerated. * gcj/Makefile.in: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122019 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-02-15 Kyle Galloway <kgallowa@redhat.com>kgallowa2007-02-151-0/+24
| | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121999 138bc75d-0d04-0410-961f-82ee72b054a4
* * include/jvmti-int.h (JVMTI): Declare member "enabled".kseitz2007-01-311-18/+23
| | | | | | | | | | | | | | | * jvmti.cc (JVMTI): Add member "enabled". (_Jv_GetJVMTIEnv): Mark JVMTI enabled. * interpret.cc (_Jv_InterpMethod::ncode): Use JVMTI::enabled instead of gnu::classpath::jdwp::Jdwp::isDebugging. (_Jv_CompileMethod): If JVMTI is enabled, use run_debug instead of run to compile the method. * interpret-run.cc [DEBUG] (NEXT_INSN): Add JVMTI single step notification. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121442 138bc75d-0d04-0410-961f-82ee72b054a4
* * interpret.cc (run_debug): Remove comment.tromey2007-01-291-86/+92
| | | | | | | | | | | | | | | | | | | | | | (STOREA): Reformat. (STOREI): Likewise. (STOREF): Likewise. (STOREL): Likewise. (STORED): Likewise. (POKEI): Likewise. (run_normal_debug): Likewise. (run_synch_object_debug): Likewise. (run_class_debug): Likewise. (run_synch_class_debug): Likewise. (get1s): Likewise. (get1u): Likewise. (get2u): Likewise. (get4): Likewise. (NULLARRAYCHECK): Likewise. (ARRAYBOUNDSCHECK): Likewise. * interpret-run.cc (insn_target) <breakpoint>: Tidy. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121313 138bc75d-0d04-0410-961f-82ee72b054a4
* * interpret.cc: Include gnu/gcj/jvmti/Breakpoint.h,kseitz2007-01-251-1/+6
| | | | | | | | gnu/gcj/jvmti/BreakpointManager.h, jvmti.h, and jvmti-int.h * interpret-run.cc: Implement insn_breakpoint. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121155 138bc75d-0d04-0410-961f-82ee72b054a4
* Merged gcj-eclipse branch to trunk.tromey2007-01-091-25/+25
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120621 138bc75d-0d04-0410-961f-82ee72b054a4
* * include/java-insns.h (enum java_code): Add op_breakpoint.kseitz2006-10-141-0/+25
| | | | | | | | | | | | | | | | | | | | * include/java-interp.h (_Jv_InterpMethod): Declare breakpoint_insn. [INTERPRETER]: Declare _Jv_InterpMethod::bp_insn_slot. [!INTERPRETER]: Declare _Jv_InterpMethod::bp_insn_opcode. (install_break): Declare. * interpret.cc (breakpoint_insn): Define breakpoint insn. (compile): Add op_breakpoint to "can't happen" cases. [INTERPRETER] Initialize breakpoint insn if necessary. (install_break): New method. * interpret-run.cc: Add op_breakpoint to insn_targets. Add insn_breakpoint label. * verify.cc (branch_prepass): Add op_breakpoint to unrecognized opcodes section of switch statement. (verify_instructions_0): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117734 138bc75d-0d04-0410-961f-82ee72b054a4
* * include/java-interp.h (_Jv_InterpMethod::get_insn): Declare.kseitz2006-10-101-0/+40
| | | | | | | | | (_Jv_InterpMethod::set_insn): Declare. * interpret.cc (_Jv_InterpMethod::get_insn): New method. (_Jv_InterpMethod::get_insn): New method. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117614 138bc75d-0d04-0410-961f-82ee72b054a4
* * include/java-interp.h (prepared): Change type to pc_t.kseitz2006-09-301-6/+9
| | | | | | | | | | | | | | | (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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117333 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-08-15 Kyle Galloway <kgallowa@redhat.com>kgallowa2006-08-151-2506/+138
| | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116167 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-07-13 Bryce McKinlay <mckinlay@redhat.com>bryce2006-07-141-1/+0
| | | | | | | * interpret.cc (_Jv_InterpMethod::run): Don't SAVE_PC for fdiv. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115431 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-07-13 Bryce McKinlay <mckinlay@redhat.com>bryce2006-07-131-5/+22
| | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115422 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libgcj/26861:tromey2006-05-041-8/+11
| | | | | | | | | * interpret.cc (run) <insn_getfield>: Removed 0xffff check. <insn_putfield>: Likewise. (NULLCHECK): Define unconditionally. * link.cc (ensure_class_linked): Removed dead code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113531 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-04-28 Bryce McKinlay <mckinlay@redhat.com>bryce2006-04-291-37/+20
| | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113370 138bc75d-0d04-0410-961f-82ee72b054a4
* * interpret.cc (do_allocate_static_fields): Added comment.tromey2006-03-031-1/+11
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111683 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-02-08 Bryce McKinlay <mckinlay@redhat.com>bryce2006-02-091-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110783 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-02-08 Bryce McKinlay <mckinlay@redhat.com>bryce2006-02-081-4/+4
| | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110767 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libgcj/26063, PR libgcj/17978, PR libgcj/10598:tromey2006-02-081-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110763 138bc75d-0d04-0410-961f-82ee72b054a4
* * include/java-interp.h (insn_index): New declaration.kseitz2006-01-301-0/+75
| | | | | | | | | | (num_insn_slots): New private variable. (get_line_table): New declaration. * interpret.cc (insn_index): New function. (get_line_table): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110411 138bc75d-0d04-0410-961f-82ee72b054a4
* * include/java-interp.h (_Jv_CompileMethod): Add declaration.kseitz2006-01-181-14/+30
| | | | | | | | | | | (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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109918 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libgcj/16032:tromey2005-09-151-4/+47
| | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104325 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-07-06 Colin Walters <walters@verbum.org>tromey2005-07-081-0/+5
| | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101788 138bc75d-0d04-0410-961f-82ee72b054a4
* * interpret.cc (run) <insn_checkcast, checkcast_resolved>: Usetromey2005-06-291-5/+2
| | | | | | | _Jv_CheckCast. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101427 138bc75d-0d04-0410-961f-82ee72b054a4
* * interpret.cc (compile): Handle case where table entry istromey2005-06-241-1/+5
| | | | | | | outside of PC range. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101298 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-04-22 Anthony Green <green@redhat.com>green2005-04-221-1/+0
| | | | | | | | | * jni.cc (natrehash): Don't bother clearing memory again. * interpret.cc (do_allocate_static_fields): Ditto. * java/lang/natString.cc (rehash): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98583 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-03-10 Bryce McKinlay <mckinlay@redhat.com>bryce2005-03-101-78/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96253 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libgcj/15719:tromey2005-01-051-2/+2
| | | | | | | | * interpret.cc (run) <insn_dcmpl, insn_dcmpg>: Set tmpval correctly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92966 138bc75d-0d04-0410-961f-82ee72b054a4
* * Merged gcj-abi-2-dev-branch to trunk.tromey2004-11-251-22/+587
| | | | | | | | (Actual changes too large to list in the commit message; see ChangeLog.) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91270 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-10-13 Andrew Haley <aph@redhat.com>aph2004-10-141-13/+13
| | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89037 138bc75d-0d04-0410-961f-82ee72b054a4
* * interpret.cc (run): Correctly access libffi return values ofuweigand2004-07-131-3/+3
| | | | | | | integral smaller-than-int type; these are implicitly promoted. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84645 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-07-13 Bryce McKinlay <mckinlay@redhat.com>bryce2004-07-131-2/+22
| | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84644 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-07-12 Bryce McKinlay <mckinlay@redhat.com>bryce2004-07-131-35/+27
| | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84596 138bc75d-0d04-0410-961f-82ee72b054a4
* * interpret.cc (run): Handle wide fload.tromey2004-06-101-1/+5
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82889 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-04-16 Bryce McKinlay <mckinlay@redhat.com>bryce2004-04-161-6/+2
| | | | | | | | * interpret.cc (_Jv_InterpMethod::run): Update _Jv_AllocObject arguments to match new signature. Remove FIXME comments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@80766 138bc75d-0d04-0410-961f-82ee72b054a4
* 2003-10-14 Paolo Bonzini <bonzini@gnu.org>tromey2003-10-141-3/+3
| | | | | | | | | * interpret.cc (_Jv_InterpMethod::run): Don't use libffi types, they were meant to be internal. * gcj/javaprims.h (_Jv_ulong): New typedef. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72482 138bc75d-0d04-0410-961f-82ee72b054a4
* * defineclass.cc (handleMethodsEnd): Precompute code for statictromey2003-01-241-16/+31
| | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61727 138bc75d-0d04-0410-961f-82ee72b054a4
* * boehm.cc: Remove stray semicolon.mmitchel2002-12-281-1/+1
| | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60556 138bc75d-0d04-0410-961f-82ee72b054a4
* * include/java-interp.h (class _Jv_InterpMethod): Addedtromey2002-12-061-1/+1
| | | | | | | | | | JV_MARKOBJ_DECL. * boehm.cc (_Jv_MarkObj): Consolidated interpreter code. Also mark `prepared' field of interpreted method. * interpret.cc (compile): Use _Jv_AllocBytes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59900 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (type::compatible): Check initialization statustromey2002-11-261-2/+8
| | | | | | | | | first. * interpret.cc (run) [insn_invokespecial, invokespecial_resolved]: Don't use NULLCHECK. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59494 138bc75d-0d04-0410-961f-82ee72b054a4