200 void set_end(address pc) { assert(allocates2(pc), "not in CodeBuffer memory: " INTPTR_FORMAT " <= " INTPTR_FORMAT " <= " INTPTR_FORMAT, p2i(_start), p2i(pc), p2i(_limit)); _end = pc; }
201 void set_mark(address pc) { assert(contains2(pc), "not in codeBuffer");
202 _mark = pc; }
203 void set_mark() { _mark = _end; }
204 void clear_mark() { _mark = nullptr; }
205
206 void set_locs_end(relocInfo* p) {
207 assert(p <= locs_limit(), "locs data fits in allocated buffer");
208 _locs_end = p;
209 }
210 void set_locs_point(address pc) {
211 assert(pc >= locs_point(), "relocation addr may not decrease");
212 assert(allocates2(pc), "relocation addr " INTPTR_FORMAT " must be in this section from " INTPTR_FORMAT " to " INTPTR_FORMAT, p2i(pc), p2i(_start), p2i(_limit));
213 _locs_point = pc;
214 }
215
216 void register_skipped(int size) {
217 _skipped_instructions_size += size;
218 }
219
220 // Code emission
221 void emit_int8(uint8_t x1) {
222 address curr = end();
223 *((uint8_t*) curr++) = x1;
224 set_end(curr);
225 }
226
227 template <typename T>
228 void emit_native(T x) { put_native(end(), x); set_end(end() + sizeof x); }
229
230 void emit_int16(uint16_t x) { emit_native(x); }
231 void emit_int16(uint8_t x1, uint8_t x2) {
232 address curr = end();
233 *((uint8_t*) curr++) = x1;
234 *((uint8_t*) curr++) = x2;
235 set_end(curr);
236 }
237
238 void emit_int24(uint8_t x1, uint8_t x2, uint8_t x3) {
239 address curr = end();
|
200 void set_end(address pc) { assert(allocates2(pc), "not in CodeBuffer memory: " INTPTR_FORMAT " <= " INTPTR_FORMAT " <= " INTPTR_FORMAT, p2i(_start), p2i(pc), p2i(_limit)); _end = pc; }
201 void set_mark(address pc) { assert(contains2(pc), "not in codeBuffer");
202 _mark = pc; }
203 void set_mark() { _mark = _end; }
204 void clear_mark() { _mark = nullptr; }
205
206 void set_locs_end(relocInfo* p) {
207 assert(p <= locs_limit(), "locs data fits in allocated buffer");
208 _locs_end = p;
209 }
210 void set_locs_point(address pc) {
211 assert(pc >= locs_point(), "relocation addr may not decrease");
212 assert(allocates2(pc), "relocation addr " INTPTR_FORMAT " must be in this section from " INTPTR_FORMAT " to " INTPTR_FORMAT, p2i(pc), p2i(_start), p2i(_limit));
213 _locs_point = pc;
214 }
215
216 void register_skipped(int size) {
217 _skipped_instructions_size += size;
218 }
219
220 void set_skipped(int size) {
221 _skipped_instructions_size = size;
222 }
223
224 int get_skipped() {
225 return _skipped_instructions_size;
226 }
227
228 // Code emission
229 void emit_int8(uint8_t x1) {
230 address curr = end();
231 *((uint8_t*) curr++) = x1;
232 set_end(curr);
233 }
234
235 template <typename T>
236 void emit_native(T x) { put_native(end(), x); set_end(end() + sizeof x); }
237
238 void emit_int16(uint16_t x) { emit_native(x); }
239 void emit_int16(uint8_t x1, uint8_t x2) {
240 address curr = end();
241 *((uint8_t*) curr++) = x1;
242 *((uint8_t*) curr++) = x2;
243 set_end(curr);
244 }
245
246 void emit_int24(uint8_t x1, uint8_t x2, uint8_t x3) {
247 address curr = end();
|