hotspot/src/share/vm/ci/ciMethod.cpp
changeset 20695 4f5a5e95090b
parent 20692 65021f70c2fc
child 21099 46e6bbecd9e5
equal deleted inserted replaced
20694:2b8425bb18c2 20695:4f5a5e95090b
   844 //
   844 //
   845 // Generate new MethodData* objects at compile time.
   845 // Generate new MethodData* objects at compile time.
   846 // Return true if allocation was successful or no MDO is required.
   846 // Return true if allocation was successful or no MDO is required.
   847 bool ciMethod::ensure_method_data(methodHandle h_m) {
   847 bool ciMethod::ensure_method_data(methodHandle h_m) {
   848   EXCEPTION_CONTEXT;
   848   EXCEPTION_CONTEXT;
   849   if (is_native() || is_abstract() || h_m()->is_accessor()) return true;
   849   if (is_native() || is_abstract() || h_m()->is_accessor()) {
       
   850     return true;
       
   851   }
   850   if (h_m()->method_data() == NULL) {
   852   if (h_m()->method_data() == NULL) {
   851     Method::build_interpreter_method_data(h_m, THREAD);
   853     Method::build_interpreter_method_data(h_m, THREAD);
   852     if (HAS_PENDING_EXCEPTION) {
   854     if (HAS_PENDING_EXCEPTION) {
   853       CLEAR_PENDING_EXCEPTION;
   855       CLEAR_PENDING_EXCEPTION;
   854     }
   856     }
   901 // ciMethod::method_data_or_null
   903 // ciMethod::method_data_or_null
   902 // Returns a pointer to ciMethodData if MDO exists on the VM side,
   904 // Returns a pointer to ciMethodData if MDO exists on the VM side,
   903 // NULL otherwise.
   905 // NULL otherwise.
   904 ciMethodData* ciMethod::method_data_or_null() {
   906 ciMethodData* ciMethod::method_data_or_null() {
   905   ciMethodData *md = method_data();
   907   ciMethodData *md = method_data();
   906   if (md->is_empty()) return NULL;
   908   if (md->is_empty()) {
       
   909     return NULL;
       
   910   }
   907   return md;
   911   return md;
   908 }
   912 }
   909 
   913 
   910 // ------------------------------------------------------------------
   914 // ------------------------------------------------------------------
   911 // ciMethod::ensure_method_counters
   915 // ciMethod::ensure_method_counters
   912 //
   916 //
   913 address ciMethod::ensure_method_counters() {
   917 MethodCounters* ciMethod::ensure_method_counters() {
   914   check_is_loaded();
   918   check_is_loaded();
   915   VM_ENTRY_MARK;
   919   VM_ENTRY_MARK;
   916   methodHandle mh(THREAD, get_Method());
   920   methodHandle mh(THREAD, get_Method());
   917   MethodCounters *counter = mh->method_counters();
   921   MethodCounters* method_counters = mh->get_method_counters(CHECK_NULL);
   918   if (counter == NULL) {
   922   return method_counters;
   919     counter = Method::build_method_counters(mh(), CHECK_AND_CLEAR_NULL);
       
   920   }
       
   921   return (address)counter;
       
   922 }
   923 }
   923 
   924 
   924 // ------------------------------------------------------------------
   925 // ------------------------------------------------------------------
   925 // ciMethod::should_exclude
   926 // ciMethod::should_exclude
   926 //
   927 //