src/share/vm/code/codeBlob.hpp

changeset 2895
167b70ff3abc
parent 2314
f95d63e2154a
child 3969
1d7922586cf6
     1.1 --- a/src/share/vm/code/codeBlob.hpp	Fri May 06 12:12:29 2011 -0700
     1.2 +++ b/src/share/vm/code/codeBlob.hpp	Fri May 06 16:33:13 2011 -0700
     1.3 @@ -35,6 +35,7 @@
     1.4  // Suptypes are:
     1.5  //   nmethod            : Compiled Java methods (include method that calls to native code)
     1.6  //   RuntimeStub        : Call to VM runtime methods
     1.7 +//   RicochetBlob       : Used for blocking MethodHandle adapters
     1.8  //   DeoptimizationBlob : Used for deoptimizatation
     1.9  //   ExceptionBlob      : Used for stack unrolling
    1.10  //   SafepointBlob      : Used to handle illegal instruction exceptions
    1.11 @@ -95,12 +96,13 @@
    1.12    void flush();
    1.13  
    1.14    // Typing
    1.15 -  virtual bool is_buffer_blob() const                 { return false; }
    1.16 -  virtual bool is_nmethod() const                     { return false; }
    1.17 -  virtual bool is_runtime_stub() const                { return false; }
    1.18 -  virtual bool is_deoptimization_stub() const         { return false; }
    1.19 -  virtual bool is_uncommon_trap_stub() const          { return false; }
    1.20 -  virtual bool is_exception_stub() const              { return false; }
    1.21 +  virtual bool is_buffer_blob() const            { return false; }
    1.22 +  virtual bool is_nmethod() const                { return false; }
    1.23 +  virtual bool is_runtime_stub() const           { return false; }
    1.24 +  virtual bool is_ricochet_stub() const          { return false; }
    1.25 +  virtual bool is_deoptimization_stub() const    { return false; }
    1.26 +  virtual bool is_uncommon_trap_stub() const     { return false; }
    1.27 +  virtual bool is_exception_stub() const         { return false; }
    1.28    virtual bool is_safepoint_stub() const              { return false; }
    1.29    virtual bool is_adapter_blob() const                { return false; }
    1.30    virtual bool is_method_handles_adapter_blob() const { return false; }
    1.31 @@ -182,6 +184,9 @@
    1.32    virtual void print_on(outputStream* st) const;
    1.33    virtual void print_value_on(outputStream* st) const;
    1.34  
    1.35 +  // Deal with Disassembler, VTune, Forte, JvmtiExport, MemoryService.
    1.36 +  static void trace_new_stub(CodeBlob* blob, const char* name1, const char* name2 = "");
    1.37 +
    1.38    // Print the comment associated with offset on stream, if there is one
    1.39    virtual void print_block_comment(outputStream* stream, address block_begin) {
    1.40      intptr_t offset = (intptr_t)(block_begin - code_begin());
    1.41 @@ -318,7 +323,11 @@
    1.42  
    1.43  class SingletonBlob: public CodeBlob {
    1.44    friend class VMStructs;
    1.45 -  public:
    1.46 +
    1.47 + protected:
    1.48 +  void* operator new(size_t s, unsigned size);
    1.49 +
    1.50 + public:
    1.51     SingletonBlob(
    1.52       const char* name,
    1.53       CodeBuffer* cb,
    1.54 @@ -341,6 +350,50 @@
    1.55  
    1.56  
    1.57  //----------------------------------------------------------------------------------------------------
    1.58 +// RicochetBlob
    1.59 +// Holds an arbitrary argument list indefinitely while Java code executes recursively.
    1.60 +
    1.61 +class RicochetBlob: public SingletonBlob {
    1.62 +  friend class VMStructs;
    1.63 + private:
    1.64 +
    1.65 +  int _bounce_offset;
    1.66 +  int _exception_offset;
    1.67 +
    1.68 +  // Creation support
    1.69 +  RicochetBlob(
    1.70 +    CodeBuffer* cb,
    1.71 +    int         size,
    1.72 +    int         bounce_offset,
    1.73 +    int         exception_offset,
    1.74 +    int         frame_size
    1.75 +  );
    1.76 +
    1.77 + public:
    1.78 +  // Creation
    1.79 +  static RicochetBlob* create(
    1.80 +    CodeBuffer* cb,
    1.81 +    int         bounce_offset,
    1.82 +    int         exception_offset,
    1.83 +    int         frame_size
    1.84 +  );
    1.85 +
    1.86 +  // Typing
    1.87 +  bool is_ricochet_stub() const { return true; }
    1.88 +
    1.89 +  // GC for args
    1.90 +  void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { /* Nothing to do */ }
    1.91 +
    1.92 +  address bounce_addr() const           { return code_begin() + _bounce_offset; }
    1.93 +  address exception_addr() const        { return code_begin() + _exception_offset; }
    1.94 +  bool returns_to_bounce_addr(address pc) const {
    1.95 +    address bounce_pc = bounce_addr();
    1.96 +    return (pc == bounce_pc || (pc + frame::pc_return_offset) == bounce_pc);
    1.97 +  }
    1.98 +};
    1.99 +
   1.100 +
   1.101 +//----------------------------------------------------------------------------------------------------
   1.102  // DeoptimizationBlob
   1.103  
   1.104  class DeoptimizationBlob: public SingletonBlob {
   1.105 @@ -363,8 +416,6 @@
   1.106      int         frame_size
   1.107    );
   1.108  
   1.109 -  void* operator new(size_t s, unsigned size);
   1.110 -
   1.111   public:
   1.112    // Creation
   1.113    static DeoptimizationBlob* create(
   1.114 @@ -378,7 +429,6 @@
   1.115  
   1.116    // Typing
   1.117    bool is_deoptimization_stub() const { return true; }
   1.118 -  const DeoptimizationBlob *as_deoptimization_stub() const { return this; }
   1.119    bool exception_address_is_unpack_entry(address pc) const {
   1.120      address unpack_pc = unpack();
   1.121      return (pc == unpack_pc || (pc + frame::pc_return_offset) == unpack_pc);
   1.122 @@ -426,8 +476,6 @@
   1.123      int         frame_size
   1.124    );
   1.125  
   1.126 -  void* operator new(size_t s, unsigned size);
   1.127 -
   1.128   public:
   1.129    // Creation
   1.130    static UncommonTrapBlob* create(
   1.131 @@ -458,8 +506,6 @@
   1.132      int         frame_size
   1.133    );
   1.134  
   1.135 -  void* operator new(size_t s, unsigned size);
   1.136 -
   1.137   public:
   1.138    // Creation
   1.139    static ExceptionBlob* create(
   1.140 @@ -491,8 +537,6 @@
   1.141      int         frame_size
   1.142    );
   1.143  
   1.144 -  void* operator new(size_t s, unsigned size);
   1.145 -
   1.146   public:
   1.147    // Creation
   1.148    static SafepointBlob* create(

mercurial