< prev index next >

src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp

Print this page




 466   __ nop();
 467 
 468   // generate code for exception handler
 469   address handler_base = __ start_a_stub(deopt_handler_size);
 470   if (handler_base == NULL) {
 471     // not enough space left for the handler
 472     bailout("deopt handler overflow");
 473     return -1;
 474   }
 475 
 476   int offset = code_offset();
 477 
 478   __ adr(lr, pc());
 479   __ far_jump(RuntimeAddress(SharedRuntime::deopt_blob()->unpack()));
 480   guarantee(code_offset() - offset <= deopt_handler_size, "overflow");
 481   __ end_a_stub();
 482 
 483   return offset;
 484 }
 485 
 486 
 487 // This is the fast version of java.lang.String.compare; it has not
 488 // OSR-entry and therefore, we generate a slow version for OSR's
 489 void LIR_Assembler::emit_string_compare(LIR_Opr arg0, LIR_Opr arg1, LIR_Opr dst, CodeEmitInfo* info)  {
 490   __ mov(r2, (address)__FUNCTION__);
 491   __ call_Unimplemented();
 492 }
 493 
 494 
 495 void LIR_Assembler::add_debug_info_for_branch(address adr, CodeEmitInfo* info) {
 496   _masm->code_section()->relocate(adr, relocInfo::poll_type);
 497   int pc_offset = code_offset();
 498   flush_debug_info(pc_offset);
 499   info->record_debug_info(compilation()->debug_info_recorder(), pc_offset);
 500   if (info->exception_handlers() != NULL) {
 501     compilation()->add_exception_handlers_for_pco(pc_offset, info->exception_handlers());
 502   }
 503 }
 504 
 505 // Rather than take a segfault when the polling page is protected,
 506 // explicitly check for a safepoint in progress and if there is one,
 507 // fake a call to the handler as if a segfault had been caught.
 508 void LIR_Assembler::poll_for_safepoint(relocInfo::relocType rtype, CodeEmitInfo* info) {
 509   __ mov(rscratch1, SafepointSynchronize::address_of_state());
 510   __ ldrb(rscratch1, Address(rscratch1));
 511   Label nope, poll;
 512   __ cbz(rscratch1, nope);
 513   __ block_comment("safepoint");
 514   __ enter();




 466   __ nop();
 467 
 468   // generate code for exception handler
 469   address handler_base = __ start_a_stub(deopt_handler_size);
 470   if (handler_base == NULL) {
 471     // not enough space left for the handler
 472     bailout("deopt handler overflow");
 473     return -1;
 474   }
 475 
 476   int offset = code_offset();
 477 
 478   __ adr(lr, pc());
 479   __ far_jump(RuntimeAddress(SharedRuntime::deopt_blob()->unpack()));
 480   guarantee(code_offset() - offset <= deopt_handler_size, "overflow");
 481   __ end_a_stub();
 482 
 483   return offset;
 484 }
 485 









 486 void LIR_Assembler::add_debug_info_for_branch(address adr, CodeEmitInfo* info) {
 487   _masm->code_section()->relocate(adr, relocInfo::poll_type);
 488   int pc_offset = code_offset();
 489   flush_debug_info(pc_offset);
 490   info->record_debug_info(compilation()->debug_info_recorder(), pc_offset);
 491   if (info->exception_handlers() != NULL) {
 492     compilation()->add_exception_handlers_for_pco(pc_offset, info->exception_handlers());
 493   }
 494 }
 495 
 496 // Rather than take a segfault when the polling page is protected,
 497 // explicitly check for a safepoint in progress and if there is one,
 498 // fake a call to the handler as if a segfault had been caught.
 499 void LIR_Assembler::poll_for_safepoint(relocInfo::relocType rtype, CodeEmitInfo* info) {
 500   __ mov(rscratch1, SafepointSynchronize::address_of_state());
 501   __ ldrb(rscratch1, Address(rscratch1));
 502   Label nope, poll;
 503   __ cbz(rscratch1, nope);
 504   __ block_comment("safepoint");
 505   __ enter();


< prev index next >