36 #include "utilities/resizeableResourceHash.hpp"
37 #include "utilities/macros.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 DeoptMH, // Offset where MethodHandle deopt handler lives
61 UnwindHandler, // Offset to default unwind handler
62 max_Entries };
63
64 // special value to note codeBlobs where profile (forte) stack walking is
65 // always dangerous and suspect.
66
67 enum { frame_never_safe = -1 };
68
69 private:
70 int _values[max_Entries];
71
72 public:
73 CodeOffsets() {
74 _values[Entry ] = 0;
75 _values[Verified_Entry] = 0;
76 _values[Frame_Complete] = frame_never_safe;
77 _values[OSR_Entry ] = 0;
78 _values[Exceptions ] = -1;
79 _values[Deopt ] = -1;
80 _values[DeoptMH ] = -1;
81 _values[UnwindHandler ] = -1;
82 }
83
84 int value(Entries e) { return _values[e]; }
85 void set_value(Entries e, int val) { _values[e] = val; }
86 };
87
88 // This class represents a stream of code and associated relocations.
89 // There are a few in each CodeBuffer.
90 // They are filled concurrently, and concatenated at the end.
91 class CodeSection {
92 friend class CodeBuffer;
93 friend class AOTCodeReader;
94 public:
95 typedef int csize_t; // code size type; would be size_t except for history
96
97 private:
98 address _start; // first byte of contents (instructions)
99 address _mark; // user mark, usually an instruction beginning
100 address _end; // current end address
101 address _limit; // last possible (allocated) end address
102 relocInfo* _locs_start; // first byte of relocation information
103 relocInfo* _locs_end; // first byte after relocation information
104 relocInfo* _locs_limit; // first byte after relocation information buf
105 address _locs_point; // last relocated position (grows upward)
|
36 #include "utilities/resizeableResourceHash.hpp"
37 #include "utilities/macros.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 DeoptMH, // Offset where MethodHandle deopt handler lives
64 UnwindHandler, // Offset to default unwind handler
65 max_Entries };
66
67 // special value to note codeBlobs where profile (forte) stack walking is
68 // always dangerous and suspect.
69
70 enum { frame_never_safe = -1 };
71
72 private:
73 int _values[max_Entries];
74 void check(int e) const { assert(0 <= e && e < max_Entries, "must be"); }
75
76 public:
77 CodeOffsets() {
78 _values[Entry ] = 0;
79 _values[Verified_Entry] = 0;
80 _values[Inline_Entry ] = 0;
81 _values[Verified_Inline_Entry] = -1;
82 _values[Verified_Inline_Entry_RO] = -1;
83 _values[Frame_Complete] = frame_never_safe;
84 _values[OSR_Entry ] = 0;
85 _values[Exceptions ] = -1;
86 _values[Deopt ] = -1;
87 _values[DeoptMH ] = -1;
88 _values[UnwindHandler ] = -1;
89 }
90
91 int value(Entries e) const { check(e); return _values[e]; }
92 void set_value(Entries e, int val) { check(e); _values[e] = val; }
93 };
94
95 // This class represents a stream of code and associated relocations.
96 // There are a few in each CodeBuffer.
97 // They are filled concurrently, and concatenated at the end.
98 class CodeSection {
99 friend class CodeBuffer;
100 friend class AOTCodeReader;
101 public:
102 typedef int csize_t; // code size type; would be size_t except for history
103
104 private:
105 address _start; // first byte of contents (instructions)
106 address _mark; // user mark, usually an instruction beginning
107 address _end; // current end address
108 address _limit; // last possible (allocated) end address
109 relocInfo* _locs_start; // first byte of relocation information
110 relocInfo* _locs_end; // first byte after relocation information
111 relocInfo* _locs_limit; // first byte after relocation information buf
112 address _locs_point; // last relocated position (grows upward)
|