< prev index next >

src/hotspot/share/code/codeBlob.hpp

Print this page
rev 47399 : 8187091: ReturnBlobToWrongHeapTest fails because of problems in CodeHeap::contains_blob()
Reviewed-by: kvn


  34 #include "utilities/macros.hpp"
  35 
  36 // CodeBlob Types
  37 // Used in the CodeCache to assign CodeBlobs to different CodeHeaps
  38 struct CodeBlobType {
  39   enum {
  40     MethodNonProfiled   = 0,    // Execution level 1 and 4 (non-profiled) nmethods (including native nmethods)
  41     MethodProfiled      = 1,    // Execution level 2 and 3 (profiled) nmethods
  42     NonNMethod          = 2,    // Non-nmethods like Buffers, Adapters and Runtime Stubs
  43     All                 = 3,    // All types (No code cache segmentation)
  44     AOT                 = 4,    // AOT methods
  45     NumTypes            = 5     // Number of CodeBlobTypes
  46   };
  47 };
  48 
  49 // CodeBlob - superclass for all entries in the CodeCache.
  50 //
  51 // Subtypes are:
  52 //   CompiledMethod       : Compiled Java methods (include method that calls to native code)
  53 //     nmethod            : JIT Compiled Java methods




  54 //   RuntimeBlob          : Non-compiled method code; generated glue code



  55 //     RuntimeStub        : Call to VM runtime methods

  56 //     DeoptimizationBlob : Used for deoptimization
  57 //     ExceptionBlob      : Used for stack unrolling
  58 //     SafepointBlob      : Used to handle illegal instruction exceptions

  59 //
  60 //
  61 // Layout:
  62 //   - header
  63 //   - relocation
  64 //   - content space
  65 //     - instruction space
  66 //   - data space





  67 
  68 
  69 class CodeBlobLayout;
  70 
  71 class CodeBlob VALUE_OBJ_CLASS_SPEC {
  72   friend class VMStructs;
  73   friend class JVMCIVMStructs;
  74   friend class CodeCacheDumper;
  75 
  76 protected:
  77 
  78   const CompilerType _type;                      // CompilerType
  79   int        _size;                              // total size of CodeBlob in bytes
  80   int        _header_size;                       // size of header (depends on subclass)
  81   int        _frame_complete_offset;             // instruction offsets in [0.._frame_complete_offset) have
  82                                                  // not finished setting up their frame. Beware of pc's in
  83                                                  // that range. There is a similar range(s) on returns
  84                                                  // which we don't detect.
  85   int        _data_offset;                       // offset to where data region begins
  86   int        _frame_size;                        // size of stack frame




  34 #include "utilities/macros.hpp"
  35 
  36 // CodeBlob Types
  37 // Used in the CodeCache to assign CodeBlobs to different CodeHeaps
  38 struct CodeBlobType {
  39   enum {
  40     MethodNonProfiled   = 0,    // Execution level 1 and 4 (non-profiled) nmethods (including native nmethods)
  41     MethodProfiled      = 1,    // Execution level 2 and 3 (profiled) nmethods
  42     NonNMethod          = 2,    // Non-nmethods like Buffers, Adapters and Runtime Stubs
  43     All                 = 3,    // All types (No code cache segmentation)
  44     AOT                 = 4,    // AOT methods
  45     NumTypes            = 5     // Number of CodeBlobTypes
  46   };
  47 };
  48 
  49 // CodeBlob - superclass for all entries in the CodeCache.
  50 //
  51 // Subtypes are:
  52 //  CompiledMethod       : Compiled Java methods (include method that calls to native code)
  53 //   nmethod             : JIT Compiled Java methods
  54 //   AOTCompiledMethod   : AOT Compiled Java methods - Not in the CodeCache!
  55 //                         AOTCompiledMethod objects are allocated in the C-Heap, the code they
  56 //                         point to is allocated in the AOTCodeHeap which is in the C-Heap as
  57 //                         well (i.e. it's the memory where the shared library was loaded to)
  58 //  RuntimeBlob          : Non-compiled method code; generated glue code
  59 //   BufferBlob          : Used for non-relocatable code such as interpreter, stubroutines, etc.
  60 //    AdapterBlob        : Used to hold C2I/I2C adapters
  61 //    MethodHandlesAdapterBlob : Used to hold MethodHandles adapters
  62 //   RuntimeStub         : Call to VM runtime methods
  63 //   SingletonBlob       : Super-class for all blobs that exist in only one instance
  64 //    DeoptimizationBlob : Used for deoptimization
  65 //    ExceptionBlob      : Used for stack unrolling
  66 //    SafepointBlob      : Used to handle illegal instruction exceptions
  67 //    UncommonTrapBlob   : Used to handle uncommon traps
  68 //
  69 //
  70 // Layout (all except AOTCompiledMethod) : continuous in the CodeCache
  71 //   - header
  72 //   - relocation
  73 //   - content space
  74 //     - instruction space
  75 //   - data space
  76 //
  77 // Layout (AOTCompiledMethod) : in the C-Heap
  78 //   - header -\
  79 //     ...     |
  80 //   - code  <-/
  81 
  82 
  83 class CodeBlobLayout;
  84 
  85 class CodeBlob VALUE_OBJ_CLASS_SPEC {
  86   friend class VMStructs;
  87   friend class JVMCIVMStructs;
  88   friend class CodeCacheDumper;
  89 
  90 protected:
  91 
  92   const CompilerType _type;                      // CompilerType
  93   int        _size;                              // total size of CodeBlob in bytes
  94   int        _header_size;                       // size of header (depends on subclass)
  95   int        _frame_complete_offset;             // instruction offsets in [0.._frame_complete_offset) have
  96                                                  // not finished setting up their frame. Beware of pc's in
  97                                                  // that range. There is a similar range(s) on returns
  98                                                  // which we don't detect.
  99   int        _data_offset;                       // offset to where data region begins
 100   int        _frame_size;                        // size of stack frame


< prev index next >