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 | 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 Verified_Value_Entry, 46 Verified_Value_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 63 public: 64 CodeOffsets() { 65 _values[Entry ] = 0; 66 _values[Verified_Entry] = 0; 67 _values[Verified_Value_Entry] = -1; 68 _values[Verified_Value_Entry_RO] = -1; 69 _values[Frame_Complete] = frame_never_safe; 70 _values[OSR_Entry ] = 0; 71 _values[Exceptions ] = -1; 72 _values[Deopt ] = -1; 73 _values[DeoptMH ] = -1; 74 _values[UnwindHandler ] = -1; 75 } 76 77 int value(Entries e) { return _values[e]; } 78 void set_value(Entries e, int val) { _values[e] = val; } 79 }; 80 81 // This class represents a stream of code and associated relocations. 82 // There are a few in each CodeBuffer. 83 // They are filled concurrently, and concatenated at the end. 84 class CodeSection { 85 friend class CodeBuffer; 86 public: 87 typedef int csize_t; // code size type; would be size_t except for history 88 |