< prev index next >

src/share/vm/code/compiledIC.hpp

Print this page




  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_CODE_COMPILEDIC_HPP
  26 #define SHARE_VM_CODE_COMPILEDIC_HPP
  27 
  28 #include "interpreter/linkResolver.hpp"
  29 #include "oops/compiledICHolder.hpp"
  30 #ifdef TARGET_ARCH_x86
  31 # include "nativeInst_x86.hpp"
  32 #endif



  33 #ifdef TARGET_ARCH_sparc
  34 # include "nativeInst_sparc.hpp"
  35 #endif
  36 #ifdef TARGET_ARCH_zero
  37 # include "nativeInst_zero.hpp"
  38 #endif
  39 #ifdef TARGET_ARCH_arm
  40 # include "nativeInst_arm.hpp"
  41 #endif
  42 #ifdef TARGET_ARCH_ppc
  43 # include "nativeInst_ppc.hpp"
  44 #endif
  45 
  46 //-----------------------------------------------------------------------------
  47 // The CompiledIC represents a compiled inline cache.
  48 //
  49 // In order to make patching of the inline cache MT-safe, we only allow the following
  50 // transitions (when not at a safepoint):
  51 //
  52 //


 303   friend class CompiledStaticCall;
 304  public:
 305   address      entry() const    { return _entry;  }
 306   methodHandle callee() const   { return _callee; }
 307 };
 308 
 309 
 310 class CompiledStaticCall: public NativeCall {
 311   friend class CompiledIC;
 312 
 313   // Also used by CompiledIC
 314   void set_to_interpreted(methodHandle callee, address entry);
 315   bool is_optimized_virtual();
 316 
 317  public:
 318   friend CompiledStaticCall* compiledStaticCall_before(address return_addr);
 319   friend CompiledStaticCall* compiledStaticCall_at(address native_call);
 320   friend CompiledStaticCall* compiledStaticCall_at(Relocation* call_site);
 321 
 322   // Code



 323   static address emit_to_interp_stub(CodeBuffer &cbuf);

 324   static int to_interp_stub_size();
 325   static int reloc_to_interp_stub();
 326 
 327   // State
 328   bool is_clean() const;
 329   bool is_call_to_compiled() const;
 330   bool is_call_to_interpreted() const;
 331 
 332   // Clean static call (will force resolving on next use)
 333   void set_to_clean();
 334 
 335   // Set state. The entry must be the same, as computed by compute_entry.
 336   // Computation and setting is split up, since the actions are separate during
 337   // a OptoRuntime::resolve_xxx.
 338   void set(const StaticCallInfo& info);
 339 
 340   // Compute entry point given a method
 341   static void compute_entry(methodHandle m, StaticCallInfo& info);
 342 
 343   // Stub support




  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_CODE_COMPILEDIC_HPP
  26 #define SHARE_VM_CODE_COMPILEDIC_HPP
  27 
  28 #include "interpreter/linkResolver.hpp"
  29 #include "oops/compiledICHolder.hpp"
  30 #ifdef TARGET_ARCH_x86
  31 # include "nativeInst_x86.hpp"
  32 #endif
  33 #ifdef TARGET_ARCH_aarch64
  34 # include "nativeInst_aarch64.hpp"
  35 #endif
  36 #ifdef TARGET_ARCH_sparc
  37 # include "nativeInst_sparc.hpp"
  38 #endif
  39 #ifdef TARGET_ARCH_zero
  40 # include "nativeInst_zero.hpp"
  41 #endif
  42 #ifdef TARGET_ARCH_arm
  43 # include "nativeInst_arm.hpp"
  44 #endif
  45 #ifdef TARGET_ARCH_ppc
  46 # include "nativeInst_ppc.hpp"
  47 #endif
  48 
  49 //-----------------------------------------------------------------------------
  50 // The CompiledIC represents a compiled inline cache.
  51 //
  52 // In order to make patching of the inline cache MT-safe, we only allow the following
  53 // transitions (when not at a safepoint):
  54 //
  55 //


 306   friend class CompiledStaticCall;
 307  public:
 308   address      entry() const    { return _entry;  }
 309   methodHandle callee() const   { return _callee; }
 310 };
 311 
 312 
 313 class CompiledStaticCall: public NativeCall {
 314   friend class CompiledIC;
 315 
 316   // Also used by CompiledIC
 317   void set_to_interpreted(methodHandle callee, address entry);
 318   bool is_optimized_virtual();
 319 
 320  public:
 321   friend CompiledStaticCall* compiledStaticCall_before(address return_addr);
 322   friend CompiledStaticCall* compiledStaticCall_at(address native_call);
 323   friend CompiledStaticCall* compiledStaticCall_at(Relocation* call_site);
 324 
 325   // Code
 326 #if defined(AARCH64) && !defined(ZERO)
 327   static address emit_to_interp_stub(CodeBuffer &cbuf, address mark);
 328 #else
 329   static address emit_to_interp_stub(CodeBuffer &cbuf);
 330 #endif
 331   static int to_interp_stub_size();
 332   static int reloc_to_interp_stub();
 333 
 334   // State
 335   bool is_clean() const;
 336   bool is_call_to_compiled() const;
 337   bool is_call_to_interpreted() const;
 338 
 339   // Clean static call (will force resolving on next use)
 340   void set_to_clean();
 341 
 342   // Set state. The entry must be the same, as computed by compute_entry.
 343   // Computation and setting is split up, since the actions are separate during
 344   // a OptoRuntime::resolve_xxx.
 345   void set(const StaticCallInfo& info);
 346 
 347   // Compute entry point given a method
 348   static void compute_entry(methodHandle m, StaticCallInfo& info);
 349 
 350   // Stub support


< prev index next >