365
366 return frame_map()->framesize();
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 {
386 PhaseTraceTime timeit(_t_buildIR);
387 build_hir();
388 }
389 if (BailoutAfterHIR) {
390 BAILOUT_("Bailing out because of -XX:+BailoutAfterHIR", no_frame_size);
391 }
392
393
394 {
395 PhaseTraceTime timeit(_t_emit_lir);
396
397 _frame_map = new FrameMap(method(), hir()->number_of_locks(), MAX2(4, hir()->max_stack()));
398 emit_lir();
399 }
400 CHECK_BAILOUT_(no_frame_size);
401
402 {
403 PhaseTraceTime timeit(_t_codeemit);
404 return emit_code_body();
541 Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* method,
542 int osr_bci, BufferBlob* buffer_blob, bool install_code, DirectiveSet* directive)
543 : _next_id(0)
544 , _next_block_id(0)
545 , _compiler(compiler)
546 , _directive(directive)
547 , _env(env)
548 , _log(env->log())
549 , _method(method)
550 , _osr_bci(osr_bci)
551 , _hir(NULL)
552 , _max_spills(-1)
553 , _frame_map(NULL)
554 , _masm(NULL)
555 , _has_exception_handlers(false)
556 , _has_fpu_code(true) // pessimistic assumption
557 , _has_unsafe_access(false)
558 , _would_profile(false)
559 , _has_method_handle_invokes(false)
560 , _has_reserved_stack_access(method->has_reserved_stack_access())
561 , _install_code(install_code)
562 , _bailout_msg(NULL)
563 , _exception_info_list(NULL)
564 , _allocator(NULL)
565 , _code(buffer_blob)
566 , _has_access_indexed(false)
567 , _interpreter_frame_size(0)
568 , _current_instruction(NULL)
569 #ifndef PRODUCT
570 , _last_instruction_printed(NULL)
571 , _cfg_printer_output(NULL)
572 #endif // PRODUCT
573 {
574 PhaseTraceTime timeit(_t_compile);
575 _arena = Thread::current()->resource_area();
576 _env->set_compiler_data(this);
577 _exception_info_list = new ExceptionInfoList();
578 _implicit_exception_table.set_size(0);
579 #ifndef PRODUCT
580 if (PrintCFGToFile) {
|
365
366 return frame_map()->framesize();
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 push_monitor();
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 {
407 PhaseTraceTime timeit(_t_codeemit);
408 return emit_code_body();
545 Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* method,
546 int osr_bci, BufferBlob* buffer_blob, bool install_code, DirectiveSet* directive)
547 : _next_id(0)
548 , _next_block_id(0)
549 , _compiler(compiler)
550 , _directive(directive)
551 , _env(env)
552 , _log(env->log())
553 , _method(method)
554 , _osr_bci(osr_bci)
555 , _hir(NULL)
556 , _max_spills(-1)
557 , _frame_map(NULL)
558 , _masm(NULL)
559 , _has_exception_handlers(false)
560 , _has_fpu_code(true) // pessimistic assumption
561 , _has_unsafe_access(false)
562 , _would_profile(false)
563 , _has_method_handle_invokes(false)
564 , _has_reserved_stack_access(method->has_reserved_stack_access())
565 , _max_monitors(0)
566 , _install_code(install_code)
567 , _bailout_msg(NULL)
568 , _exception_info_list(NULL)
569 , _allocator(NULL)
570 , _code(buffer_blob)
571 , _has_access_indexed(false)
572 , _interpreter_frame_size(0)
573 , _current_instruction(NULL)
574 #ifndef PRODUCT
575 , _last_instruction_printed(NULL)
576 , _cfg_printer_output(NULL)
577 #endif // PRODUCT
578 {
579 PhaseTraceTime timeit(_t_compile);
580 _arena = Thread::current()->resource_area();
581 _env->set_compiler_data(this);
582 _exception_info_list = new ExceptionInfoList();
583 _implicit_exception_table.set_size(0);
584 #ifndef PRODUCT
585 if (PrintCFGToFile) {
|