515 buf.consts()->initialize_shared_locs(&locs_buf[lsize * 0], lsize); |
515 buf.consts()->initialize_shared_locs(&locs_buf[lsize * 0], lsize); |
516 buf.insts()->initialize_shared_locs( &locs_buf[lsize * 1], lsize); |
516 buf.insts()->initialize_shared_locs( &locs_buf[lsize * 1], lsize); |
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 |
|
521 Label fakeL; // Fake label for branch instructions. |
|
522 bool is_branch = n->is_Branch() && n->as_Mach()->ideal_Opcode() != Op_Jump; |
|
523 if (is_branch) { |
|
524 MacroAssembler masm(&buf); |
|
525 masm.bind(fakeL); |
|
526 n->as_Mach()->label_set(&fakeL, 0); |
|
527 } |
520 n->emit(buf, this->regalloc()); |
528 n->emit(buf, this->regalloc()); |
|
529 if (is_branch) // Clear the reference to fake label. |
|
530 n->as_Mach()->label_set(NULL, 0); |
521 |
531 |
522 // End scratch_emit_size section. |
532 // End scratch_emit_size section. |
523 set_in_scratch_emit_size(false); |
533 set_in_scratch_emit_size(false); |
524 |
534 |
525 return buf.insts_size(); |
535 return buf.insts_size(); |