< prev index next >

src/hotspot/share/asm/codeBuffer.hpp

Print this page




  25 #ifndef SHARE_ASM_CODEBUFFER_HPP
  26 #define SHARE_ASM_CODEBUFFER_HPP
  27 
  28 #include "code/oopRecorder.hpp"
  29 #include "code/relocInfo.hpp"
  30 #include "utilities/align.hpp"
  31 #include "utilities/debug.hpp"
  32 #include "utilities/macros.hpp"
  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                  Frame_Complete, // Offset in the code where the frame setup is (for forte stackwalks) is complete
  46                  OSR_Entry,
  47                  Exceptions,     // Offset where exception handler lives
  48                  Deopt,          // Offset where deopt handler lives
  49                  DeoptMH,        // Offset where MethodHandle deopt handler lives
  50                  UnwindHandler,  // Offset to default unwind handler
  51                  max_Entries };
  52 
  53   // special value to note codeBlobs where profile (forte) stack walking is
  54   // always dangerous and suspect.
  55 
  56   enum { frame_never_safe = -1 };
  57 
  58 private:
  59   int _values[max_Entries];

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



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




  25 #ifndef SHARE_ASM_CODEBUFFER_HPP
  26 #define SHARE_ASM_CODEBUFFER_HPP
  27 
  28 #include "code/oopRecorder.hpp"
  29 #include "code/relocInfo.hpp"
  30 #include "utilities/align.hpp"
  31 #include "utilities/debug.hpp"
  32 #include "utilities/macros.hpp"
  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                  Value_Entry,
  46                  Verified_Value_Entry,
  47                  Verified_Value_Entry_RO,
  48                  Frame_Complete, // Offset in the code where the frame setup is (for forte stackwalks) is complete
  49                  OSR_Entry,
  50                  Exceptions,     // Offset where exception handler lives
  51                  Deopt,          // Offset where deopt handler lives
  52                  DeoptMH,        // Offset where MethodHandle deopt handler lives
  53                  UnwindHandler,  // Offset to default unwind handler
  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 >