# HG changeset patch # User coleenp # Date 1406767855 0 # Node ID 03808d9a48b2f1a09545abaa032dae55963a2d2f # Parent 103846690fc220956dd7f714dea59845f0ee9009 8051398: jvmti tests fieldacc002, fieldmod002 fail in nightly with errors: (watch#0) wrong location Summary: Didn't handle NULL bcp for native methods Reviewed-by: dcubed, sspitsyn diff -r 103846690fc2 -r 03808d9a48b2 hotspot/src/share/vm/interpreter/interpreterRuntime.cpp --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp Mon Jul 28 07:31:17 2014 -0700 +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp Thu Jul 31 00:50:55 2014 +0000 @@ -987,17 +987,6 @@ int index = cp_entry->field_index(); if ((ik->field_access_flags(index) & JVM_ACC_FIELD_ACCESS_WATCHED) == 0) return; - switch(cp_entry->flag_state()) { - case btos: // fall through - case ctos: // fall through - case stos: // fall through - case itos: // fall through - case ftos: // fall through - case ltos: // fall through - case dtos: // fall through - case atos: break; - default: ShouldNotReachHere(); return; - } bool is_static = (obj == NULL); HandleMark hm(thread); diff -r 103846690fc2 -r 03808d9a48b2 hotspot/src/share/vm/oops/method.cpp --- a/hotspot/src/share/vm/oops/method.cpp Mon Jul 28 07:31:17 2014 -0700 +++ b/hotspot/src/share/vm/oops/method.cpp Thu Jul 31 00:50:55 2014 +0000 @@ -283,6 +283,13 @@ return bcp; } +address Method::bcp_from(address bcp) const { + if (is_native() && bcp == NULL) { + return code_base(); + } else { + return bcp; + } +} int Method::size(bool is_native) { // If native, then include pointers for native_function and signature_handler diff -r 103846690fc2 -r 03808d9a48b2 hotspot/src/share/vm/oops/method.hpp --- a/hotspot/src/share/vm/oops/method.hpp Mon Jul 28 07:31:17 2014 -0700 +++ b/hotspot/src/share/vm/oops/method.hpp Thu Jul 31 00:50:55 2014 +0000 @@ -648,7 +648,8 @@ // Returns the byte code index from the byte code pointer int bci_from(address bcp) const; - address bcp_from(int bci) const; + address bcp_from(int bci) const; + address bcp_from(address bcp) const; int validate_bci_from_bcp(address bcp) const; int validate_bci(int bci) const; diff -r 103846690fc2 -r 03808d9a48b2 hotspot/src/share/vm/runtime/frame.cpp --- a/hotspot/src/share/vm/runtime/frame.cpp Mon Jul 28 07:31:17 2014 -0700 +++ b/hotspot/src/share/vm/runtime/frame.cpp Thu Jul 31 00:50:55 2014 +0000 @@ -407,7 +407,8 @@ address frame::interpreter_frame_bcp() const { assert(is_interpreted_frame(), "interpreted frame expected"); - return (address)*interpreter_frame_bcp_addr(); + address bcp = (address)*interpreter_frame_bcp_addr(); + return interpreter_frame_method()->bcp_from(bcp); } void frame::interpreter_frame_set_bcp(address bcp) {