< prev index next >

src/hotspot/share/asm/codeBuffer.hpp

Print this page


  33 
  34 class CodeStrings;
  35 class PhaseCFG;
  36 class Compile;
  37 class BufferBlob;
  38 class CodeBuffer;
  39 class Label;
  40 
  41 class CodeOffsets: public StackObj {
  42 public:
  43   enum Entries { Entry,
  44                  Verified_Entry,
  45                  Verified_Value_Entry,
  46                  Verified_Value_Entry_RO,
  47                  Frame_Complete, // Offset in the code where the frame setup is (for forte stackwalks) is complete
  48                  OSR_Entry,
  49                  Exceptions,     // Offset where exception handler lives
  50                  Deopt,          // Offset where deopt handler lives
  51                  DeoptMH,        // Offset where MethodHandle deopt handler lives
  52                  UnwindHandler,  // Offset to default unwind handler

  53                  max_Entries };
  54 
  55   // special value to note codeBlobs where profile (forte) stack walking is
  56   // always dangerous and suspect.
  57 
  58   enum { frame_never_safe = -1 };
  59 
  60 private:
  61   int _values[max_Entries];

  62 
  63 public:
  64   CodeOffsets() {
  65     _values[Entry         ] = 0;
  66     _values[Verified_Entry] = 0;

  67     _values[Verified_Value_Entry] = -1;
  68     _values[Verified_Value_Entry_RO] = -1;
  69     _values[Frame_Complete] = frame_never_safe;
  70     _values[OSR_Entry     ] = 0;
  71     _values[Exceptions    ] = -1;
  72     _values[Deopt         ] = -1;
  73     _values[DeoptMH       ] = -1;
  74     _values[UnwindHandler ] = -1;
  75   }
  76 
  77   int value(Entries e) { return _values[e]; }
  78   void set_value(Entries e, int val) { _values[e] = val; }
  79 };
  80 
  81 // This class represents a stream of code and associated relocations.
  82 // There are a few in each CodeBuffer.
  83 // They are filled concurrently, and concatenated at the end.
  84 class CodeSection {
  85   friend class CodeBuffer;
  86  public:
  87   typedef int csize_t;  // code size type; would be size_t except for history
  88 
  89  private:
  90   address     _start;           // first byte of contents (instructions)
  91   address     _mark;            // user mark, usually an instruction beginning
  92   address     _end;             // current end address
  93   address     _limit;           // last possible (allocated) end address
  94   relocInfo*  _locs_start;      // first byte of relocation information
  95   relocInfo*  _locs_end;        // first byte after relocation information
  96   relocInfo*  _locs_limit;      // first byte after relocation information buf
  97   address     _locs_point;      // last relocated position (grows upward)
  98   bool        _locs_own;        // did I allocate the locs myself?




  33 
  34 class CodeStrings;
  35 class PhaseCFG;
  36 class Compile;
  37 class BufferBlob;
  38 class CodeBuffer;
  39 class Label;
  40 
  41 class CodeOffsets: public StackObj {
  42 public:
  43   enum Entries { Entry,
  44                  Verified_Entry,
  45                  Verified_Value_Entry,
  46                  Verified_Value_Entry_RO,
  47                  Frame_Complete, // Offset in the code where the frame setup is (for forte stackwalks) is complete
  48                  OSR_Entry,
  49                  Exceptions,     // Offset where exception handler lives
  50                  Deopt,          // Offset where deopt handler lives
  51                  DeoptMH,        // Offset where MethodHandle deopt handler lives
  52                  UnwindHandler,  // Offset to default unwind handler
  53                  Value_Entry,
  54                  max_Entries };
  55 
  56   // special value to note codeBlobs where profile (forte) stack walking is
  57   // always dangerous and suspect.
  58 
  59   enum { frame_never_safe = -1 };
  60 
  61 private:
  62   int _values[max_Entries];
  63   void check(int e) const { assert(0 <= e && e < max_Entries, "must be"); }
  64 
  65 public:
  66   CodeOffsets() {
  67     _values[Entry         ] = 0;
  68     _values[Verified_Entry] = 0;
  69     _values[Value_Entry   ] = 0;
  70     _values[Verified_Value_Entry] = -1;
  71     _values[Verified_Value_Entry_RO] = -1;
  72     _values[Frame_Complete] = frame_never_safe;
  73     _values[OSR_Entry     ] = 0;
  74     _values[Exceptions    ] = -1;
  75     _values[Deopt         ] = -1;
  76     _values[DeoptMH       ] = -1;
  77     _values[UnwindHandler ] = -1;
  78   }
  79 
  80   int value(Entries e) const { check(e); return _values[e]; }
  81   void set_value(Entries e, int val) { check(e);  _values[e] = val; }
  82 };
  83 
  84 // This class represents a stream of code and associated relocations.
  85 // There are a few in each CodeBuffer.
  86 // They are filled concurrently, and concatenated at the end.
  87 class CodeSection {
  88   friend class CodeBuffer;
  89  public:
  90   typedef int csize_t;  // code size type; would be size_t except for history
  91 
  92  private:
  93   address     _start;           // first byte of contents (instructions)
  94   address     _mark;            // user mark, usually an instruction beginning
  95   address     _end;             // current end address
  96   address     _limit;           // last possible (allocated) end address
  97   relocInfo*  _locs_start;      // first byte of relocation information
  98   relocInfo*  _locs_end;        // first byte after relocation information
  99   relocInfo*  _locs_limit;      // first byte after relocation information buf
 100   address     _locs_point;      // last relocated position (grows upward)
 101   bool        _locs_own;        // did I allocate the locs myself?


< prev index next >