232 assert(cs->is_frozen(), "cross-section branch needs stable offsets");
233 }
234 }
235 #endif //ASSERT
236
237 // Push the target offset into the branch instruction.
238 masm->pd_patch_instruction(branch, target);
239 }
240 }
241
242
243 void AbstractAssembler::block_comment(const char* comment) {
244 if (sect() == CodeBuffer::SECT_INSTS) {
245 code_section()->outer()->block_comment(offset(), comment);
246 }
247 }
248
249 bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
250 // Exception handler checks the nmethod's implicit null checks table
251 // only when this method returns false.
252 #ifndef SPARC
253 // Sparc does not have based addressing
254 if (UseCompressedOops) {
255 // The first page after heap_base is unmapped and
256 // the 'offset' is equal to [heap_base + offset] for
257 // narrow oop implicit null checks.
258 uintptr_t heap_base = (uintptr_t)Universe::heap_base();
259 if ((uintptr_t)offset >= heap_base) {
260 // Normalize offset for the next check.
261 offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1));
262 }
263 }
264 #endif // SPARC
265 return offset < 0 || os::vm_page_size() <= offset;
266 }
267
268 #ifndef PRODUCT
269 void Label::print_instructions(MacroAssembler* masm) const {
270 CodeBuffer* cb = masm->code();
271 for (int i = 0; i < _patch_index; ++i) {
272 int branch_loc;
273 if (i >= PatchCacheSize) {
274 branch_loc = _patch_overflow->at(i - PatchCacheSize);
275 } else {
276 branch_loc = _patches[i];
277 }
278 int branch_pos = CodeBuffer::locator_pos(branch_loc);
279 int branch_sect = CodeBuffer::locator_sect(branch_loc);
280 address branch = cb->locator_address(branch_loc);
281 tty->print_cr("unbound label");
282 tty->print("@ %d|%d ", branch_pos, branch_sect);
283 if (branch_sect == CodeBuffer::SECT_CONSTS) {
284 tty->print_cr(PTR_FORMAT, *(address*)branch);
|
232 assert(cs->is_frozen(), "cross-section branch needs stable offsets");
233 }
234 }
235 #endif //ASSERT
236
237 // Push the target offset into the branch instruction.
238 masm->pd_patch_instruction(branch, target);
239 }
240 }
241
242
243 void AbstractAssembler::block_comment(const char* comment) {
244 if (sect() == CodeBuffer::SECT_INSTS) {
245 code_section()->outer()->block_comment(offset(), comment);
246 }
247 }
248
249 bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
250 // Exception handler checks the nmethod's implicit null checks table
251 // only when this method returns false.
252 if (UseCompressedOops) {
253 // The first page after heap_base is unmapped and
254 // the 'offset' is equal to [heap_base + offset] for
255 // narrow oop implicit null checks.
256 uintptr_t heap_base = (uintptr_t)Universe::heap_base();
257 if ((uintptr_t)offset >= heap_base) {
258 // Normalize offset for the next check.
259 offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1));
260 }
261 }
262 return offset < 0 || os::vm_page_size() <= offset;
263 }
264
265 #ifndef PRODUCT
266 void Label::print_instructions(MacroAssembler* masm) const {
267 CodeBuffer* cb = masm->code();
268 for (int i = 0; i < _patch_index; ++i) {
269 int branch_loc;
270 if (i >= PatchCacheSize) {
271 branch_loc = _patch_overflow->at(i - PatchCacheSize);
272 } else {
273 branch_loc = _patches[i];
274 }
275 int branch_pos = CodeBuffer::locator_pos(branch_loc);
276 int branch_sect = CodeBuffer::locator_sect(branch_loc);
277 address branch = cb->locator_address(branch_loc);
278 tty->print_cr("unbound label");
279 tty->print("@ %d|%d ", branch_pos, branch_sect);
280 if (branch_sect == CodeBuffer::SECT_CONSTS) {
281 tty->print_cr(PTR_FORMAT, *(address*)branch);
|