< prev index next >

src/hotspot/share/asm/codeBuffer.hpp

Print this page

 35 #include "utilities/resizeableResourceHash.hpp"
 36 #include "utilities/macros.hpp"
 37 
 38 template <typename T>
 39 static inline void put_native(address p, T x) {
 40     memcpy((void*)p, &x, sizeof x);
 41 }
 42 
 43 class PhaseCFG;
 44 class Compile;
 45 class BufferBlob;
 46 class CodeBuffer;
 47 class Label;
 48 class ciMethod;
 49 class SharedStubToInterpRequest;
 50 
 51 class CodeOffsets: public StackObj {
 52 public:
 53   enum Entries { Entry,
 54                  Verified_Entry,



 55                  Frame_Complete, // Offset in the code where the frame setup is (for forte stackwalks) is complete
 56                  OSR_Entry,
 57                  Exceptions,     // Offset where exception handler lives
 58                  Deopt,          // Offset where deopt handler lives
 59                  DeoptMH,        // Offset where MethodHandle deopt handler lives
 60                  UnwindHandler,  // Offset to default unwind handler
 61                  max_Entries };
 62 
 63   // special value to note codeBlobs where profile (forte) stack walking is
 64   // always dangerous and suspect.
 65 
 66   enum { frame_never_safe = -1 };
 67 
 68 private:
 69   int _values[max_Entries];

 70 
 71 public:
 72   CodeOffsets() {
 73     _values[Entry         ] = 0;
 74     _values[Verified_Entry] = 0;



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

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