aboutsummaryrefslogtreecommitdiff
path: root/libjava/interpret-run.cc
AgeCommit message (Collapse)AuthorFilesLines
2009-04-28interpret.cc (DEBUG): Rename this ...Dave Korn1-8/+8
* interpret.cc (DEBUG): Rename this ... (__GCJ_DEBUG): ... to this throughout. * configure.ac: Likewise. * interpret-run.cc: Likewise. * prims.cc: Likewise. * gnu/classpath/natConfiguration.cc: Likewise. * include/java-assert.h: Likewise. * java/io/natVMObjectInputStream.cc: Likewise. * configure: Regenerate. * include/config.h.in: Regenerate. From-SVN: r146869
2008-09-23re PR libgcj/8995 (race cases in interpreter)Andrew Haley1-27/+40
2008-09-17 Andrew Haley <aph@redhat.com> PR libgcj/8995: * defineclass.cc (_Jv_ClassReader::handleCodeAttribute): Initialize thread_count. * include/java-interp.h (_Jv_InterpMethod::thread_count): New field. (_Jv_InterpMethod::rewrite_insn_mutex): New mutex. (_Jv_InterpFrame:: _Jv_InterpFrame): Pass frame_type. * interpret.cc (ThreadCountAdjuster): New class. (_Jv_InterpMethod::thread_count): New field. (_Jv_InitInterpreter): Initialize rewrite_insn_mutex. Increment and decrement thread_count field in methods. * interpret-run.cc (REWRITE_INSN): Check thread_count <= 1. (REWRITE_INSN): Likewise. Declare a ThreadCountAdjuster. * java/lang/reflect/natVMProxy.cc (run_proxy): Initialize frame type as frame_proxy. From-SVN: r140593
2008-08-22re PR libgcj/8995 (race cases in interpreter)Andrew Haley1-6/+18
2008-08-22 Andrew Haley <aph@redhat.com> PR libgcj/8895: * interpret-run.cc (REWRITE_INSN): Null this macro. * include/jvm.h (class _Jv_Linker): Declare resolve_mutex, init. (read_cpool_entry, write_cpool_entry): New functions. * link.cc (_Jv_Linker::resolve_mutex): new. (_Jv_Linker::init): New function. (_Jv_Linker::resolve_pool_entry): Use {read,write}_cpool_entry to ensure atomic access to constant pool entries. From-SVN: r139492
2007-12-06ffi.h.in (FFI_SIZEOF_JAVA_RAW): Define if not already defined.David Daney1-1/+1
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
2007-09-09interpret-run.cc (invokevirtual_resolved): Nullcheck object on TOS.Andrew Haley1-0/+1
* interpret-run.cc (invokevirtual_resolved): Nullcheck object on TOS. From-SVN: r128298
2007-06-19Breakpoint.java: Make abstract.Keith Seitz1-9/+4
* gnu/gcj/jvmti/Breakpoint.java: Make abstract. (method): Change from private to protected. (location): Likewise. (Breakpoint): Change argument list to take only integer type. Add default constructor. (initialize_native): Renamed to ... (_save_insn): ... this to make function more explicit. (execute): New method. * gnu/gcj/jvmti/Breakpoint.h: Regenerate. * gnu/gcj/jvmti/natBreakpoint.cc (initialize_native): Rename to... (_save_insn): ... this. (install): Save the original instruction. * gnu/gcj/jvmti/NormalBreakpoint.java: New file. * gnu/gcj/jvmti/NormalBreakpoint.h: New file. * gnu/gcj/jvmti/natNormalBreakpoint.cc: New file. * gnu/gcj/jvmti/BreakpointManager.java (newBreakpoint): Instantiate a NormalBreakpoint instead of Breakpoint. * interpret-run.cc (insn_breakpoint): Remove breakpoint actions and call Breakpoint.execute to do them. * classpath/lib/gnu/gcj/jvmti/Breakpoint.class: Regenerate. * classpath/lib/gnu/gcj/jvmti/BreakpointManager.class: Likewise. * classpath/lib/gnu/gcj/jvmti/NormalBreakpoint.class: New file. * sources.am: Regenerate. * Makefile.am (nat_source_files): Add natNormalBreakpoint.cc. * Makefile.in: Regenerated. From-SVN: r125834
2007-05-04jvmti-int.h (_Jv_ReportJVMTIExceptionThrow): Declare.Keith Seitz1-22/+21
* include/jvmti-int.h (_Jv_ReportJVMTIExceptionThrow): 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. From-SVN: r124406
2007-05-01interpret-run.cc (NEXT_INSN): Advance PC before executing the instruction.Keith Seitz1-2/+3
* 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-24headers.txt (gnu/gcj/jvmti/Breakpoint.h): Add _Jv_RewriteBreakpointInsn ↵Keith Seitz1-24/+35
friend declaration. * headers.txt (gnu/gcj/jvmti/Breakpoint.h)[DIRECT_THREADED]: Add _Jv_RewriteBreakpointInsn friend declaration. * gnu/gcj/jvmti/natBreakpoint.cc (_Jv_RewriteBreakpointInsn) [DIRECT_THREADED]: New function. * gnu/gcj/jvmti/Breakpoint.h: Regenerate. * interpret-run.cc: Define new REWRITE_INSN macro. Changed all occurrences of insn rewriting to call REWRITE_INSN. From-SVN: r124111
2007-04-23java-interp.h (_Jv_InterpFrame): Add pointer to the interpreter PC.Kyle Galloway1-2/+7
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-04-20interpret-run.cc [...]: Save the original insn for the breakpoint before ↵Keith Seitz1-5/+6
posting the JVMTI notification. * interpret-run.cc [insn_breakpoint]: Save the original insn for the breakpoint before posting the JVMTI notification. From-SVN: r123985
2007-04-09interpret-run.cc: If debugging, check if args is NULL before getting the ↵Kyle Galloway1-3/+7
"this" pointer. 2007-04-09 Kyle Galloway <kgallowa@redhat.com> * interpret-run.cc: If debugging, check if args is NULL before getting the "this" pointer. From-SVN: r123681
2007-04-02interpret-run.cc: Add code to properly set up variable slots when debugging.Kyle Galloway1-12/+82
2007-04-02 Kyle Galloway <kgallowa@redhat.com> * interpret-run.cc: Add code to properly set up variable slots when debugging. * gnu/classpath/jdwp/natVMFrame.cc (checkJVMTIError): New function. (getObjectJVMTI): New function. (setObjectJVMTI): New function. (getIntJVMTI): New function. (setIntJVMTI): New function. (getLongJVMTI): New function. (setLongJVMTI): New function. (getFloatJVMTI): New function. (setFloatJVMTI): New function. (getDoubleJVMTI): New function. (setDoubleJVMTI): New function. (getFrameDepth): New function. (getValue): Implement. (setValue): Implement. From-SVN: r123427
2007-02-16interpret.cc: Add extra DEBUG_LOCALS_INSN calls for multi-slot variables to ↵Kyle Galloway1-0/+7
maintain type info. 2007-02-16 Kyle Galloway <kgallowa@redhat.com> * 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. From-SVN: r122048
2007-02-16interpret.cc (_Jv_InterpMethod::check_handler): New method.Kyle Galloway1-36/+31
2007-02-15 Kyle Galloway <kgallowa@redhat.com> * 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. From-SVN: r122019
2007-02-08java-interp.h (_Jv_InterpFrame): obj_ptr field added to hold "this" pointer ↵Kyle Galloway1-0/+9
for frame. 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-31jvmti-int.h (JVMTI): Declare member "enabled".Keith Seitz1-0/+35
* include/jvmti-int.h (JVMTI): Declare member "enabled". * 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. From-SVN: r121442
2007-01-29interpret.cc (run_debug): Remove comment.Tom Tromey1-1/+1
* interpret.cc (run_debug): Remove comment. (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. From-SVN: r121313
2007-01-25interpret.cc: Include gnu/gcj/jvmti/Breakpoint.h...Keith Seitz1-2/+27
* interpret.cc: Include gnu/gcj/jvmti/Breakpoint.h, gnu/gcj/jvmti/BreakpointManager.h, jvmti.h, and jvmti-int.h * interpret-run.cc: Implement insn_breakpoint. From-SVN: r121155
2006-10-14java-insns.h (enum java_code): Add op_breakpoint.Keith Seitz1-1/+6
* include/java-insns.h (enum java_code): Add op_breakpoint. * 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. From-SVN: r117734
2006-09-30java-interp.h (prepared): Change type to pc_t.Keith Seitz1-9/+9
* 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-15java-interp.h (_Jv_InterpMethod::run_debug): New method.Kyle Galloway1-0/+2508
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