src/share/vm/ci/ciMethod.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8025566 Sdiff src/share/vm/ci

src/share/vm/ci/ciMethod.cpp

Print this page




 829 }
 830 
 831 // ------------------------------------------------------------------
 832 // ciMethod::has_member_arg
 833 //
 834 // Return true if the method is a linker intrinsic like _linkToVirtual.
 835 // These are built by the JVM.
 836 bool ciMethod::has_member_arg() const {
 837   vmIntrinsics::ID iid = _intrinsic_id;  // do not check if loaded
 838   return (MethodHandles::is_signature_polymorphic(iid) &&
 839           MethodHandles::has_member_arg(iid));
 840 }
 841 
 842 // ------------------------------------------------------------------
 843 // ciMethod::ensure_method_data
 844 //
 845 // Generate new MethodData* objects at compile time.
 846 // Return true if allocation was successful or no MDO is required.
 847 bool ciMethod::ensure_method_data(methodHandle h_m) {
 848   EXCEPTION_CONTEXT;
 849   if (is_native() || is_abstract() || h_m()->is_accessor()) return true;


 850   if (h_m()->method_data() == NULL) {
 851     Method::build_interpreter_method_data(h_m, THREAD);
 852     if (HAS_PENDING_EXCEPTION) {
 853       CLEAR_PENDING_EXCEPTION;
 854     }
 855   }
 856   if (h_m()->method_data() != NULL) {
 857     _method_data = CURRENT_ENV->get_method_data(h_m()->method_data());
 858     _method_data->load_data();
 859     return true;
 860   } else {
 861     _method_data = CURRENT_ENV->get_empty_methodData();
 862     return false;
 863   }
 864 }
 865 
 866 // public, retroactive version
 867 bool ciMethod::ensure_method_data() {
 868   bool result = true;
 869   if (_method_data == NULL || _method_data->is_empty()) {


 886   ciEnv* env = CURRENT_ENV;
 887   Thread* my_thread = JavaThread::current();
 888   methodHandle h_m(my_thread, get_Method());
 889 
 890   if (h_m()->method_data() != NULL) {
 891     _method_data = CURRENT_ENV->get_method_data(h_m()->method_data());
 892     _method_data->load_data();
 893   } else {
 894     _method_data = CURRENT_ENV->get_empty_methodData();
 895   }
 896   return _method_data;
 897 
 898 }
 899 
 900 // ------------------------------------------------------------------
 901 // ciMethod::method_data_or_null
 902 // Returns a pointer to ciMethodData if MDO exists on the VM side,
 903 // NULL otherwise.
 904 ciMethodData* ciMethod::method_data_or_null() {
 905   ciMethodData *md = method_data();
 906   if (md->is_empty()) return NULL;


 907   return md;
 908 }
 909 
 910 // ------------------------------------------------------------------
 911 // ciMethod::ensure_method_counters
 912 //
 913 address ciMethod::ensure_method_counters() {
 914   check_is_loaded();
 915   VM_ENTRY_MARK;
 916   methodHandle mh(THREAD, get_Method());
 917   MethodCounters *counter = mh->method_counters();
 918   if (counter == NULL) {
 919     counter = Method::build_method_counters(mh(), CHECK_AND_CLEAR_NULL);
 920   }
 921   return (address)counter;
 922 }
 923 
 924 // ------------------------------------------------------------------
 925 // ciMethod::should_exclude
 926 //
 927 // Should this method be excluded from compilation?
 928 bool ciMethod::should_exclude() {
 929   check_is_loaded();
 930   VM_ENTRY_MARK;
 931   methodHandle mh(THREAD, get_Method());
 932   bool ignore;
 933   return CompilerOracle::should_exclude(mh, ignore);
 934 }
 935 
 936 // ------------------------------------------------------------------
 937 // ciMethod::should_inline
 938 //
 939 // Should this method be inlined during compilation?
 940 bool ciMethod::should_inline() {
 941   check_is_loaded();




 829 }
 830 
 831 // ------------------------------------------------------------------
 832 // ciMethod::has_member_arg
 833 //
 834 // Return true if the method is a linker intrinsic like _linkToVirtual.
 835 // These are built by the JVM.
 836 bool ciMethod::has_member_arg() const {
 837   vmIntrinsics::ID iid = _intrinsic_id;  // do not check if loaded
 838   return (MethodHandles::is_signature_polymorphic(iid) &&
 839           MethodHandles::has_member_arg(iid));
 840 }
 841 
 842 // ------------------------------------------------------------------
 843 // ciMethod::ensure_method_data
 844 //
 845 // Generate new MethodData* objects at compile time.
 846 // Return true if allocation was successful or no MDO is required.
 847 bool ciMethod::ensure_method_data(methodHandle h_m) {
 848   EXCEPTION_CONTEXT;
 849   if (is_native() || is_abstract() || h_m()->is_accessor()) {
 850     return true;
 851   }
 852   if (h_m()->method_data() == NULL) {
 853     Method::build_interpreter_method_data(h_m, THREAD);
 854     if (HAS_PENDING_EXCEPTION) {
 855       CLEAR_PENDING_EXCEPTION;
 856     }
 857   }
 858   if (h_m()->method_data() != NULL) {
 859     _method_data = CURRENT_ENV->get_method_data(h_m()->method_data());
 860     _method_data->load_data();
 861     return true;
 862   } else {
 863     _method_data = CURRENT_ENV->get_empty_methodData();
 864     return false;
 865   }
 866 }
 867 
 868 // public, retroactive version
 869 bool ciMethod::ensure_method_data() {
 870   bool result = true;
 871   if (_method_data == NULL || _method_data->is_empty()) {


 888   ciEnv* env = CURRENT_ENV;
 889   Thread* my_thread = JavaThread::current();
 890   methodHandle h_m(my_thread, get_Method());
 891 
 892   if (h_m()->method_data() != NULL) {
 893     _method_data = CURRENT_ENV->get_method_data(h_m()->method_data());
 894     _method_data->load_data();
 895   } else {
 896     _method_data = CURRENT_ENV->get_empty_methodData();
 897   }
 898   return _method_data;
 899 
 900 }
 901 
 902 // ------------------------------------------------------------------
 903 // ciMethod::method_data_or_null
 904 // Returns a pointer to ciMethodData if MDO exists on the VM side,
 905 // NULL otherwise.
 906 ciMethodData* ciMethod::method_data_or_null() {
 907   ciMethodData *md = method_data();
 908   if (md->is_empty()) {
 909     return NULL;
 910   }
 911   return md;
 912 }
 913 
 914 // ------------------------------------------------------------------
 915 // ciMethod::ensure_method_counters
 916 //
 917 MethodCounters* ciMethod::ensure_method_counters() {
 918   check_is_loaded();
 919   VM_ENTRY_MARK;
 920   methodHandle mh(THREAD, get_Method());
 921   MethodCounters* method_counters = mh->get_method_counters(CHECK_NULL);
 922   return method_counters;



 923 }
 924 
 925 // ------------------------------------------------------------------
 926 // ciMethod::should_exclude
 927 //
 928 // Should this method be excluded from compilation?
 929 bool ciMethod::should_exclude() {
 930   check_is_loaded();
 931   VM_ENTRY_MARK;
 932   methodHandle mh(THREAD, get_Method());
 933   bool ignore;
 934   return CompilerOracle::should_exclude(mh, ignore);
 935 }
 936 
 937 // ------------------------------------------------------------------
 938 // ciMethod::should_inline
 939 //
 940 // Should this method be inlined during compilation?
 941 bool ciMethod::should_inline() {
 942   check_is_loaded();


src/share/vm/ci/ciMethod.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File