< prev index next >

src/hotspot/share/code/compiledIC.hpp

Print this page


 259   bool is_call_to_interpreted() const;
 260 
 261   bool is_icholder_call() const;
 262 
 263   address end_of_call() { return  _call->return_address(); }
 264 
 265   // MT-safe patching of inline caches. Note: Only safe to call is_xxx when holding the CompiledIC_ock
 266   // so you are guaranteed that no patching takes place. The same goes for verify.
 267   //
 268   // Note: We do not provide any direct access to the stub code, to prevent parts of the code
 269   // to manipulate the inline cache in MT-unsafe ways.
 270   //
 271   // They all takes a TRAP argument, since they can cause a GC if the inline-cache buffer is full.
 272   //
 273   bool set_to_clean(bool in_use = true);
 274   bool set_to_monomorphic(CompiledICInfo& info);
 275   void clear_ic_stub();
 276 
 277   // Returns true if successful and false otherwise. The call can fail if memory
 278   // allocation in the code cache fails, or ic stub refill is required.
 279   bool set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, bool& needs_ic_stub_refill, TRAPS);
 280 
 281   static void compute_monomorphic_entry(const methodHandle& method, Klass* receiver_klass,
 282                                         bool is_optimized, bool static_bound, bool caller_is_nmethod,
 283                                         CompiledICInfo& info, TRAPS);
 284 
 285   // Location
 286   address instruction_address() const { return _call->instruction_address(); }
 287 
 288   // Misc
 289   void print()             PRODUCT_RETURN;
 290   void print_compiled_ic() PRODUCT_RETURN;
 291   void verify()            PRODUCT_RETURN;
 292 };
 293 
 294 inline CompiledIC* CompiledIC_before(CompiledMethod* nm, address return_addr) {
 295   CompiledIC* c_ic = new CompiledIC(nm, nativeCall_before(return_addr));
 296   c_ic->verify();
 297   return c_ic;
 298 }
 299 
 300 inline CompiledIC* CompiledIC_at(CompiledMethod* nm, address call_site) {
 301   CompiledIC* c_ic = new CompiledIC(nm, nativeCall_at(call_site));
 302   c_ic->verify();
 303   return c_ic;


 346   friend class CompiledStaticCall;
 347   friend class CompiledDirectStaticCall;
 348   friend class CompiledPltStaticCall;
 349  public:
 350   address      entry() const    { return _entry;  }
 351   methodHandle callee() const   { return _callee; }
 352 };
 353 
 354 class CompiledStaticCall : public ResourceObj {
 355  public:
 356   // Code
 357   static address emit_to_interp_stub(CodeBuffer &cbuf, address mark = NULL);
 358   static int to_interp_stub_size();
 359   static int to_trampoline_stub_size();
 360   static int reloc_to_interp_stub();
 361   static void emit_to_aot_stub(CodeBuffer &cbuf, address mark = NULL);
 362   static int to_aot_stub_size();
 363   static int reloc_to_aot_stub();
 364 
 365   // Compute entry point given a method
 366   static void compute_entry(const methodHandle& m, bool caller_is_nmethod, StaticCallInfo& info);
 367 
 368 public:
 369   // Clean static call (will force resolving on next use)
 370   virtual address destination() const = 0;
 371 
 372   // Clean static call (will force resolving on next use)
 373   bool set_to_clean(bool in_use = true);
 374 
 375   // Set state. The entry must be the same, as computed by compute_entry.
 376   // Computation and setting is split up, since the actions are separate during
 377   // a OptoRuntime::resolve_xxx.
 378   void set(const StaticCallInfo& info);
 379 
 380   // State
 381   bool is_clean() const;
 382   bool is_call_to_compiled() const;
 383   virtual bool is_call_to_interpreted() const = 0;
 384 
 385   virtual address instruction_address() const = 0;
 386 protected:




 259   bool is_call_to_interpreted() const;
 260 
 261   bool is_icholder_call() const;
 262 
 263   address end_of_call() { return  _call->return_address(); }
 264 
 265   // MT-safe patching of inline caches. Note: Only safe to call is_xxx when holding the CompiledIC_ock
 266   // so you are guaranteed that no patching takes place. The same goes for verify.
 267   //
 268   // Note: We do not provide any direct access to the stub code, to prevent parts of the code
 269   // to manipulate the inline cache in MT-unsafe ways.
 270   //
 271   // They all takes a TRAP argument, since they can cause a GC if the inline-cache buffer is full.
 272   //
 273   bool set_to_clean(bool in_use = true);
 274   bool set_to_monomorphic(CompiledICInfo& info);
 275   void clear_ic_stub();
 276 
 277   // Returns true if successful and false otherwise. The call can fail if memory
 278   // allocation in the code cache fails, or ic stub refill is required.
 279   bool set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, bool& needs_ic_stub_refill, bool caller_is_c1, TRAPS);
 280 
 281   static void compute_monomorphic_entry(const methodHandle& method, Klass* receiver_klass,
 282                                         bool is_optimized, bool static_bound, bool caller_is_nmethod,
 283                                         bool caller_is_c1, CompiledICInfo& info, TRAPS);
 284 
 285   // Location
 286   address instruction_address() const { return _call->instruction_address(); }
 287 
 288   // Misc
 289   void print()             PRODUCT_RETURN;
 290   void print_compiled_ic() PRODUCT_RETURN;
 291   void verify()            PRODUCT_RETURN;
 292 };
 293 
 294 inline CompiledIC* CompiledIC_before(CompiledMethod* nm, address return_addr) {
 295   CompiledIC* c_ic = new CompiledIC(nm, nativeCall_before(return_addr));
 296   c_ic->verify();
 297   return c_ic;
 298 }
 299 
 300 inline CompiledIC* CompiledIC_at(CompiledMethod* nm, address call_site) {
 301   CompiledIC* c_ic = new CompiledIC(nm, nativeCall_at(call_site));
 302   c_ic->verify();
 303   return c_ic;


 346   friend class CompiledStaticCall;
 347   friend class CompiledDirectStaticCall;
 348   friend class CompiledPltStaticCall;
 349  public:
 350   address      entry() const    { return _entry;  }
 351   methodHandle callee() const   { return _callee; }
 352 };
 353 
 354 class CompiledStaticCall : public ResourceObj {
 355  public:
 356   // Code
 357   static address emit_to_interp_stub(CodeBuffer &cbuf, address mark = NULL);
 358   static int to_interp_stub_size();
 359   static int to_trampoline_stub_size();
 360   static int reloc_to_interp_stub();
 361   static void emit_to_aot_stub(CodeBuffer &cbuf, address mark = NULL);
 362   static int to_aot_stub_size();
 363   static int reloc_to_aot_stub();
 364 
 365   // Compute entry point given a method
 366   static void compute_entry(const methodHandle& m, CompiledMethod* caller_nm, StaticCallInfo& info);
 367 
 368 public:
 369   // Clean static call (will force resolving on next use)
 370   virtual address destination() const = 0;
 371 
 372   // Clean static call (will force resolving on next use)
 373   bool set_to_clean(bool in_use = true);
 374 
 375   // Set state. The entry must be the same, as computed by compute_entry.
 376   // Computation and setting is split up, since the actions are separate during
 377   // a OptoRuntime::resolve_xxx.
 378   void set(const StaticCallInfo& info);
 379 
 380   // State
 381   bool is_clean() const;
 382   bool is_call_to_compiled() const;
 383   virtual bool is_call_to_interpreted() const = 0;
 384 
 385   virtual address instruction_address() const = 0;
 386 protected:


< prev index next >