935 //
936 // Return true if the method is an instance of the JVM-generated
937 // signature-polymorphic MethodHandle methods, _invokeBasic, _linkToVirtual, etc.
938 bool ciMethod::is_method_handle_intrinsic() const {
939 vmIntrinsics::ID iid = _intrinsic_id; // do not check if loaded
940 return (MethodHandles::is_signature_polymorphic(iid) &&
941 MethodHandles::is_signature_polymorphic_intrinsic(iid));
942 }
943
944 // ------------------------------------------------------------------
945 // ciMethod::is_compiled_lambda_form
946 //
947 // Return true if the method is a generated MethodHandle adapter.
948 // These are built by Java code.
949 bool ciMethod::is_compiled_lambda_form() const {
950 vmIntrinsics::ID iid = _intrinsic_id; // do not check if loaded
951 return iid == vmIntrinsics::_compiledLambdaForm;
952 }
953
954 // ------------------------------------------------------------------
955 // ciMethod::is_object_initializer
956 //
957 bool ciMethod::is_object_initializer() const {
958 return name() == ciSymbol::object_initializer_name();
959 }
960
961 // ------------------------------------------------------------------
962 // ciMethod::has_member_arg
963 //
964 // Return true if the method is a linker intrinsic like _linkToVirtual.
965 // These are built by the JVM.
966 bool ciMethod::has_member_arg() const {
967 vmIntrinsics::ID iid = _intrinsic_id; // do not check if loaded
968 return (MethodHandles::is_signature_polymorphic(iid) &&
969 MethodHandles::has_member_arg(iid));
970 }
971
972 // ------------------------------------------------------------------
973 // ciMethod::ensure_method_data
974 //
975 // Generate new MethodData* objects at compile time.
976 // Return true if allocation was successful or no MDO is required.
977 bool ciMethod::ensure_method_data(const methodHandle& h_m) {
978 EXCEPTION_CONTEXT;
1258 // Print the bytecodes for this method.
1259 void ciMethod::print_codes_on(outputStream* st) {
1260 check_is_loaded();
1261 GUARDED_VM_ENTRY(get_Method()->print_codes_on(st);)
1262 }
1263
1264
1265 #define FETCH_FLAG_FROM_VM(flag_accessor) { \
1266 check_is_loaded(); \
1267 VM_ENTRY_MARK; \
1268 return get_Method()->flag_accessor(); \
1269 }
1270
1271 bool ciMethod::is_empty_method() const { FETCH_FLAG_FROM_VM(is_empty_method); }
1272 bool ciMethod::is_vanilla_constructor() const { FETCH_FLAG_FROM_VM(is_vanilla_constructor); }
1273 bool ciMethod::has_loops () const { FETCH_FLAG_FROM_VM(has_loops); }
1274 bool ciMethod::has_jsrs () const { FETCH_FLAG_FROM_VM(has_jsrs); }
1275 bool ciMethod::is_getter () const { FETCH_FLAG_FROM_VM(is_getter); }
1276 bool ciMethod::is_setter () const { FETCH_FLAG_FROM_VM(is_setter); }
1277 bool ciMethod::is_accessor () const { FETCH_FLAG_FROM_VM(is_accessor); }
1278 bool ciMethod::is_initializer () const { FETCH_FLAG_FROM_VM(is_initializer); }
1279
1280 bool ciMethod::is_boxing_method() const {
1281 if (holder()->is_box_klass()) {
1282 switch (intrinsic_id()) {
1283 case vmIntrinsics::_Boolean_valueOf:
1284 case vmIntrinsics::_Byte_valueOf:
1285 case vmIntrinsics::_Character_valueOf:
1286 case vmIntrinsics::_Short_valueOf:
1287 case vmIntrinsics::_Integer_valueOf:
1288 case vmIntrinsics::_Long_valueOf:
1289 case vmIntrinsics::_Float_valueOf:
1290 case vmIntrinsics::_Double_valueOf:
1291 return true;
1292 default:
1293 return false;
1294 }
1295 }
1296 return false;
1297 }
1298
|
935 //
936 // Return true if the method is an instance of the JVM-generated
937 // signature-polymorphic MethodHandle methods, _invokeBasic, _linkToVirtual, etc.
938 bool ciMethod::is_method_handle_intrinsic() const {
939 vmIntrinsics::ID iid = _intrinsic_id; // do not check if loaded
940 return (MethodHandles::is_signature_polymorphic(iid) &&
941 MethodHandles::is_signature_polymorphic_intrinsic(iid));
942 }
943
944 // ------------------------------------------------------------------
945 // ciMethod::is_compiled_lambda_form
946 //
947 // Return true if the method is a generated MethodHandle adapter.
948 // These are built by Java code.
949 bool ciMethod::is_compiled_lambda_form() const {
950 vmIntrinsics::ID iid = _intrinsic_id; // do not check if loaded
951 return iid == vmIntrinsics::_compiledLambdaForm;
952 }
953
954 // ------------------------------------------------------------------
955 // ciMethod::is_object_constructor
956 //
957 bool ciMethod::is_object_constructor() const {
958 return (name() == ciSymbol::object_initializer_name()
959 && signature()->return_type()->is_void());
960 // Note: We can't test is_static, because that would
961 // require the method to be loaded. Sometimes it isn't.
962 }
963
964 // ------------------------------------------------------------------
965 // ciMethod::is_static_init_factory
966 //
967 bool ciMethod::is_static_init_factory() const {
968 return (name() == ciSymbol::object_initializer_name()
969 && !signature()->return_type()->is_void());
970 }
971
972 // ------------------------------------------------------------------
973 // ciMethod::has_member_arg
974 //
975 // Return true if the method is a linker intrinsic like _linkToVirtual.
976 // These are built by the JVM.
977 bool ciMethod::has_member_arg() const {
978 vmIntrinsics::ID iid = _intrinsic_id; // do not check if loaded
979 return (MethodHandles::is_signature_polymorphic(iid) &&
980 MethodHandles::has_member_arg(iid));
981 }
982
983 // ------------------------------------------------------------------
984 // ciMethod::ensure_method_data
985 //
986 // Generate new MethodData* objects at compile time.
987 // Return true if allocation was successful or no MDO is required.
988 bool ciMethod::ensure_method_data(const methodHandle& h_m) {
989 EXCEPTION_CONTEXT;
1269 // Print the bytecodes for this method.
1270 void ciMethod::print_codes_on(outputStream* st) {
1271 check_is_loaded();
1272 GUARDED_VM_ENTRY(get_Method()->print_codes_on(st);)
1273 }
1274
1275
1276 #define FETCH_FLAG_FROM_VM(flag_accessor) { \
1277 check_is_loaded(); \
1278 VM_ENTRY_MARK; \
1279 return get_Method()->flag_accessor(); \
1280 }
1281
1282 bool ciMethod::is_empty_method() const { FETCH_FLAG_FROM_VM(is_empty_method); }
1283 bool ciMethod::is_vanilla_constructor() const { FETCH_FLAG_FROM_VM(is_vanilla_constructor); }
1284 bool ciMethod::has_loops () const { FETCH_FLAG_FROM_VM(has_loops); }
1285 bool ciMethod::has_jsrs () const { FETCH_FLAG_FROM_VM(has_jsrs); }
1286 bool ciMethod::is_getter () const { FETCH_FLAG_FROM_VM(is_getter); }
1287 bool ciMethod::is_setter () const { FETCH_FLAG_FROM_VM(is_setter); }
1288 bool ciMethod::is_accessor () const { FETCH_FLAG_FROM_VM(is_accessor); }
1289 bool ciMethod::is_object_constructor_or_class_initializer() const { FETCH_FLAG_FROM_VM(is_object_constructor_or_class_initializer); }
1290
1291 bool ciMethod::is_boxing_method() const {
1292 if (holder()->is_box_klass()) {
1293 switch (intrinsic_id()) {
1294 case vmIntrinsics::_Boolean_valueOf:
1295 case vmIntrinsics::_Byte_valueOf:
1296 case vmIntrinsics::_Character_valueOf:
1297 case vmIntrinsics::_Short_valueOf:
1298 case vmIntrinsics::_Integer_valueOf:
1299 case vmIntrinsics::_Long_valueOf:
1300 case vmIntrinsics::_Float_valueOf:
1301 case vmIntrinsics::_Double_valueOf:
1302 return true;
1303 default:
1304 return false;
1305 }
1306 }
1307 return false;
1308 }
1309
|