Print this page
Split |
Close |
Expand all |
Collapse all |
--- old/src/share/vm/code/relocInfo.cpp
+++ new/src/share/vm/code/relocInfo.cpp
1 1 /*
2 - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
2 + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved.
3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 4 *
5 5 * This code is free software; you can redistribute it and/or modify it
6 6 * under the terms of the GNU General Public License version 2 only, as
7 7 * published by the Free Software Foundation.
8 8 *
9 9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 12 * version 2 for more details (a copy is included in the LICENSE file that
13 13 * accompanied this code).
14 14 *
15 15 * You should have received a copy of the GNU General Public License version
16 16 * 2 along with this work; if not, write to the Free Software Foundation,
17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 18 *
19 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 21 * have any questions.
22 22 *
23 23 */
24 24
25 25 # include "incls/_precompiled.incl"
26 26 # include "incls/_relocInfo.cpp.incl"
27 27
28 28
29 29 const RelocationHolder RelocationHolder::none; // its type is relocInfo::none
30 30
31 31
32 32 // Implementation of relocInfo
33 33
34 34 #ifdef ASSERT
35 35 relocInfo::relocInfo(relocType t, int off, int f) {
36 36 assert(t != data_prefix_tag, "cannot build a prefix this way");
37 37 assert((t & type_mask) == t, "wrong type");
38 38 assert((f & format_mask) == f, "wrong format");
39 39 assert(off >= 0 && off < offset_limit(), "offset out off bounds");
40 40 assert((off & (offset_unit-1)) == 0, "misaligned offset");
41 41 (*this) = relocInfo(t, RAW_BITS, off, f);
42 42 }
43 43 #endif
44 44
45 45 void relocInfo::initialize(CodeSection* dest, Relocation* reloc) {
46 46 relocInfo* data = this+1; // here's where the data might go
47 47 dest->set_locs_end(data); // sync end: the next call may read dest.locs_end
48 48 reloc->pack_data_to(dest); // maybe write data into locs, advancing locs_end
49 49 relocInfo* data_limit = dest->locs_end();
50 50 if (data_limit > data) {
51 51 relocInfo suffix = (*this);
52 52 data_limit = this->finish_prefix((short*) data_limit);
53 53 // Finish up with the suffix. (Hack note: pack_data_to might edit this.)
54 54 *data_limit = suffix;
55 55 dest->set_locs_end(data_limit+1);
56 56 }
57 57 }
58 58
59 59 relocInfo* relocInfo::finish_prefix(short* prefix_limit) {
60 60 assert(sizeof(relocInfo) == sizeof(short), "change this code");
61 61 short* p = (short*)(this+1);
62 62 assert(prefix_limit >= p, "must be a valid span of data");
63 63 int plen = prefix_limit - p;
64 64 if (plen == 0) {
65 65 debug_only(_value = 0xFFFF);
66 66 return this; // no data: remove self completely
67 67 }
68 68 if (plen == 1 && fits_into_immediate(p[0])) {
69 69 (*this) = immediate_relocInfo(p[0]); // move data inside self
70 70 return this+1;
71 71 }
72 72 // cannot compact, so just update the count and return the limit pointer
73 73 (*this) = prefix_relocInfo(plen); // write new datalen
74 74 assert(data() + datalen() == prefix_limit, "pointers must line up");
75 75 return (relocInfo*)prefix_limit;
76 76 }
77 77
78 78
79 79 void relocInfo::set_type(relocType t) {
80 80 int old_offset = addr_offset();
81 81 int old_format = format();
82 82 (*this) = relocInfo(t, old_offset, old_format);
83 83 assert(type()==(int)t, "sanity check");
84 84 assert(addr_offset()==old_offset, "sanity check");
85 85 assert(format()==old_format, "sanity check");
86 86 }
87 87
88 88
89 89 void relocInfo::set_format(int f) {
90 90 int old_offset = addr_offset();
91 91 assert((f & format_mask) == f, "wrong format");
92 92 _value = (_value & ~(format_mask << offset_width)) | (f << offset_width);
93 93 assert(addr_offset()==old_offset, "sanity check");
94 94 }
95 95
96 96
97 97 void relocInfo::change_reloc_info_for_address(RelocIterator *itr, address pc, relocType old_type, relocType new_type) {
98 98 bool found = false;
99 99 while (itr->next() && !found) {
100 100 if (itr->addr() == pc) {
101 101 assert(itr->type()==old_type, "wrong relocInfo type found");
102 102 itr->current()->set_type(new_type);
103 103 found=true;
104 104 }
105 105 }
106 106 assert(found, "no relocInfo found for pc");
107 107 }
↓ open down ↓ |
95 lines elided |
↑ open up ↑ |
108 108
109 109
110 110 void relocInfo::remove_reloc_info_for_address(RelocIterator *itr, address pc, relocType old_type) {
111 111 change_reloc_info_for_address(itr, pc, old_type, none);
112 112 }
113 113
114 114
115 115 // ----------------------------------------------------------------------------------------------------
116 116 // Implementation of RelocIterator
117 117
118 -void RelocIterator::initialize(CodeBlob* cb, address begin, address limit) {
118 +void RelocIterator::initialize(nmethod* nm, address begin, address limit) {
119 119 initialize_misc();
120 120
121 - if (cb == NULL && begin != NULL) {
122 - // allow CodeBlob to be deduced from beginning address
123 - cb = CodeCache::find_blob(begin);
124 - }
125 - assert(cb != NULL, "must be able to deduce nmethod from other arguments");
126 -
127 - _code = cb;
128 - _current = cb->relocation_begin()-1;
129 - _end = cb->relocation_end();
130 - _addr = (address) cb->instructions_begin();
121 + if (nm == NULL && begin != NULL) {
122 + // allow nmethod to be deduced from beginning address
123 + CodeBlob* cb = CodeCache::find_blob(begin);
124 + nm = cb->as_nmethod_or_null();
125 + }
126 + assert(nm != NULL, "must be able to deduce nmethod from other arguments");
127 +
128 + _code = nm;
129 + _current = nm->relocation_begin() - 1;
130 + _end = nm->relocation_end();
131 + _addr = (address) nm->instructions_begin();
131 132
132 133 assert(!has_current(), "just checking");
133 - address code_end = cb->instructions_end();
134 + address code_end = nm->instructions_end();
134 135
135 - assert(begin == NULL || begin >= cb->instructions_begin(), "in bounds");
136 + assert(begin == NULL || begin >= nm->instructions_begin(), "in bounds");
136 137 // FIX THIS assert(limit == NULL || limit <= code_end, "in bounds");
137 138 set_limits(begin, limit);
138 139 }
139 140
140 141
141 142 RelocIterator::RelocIterator(CodeSection* cs, address begin, address limit) {
142 143 initialize_misc();
143 144
144 145 _current = cs->locs_start()-1;
145 146 _end = cs->locs_end();
146 147 _addr = cs->start();
147 148 _code = NULL; // Not cb->blob();
148 149
149 150 CodeBuffer* cb = cs->outer();
150 151 assert((int)SECT_LIMIT == CodeBuffer::SECT_LIMIT, "my copy must be equal");
151 152 for (int n = 0; n < (int)SECT_LIMIT; n++) {
152 153 _section_start[n] = cb->code_section(n)->start();
153 154 }
154 155
155 156 assert(!has_current(), "just checking");
156 157
157 158 assert(begin == NULL || begin >= cs->start(), "in bounds");
158 159 assert(limit == NULL || limit <= cs->end(), "in bounds");
159 160 set_limits(begin, limit);
160 161 }
161 162
162 163
163 164 enum { indexCardSize = 128 };
164 165 struct RelocIndexEntry {
165 166 jint addr_offset; // offset from header_end of an addr()
166 167 jint reloc_offset; // offset from header_end of a relocInfo (prefix)
167 168 };
168 169
169 170
170 171 static inline int num_cards(int code_size) {
171 172 return (code_size-1) / indexCardSize;
172 173 }
173 174
174 175
175 176 int RelocIterator::locs_and_index_size(int code_size, int locs_size) {
176 177 if (!UseRelocIndex) return locs_size; // no index
177 178 code_size = round_to(code_size, oopSize);
178 179 locs_size = round_to(locs_size, oopSize);
179 180 int index_size = num_cards(code_size) * sizeof(RelocIndexEntry);
180 181 // format of indexed relocs:
181 182 // relocation_begin: relocInfo ...
182 183 // index: (addr,reloc#) ...
183 184 // indexSize :relocation_end
184 185 return locs_size + index_size + BytesPerInt;
185 186 }
186 187
187 188
188 189 void RelocIterator::create_index(relocInfo* dest_begin, int dest_count, relocInfo* dest_end) {
189 190 address relocation_begin = (address)dest_begin;
190 191 address relocation_end = (address)dest_end;
191 192 int total_size = relocation_end - relocation_begin;
192 193 int locs_size = dest_count * sizeof(relocInfo);
193 194 if (!UseRelocIndex) {
194 195 Copy::fill_to_bytes(relocation_begin + locs_size, total_size-locs_size, 0);
195 196 return;
196 197 }
197 198 int index_size = total_size - locs_size - BytesPerInt; // find out how much space is left
198 199 int ncards = index_size / sizeof(RelocIndexEntry);
199 200 assert(total_size == locs_size + index_size + BytesPerInt, "checkin'");
200 201 assert(index_size >= 0 && index_size % sizeof(RelocIndexEntry) == 0, "checkin'");
201 202 jint* index_size_addr = (jint*)relocation_end - 1;
202 203
203 204 assert(sizeof(jint) == BytesPerInt, "change this code");
204 205
205 206 *index_size_addr = index_size;
206 207 if (index_size != 0) {
207 208 assert(index_size > 0, "checkin'");
208 209
209 210 RelocIndexEntry* index = (RelocIndexEntry *)(relocation_begin + locs_size);
210 211 assert(index == (RelocIndexEntry*)index_size_addr - ncards, "checkin'");
211 212
212 213 // walk over the relocations, and fill in index entries as we go
213 214 RelocIterator iter;
214 215 const address initial_addr = NULL;
215 216 relocInfo* const initial_current = dest_begin - 1; // biased by -1 like elsewhere
216 217
217 218 iter._code = NULL;
218 219 iter._addr = initial_addr;
219 220 iter._limit = (address)(intptr_t)(ncards * indexCardSize);
220 221 iter._current = initial_current;
221 222 iter._end = dest_begin + dest_count;
222 223
223 224 int i = 0;
224 225 address next_card_addr = (address)indexCardSize;
225 226 int addr_offset = 0;
226 227 int reloc_offset = 0;
227 228 while (true) {
228 229 // Checkpoint the iterator before advancing it.
229 230 addr_offset = iter._addr - initial_addr;
230 231 reloc_offset = iter._current - initial_current;
231 232 if (!iter.next()) break;
232 233 while (iter.addr() >= next_card_addr) {
233 234 index[i].addr_offset = addr_offset;
234 235 index[i].reloc_offset = reloc_offset;
235 236 i++;
236 237 next_card_addr += indexCardSize;
237 238 }
238 239 }
239 240 while (i < ncards) {
240 241 index[i].addr_offset = addr_offset;
241 242 index[i].reloc_offset = reloc_offset;
242 243 i++;
243 244 }
244 245 }
245 246 }
246 247
247 248
248 249 void RelocIterator::set_limits(address begin, address limit) {
249 250 int index_size = 0;
250 251 if (UseRelocIndex && _code != NULL) {
251 252 index_size = ((jint*)_end)[-1];
252 253 _end = (relocInfo*)( (address)_end - index_size - BytesPerInt );
253 254 }
254 255
255 256 _limit = limit;
256 257
257 258 // the limit affects this next stuff:
258 259 if (begin != NULL) {
259 260 #ifdef ASSERT
260 261 // In ASSERT mode we do not actually use the index, but simply
261 262 // check that its contents would have led us to the right answer.
262 263 address addrCheck = _addr;
263 264 relocInfo* infoCheck = _current;
264 265 #endif // ASSERT
265 266 if (index_size > 0) {
266 267 // skip ahead
267 268 RelocIndexEntry* index = (RelocIndexEntry*)_end;
268 269 RelocIndexEntry* index_limit = (RelocIndexEntry*)((address)index + index_size);
269 270 assert(_addr == _code->instructions_begin(), "_addr must be unadjusted");
270 271 int card = (begin - _addr) / indexCardSize;
271 272 if (card > 0) {
272 273 if (index+card-1 < index_limit) index += card-1;
273 274 else index = index_limit - 1;
274 275 #ifdef ASSERT
275 276 addrCheck = _addr + index->addr_offset;
276 277 infoCheck = _current + index->reloc_offset;
277 278 #else
278 279 // Advance the iterator immediately to the last valid state
279 280 // for the previous card. Calling "next" will then advance
280 281 // it to the first item on the required card.
281 282 _addr += index->addr_offset;
282 283 _current += index->reloc_offset;
283 284 #endif // ASSERT
284 285 }
285 286 }
286 287
287 288 relocInfo* backup;
288 289 address backup_addr;
289 290 while (true) {
290 291 backup = _current;
291 292 backup_addr = _addr;
292 293 #ifdef ASSERT
293 294 if (backup == infoCheck) {
294 295 assert(backup_addr == addrCheck, "must match"); addrCheck = NULL; infoCheck = NULL;
295 296 } else {
296 297 assert(addrCheck == NULL || backup_addr <= addrCheck, "must not pass addrCheck");
297 298 }
298 299 #endif // ASSERT
299 300 if (!next() || addr() >= begin) break;
300 301 }
301 302 assert(addrCheck == NULL || addrCheck == backup_addr, "must have matched addrCheck");
302 303 assert(infoCheck == NULL || infoCheck == backup, "must have matched infoCheck");
303 304 // At this point, either we are at the first matching record,
304 305 // or else there is no such record, and !has_current().
305 306 // In either case, revert to the immediatly preceding state.
306 307 _current = backup;
307 308 _addr = backup_addr;
308 309 set_has_current(false);
309 310 }
310 311 }
311 312
312 313
313 314 void RelocIterator::set_limit(address limit) {
314 315 address code_end = (address)code() + code()->size();
315 316 assert(limit == NULL || limit <= code_end, "in bounds");
316 317 _limit = limit;
317 318 }
318 319
319 320
320 321 void PatchingRelocIterator:: prepass() {
321 322 // turn breakpoints off during patching
322 323 _init_state = (*this); // save cursor
323 324 while (next()) {
324 325 if (type() == relocInfo::breakpoint_type) {
325 326 breakpoint_reloc()->set_active(false);
326 327 }
327 328 }
328 329 (RelocIterator&)(*this) = _init_state; // reset cursor for client
329 330 }
330 331
331 332
332 333 void PatchingRelocIterator:: postpass() {
333 334 // turn breakpoints back on after patching
334 335 (RelocIterator&)(*this) = _init_state; // reset cursor again
335 336 while (next()) {
336 337 if (type() == relocInfo::breakpoint_type) {
337 338 breakpoint_Relocation* bpt = breakpoint_reloc();
338 339 bpt->set_active(bpt->enabled());
339 340 }
340 341 }
341 342 }
342 343
343 344
344 345 // All the strange bit-encodings are in here.
345 346 // The idea is to encode relocation data which are small integers
346 347 // very efficiently (a single extra halfword). Larger chunks of
347 348 // relocation data need a halfword header to hold their size.
348 349 void RelocIterator::advance_over_prefix() {
349 350 if (_current->is_datalen()) {
350 351 _data = (short*) _current->data();
351 352 _datalen = _current->datalen();
352 353 _current += _datalen + 1; // skip the embedded data & header
353 354 } else {
354 355 _databuf = _current->immediate();
355 356 _data = &_databuf;
356 357 _datalen = 1;
357 358 _current++; // skip the header
358 359 }
359 360 // The client will see the following relocInfo, whatever that is.
360 361 // It is the reloc to which the preceding data applies.
361 362 }
362 363
363 364
364 365 address RelocIterator::compute_section_start(int n) const {
365 366 // This routine not only computes a section start, but also
366 367 // memoizes it for later.
367 368 #define CACHE ((RelocIterator*)this)->_section_start[n]
368 369 CodeBlob* cb = code();
369 370 guarantee(cb != NULL, "must have a code blob");
370 371 if (n == CodeBuffer::SECT_INSTS)
371 372 return CACHE = cb->instructions_begin();
372 373 assert(cb->is_nmethod(), "only nmethods have these sections");
373 374 nmethod* nm = (nmethod*) cb;
374 375 address res = NULL;
375 376 switch (n) {
376 377 case CodeBuffer::SECT_STUBS:
377 378 res = nm->stub_begin();
378 379 break;
379 380 case CodeBuffer::SECT_CONSTS:
380 381 res = nm->consts_begin();
381 382 break;
382 383 default:
383 384 ShouldNotReachHere();
384 385 }
385 386 assert(nm->contains(res) || res == nm->instructions_end(), "tame pointer");
386 387 CACHE = res;
387 388 return res;
388 389 #undef CACHE
389 390 }
390 391
391 392
392 393 Relocation* RelocIterator::reloc() {
393 394 // (take the "switch" out-of-line)
394 395 relocInfo::relocType t = type();
395 396 if (false) {}
396 397 #define EACH_TYPE(name) \
397 398 else if (t == relocInfo::name##_type) { \
398 399 return name##_reloc(); \
399 400 }
400 401 APPLY_TO_RELOCATIONS(EACH_TYPE);
401 402 #undef EACH_TYPE
402 403 assert(t == relocInfo::none, "must be padding");
403 404 return new(_rh) Relocation();
404 405 }
405 406
406 407
407 408 //////// Methods for flyweight Relocation types
408 409
409 410
410 411 RelocationHolder RelocationHolder::plus(int offset) const {
411 412 if (offset != 0) {
412 413 switch (type()) {
413 414 case relocInfo::none:
414 415 break;
415 416 case relocInfo::oop_type:
416 417 {
417 418 oop_Relocation* r = (oop_Relocation*)reloc();
418 419 return oop_Relocation::spec(r->oop_index(), r->offset() + offset);
419 420 }
420 421 default:
421 422 ShouldNotReachHere();
422 423 }
423 424 }
424 425 return (*this);
425 426 }
426 427
427 428
428 429 void Relocation::guarantee_size() {
429 430 guarantee(false, "Make _relocbuf bigger!");
430 431 }
431 432
432 433 // some relocations can compute their own values
433 434 address Relocation::value() {
434 435 ShouldNotReachHere();
435 436 return NULL;
436 437 }
437 438
438 439
439 440 void Relocation::set_value(address x) {
440 441 ShouldNotReachHere();
441 442 }
442 443
443 444
444 445 RelocationHolder Relocation::spec_simple(relocInfo::relocType rtype) {
445 446 if (rtype == relocInfo::none) return RelocationHolder::none;
446 447 relocInfo ri = relocInfo(rtype, 0);
447 448 RelocIterator itr;
448 449 itr.set_current(ri);
449 450 itr.reloc();
450 451 return itr._rh;
451 452 }
452 453
453 454
454 455 static inline bool is_index(intptr_t index) {
455 456 return 0 < index && index < os::vm_page_size();
456 457 }
457 458
458 459
459 460 int32_t Relocation::runtime_address_to_index(address runtime_address) {
460 461 assert(!is_index((intptr_t)runtime_address), "must not look like an index");
461 462
462 463 if (runtime_address == NULL) return 0;
463 464
464 465 StubCodeDesc* p = StubCodeDesc::desc_for(runtime_address);
465 466 if (p != NULL && p->begin() == runtime_address) {
466 467 assert(is_index(p->index()), "there must not be too many stubs");
467 468 return (int32_t)p->index();
468 469 } else {
469 470 // Known "miscellaneous" non-stub pointers:
470 471 // os::get_polling_page(), SafepointSynchronize::address_of_state()
471 472 if (PrintRelocations) {
472 473 tty->print_cr("random unregistered address in relocInfo: " INTPTR_FORMAT, runtime_address);
473 474 }
474 475 #ifndef _LP64
475 476 return (int32_t) (intptr_t)runtime_address;
476 477 #else
477 478 // didn't fit return non-index
478 479 return -1;
479 480 #endif /* _LP64 */
480 481 }
481 482 }
482 483
483 484
484 485 address Relocation::index_to_runtime_address(int32_t index) {
485 486 if (index == 0) return NULL;
486 487
487 488 if (is_index(index)) {
488 489 StubCodeDesc* p = StubCodeDesc::desc_for_index(index);
489 490 assert(p != NULL, "there must be a stub for this index");
490 491 return p->begin();
491 492 } else {
492 493 #ifndef _LP64
493 494 // this only works on 32bit machines
494 495 return (address) ((intptr_t) index);
495 496 #else
496 497 fatal("Relocation::index_to_runtime_address, int32_t not pointer sized");
497 498 return NULL;
498 499 #endif /* _LP64 */
499 500 }
500 501 }
501 502
502 503 address Relocation::old_addr_for(address newa,
503 504 const CodeBuffer* src, CodeBuffer* dest) {
504 505 int sect = dest->section_index_of(newa);
505 506 guarantee(sect != CodeBuffer::SECT_NONE, "lost track of this address");
506 507 address ostart = src->code_section(sect)->start();
507 508 address nstart = dest->code_section(sect)->start();
508 509 return ostart + (newa - nstart);
509 510 }
510 511
511 512 address Relocation::new_addr_for(address olda,
512 513 const CodeBuffer* src, CodeBuffer* dest) {
513 514 debug_only(const CodeBuffer* src0 = src);
514 515 int sect = CodeBuffer::SECT_NONE;
515 516 // Look for olda in the source buffer, and all previous incarnations
516 517 // if the source buffer has been expanded.
517 518 for (; src != NULL; src = src->before_expand()) {
518 519 sect = src->section_index_of(olda);
519 520 if (sect != CodeBuffer::SECT_NONE) break;
520 521 }
521 522 guarantee(sect != CodeBuffer::SECT_NONE, "lost track of this address");
522 523 address ostart = src->code_section(sect)->start();
523 524 address nstart = dest->code_section(sect)->start();
524 525 return nstart + (olda - ostart);
525 526 }
526 527
527 528 void Relocation::normalize_address(address& addr, const CodeSection* dest, bool allow_other_sections) {
528 529 address addr0 = addr;
529 530 if (addr0 == NULL || dest->allocates2(addr0)) return;
530 531 CodeBuffer* cb = dest->outer();
531 532 addr = new_addr_for(addr0, cb, cb);
532 533 assert(allow_other_sections || dest->contains2(addr),
533 534 "addr must be in required section");
534 535 }
535 536
536 537
537 538 void CallRelocation::set_destination(address x) {
538 539 pd_set_call_destination(x);
539 540 }
540 541
541 542 void CallRelocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
542 543 // Usually a self-relative reference to an external routine.
543 544 // On some platforms, the reference is absolute (not self-relative).
544 545 // The enhanced use of pd_call_destination sorts this all out.
545 546 address orig_addr = old_addr_for(addr(), src, dest);
546 547 address callee = pd_call_destination(orig_addr);
547 548 // Reassert the callee address, this time in the new copy of the code.
548 549 pd_set_call_destination(callee);
549 550 }
550 551
551 552
552 553 //// pack/unpack methods
553 554
554 555 void oop_Relocation::pack_data_to(CodeSection* dest) {
555 556 short* p = (short*) dest->locs_end();
556 557 p = pack_2_ints_to(p, _oop_index, _offset);
557 558 dest->set_locs_end((relocInfo*) p);
558 559 }
559 560
560 561
561 562 void oop_Relocation::unpack_data() {
562 563 unpack_2_ints(_oop_index, _offset);
563 564 }
564 565
565 566
566 567 void virtual_call_Relocation::pack_data_to(CodeSection* dest) {
567 568 short* p = (short*) dest->locs_end();
568 569 address point = dest->locs_point();
569 570
570 571 // Try to make a pointer NULL first.
571 572 if (_oop_limit >= point &&
572 573 _oop_limit <= point + NativeCall::instruction_size) {
573 574 _oop_limit = NULL;
574 575 }
575 576 // If the _oop_limit is NULL, it "defaults" to the end of the call.
576 577 // See ic_call_Relocation::oop_limit() below.
577 578
578 579 normalize_address(_first_oop, dest);
579 580 normalize_address(_oop_limit, dest);
580 581 jint x0 = scaled_offset_null_special(_first_oop, point);
581 582 jint x1 = scaled_offset_null_special(_oop_limit, point);
582 583 p = pack_2_ints_to(p, x0, x1);
583 584 dest->set_locs_end((relocInfo*) p);
584 585 }
585 586
586 587
587 588 void virtual_call_Relocation::unpack_data() {
588 589 jint x0, x1; unpack_2_ints(x0, x1);
589 590 address point = addr();
590 591 _first_oop = x0==0? NULL: address_from_scaled_offset(x0, point);
591 592 _oop_limit = x1==0? NULL: address_from_scaled_offset(x1, point);
592 593 }
593 594
594 595
595 596 void static_stub_Relocation::pack_data_to(CodeSection* dest) {
596 597 short* p = (short*) dest->locs_end();
597 598 CodeSection* insts = dest->outer()->insts();
598 599 normalize_address(_static_call, insts);
599 600 p = pack_1_int_to(p, scaled_offset(_static_call, insts->start()));
600 601 dest->set_locs_end((relocInfo*) p);
601 602 }
602 603
603 604 void static_stub_Relocation::unpack_data() {
604 605 address base = binding()->section_start(CodeBuffer::SECT_INSTS);
605 606 _static_call = address_from_scaled_offset(unpack_1_int(), base);
606 607 }
607 608
608 609
609 610 void external_word_Relocation::pack_data_to(CodeSection* dest) {
610 611 short* p = (short*) dest->locs_end();
611 612 int32_t index = runtime_address_to_index(_target);
612 613 #ifndef _LP64
613 614 p = pack_1_int_to(p, index);
614 615 #else
615 616 if (is_index(index)) {
616 617 p = pack_2_ints_to(p, index, 0);
617 618 } else {
618 619 jlong t = (jlong) _target;
619 620 int32_t lo = low(t);
620 621 int32_t hi = high(t);
621 622 p = pack_2_ints_to(p, lo, hi);
622 623 DEBUG_ONLY(jlong t1 = jlong_from(hi, lo));
623 624 assert(!is_index(t1) && (address) t1 == _target, "not symmetric");
624 625 }
625 626 #endif /* _LP64 */
626 627 dest->set_locs_end((relocInfo*) p);
627 628 }
628 629
629 630
630 631 void external_word_Relocation::unpack_data() {
631 632 #ifndef _LP64
632 633 _target = index_to_runtime_address(unpack_1_int());
633 634 #else
634 635 int32_t lo, hi;
635 636 unpack_2_ints(lo, hi);
636 637 jlong t = jlong_from(hi, lo);;
637 638 if (is_index(t)) {
638 639 _target = index_to_runtime_address(t);
639 640 } else {
640 641 _target = (address) t;
641 642 }
642 643 #endif /* _LP64 */
643 644 }
644 645
645 646
646 647 void internal_word_Relocation::pack_data_to(CodeSection* dest) {
647 648 short* p = (short*) dest->locs_end();
648 649 normalize_address(_target, dest, true);
649 650
650 651 // Check whether my target address is valid within this section.
651 652 // If not, strengthen the relocation type to point to another section.
652 653 int sindex = _section;
653 654 if (sindex == CodeBuffer::SECT_NONE && _target != NULL
654 655 && (!dest->allocates(_target) || _target == dest->locs_point())) {
655 656 sindex = dest->outer()->section_index_of(_target);
656 657 guarantee(sindex != CodeBuffer::SECT_NONE, "must belong somewhere");
657 658 relocInfo* base = dest->locs_end() - 1;
658 659 assert(base->type() == this->type(), "sanity");
659 660 // Change the written type, to be section_word_type instead.
660 661 base->set_type(relocInfo::section_word_type);
661 662 }
662 663
663 664 // Note: An internal_word relocation cannot refer to its own instruction,
664 665 // because we reserve "0" to mean that the pointer itself is embedded
665 666 // in the code stream. We use a section_word relocation for such cases.
666 667
667 668 if (sindex == CodeBuffer::SECT_NONE) {
668 669 assert(type() == relocInfo::internal_word_type, "must be base class");
669 670 guarantee(_target == NULL || dest->allocates2(_target), "must be within the given code section");
670 671 jint x0 = scaled_offset_null_special(_target, dest->locs_point());
671 672 assert(!(x0 == 0 && _target != NULL), "correct encoding of null target");
672 673 p = pack_1_int_to(p, x0);
673 674 } else {
674 675 assert(_target != NULL, "sanity");
675 676 CodeSection* sect = dest->outer()->code_section(sindex);
676 677 guarantee(sect->allocates2(_target), "must be in correct section");
677 678 address base = sect->start();
678 679 jint offset = scaled_offset(_target, base);
679 680 assert((uint)sindex < (uint)CodeBuffer::SECT_LIMIT, "sanity");
680 681 assert(CodeBuffer::SECT_LIMIT <= (1 << section_width), "section_width++");
681 682 p = pack_1_int_to(p, (offset << section_width) | sindex);
682 683 }
683 684
684 685 dest->set_locs_end((relocInfo*) p);
685 686 }
686 687
687 688
688 689 void internal_word_Relocation::unpack_data() {
689 690 jint x0 = unpack_1_int();
690 691 _target = x0==0? NULL: address_from_scaled_offset(x0, addr());
691 692 _section = CodeBuffer::SECT_NONE;
692 693 }
693 694
694 695
695 696 void section_word_Relocation::unpack_data() {
696 697 jint x = unpack_1_int();
697 698 jint offset = (x >> section_width);
698 699 int sindex = (x & ((1<<section_width)-1));
699 700 address base = binding()->section_start(sindex);
700 701
701 702 _section = sindex;
702 703 _target = address_from_scaled_offset(offset, base);
703 704 }
704 705
705 706
706 707 void breakpoint_Relocation::pack_data_to(CodeSection* dest) {
707 708 short* p = (short*) dest->locs_end();
708 709 address point = dest->locs_point();
709 710
710 711 *p++ = _bits;
711 712
712 713 assert(_target != NULL, "sanity");
713 714
714 715 if (internal()) normalize_address(_target, dest);
715 716
716 717 jint target_bits =
717 718 (jint)( internal() ? scaled_offset (_target, point)
718 719 : runtime_address_to_index(_target) );
719 720 if (settable()) {
720 721 // save space for set_target later
721 722 p = add_jint(p, target_bits);
722 723 } else {
723 724 p = add_var_int(p, target_bits);
724 725 }
725 726
726 727 for (int i = 0; i < instrlen(); i++) {
727 728 // put placeholder words until bytes can be saved
728 729 p = add_short(p, (short)0x7777);
729 730 }
730 731
731 732 dest->set_locs_end((relocInfo*) p);
732 733 }
733 734
734 735
735 736 void breakpoint_Relocation::unpack_data() {
736 737 _bits = live_bits();
737 738
738 739 int targetlen = datalen() - 1 - instrlen();
739 740 jint target_bits = 0;
740 741 if (targetlen == 0) target_bits = 0;
741 742 else if (targetlen == 1) target_bits = *(data()+1);
742 743 else if (targetlen == 2) target_bits = relocInfo::jint_from_data(data()+1);
743 744 else { ShouldNotReachHere(); }
744 745
745 746 _target = internal() ? address_from_scaled_offset(target_bits, addr())
746 747 : index_to_runtime_address (target_bits);
↓ open down ↓ |
601 lines elided |
↑ open up ↑ |
747 748 }
748 749
749 750
750 751 //// miscellaneous methods
751 752 oop* oop_Relocation::oop_addr() {
752 753 int n = _oop_index;
753 754 if (n == 0) {
754 755 // oop is stored in the code stream
755 756 return (oop*) pd_address_in_code();
756 757 } else {
757 - // oop is stored in table at CodeBlob::oops_begin
758 + // oop is stored in table at nmethod::oops_begin
758 759 return code()->oop_addr_at(n);
759 760 }
760 761 }
761 762
762 763
763 764 oop oop_Relocation::oop_value() {
764 765 oop v = *oop_addr();
765 766 // clean inline caches store a special pseudo-null
766 767 if (v == (oop)Universe::non_oop_word()) v = NULL;
767 768 return v;
768 769 }
↓ open down ↓ |
1 lines elided |
↑ open up ↑ |
769 770
770 771
771 772 void oop_Relocation::fix_oop_relocation() {
772 773 if (!oop_is_immediate()) {
773 774 // get the oop from the pool, and re-insert it into the instruction:
774 775 set_value(value());
775 776 }
776 777 }
777 778
778 779
779 -RelocIterator virtual_call_Relocation::parse_ic(CodeBlob* &code, address &ic_call, address &first_oop,
780 +RelocIterator virtual_call_Relocation::parse_ic(nmethod* &nm, address &ic_call, address &first_oop,
780 781 oop* &oop_addr, bool *is_optimized) {
781 782 assert(ic_call != NULL, "ic_call address must be set");
782 783 assert(ic_call != NULL || first_oop != NULL, "must supply a non-null input");
783 - if (code == NULL) {
784 + if (nm == NULL) {
785 + CodeBlob* code;
784 786 if (ic_call != NULL) {
785 787 code = CodeCache::find_blob(ic_call);
786 788 } else if (first_oop != NULL) {
787 789 code = CodeCache::find_blob(first_oop);
788 790 }
789 - assert(code != NULL, "address to parse must be in CodeBlob");
791 + nm = code->as_nmethod_or_null();
792 + assert(nm != NULL, "address to parse must be in nmethod");
790 793 }
791 - assert(ic_call == NULL || code->contains(ic_call), "must be in CodeBlob");
792 - assert(first_oop == NULL || code->contains(first_oop), "must be in CodeBlob");
794 + assert(ic_call == NULL || nm->contains(ic_call), "must be in nmethod");
795 + assert(first_oop == NULL || nm->contains(first_oop), "must be in nmethod");
793 796
794 797 address oop_limit = NULL;
795 798
796 799 if (ic_call != NULL) {
797 800 // search for the ic_call at the given address
798 - RelocIterator iter(code, ic_call, ic_call+1);
801 + RelocIterator iter(nm, ic_call, ic_call+1);
799 802 bool ret = iter.next();
800 803 assert(ret == true, "relocInfo must exist at this address");
801 804 assert(iter.addr() == ic_call, "must find ic_call");
802 805 if (iter.type() == relocInfo::virtual_call_type) {
803 806 virtual_call_Relocation* r = iter.virtual_call_reloc();
804 807 first_oop = r->first_oop();
805 808 oop_limit = r->oop_limit();
806 809 *is_optimized = false;
807 810 } else {
808 811 assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call");
809 812 *is_optimized = true;
810 813 oop_addr = NULL;
811 814 first_oop = NULL;
812 815 return iter;
813 816 }
814 817 }
815 818
816 819 // search for the first_oop, to get its oop_addr
817 - RelocIterator all_oops(code, first_oop);
820 + RelocIterator all_oops(nm, first_oop);
818 821 RelocIterator iter = all_oops;
819 822 iter.set_limit(first_oop+1);
820 823 bool found_oop = false;
821 824 while (iter.next()) {
822 825 if (iter.type() == relocInfo::oop_type) {
823 826 assert(iter.addr() == first_oop, "must find first_oop");
824 827 oop_addr = iter.oop_reloc()->oop_addr();
825 828 found_oop = true;
826 829 break;
827 830 }
828 831 }
829 832 assert(found_oop, "must find first_oop");
830 833
831 834 bool did_reset = false;
832 835 while (ic_call == NULL) {
833 836 // search forward for the ic_call matching the given first_oop
834 837 while (iter.next()) {
↓ open down ↓ |
7 lines elided |
↑ open up ↑ |
835 838 if (iter.type() == relocInfo::virtual_call_type) {
836 839 virtual_call_Relocation* r = iter.virtual_call_reloc();
837 840 if (r->first_oop() == first_oop) {
838 841 ic_call = r->addr();
839 842 oop_limit = r->oop_limit();
840 843 break;
841 844 }
842 845 }
843 846 }
844 847 guarantee(!did_reset, "cannot find ic_call");
845 - iter = RelocIterator(code); // search the whole CodeBlob
848 + iter = RelocIterator(nm); // search the whole nmethod
846 849 did_reset = true;
847 850 }
848 851
849 852 assert(oop_limit != NULL && first_oop != NULL && ic_call != NULL, "");
850 853 all_oops.set_limit(oop_limit);
851 854 return all_oops;
852 855 }
853 856
854 857
855 858 address virtual_call_Relocation::first_oop() {
856 859 assert(_first_oop != NULL && _first_oop < addr(), "must precede ic_call");
857 860 return _first_oop;
858 861 }
859 862
860 863
861 864 address virtual_call_Relocation::oop_limit() {
862 865 if (_oop_limit == NULL)
863 866 return addr() + NativeCall::instruction_size;
864 867 else
865 868 return _oop_limit;
866 869 }
867 870
868 871
869 872
870 873 void virtual_call_Relocation::clear_inline_cache() {
871 874 // No stubs for ICs
872 875 // Clean IC
873 876 ResourceMark rm;
874 877 CompiledIC* icache = CompiledIC_at(this);
875 878 icache->set_to_clean();
876 879 }
877 880
878 881
879 882 void opt_virtual_call_Relocation::clear_inline_cache() {
880 883 // No stubs for ICs
881 884 // Clean IC
882 885 ResourceMark rm;
883 886 CompiledIC* icache = CompiledIC_at(this);
884 887 icache->set_to_clean();
885 888 }
886 889
887 890
888 891 address opt_virtual_call_Relocation::static_stub() {
889 892 // search for the static stub who points back to this static call
890 893 address static_call_addr = addr();
891 894 RelocIterator iter(code());
892 895 while (iter.next()) {
893 896 if (iter.type() == relocInfo::static_stub_type) {
894 897 if (iter.static_stub_reloc()->static_call() == static_call_addr) {
895 898 return iter.addr();
896 899 }
897 900 }
898 901 }
899 902 return NULL;
900 903 }
901 904
902 905
903 906 void static_call_Relocation::clear_inline_cache() {
904 907 // Safe call site info
905 908 CompiledStaticCall* handler = compiledStaticCall_at(this);
906 909 handler->set_to_clean();
907 910 }
908 911
909 912
910 913 address static_call_Relocation::static_stub() {
911 914 // search for the static stub who points back to this static call
912 915 address static_call_addr = addr();
913 916 RelocIterator iter(code());
914 917 while (iter.next()) {
915 918 if (iter.type() == relocInfo::static_stub_type) {
916 919 if (iter.static_stub_reloc()->static_call() == static_call_addr) {
917 920 return iter.addr();
918 921 }
919 922 }
920 923 }
921 924 return NULL;
922 925 }
923 926
924 927
925 928 void static_stub_Relocation::clear_inline_cache() {
926 929 // Call stub is only used when calling the interpreted code.
927 930 // It does not really need to be cleared, except that we want to clean out the methodoop.
928 931 CompiledStaticCall::set_stub_to_clean(this);
929 932 }
930 933
931 934
932 935 void external_word_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
933 936 address target = _target;
934 937 if (target == NULL) {
935 938 // An absolute embedded reference to an external location,
936 939 // which means there is nothing to fix here.
937 940 return;
938 941 }
939 942 // Probably this reference is absolute, not relative, so the
940 943 // following is probably a no-op.
941 944 assert(src->section_index_of(target) == CodeBuffer::SECT_NONE, "sanity");
942 945 set_value(target);
943 946 }
944 947
945 948
946 949 address external_word_Relocation::target() {
947 950 address target = _target;
948 951 if (target == NULL) {
949 952 target = pd_get_address_from_code();
950 953 }
951 954 return target;
952 955 }
953 956
954 957
955 958 void internal_word_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
956 959 address target = _target;
957 960 if (target == NULL) {
958 961 if (addr_in_const()) {
959 962 target = new_addr_for(*(address*)addr(), src, dest);
960 963 } else {
961 964 target = new_addr_for(pd_get_address_from_code(), src, dest);
962 965 }
963 966 }
964 967 set_value(target);
965 968 }
966 969
967 970
968 971 address internal_word_Relocation::target() {
969 972 address target = _target;
970 973 if (target == NULL) {
971 974 target = pd_get_address_from_code();
972 975 }
973 976 return target;
974 977 }
975 978
976 979
977 980 breakpoint_Relocation::breakpoint_Relocation(int kind, address target, bool internal) {
978 981 bool active = false;
979 982 bool enabled = (kind == initialization);
980 983 bool removable = (kind != safepoint);
981 984 bool settable = (target == NULL);
982 985
983 986 int bits = kind;
984 987 if (enabled) bits |= enabled_state;
985 988 if (internal) bits |= internal_attr;
986 989 if (removable) bits |= removable_attr;
987 990 if (settable) bits |= settable_attr;
988 991
989 992 _bits = bits | high_bit;
990 993 _target = target;
991 994
992 995 assert(this->kind() == kind, "kind encoded");
993 996 assert(this->enabled() == enabled, "enabled encoded");
994 997 assert(this->active() == active, "active encoded");
995 998 assert(this->internal() == internal, "internal encoded");
996 999 assert(this->removable() == removable, "removable encoded");
997 1000 assert(this->settable() == settable, "settable encoded");
998 1001 }
999 1002
1000 1003
1001 1004 address breakpoint_Relocation::target() const {
1002 1005 return _target;
1003 1006 }
1004 1007
1005 1008
1006 1009 void breakpoint_Relocation::set_target(address x) {
1007 1010 assert(settable(), "must be settable");
1008 1011 jint target_bits =
1009 1012 (jint)(internal() ? scaled_offset (x, addr())
1010 1013 : runtime_address_to_index(x));
1011 1014 short* p = &live_bits() + 1;
1012 1015 p = add_jint(p, target_bits);
1013 1016 assert(p == instrs(), "new target must fit");
1014 1017 _target = x;
1015 1018 }
1016 1019
1017 1020
1018 1021 void breakpoint_Relocation::set_enabled(bool b) {
1019 1022 if (enabled() == b) return;
1020 1023
1021 1024 if (b) {
1022 1025 set_bits(bits() | enabled_state);
1023 1026 } else {
1024 1027 set_active(false); // remove the actual breakpoint insn, if any
1025 1028 set_bits(bits() & ~enabled_state);
1026 1029 }
1027 1030 }
1028 1031
1029 1032
1030 1033 void breakpoint_Relocation::set_active(bool b) {
1031 1034 assert(!b || enabled(), "cannot activate a disabled breakpoint");
1032 1035
1033 1036 if (active() == b) return;
1034 1037
1035 1038 // %%% should probably seize a lock here (might not be the right lock)
1036 1039 //MutexLockerEx ml_patch(Patching_lock, true);
1037 1040 //if (active() == b) return; // recheck state after locking
1038 1041
1039 1042 if (b) {
1040 1043 set_bits(bits() | active_state);
1041 1044 if (instrlen() == 0)
1042 1045 fatal("breakpoints in original code must be undoable");
1043 1046 pd_swap_in_breakpoint (addr(), instrs(), instrlen());
1044 1047 } else {
1045 1048 set_bits(bits() & ~active_state);
1046 1049 pd_swap_out_breakpoint(addr(), instrs(), instrlen());
1047 1050 }
1048 1051 }
1049 1052
1050 1053
1051 1054 //---------------------------------------------------------------------------------
1052 1055 // Non-product code
1053 1056
1054 1057 #ifndef PRODUCT
1055 1058
1056 1059 static const char* reloc_type_string(relocInfo::relocType t) {
1057 1060 switch (t) {
1058 1061 #define EACH_CASE(name) \
1059 1062 case relocInfo::name##_type: \
1060 1063 return #name;
1061 1064
1062 1065 APPLY_TO_RELOCATIONS(EACH_CASE);
1063 1066 #undef EACH_CASE
1064 1067
1065 1068 case relocInfo::none:
1066 1069 return "none";
1067 1070 case relocInfo::data_prefix_tag:
1068 1071 return "prefix";
1069 1072 default:
1070 1073 return "UNKNOWN RELOC TYPE";
1071 1074 }
1072 1075 }
1073 1076
1074 1077
1075 1078 void RelocIterator::print_current() {
1076 1079 if (!has_current()) {
1077 1080 tty->print_cr("(no relocs)");
1078 1081 return;
1079 1082 }
1080 1083 tty->print("relocInfo@" INTPTR_FORMAT " [type=%d(%s) addr=" INTPTR_FORMAT,
1081 1084 _current, type(), reloc_type_string((relocInfo::relocType) type()), _addr);
1082 1085 if (current()->format() != 0)
1083 1086 tty->print(" format=%d", current()->format());
1084 1087 if (datalen() == 1) {
1085 1088 tty->print(" data=%d", data()[0]);
1086 1089 } else if (datalen() > 0) {
1087 1090 tty->print(" data={");
1088 1091 for (int i = 0; i < datalen(); i++) {
1089 1092 tty->print("%04x", data()[i] & 0xFFFF);
1090 1093 }
1091 1094 tty->print("}");
1092 1095 }
1093 1096 tty->print("]");
1094 1097 switch (type()) {
1095 1098 case relocInfo::oop_type:
1096 1099 {
1097 1100 oop_Relocation* r = oop_reloc();
1098 1101 oop* oop_addr = NULL;
1099 1102 oop raw_oop = NULL;
1100 1103 oop oop_value = NULL;
1101 1104 if (code() != NULL || r->oop_is_immediate()) {
1102 1105 oop_addr = r->oop_addr();
1103 1106 raw_oop = *oop_addr;
1104 1107 oop_value = r->oop_value();
1105 1108 }
1106 1109 tty->print(" | [oop_addr=" INTPTR_FORMAT " *=" INTPTR_FORMAT " offset=%d]",
1107 1110 oop_addr, (address)raw_oop, r->offset());
1108 1111 // Do not print the oop by default--we want this routine to
1109 1112 // work even during GC or other inconvenient times.
1110 1113 if (WizardMode && oop_value != NULL) {
1111 1114 tty->print("oop_value=" INTPTR_FORMAT ": ", (address)oop_value);
1112 1115 oop_value->print_value_on(tty);
1113 1116 }
1114 1117 break;
1115 1118 }
1116 1119 case relocInfo::external_word_type:
1117 1120 case relocInfo::internal_word_type:
1118 1121 case relocInfo::section_word_type:
1119 1122 {
1120 1123 DataRelocation* r = (DataRelocation*) reloc();
1121 1124 tty->print(" | [target=" INTPTR_FORMAT "]", r->value()); //value==target
1122 1125 break;
1123 1126 }
1124 1127 case relocInfo::static_call_type:
1125 1128 case relocInfo::runtime_call_type:
1126 1129 {
1127 1130 CallRelocation* r = (CallRelocation*) reloc();
1128 1131 tty->print(" | [destination=" INTPTR_FORMAT "]", r->destination());
1129 1132 break;
1130 1133 }
1131 1134 case relocInfo::virtual_call_type:
1132 1135 {
1133 1136 virtual_call_Relocation* r = (virtual_call_Relocation*) reloc();
1134 1137 tty->print(" | [destination=" INTPTR_FORMAT " first_oop=" INTPTR_FORMAT " oop_limit=" INTPTR_FORMAT "]",
1135 1138 r->destination(), r->first_oop(), r->oop_limit());
1136 1139 break;
1137 1140 }
1138 1141 case relocInfo::static_stub_type:
1139 1142 {
1140 1143 static_stub_Relocation* r = (static_stub_Relocation*) reloc();
1141 1144 tty->print(" | [static_call=" INTPTR_FORMAT "]", r->static_call());
1142 1145 break;
1143 1146 }
1144 1147 }
1145 1148 tty->cr();
1146 1149 }
1147 1150
1148 1151
1149 1152 void RelocIterator::print() {
1150 1153 RelocIterator save_this = (*this);
1151 1154 relocInfo* scan = _current;
1152 1155 if (!has_current()) scan += 1; // nothing to scan here!
1153 1156
1154 1157 bool skip_next = has_current();
1155 1158 bool got_next;
1156 1159 while (true) {
1157 1160 got_next = (skip_next || next());
1158 1161 skip_next = false;
1159 1162
1160 1163 tty->print(" @" INTPTR_FORMAT ": ", scan);
1161 1164 relocInfo* newscan = _current+1;
1162 1165 if (!has_current()) newscan -= 1; // nothing to scan here!
1163 1166 while (scan < newscan) {
1164 1167 tty->print("%04x", *(short*)scan & 0xFFFF);
1165 1168 scan++;
1166 1169 }
1167 1170 tty->cr();
↓ open down ↓ |
312 lines elided |
↑ open up ↑ |
1168 1171
1169 1172 if (!got_next) break;
1170 1173 print_current();
1171 1174 }
1172 1175
1173 1176 (*this) = save_this;
1174 1177 }
1175 1178
1176 1179 // For the debugger:
1177 1180 extern "C"
1178 -void print_blob_locs(CodeBlob* cb) {
1179 - cb->print();
1180 - RelocIterator iter(cb);
1181 +void print_blob_locs(nmethod* nm) {
1182 + nm->print();
1183 + RelocIterator iter(nm);
1181 1184 iter.print();
1182 1185 }
1183 1186 extern "C"
1184 1187 void print_buf_locs(CodeBuffer* cb) {
1185 1188 FlagSetting fs(PrintRelocations, true);
1186 1189 cb->print();
1187 1190 }
1188 1191 #endif // !PRODUCT
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX