517 buf.stubs()->initialize_shared_locs( &locs_buf[lsize * 2], lsize); |
517 buf.stubs()->initialize_shared_locs( &locs_buf[lsize * 2], lsize); |
518 |
518 |
519 // Do the emission. |
519 // Do the emission. |
520 |
520 |
521 Label fakeL; // Fake label for branch instructions. |
521 Label fakeL; // Fake label for branch instructions. |
522 bool is_branch = n->is_Branch() && n->as_Mach()->ideal_Opcode() != Op_Jump; |
522 Label* saveL = NULL; |
|
523 uint save_bnum = 0; |
|
524 bool is_branch = n->is_MachBranch(); |
523 if (is_branch) { |
525 if (is_branch) { |
524 MacroAssembler masm(&buf); |
526 MacroAssembler masm(&buf); |
525 masm.bind(fakeL); |
527 masm.bind(fakeL); |
526 n->as_Mach()->label_set(&fakeL, 0); |
528 n->as_MachBranch()->save_label(&saveL, &save_bnum); |
|
529 n->as_MachBranch()->label_set(&fakeL, 0); |
527 } |
530 } |
528 n->emit(buf, this->regalloc()); |
531 n->emit(buf, this->regalloc()); |
529 if (is_branch) // Clear the reference to fake label. |
532 if (is_branch) // Restore label. |
530 n->as_Mach()->label_set(NULL, 0); |
533 n->as_MachBranch()->label_set(saveL, save_bnum); |
531 |
534 |
532 // End scratch_emit_size section. |
535 // End scratch_emit_size section. |
533 set_in_scratch_emit_size(false); |
536 set_in_scratch_emit_size(false); |
534 |
537 |
535 return buf.insts_size(); |
538 return buf.insts_size(); |