comparison src/share/vm/opto/compile.cpp @ 38:b789bcaf2dd9

6667610: (Escape Analysis) retry compilation without EA if it fails Summary: During split unique types EA could exceed nodes limit and fail the method compilation. Reviewed-by: rasbold
author kvn
date Thu, 06 Mar 2008 10:30:17 -0800
parents a61af66fc99e
children 99269dbf4ba8
comparison
equal deleted inserted replaced
37:73970d8c0b27 38:b789bcaf2dd9
329 // Check if recompiling 329 // Check if recompiling
330 if (_subsume_loads == false && PrintOpto) { 330 if (_subsume_loads == false && PrintOpto) {
331 // Recompiling without allowing machine instructions to subsume loads 331 // Recompiling without allowing machine instructions to subsume loads
332 tty->print_cr("*********************************************************"); 332 tty->print_cr("*********************************************************");
333 tty->print_cr("** Bailout: Recompile without subsuming loads **"); 333 tty->print_cr("** Bailout: Recompile without subsuming loads **");
334 tty->print_cr("*********************************************************");
335 }
336 if (_do_escape_analysis != DoEscapeAnalysis && PrintOpto) {
337 // Recompiling without escape analysis
338 tty->print_cr("*********************************************************");
339 tty->print_cr("** Bailout: Recompile without escape analysis **");
334 tty->print_cr("*********************************************************"); 340 tty->print_cr("*********************************************************");
335 } 341 }
336 if (env()->break_at_compile()) { 342 if (env()->break_at_compile()) {
337 // Open the debugger when compiing this method. 343 // Open the debugger when compiing this method.
338 tty->print("### Breaking when compiling: "); 344 tty->print("### Breaking when compiling: ");
413 419
414 // Compile a method. entry_bci is -1 for normal compilations and indicates 420 // Compile a method. entry_bci is -1 for normal compilations and indicates
415 // the continuation bci for on stack replacement. 421 // the continuation bci for on stack replacement.
416 422
417 423
418 Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr_bci, bool subsume_loads ) 424 Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr_bci, bool subsume_loads, bool do_escape_analysis )
419 : Phase(Compiler), 425 : Phase(Compiler),
420 _env(ci_env), 426 _env(ci_env),
421 _log(ci_env->log()), 427 _log(ci_env->log()),
422 _compile_id(ci_env->compile_id()), 428 _compile_id(ci_env->compile_id()),
423 _save_argument_registers(false), 429 _save_argument_registers(false),
428 _entry_bci(osr_bci), 434 _entry_bci(osr_bci),
429 _initial_gvn(NULL), 435 _initial_gvn(NULL),
430 _for_igvn(NULL), 436 _for_igvn(NULL),
431 _warm_calls(NULL), 437 _warm_calls(NULL),
432 _subsume_loads(subsume_loads), 438 _subsume_loads(subsume_loads),
439 _do_escape_analysis(do_escape_analysis),
433 _failure_reason(NULL), 440 _failure_reason(NULL),
434 _code_buffer("Compile::Fill_buffer"), 441 _code_buffer("Compile::Fill_buffer"),
435 _orig_pc_slot(0), 442 _orig_pc_slot(0),
436 _orig_pc_slot_offset_in_bytes(0), 443 _orig_pc_slot_offset_in_bytes(0),
437 _node_bundling_limit(0), 444 _node_bundling_limit(0),
485 uint estimated_size = method()->code_size()*4+64; 492 uint estimated_size = method()->code_size()*4+64;
486 estimated_size = (estimated_size < MINIMUM_NODE_HASH ? MINIMUM_NODE_HASH : estimated_size); 493 estimated_size = (estimated_size < MINIMUM_NODE_HASH ? MINIMUM_NODE_HASH : estimated_size);
487 PhaseGVN gvn(node_arena(), estimated_size); 494 PhaseGVN gvn(node_arena(), estimated_size);
488 set_initial_gvn(&gvn); 495 set_initial_gvn(&gvn);
489 496
490 if (DoEscapeAnalysis) 497 if (_do_escape_analysis)
491 _congraph = new ConnectionGraph(this); 498 _congraph = new ConnectionGraph(this);
492 499
493 { // Scope for timing the parser 500 { // Scope for timing the parser
494 TracePhase t3("parse", &_t_parser, true); 501 TracePhase t3("parse", &_t_parser, true);
495 502
575 582
576 // Perform escape analysis 583 // Perform escape analysis
577 if (_congraph != NULL) { 584 if (_congraph != NULL) {
578 NOT_PRODUCT( TracePhase t2("escapeAnalysis", &_t_escapeAnalysis, TimeCompiler); ) 585 NOT_PRODUCT( TracePhase t2("escapeAnalysis", &_t_escapeAnalysis, TimeCompiler); )
579 _congraph->compute_escape(); 586 _congraph->compute_escape();
587 if (failing()) return;
588
580 #ifndef PRODUCT 589 #ifndef PRODUCT
581 if (PrintEscapeAnalysis) { 590 if (PrintEscapeAnalysis) {
582 _congraph->dump(); 591 _congraph->dump();
583 } 592 }
584 #endif 593 #endif
673 _for_igvn(NULL), 682 _for_igvn(NULL),
674 _warm_calls(NULL), 683 _warm_calls(NULL),
675 _orig_pc_slot(0), 684 _orig_pc_slot(0),
676 _orig_pc_slot_offset_in_bytes(0), 685 _orig_pc_slot_offset_in_bytes(0),
677 _subsume_loads(true), 686 _subsume_loads(true),
687 _do_escape_analysis(false),
678 _failure_reason(NULL), 688 _failure_reason(NULL),
679 _code_buffer("Compile::Fill_buffer"), 689 _code_buffer("Compile::Fill_buffer"),
680 _node_bundling_limit(0), 690 _node_bundling_limit(0),
681 _node_bundling_base(NULL), 691 _node_bundling_base(NULL),
682 #ifndef PRODUCT 692 #ifndef PRODUCT
820 // // Update cached type information 830 // // Update cached type information
821 // if( _method && _method->constants() ) 831 // if( _method && _method->constants() )
822 // Type::update_loaded_types(_method, _method->constants()); 832 // Type::update_loaded_types(_method, _method->constants());
823 833
824 // Init alias_type map. 834 // Init alias_type map.
825 if (!DoEscapeAnalysis && aliaslevel == 3) 835 if (!_do_escape_analysis && aliaslevel == 3)
826 aliaslevel = 2; // No unique types without escape analysis 836 aliaslevel = 2; // No unique types without escape analysis
827 _AliasLevel = aliaslevel; 837 _AliasLevel = aliaslevel;
828 const int grow_ats = 16; 838 const int grow_ats = 16;
829 _max_alias_types = grow_ats; 839 _max_alias_types = grow_ats;
830 _alias_types = NEW_ARENA_ARRAY(comp_arena(), AliasType*, grow_ats); 840 _alias_types = NEW_ARENA_ARRAY(comp_arena(), AliasType*, grow_ats);