36 #include "utilities/macros.hpp"
37 #include "utilities/resizableHashTable.hpp"
38
39 template <typename T>
40 static inline void put_native(address p, T x) {
41 memcpy((void*)p, &x, sizeof x);
42 }
43
44 class PhaseCFG;
45 class Compile;
46 class BufferBlob;
47 class CodeBuffer;
48 class Label;
49 class ciMethod;
50 class SharedStubToInterpRequest;
51
52 class CodeOffsets: public StackObj {
53 public:
54 enum Entries { Entry,
55 Verified_Entry,
56 Frame_Complete, // Offset in the code where the frame setup is (for forte stackwalks) is complete
57 OSR_Entry,
58 Exceptions, // Offset where exception handler lives
59 Deopt, // Offset where 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[UnwindHandler ] = -1;
80 }
81
82 int value(Entries e) { return _values[e]; }
83 void set_value(Entries e, int val) { _values[e] = val; }
84 };
85
86 // This class represents a stream of code and associated relocations.
87 // There are a few in each CodeBuffer.
88 // They are filled concurrently, and concatenated at the end.
89 class CodeSection {
90 friend class CodeBuffer;
91 friend class AOTCodeReader;
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)
|
36 #include "utilities/macros.hpp"
37 #include "utilities/resizableHashTable.hpp"
38
39 template <typename T>
40 static inline void put_native(address p, T x) {
41 memcpy((void*)p, &x, sizeof x);
42 }
43
44 class PhaseCFG;
45 class Compile;
46 class BufferBlob;
47 class CodeBuffer;
48 class Label;
49 class ciMethod;
50 class SharedStubToInterpRequest;
51
52 class CodeOffsets: public StackObj {
53 public:
54 enum Entries { Entry,
55 Verified_Entry,
56 Inline_Entry,
57 Verified_Inline_Entry,
58 Verified_Inline_Entry_RO,
59 Frame_Complete, // Offset in the code where the frame setup is (for forte stackwalks) is complete
60 OSR_Entry,
61 Exceptions, // Offset where exception handler lives
62 Deopt, // Offset where 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[UnwindHandler ] = -1;
87 }
88
89 int value(Entries e) const { check(e); return _values[e]; }
90 void set_value(Entries e, int val) { check(e); _values[e] = val; }
91 };
92
93 // This class represents a stream of code and associated relocations.
94 // There are a few in each CodeBuffer.
95 // They are filled concurrently, and concatenated at the end.
96 class CodeSection {
97 friend class CodeBuffer;
98 friend class AOTCodeReader;
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)
|