changeset 6488:ee679e75ed23

8035396: Introduce accessor for tmp_oop in frame. Summary: Avoid #ifs by introducing the accessor function interpreter_frame_temp_oop_addr(). Reviewed-by: kvn, twisti
author goetz
date Fri, 21 Mar 2014 21:01:24 +0100
parents efa0681495c5
children 807f61aed46a
files src/cpu/sparc/vm/frame_sparc.inline.hpp src/cpu/x86/vm/frame_x86.inline.hpp src/share/vm/runtime/frame.cpp src/share/vm/runtime/frame.hpp src/share/vm/runtime/frame.inline.hpp
diffstat 5 files changed, 20 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/sparc/vm/frame_sparc.inline.hpp	Mon Feb 17 14:17:20 2014 +0100
+++ b/src/cpu/sparc/vm/frame_sparc.inline.hpp	Fri Mar 21 21:01:24 2014 +0100
@@ -235,6 +235,10 @@
 inline constantPoolCacheOop* frame::interpreter_frame_cache_addr() const {
   return (constantPoolCacheOop*)sp_addr_at( LcpoolCache->sp_offset_in_saved_window());
 }
+
+inline oop* frame::interpreter_frame_temp_oop_addr() const {
+  return (oop *)(fp() + interpreter_frame_oop_temp_offset);
+}
 #endif // CC_INTERP
 
 
--- a/src/cpu/x86/vm/frame_x86.inline.hpp	Mon Feb 17 14:17:20 2014 +0100
+++ b/src/cpu/x86/vm/frame_x86.inline.hpp	Fri Mar 21 21:01:24 2014 +0100
@@ -245,6 +245,10 @@
   }
 }
 
+inline oop* frame::interpreter_frame_temp_oop_addr() const {
+  return (oop *)(fp() + interpreter_frame_oop_temp_offset);
+}
+
 #endif /* CC_INTERP */
 
 inline int frame::pd_oop_map_offset_adjustment() const {
--- a/src/share/vm/runtime/frame.cpp	Mon Feb 17 14:17:20 2014 +0100
+++ b/src/share/vm/runtime/frame.cpp	Fri Mar 21 21:01:24 2014 +0100
@@ -930,22 +930,11 @@
   if (istate->msg() == BytecodeInterpreter::call_method) {
     f->do_oop((oop*)&istate->_result._to_call._callee);
   }
-
 #endif /* CC_INTERP */
 
-#if !defined(PPC32) || defined(ZERO)
-  if (m->is_native()) {
-#ifdef CC_INTERP
-    f->do_oop((oop*)&istate->_oop_temp);
-#else
-    f->do_oop((oop*)( fp() + interpreter_frame_oop_temp_offset ));
-#endif /* CC_INTERP */
+  if (m->is_native() PPC32_ONLY(&& m->is_static())) {
+    f->do_oop(interpreter_frame_temp_oop_addr());
   }
-#else // PPC32
-  if (m->is_native() && m->is_static()) {
-    f->do_oop(interpreter_frame_mirror_addr());
-  }
-#endif // PPC32
 
   int max_locals = m->is_native() ? m->size_of_parameters() : m->max_locals();
 
--- a/src/share/vm/runtime/frame.hpp	Mon Feb 17 14:17:20 2014 +0100
+++ b/src/share/vm/runtime/frame.hpp	Fri Mar 21 21:01:24 2014 +0100
@@ -315,6 +315,9 @@
   void interpreter_frame_set_monitor_end(BasicObjectLock* value);
 #endif // CC_INTERP
 
+  // Address of the temp oop in the frame. Needed as GC root.
+  oop* interpreter_frame_temp_oop_addr() const;
+
   // BasicObjectLocks:
   //
   // interpreter_frame_monitor_begin is higher in memory than interpreter_frame_monitor_end
@@ -351,9 +354,6 @@
   void interpreter_frame_set_method(methodOop method);
   methodOop* interpreter_frame_method_addr() const;
   constantPoolCacheOop* interpreter_frame_cache_addr() const;
-#ifdef PPC32
-  oop* interpreter_frame_mirror_addr() const;
-#endif
 
  public:
   // Entry frames
--- a/src/share/vm/runtime/frame.inline.hpp	Mon Feb 17 14:17:20 2014 +0100
+++ b/src/share/vm/runtime/frame.inline.hpp	Fri Mar 21 21:01:24 2014 +0100
@@ -87,6 +87,13 @@
   return is_entry_frame() && entry_frame_is_first();
 }
 
+#ifdef CC_INTERP
+inline oop* frame::interpreter_frame_temp_oop_addr() const {
+  interpreterState istate = get_interpreterState();
+  return (oop *)&istate->_oop_temp;
+}
+#endif // CC_INTERP
+
 // here are the platform-dependent bodies:
 
 #ifdef TARGET_ARCH_x86