< prev index next >

src/hotspot/share/c1/c1_Compilation.cpp

Print this page

417     PhaseTraceTime timeit(_t_codeemit);
418     return emit_code_body();
419   }
420 }
421 
422 void Compilation::install_code(int frame_size) {
423   // frame_size is in 32-bit words so adjust it intptr_t words
424   assert(frame_size == frame_map()->framesize(), "must match");
425   assert(in_bytes(frame_map()->framesize_in_bytes()) % sizeof(intptr_t) == 0, "must be at least pointer aligned");
426   _env->register_method(
427     method(),
428     osr_bci(),
429     &_offsets,
430     in_bytes(_frame_map->sp_offset_for_orig_pc()),
431     code(),
432     in_bytes(frame_map()->framesize_in_bytes()) / sizeof(intptr_t),
433     debug_info_recorder()->_oopmaps,
434     exception_handler_table(),
435     implicit_exception_table(),
436     compiler(),


437     has_unsafe_access(),
438     SharedRuntime::is_wide_vector(max_vector_size()),
439     has_monitors(),
440     has_scoped_access(),
441     _immediate_oops_patched

442   );
443 }
444 
445 
446 void Compilation::compile_method() {
447 
448   {
449     PhaseTraceTime timeit(_t_setup);
450 
451     // setup compilation
452     initialize();
453     CHECK_BAILOUT();
454 
455   }
456 
457   if (!method()->can_be_compiled()) {
458     // Prevent race condition 6328518.
459     // This can happen if the method is obsolete or breakpointed.
460     bailout("Bailing out because method is not compilable");
461     return;

466     dependency_recorder()->assert_evol_method(method());
467   }
468 
469   if (env()->break_at_compile()) {
470     BREAKPOINT;
471   }
472 
473 #ifndef PRODUCT
474   if (PrintCFGToFile) {
475     CFGPrinter::print_compilation(this);
476   }
477 #endif
478 
479   // compile method
480   int frame_size = compile_java_method();
481 
482   // bailout if method couldn't be compiled
483   // Note: make sure we mark the method as not compilable!
484   CHECK_BAILOUT();
485 
486   if (should_install_code()) {
487     // install code
488     PhaseTraceTime timeit(_t_codeinstall);
489     install_code(frame_size);
490   }
491 
492   if (log() != nullptr) // Print code cache state into compiler log
493     log()->code_cache_state();
494 
495 }
496 
497 
498 void Compilation::generate_exception_handler_table() {
499   // Generate an ExceptionHandlerTable from the exception handler
500   // information accumulated during the compilation.
501   ExceptionInfoList* info_list = exception_info_list();
502 
503   if (info_list->length() == 0) {
504     return;
505   }
506 
507   // allocate some arrays for use by the collection code.

417     PhaseTraceTime timeit(_t_codeemit);
418     return emit_code_body();
419   }
420 }
421 
422 void Compilation::install_code(int frame_size) {
423   // frame_size is in 32-bit words so adjust it intptr_t words
424   assert(frame_size == frame_map()->framesize(), "must match");
425   assert(in_bytes(frame_map()->framesize_in_bytes()) % sizeof(intptr_t) == 0, "must be at least pointer aligned");
426   _env->register_method(
427     method(),
428     osr_bci(),
429     &_offsets,
430     in_bytes(_frame_map->sp_offset_for_orig_pc()),
431     code(),
432     in_bytes(frame_map()->framesize_in_bytes()) / sizeof(intptr_t),
433     debug_info_recorder()->_oopmaps,
434     exception_handler_table(),
435     implicit_exception_table(),
436     compiler(),
437     false, // has_clinit_barriers
438     false, // for_preload
439     has_unsafe_access(),
440     SharedRuntime::is_wide_vector(max_vector_size()),
441     has_monitors(),
442     has_scoped_access(),
443     _immediate_oops_patched,
444     should_install_code()
445   );
446 }
447 
448 
449 void Compilation::compile_method() {
450 
451   {
452     PhaseTraceTime timeit(_t_setup);
453 
454     // setup compilation
455     initialize();
456     CHECK_BAILOUT();
457 
458   }
459 
460   if (!method()->can_be_compiled()) {
461     // Prevent race condition 6328518.
462     // This can happen if the method is obsolete or breakpointed.
463     bailout("Bailing out because method is not compilable");
464     return;

469     dependency_recorder()->assert_evol_method(method());
470   }
471 
472   if (env()->break_at_compile()) {
473     BREAKPOINT;
474   }
475 
476 #ifndef PRODUCT
477   if (PrintCFGToFile) {
478     CFGPrinter::print_compilation(this);
479   }
480 #endif
481 
482   // compile method
483   int frame_size = compile_java_method();
484 
485   // bailout if method couldn't be compiled
486   // Note: make sure we mark the method as not compilable!
487   CHECK_BAILOUT();
488 
489   { // install code

490     PhaseTraceTime timeit(_t_codeinstall);
491     install_code(frame_size);
492   }
493 
494   if (log() != nullptr) // Print code cache state into compiler log
495     log()->code_cache_state();
496 
497 }
498 
499 
500 void Compilation::generate_exception_handler_table() {
501   // Generate an ExceptionHandlerTable from the exception handler
502   // information accumulated during the compilation.
503   ExceptionInfoList* info_list = exception_info_list();
504 
505   if (info_list->length() == 0) {
506     return;
507   }
508 
509   // allocate some arrays for use by the collection code.
< prev index next >