< prev index next >

src/hotspot/share/asm/codeBuffer.hpp

Print this page

 24 
 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 PhaseCFG;
 35 class Compile;
 36 class BufferBlob;
 37 class CodeBuffer;
 38 class Label;
 39 
 40 class CodeOffsets: public StackObj {
 41 public:
 42   enum Entries { Entry,
 43                  Verified_Entry,



 44                  Frame_Complete, // Offset in the code where the frame setup is (for forte stackwalks) is complete
 45                  OSR_Entry,
 46                  Exceptions,     // Offset where exception handler lives
 47                  Deopt,          // Offset where deopt handler lives
 48                  DeoptMH,        // Offset where MethodHandle deopt handler lives
 49                  UnwindHandler,  // Offset to default unwind handler
 50                  max_Entries };
 51 
 52   // special value to note codeBlobs where profile (forte) stack walking is
 53   // always dangerous and suspect.
 54 
 55   enum { frame_never_safe = -1 };
 56 
 57 private:
 58   int _values[max_Entries];

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



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

 24 
 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 PhaseCFG;
 35 class Compile;
 36 class BufferBlob;
 37 class CodeBuffer;
 38 class Label;
 39 
 40 class CodeOffsets: public StackObj {
 41 public:
 42   enum Entries { Entry,
 43                  Verified_Entry,
 44                  Inline_Entry,
 45                  Verified_Inline_Entry,
 46                  Verified_Inline_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   void check(int e) const { assert(0 <= e && e < max_Entries, "must be"); }
 63 
 64 public:
 65   CodeOffsets() {
 66     _values[Entry         ] = 0;
 67     _values[Verified_Entry] = 0;
 68     _values[Inline_Entry  ] = 0;
 69     _values[Verified_Inline_Entry] = -1;
 70     _values[Verified_Inline_Entry_RO] = -1;
 71     _values[Frame_Complete] = frame_never_safe;
 72     _values[OSR_Entry     ] = 0;
 73     _values[Exceptions    ] = -1;
 74     _values[Deopt         ] = -1;
 75     _values[DeoptMH       ] = -1;
 76     _values[UnwindHandler ] = -1;
 77   }
 78 
 79   int value(Entries e) const { check(e); return _values[e]; }
 80   void set_value(Entries e, int val) { check(e); _values[e] = val; }
 81 };
 82 
 83 // This class represents a stream of code and associated relocations.
 84 // There are a few in each CodeBuffer.
 85 // They are filled concurrently, and concatenated at the end.
 86 class CodeSection {
 87   friend class CodeBuffer;
 88  public:
 89   typedef int csize_t;  // code size type; would be size_t except for history
 90 
 91  private:
 92   address     _start;           // first byte of contents (instructions)
 93   address     _mark;            // user mark, usually an instruction beginning
 94   address     _end;             // current end address
 95   address     _limit;           // last possible (allocated) end address
 96   relocInfo*  _locs_start;      // first byte of relocation information
 97   relocInfo*  _locs_end;        // first byte after relocation information
 98   relocInfo*  _locs_limit;      // first byte after relocation information buf
 99   address     _locs_point;      // last relocated position (grows upward)
100   bool        _locs_own;        // did I allocate the locs myself?
< prev index next >