| 105 | class FrameDesc; |
| 106 | |
| 107 | class CodeCache { |
| 108 | private: |
| 109 | char* _name; |
| 110 | short _lib_index; |
| 111 | const void* _min_address; |
| 112 | const void* _max_address; |
| 113 | const char* _text_base; |
| 114 | const char* _image_base; |
| 115 | |
| 116 | unsigned int _plt_offset; |
| 117 | unsigned int _plt_size; |
| 118 | |
| 119 | void** _imports[NUM_IMPORTS][NUM_IMPORT_TYPES]; |
| 120 | bool _imports_patchable; |
| 121 | bool _debug_symbols; |
| 122 | |
| 123 | FrameDesc* _dwarf_table; |
| 124 | int _dwarf_table_length; |
| 125 | |
| 126 | int _capacity; |
| 127 | int _count; |
| 128 | CodeBlob* _blobs; |
| 129 | |
| 130 | void expand(); |
| 131 | bool makeImportsPatchable(); |
| 132 | void saveImport(ImportId id, void** entry); |
| 133 | |
| 134 | public: |
| 135 | CodeCache(const char* name, |
| 136 | short lib_index = -1, |
| 137 | const void* min_address = NO_MIN_ADDRESS, |
| 138 | const void* max_address = NO_MAX_ADDRESS, |
| 139 | const char* image_base = NULL); |
| 140 | |
| 141 | ~CodeCache(); |
| 142 | |
| 143 | const char* name() const { |
| 144 | return _name; |
| 145 | } |
| 146 | |
| 147 | const void* minAddress() const { |
| 148 | return _min_address; |
| 149 | } |
| 150 | |
| 151 | const void* maxAddress() const { |
| 152 | return _max_address; |
| 153 | } |
| 154 | |
| 155 | const char* imageBase() const { |
| 156 | return _image_base; |
| 157 | } |
| 158 | |
| 159 | bool contains(const void* address) const { |
| 160 | return address >= _min_address && address < _max_address; |
| 161 | } |
| 162 | |
| 163 | void setTextBase(const char* text_base) { |
| 164 | _text_base = text_base; |
nothing calls this directly
no outgoing calls
no test coverage detected