1.1 --- a/src/share/vm/c1/c1_Compilation.cpp Thu Sep 02 11:40:02 2010 -0700 1.2 +++ b/src/share/vm/c1/c1_Compilation.cpp Fri Sep 03 17:51:07 2010 -0700 1.3 @@ -290,9 +290,13 @@ 1.4 1.5 CHECK_BAILOUT_(no_frame_size); 1.6 1.7 + if (is_profiling()) { 1.8 + method()->build_method_data(); 1.9 + } 1.10 + 1.11 { 1.12 PhaseTraceTime timeit(_t_buildIR); 1.13 - build_hir(); 1.14 + build_hir(); 1.15 } 1.16 if (BailoutAfterHIR) { 1.17 BAILOUT_("Bailing out because of -XX:+BailoutAfterHIR", no_frame_size); 1.18 @@ -447,6 +451,7 @@ 1.19 , _masm(NULL) 1.20 , _has_exception_handlers(false) 1.21 , _has_fpu_code(true) // pessimistic assumption 1.22 +, _would_profile(false) 1.23 , _has_unsafe_access(false) 1.24 , _has_method_handle_invokes(false) 1.25 , _bailout_msg(NULL) 1.26 @@ -461,12 +466,16 @@ 1.27 #endif // PRODUCT 1.28 { 1.29 PhaseTraceTime timeit(_t_compile); 1.30 - 1.31 _arena = Thread::current()->resource_area(); 1.32 _env->set_compiler_data(this); 1.33 _exception_info_list = new ExceptionInfoList(); 1.34 _implicit_exception_table.set_size(0); 1.35 compile_method(); 1.36 + if (is_profiling() && _would_profile) { 1.37 + ciMethodData *md = method->method_data(); 1.38 + assert (md != NULL, "Should have MDO"); 1.39 + md->set_would_profile(_would_profile); 1.40 + } 1.41 } 1.42 1.43 Compilation::~Compilation() {