591 buf.initialize_stubs_size(MAX_stubs_size); 592 assert(locs_buf != NULL, "sanity"); 593 int lsize = MAX_locs_size / 3; 594 buf.consts()->initialize_shared_locs(&locs_buf[lsize * 0], lsize); 595 buf.insts()->initialize_shared_locs( &locs_buf[lsize * 1], lsize); 596 buf.stubs()->initialize_shared_locs( &locs_buf[lsize * 2], lsize); 597 598 // Do the emission. 599 600 Label fakeL; // Fake label for branch instructions. 601 Label* saveL = NULL; 602 uint save_bnum = 0; 603 bool is_branch = n->is_MachBranch(); 604 if (is_branch) { 605 MacroAssembler masm(&buf); 606 masm.bind(fakeL); 607 n->as_MachBranch()->save_label(&saveL, &save_bnum); 608 n->as_MachBranch()->label_set(&fakeL, 0); 609 } 610 n->emit(buf, this->regalloc()); 611 if (is_branch) // Restore label. 612 n->as_MachBranch()->label_set(saveL, save_bnum); 613 614 // End scratch_emit_size section. 615 set_in_scratch_emit_size(false); 616 617 return buf.insts_size(); 618 } 619 620 621 // ============================================================================ 622 //------------------------------Compile standard------------------------------- 623 debug_only( int Compile::_debug_idx = 100000; ) 624 625 // Compile a method. entry_bci is -1 for normal compilations and indicates 626 // the continuation bci for on stack replacement. 627 628 629 Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr_bci, 630 bool subsume_loads, bool do_escape_analysis, bool eliminate_boxing ) | 591 buf.initialize_stubs_size(MAX_stubs_size); 592 assert(locs_buf != NULL, "sanity"); 593 int lsize = MAX_locs_size / 3; 594 buf.consts()->initialize_shared_locs(&locs_buf[lsize * 0], lsize); 595 buf.insts()->initialize_shared_locs( &locs_buf[lsize * 1], lsize); 596 buf.stubs()->initialize_shared_locs( &locs_buf[lsize * 2], lsize); 597 598 // Do the emission. 599 600 Label fakeL; // Fake label for branch instructions. 601 Label* saveL = NULL; 602 uint save_bnum = 0; 603 bool is_branch = n->is_MachBranch(); 604 if (is_branch) { 605 MacroAssembler masm(&buf); 606 masm.bind(fakeL); 607 n->as_MachBranch()->save_label(&saveL, &save_bnum); 608 n->as_MachBranch()->label_set(&fakeL, 0); 609 } 610 n->emit(buf, this->regalloc()); 611 612 // Emitting into the scratch buffer should not fail 613 assert (!failing(), err_msg_res("Must not have pending failure. Reason is: %s", failure_reason())); 614 615 if (is_branch) // Restore label. 616 n->as_MachBranch()->label_set(saveL, save_bnum); 617 618 // End scratch_emit_size section. 619 set_in_scratch_emit_size(false); 620 621 return buf.insts_size(); 622 } 623 624 625 // ============================================================================ 626 //------------------------------Compile standard------------------------------- 627 debug_only( int Compile::_debug_idx = 100000; ) 628 629 // Compile a method. entry_bci is -1 for normal compilations and indicates 630 // the continuation bci for on stack replacement. 631 632 633 Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr_bci, 634 bool subsume_loads, bool do_escape_analysis, bool eliminate_boxing ) |