8051398: jvmti tests fieldacc002, fieldmod002 fail in nightly with errors: (watch#0) wrong location
authorcoleenp
Thu, 31 Jul 2014 00:50:55 +0000
changeset 25895 03808d9a48b2
parent 25891 103846690fc2
child 25896 5f21a029fdeb
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
hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
hotspot/src/share/vm/oops/method.cpp
hotspot/src/share/vm/oops/method.hpp
hotspot/src/share/vm/runtime/frame.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);
 
--- 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
--- 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;
 
--- 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) {