src/share/vm/opto/compile.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 7063628 Sdiff src/share/vm/opto

src/share/vm/opto/compile.cpp

Print this page




 500   // may be shared by several calls to scratch_emit_size.
 501   // The allocation of the scratch buffer blob is particularly
 502   // expensive, since it has to grab the code cache lock.
 503   BufferBlob* blob = this->scratch_buffer_blob();
 504   assert(blob != NULL, "Initialize BufferBlob at start");
 505   assert(blob->size() > MAX_inst_size, "sanity");
 506   relocInfo* locs_buf = scratch_locs_memory();
 507   address blob_begin = blob->content_begin();
 508   address blob_end   = (address)locs_buf;
 509   assert(blob->content_contains(blob_end), "sanity");
 510   CodeBuffer buf(blob_begin, blob_end - blob_begin);
 511   buf.initialize_consts_size(_scratch_const_size);
 512   buf.initialize_stubs_size(MAX_stubs_size);
 513   assert(locs_buf != NULL, "sanity");
 514   int lsize = MAX_locs_size / 3;
 515   buf.consts()->initialize_shared_locs(&locs_buf[lsize * 0], lsize);
 516   buf.insts()->initialize_shared_locs( &locs_buf[lsize * 1], lsize);
 517   buf.stubs()->initialize_shared_locs( &locs_buf[lsize * 2], lsize);
 518 
 519   // Do the emission.








 520   n->emit(buf, this->regalloc());
 521 
 522   // End scratch_emit_size section.
 523   set_in_scratch_emit_size(false);
 524 
 525   return buf.insts_size();
 526 }
 527 
 528 
 529 // ============================================================================
 530 //------------------------------Compile standard-------------------------------
 531 debug_only( int Compile::_debug_idx = 100000; )
 532 
 533 // Compile a method.  entry_bci is -1 for normal compilations and indicates
 534 // the continuation bci for on stack replacement.
 535 
 536 
 537 Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr_bci, bool subsume_loads, bool do_escape_analysis )
 538                 : Phase(Compiler),
 539                   _env(ci_env),




 500   // may be shared by several calls to scratch_emit_size.
 501   // The allocation of the scratch buffer blob is particularly
 502   // expensive, since it has to grab the code cache lock.
 503   BufferBlob* blob = this->scratch_buffer_blob();
 504   assert(blob != NULL, "Initialize BufferBlob at start");
 505   assert(blob->size() > MAX_inst_size, "sanity");
 506   relocInfo* locs_buf = scratch_locs_memory();
 507   address blob_begin = blob->content_begin();
 508   address blob_end   = (address)locs_buf;
 509   assert(blob->content_contains(blob_end), "sanity");
 510   CodeBuffer buf(blob_begin, blob_end - blob_begin);
 511   buf.initialize_consts_size(_scratch_const_size);
 512   buf.initialize_stubs_size(MAX_stubs_size);
 513   assert(locs_buf != NULL, "sanity");
 514   int lsize = MAX_locs_size / 3;
 515   buf.consts()->initialize_shared_locs(&locs_buf[lsize * 0], lsize);
 516   buf.insts()->initialize_shared_locs( &locs_buf[lsize * 1], lsize);
 517   buf.stubs()->initialize_shared_locs( &locs_buf[lsize * 2], lsize);
 518 
 519   // Do the emission.
 520 
 521   // Fake label for branch instructions.
 522   Label fakeL;
 523   if (n->is_Branch() && n->as_Mach()->ideal_Opcode() != Op_Jump) {
 524     MacroAssembler masm(&buf);
 525     masm.bind(fakeL);
 526     n->as_Mach()->label_set(fakeL, 0);
 527   }
 528   n->emit(buf, this->regalloc());
 529 
 530   // End scratch_emit_size section.
 531   set_in_scratch_emit_size(false);
 532 
 533   return buf.insts_size();
 534 }
 535 
 536 
 537 // ============================================================================
 538 //------------------------------Compile standard-------------------------------
 539 debug_only( int Compile::_debug_idx = 100000; )
 540 
 541 // Compile a method.  entry_bci is -1 for normal compilations and indicates
 542 // the continuation bci for on stack replacement.
 543 
 544 
 545 Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr_bci, bool subsume_loads, bool do_escape_analysis )
 546                 : Phase(Compiler),
 547                   _env(ci_env),


src/share/vm/opto/compile.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File