1.1 --- a/src/share/vm/ci/ciMethod.cpp Thu Dec 02 01:02:55 2010 -0800 1.2 +++ b/src/share/vm/ci/ciMethod.cpp Thu Dec 02 17:21:12 2010 -0800 1.3 @@ -797,12 +797,13 @@ 1.4 1.5 1.6 // ------------------------------------------------------------------ 1.7 -// ciMethod::build_method_data 1.8 +// ciMethod::ensure_method_data 1.9 // 1.10 // Generate new methodDataOop objects at compile time. 1.11 -void ciMethod::build_method_data(methodHandle h_m) { 1.12 +// Return true if allocation was successful or no MDO is required. 1.13 +bool ciMethod::ensure_method_data(methodHandle h_m) { 1.14 EXCEPTION_CONTEXT; 1.15 - if (is_native() || is_abstract() || h_m()->is_accessor()) return; 1.16 + if (is_native() || is_abstract() || h_m()->is_accessor()) return true; 1.17 if (h_m()->method_data() == NULL) { 1.18 methodOopDesc::build_interpreter_method_data(h_m, THREAD); 1.19 if (HAS_PENDING_EXCEPTION) { 1.20 @@ -812,18 +813,22 @@ 1.21 if (h_m()->method_data() != NULL) { 1.22 _method_data = CURRENT_ENV->get_object(h_m()->method_data())->as_method_data(); 1.23 _method_data->load_data(); 1.24 + return true; 1.25 } else { 1.26 _method_data = CURRENT_ENV->get_empty_methodData(); 1.27 + return false; 1.28 } 1.29 } 1.30 1.31 // public, retroactive version 1.32 -void ciMethod::build_method_data() { 1.33 +bool ciMethod::ensure_method_data() { 1.34 + bool result = true; 1.35 if (_method_data == NULL || _method_data->is_empty()) { 1.36 GUARDED_VM_ENTRY({ 1.37 - build_method_data(get_methodOop()); 1.38 + result = ensure_method_data(get_methodOop()); 1.39 }); 1.40 } 1.41 + return result; 1.42 } 1.43 1.44 1.45 @@ -839,11 +844,6 @@ 1.46 Thread* my_thread = JavaThread::current(); 1.47 methodHandle h_m(my_thread, get_methodOop()); 1.48 1.49 - // Create an MDO for the inlinee 1.50 - if (TieredCompilation && is_c1_compile(env->comp_level())) { 1.51 - build_method_data(h_m); 1.52 - } 1.53 - 1.54 if (h_m()->method_data() != NULL) { 1.55 _method_data = CURRENT_ENV->get_object(h_m()->method_data())->as_method_data(); 1.56 _method_data->load_data(); 1.57 @@ -854,6 +854,15 @@ 1.58 1.59 } 1.60 1.61 +// ------------------------------------------------------------------ 1.62 +// ciMethod::method_data_or_null 1.63 +// Returns a pointer to ciMethodData if MDO exists on the VM side, 1.64 +// NULL otherwise. 1.65 +ciMethodData* ciMethod::method_data_or_null() { 1.66 + ciMethodData *md = method_data(); 1.67 + if (md->is_empty()) return NULL; 1.68 + return md; 1.69 +} 1.70 1.71 // ------------------------------------------------------------------ 1.72 // ciMethod::will_link