# HG changeset patch # User goetz # Date 1393443214 28800 # Node ID af8cc1dae608028b7c2be9d0a920ae816aded87a # Parent a7d4d4655766f90306a60d55cfa6856ceda78c4e 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 diff -r a7d4d4655766 -r af8cc1dae608 src/cpu/sparc/vm/frame_sparc.inline.hpp --- a/src/cpu/sparc/vm/frame_sparc.inline.hpp Wed Mar 26 18:21:05 2014 -0700 +++ b/src/cpu/sparc/vm/frame_sparc.inline.hpp Wed Feb 26 11:33:34 2014 -0800 @@ -237,6 +237,10 @@ inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const { return (ConstantPoolCache**)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 diff -r a7d4d4655766 -r af8cc1dae608 src/cpu/x86/vm/frame_x86.inline.hpp --- a/src/cpu/x86/vm/frame_x86.inline.hpp Wed Mar 26 18:21:05 2014 -0700 +++ b/src/cpu/x86/vm/frame_x86.inline.hpp Wed Feb 26 11:33:34 2014 -0800 @@ -247,6 +247,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 { diff -r a7d4d4655766 -r af8cc1dae608 src/share/vm/runtime/frame.cpp --- a/src/share/vm/runtime/frame.cpp Wed Mar 26 18:21:05 2014 -0700 +++ b/src/share/vm/runtime/frame.cpp Wed Feb 26 11:33:34 2014 -0800 @@ -936,20 +936,9 @@ cld_f->do_cld(m->method_holder()->class_loader_data()); } -#if !defined(PPC32) || defined(ZERO) - if (m->is_native()) { -#ifdef CC_INTERP - interpreterState istate = get_interpreterState(); - 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(); diff -r a7d4d4655766 -r af8cc1dae608 src/share/vm/runtime/frame.hpp --- a/src/share/vm/runtime/frame.hpp Wed Mar 26 18:21:05 2014 -0700 +++ b/src/share/vm/runtime/frame.hpp Wed Feb 26 11:33:34 2014 -0800 @@ -314,6 +314,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 @@ -350,9 +353,6 @@ void interpreter_frame_set_method(Method* method); Method** interpreter_frame_method_addr() const; ConstantPoolCache** interpreter_frame_cache_addr() const; -#ifdef PPC32 - oop* interpreter_frame_mirror_addr() const; -#endif public: // Entry frames diff -r a7d4d4655766 -r af8cc1dae608 src/share/vm/runtime/frame.inline.hpp --- a/src/share/vm/runtime/frame.inline.hpp Wed Mar 26 18:21:05 2014 -0700 +++ b/src/share/vm/runtime/frame.inline.hpp Wed Feb 26 11:33:34 2014 -0800 @@ -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