Mercurial > hg > graal-compiler
comparison src/share/vm/code/relocInfo.cpp @ 1748:3e8fbc61cee8
6978355: renaming for 6961697
Summary: This is the renaming part of 6961697 to keep the actual changes small for review.
Reviewed-by: kvn, never
author | twisti |
---|---|
date | Wed, 25 Aug 2010 05:27:54 -0700 |
parents | e9ff18c4ace7 |
children | 0878d7bae69f |
comparison
equal
deleted
inserted
replaced
1747:53dbe853fb3a | 1748:3e8fbc61cee8 |
---|---|
126 assert(nm != NULL, "must be able to deduce nmethod from other arguments"); | 126 assert(nm != NULL, "must be able to deduce nmethod from other arguments"); |
127 | 127 |
128 _code = nm; | 128 _code = nm; |
129 _current = nm->relocation_begin() - 1; | 129 _current = nm->relocation_begin() - 1; |
130 _end = nm->relocation_end(); | 130 _end = nm->relocation_end(); |
131 _addr = (address) nm->instructions_begin(); | 131 _addr = (address) nm->code_begin(); |
132 | 132 |
133 assert(!has_current(), "just checking"); | 133 assert(!has_current(), "just checking"); |
134 address code_end = nm->instructions_end(); | 134 assert(begin == NULL || begin >= nm->code_begin(), "in bounds"); |
135 | 135 assert(limit == NULL || limit <= nm->code_end(), "in bounds"); |
136 assert(begin == NULL || begin >= nm->instructions_begin(), "in bounds"); | |
137 // FIX THIS assert(limit == NULL || limit <= code_end, "in bounds"); | |
138 set_limits(begin, limit); | 136 set_limits(begin, limit); |
139 } | 137 } |
140 | 138 |
141 | 139 |
142 RelocIterator::RelocIterator(CodeSection* cs, address begin, address limit) { | 140 RelocIterator::RelocIterator(CodeSection* cs, address begin, address limit) { |
265 #endif // ASSERT | 263 #endif // ASSERT |
266 if (index_size > 0) { | 264 if (index_size > 0) { |
267 // skip ahead | 265 // skip ahead |
268 RelocIndexEntry* index = (RelocIndexEntry*)_end; | 266 RelocIndexEntry* index = (RelocIndexEntry*)_end; |
269 RelocIndexEntry* index_limit = (RelocIndexEntry*)((address)index + index_size); | 267 RelocIndexEntry* index_limit = (RelocIndexEntry*)((address)index + index_size); |
270 assert(_addr == _code->instructions_begin(), "_addr must be unadjusted"); | 268 assert(_addr == _code->code_begin(), "_addr must be unadjusted"); |
271 int card = (begin - _addr) / indexCardSize; | 269 int card = (begin - _addr) / indexCardSize; |
272 if (card > 0) { | 270 if (card > 0) { |
273 if (index+card-1 < index_limit) index += card-1; | 271 if (index+card-1 < index_limit) index += card-1; |
274 else index = index_limit - 1; | 272 else index = index_limit - 1; |
275 #ifdef ASSERT | 273 #ifdef ASSERT |
367 // memoizes it for later. | 365 // memoizes it for later. |
368 #define CACHE ((RelocIterator*)this)->_section_start[n] | 366 #define CACHE ((RelocIterator*)this)->_section_start[n] |
369 CodeBlob* cb = code(); | 367 CodeBlob* cb = code(); |
370 guarantee(cb != NULL, "must have a code blob"); | 368 guarantee(cb != NULL, "must have a code blob"); |
371 if (n == CodeBuffer::SECT_INSTS) | 369 if (n == CodeBuffer::SECT_INSTS) |
372 return CACHE = cb->instructions_begin(); | 370 return CACHE = cb->code_begin(); |
373 assert(cb->is_nmethod(), "only nmethods have these sections"); | 371 assert(cb->is_nmethod(), "only nmethods have these sections"); |
374 nmethod* nm = (nmethod*) cb; | 372 nmethod* nm = (nmethod*) cb; |
375 address res = NULL; | 373 address res = NULL; |
376 switch (n) { | 374 switch (n) { |
377 case CodeBuffer::SECT_STUBS: | 375 case CodeBuffer::SECT_STUBS: |
381 res = nm->consts_begin(); | 379 res = nm->consts_begin(); |
382 break; | 380 break; |
383 default: | 381 default: |
384 ShouldNotReachHere(); | 382 ShouldNotReachHere(); |
385 } | 383 } |
386 assert(nm->contains(res) || res == nm->instructions_end(), "tame pointer"); | 384 assert(nm->contains(res) || res == nm->code_end(), "tame pointer"); |
387 CACHE = res; | 385 CACHE = res; |
388 return res; | 386 return res; |
389 #undef CACHE | 387 #undef CACHE |
390 } | 388 } |
391 | 389 |