367 }
368
369
370 int Compilation::compile_java_method() {
371 assert(!method()->is_native(), "should not reach here");
372
373 if (BailoutOnExceptionHandlers) {
374 if (method()->has_exception_handlers()) {
375 bailout("linear scan can't handle exception handlers");
376 }
377 }
378
379 CHECK_BAILOUT_(no_frame_size);
380
381 if (is_profiling() && !method()->ensure_method_data()) {
382 BAILOUT_("mdo allocation failed", no_frame_size);
383 }
384
385 if (method()->is_synchronized()) {
386 set_has_monitors(true);
387 }
388
389 {
390 PhaseTraceTime timeit(_t_buildIR);
391 build_hir();
392 }
393 if (BailoutAfterHIR) {
394 BAILOUT_("Bailing out because of -XX:+BailoutAfterHIR", no_frame_size);
395 }
396
397
398 {
399 PhaseTraceTime timeit(_t_emit_lir);
400
401 _frame_map = new FrameMap(method(), hir()->number_of_locks(), MAX2(4, hir()->max_stack()));
402 emit_lir();
403 }
404 CHECK_BAILOUT_(no_frame_size);
405
406 // Dump compilation data to replay it.
554 : _next_id(0)
555 , _next_block_id(0)
556 , _compiler(compiler)
557 , _directive(directive)
558 , _env(env)
559 , _log(env->log())
560 , _method(method)
561 , _osr_bci(osr_bci)
562 , _hir(NULL)
563 , _max_spills(-1)
564 , _frame_map(NULL)
565 , _masm(NULL)
566 , _has_exception_handlers(false)
567 , _has_fpu_code(true) // pessimistic assumption
568 , _has_unsafe_access(false)
569 , _has_irreducible_loops(false)
570 , _would_profile(false)
571 , _has_method_handle_invokes(false)
572 , _has_reserved_stack_access(method->has_reserved_stack_access())
573 , _has_monitors(false)
574 , _install_code(install_code)
575 , _bailout_msg(NULL)
576 , _exception_info_list(NULL)
577 , _allocator(NULL)
578 , _code(buffer_blob)
579 , _has_access_indexed(false)
580 , _interpreter_frame_size(0)
581 , _immediate_oops_patched(0)
582 , _current_instruction(NULL)
583 #ifndef PRODUCT
584 , _last_instruction_printed(NULL)
585 , _cfg_printer_output(NULL)
586 #endif // PRODUCT
587 {
588 PhaseTraceTime timeit(_t_compile);
589 _arena = Thread::current()->resource_area();
590 _env->set_compiler_data(this);
591 _exception_info_list = new ExceptionInfoList();
592 _implicit_exception_table.set_size(0);
593 #ifndef PRODUCT
|
367 }
368
369
370 int Compilation::compile_java_method() {
371 assert(!method()->is_native(), "should not reach here");
372
373 if (BailoutOnExceptionHandlers) {
374 if (method()->has_exception_handlers()) {
375 bailout("linear scan can't handle exception handlers");
376 }
377 }
378
379 CHECK_BAILOUT_(no_frame_size);
380
381 if (is_profiling() && !method()->ensure_method_data()) {
382 BAILOUT_("mdo allocation failed", no_frame_size);
383 }
384
385 if (method()->is_synchronized()) {
386 set_has_monitors(true);
387 push_monitor();
388 }
389
390 {
391 PhaseTraceTime timeit(_t_buildIR);
392 build_hir();
393 }
394 if (BailoutAfterHIR) {
395 BAILOUT_("Bailing out because of -XX:+BailoutAfterHIR", no_frame_size);
396 }
397
398
399 {
400 PhaseTraceTime timeit(_t_emit_lir);
401
402 _frame_map = new FrameMap(method(), hir()->number_of_locks(), MAX2(4, hir()->max_stack()));
403 emit_lir();
404 }
405 CHECK_BAILOUT_(no_frame_size);
406
407 // Dump compilation data to replay it.
555 : _next_id(0)
556 , _next_block_id(0)
557 , _compiler(compiler)
558 , _directive(directive)
559 , _env(env)
560 , _log(env->log())
561 , _method(method)
562 , _osr_bci(osr_bci)
563 , _hir(NULL)
564 , _max_spills(-1)
565 , _frame_map(NULL)
566 , _masm(NULL)
567 , _has_exception_handlers(false)
568 , _has_fpu_code(true) // pessimistic assumption
569 , _has_unsafe_access(false)
570 , _has_irreducible_loops(false)
571 , _would_profile(false)
572 , _has_method_handle_invokes(false)
573 , _has_reserved_stack_access(method->has_reserved_stack_access())
574 , _has_monitors(false)
575 , _max_monitors(0)
576 , _install_code(install_code)
577 , _bailout_msg(NULL)
578 , _exception_info_list(NULL)
579 , _allocator(NULL)
580 , _code(buffer_blob)
581 , _has_access_indexed(false)
582 , _interpreter_frame_size(0)
583 , _immediate_oops_patched(0)
584 , _current_instruction(NULL)
585 #ifndef PRODUCT
586 , _last_instruction_printed(NULL)
587 , _cfg_printer_output(NULL)
588 #endif // PRODUCT
589 {
590 PhaseTraceTime timeit(_t_compile);
591 _arena = Thread::current()->resource_area();
592 _env->set_compiler_data(this);
593 _exception_info_list = new ExceptionInfoList();
594 _implicit_exception_table.set_size(0);
595 #ifndef PRODUCT
|