1003 |
1003 |
1004 |
1004 |
1005 // Interface to java.lang.invoke.MemberName objects |
1005 // Interface to java.lang.invoke.MemberName objects |
1006 // (These are a private interface for Java code to query the class hierarchy.) |
1006 // (These are a private interface for Java code to query the class hierarchy.) |
1007 |
1007 |
|
1008 #define RESOLVEDMETHOD_INJECTED_FIELDS(macro) \ |
|
1009 macro(java_lang_invoke_ResolvedMethodName, vmholder, object_signature, false) \ |
|
1010 macro(java_lang_invoke_ResolvedMethodName, vmtarget, intptr_signature, false) |
|
1011 |
|
1012 class java_lang_invoke_ResolvedMethodName : AllStatic { |
|
1013 friend class JavaClasses; |
|
1014 |
|
1015 static int _vmtarget_offset; |
|
1016 static int _vmholder_offset; |
|
1017 |
|
1018 static void compute_offsets(); |
|
1019 public: |
|
1020 static int vmtarget_offset_in_bytes() { return _vmtarget_offset; } |
|
1021 |
|
1022 static Method* vmtarget(oop resolved_method); |
|
1023 static void set_vmtarget(oop resolved_method, Method* method); |
|
1024 |
|
1025 // find or create resolved member name |
|
1026 static oop find_resolved_method(const methodHandle& m, TRAPS); |
|
1027 |
|
1028 static bool is_instance(oop resolved_method); |
|
1029 }; |
|
1030 |
|
1031 |
1008 #define MEMBERNAME_INJECTED_FIELDS(macro) \ |
1032 #define MEMBERNAME_INJECTED_FIELDS(macro) \ |
1009 macro(java_lang_invoke_MemberName, vmloader, object_signature, false) \ |
1033 macro(java_lang_invoke_MemberName, vmindex, intptr_signature, false) |
1010 macro(java_lang_invoke_MemberName, vmindex, intptr_signature, false) \ |
1034 |
1011 macro(java_lang_invoke_MemberName, vmtarget, intptr_signature, false) |
|
1012 |
1035 |
1013 class java_lang_invoke_MemberName: AllStatic { |
1036 class java_lang_invoke_MemberName: AllStatic { |
1014 friend class JavaClasses; |
1037 friend class JavaClasses; |
1015 |
1038 |
1016 private: |
1039 private: |
1017 // From java.lang.invoke.MemberName: |
1040 // From java.lang.invoke.MemberName: |
1018 // private Class<?> clazz; // class in which the method is defined |
1041 // private Class<?> clazz; // class in which the method is defined |
1019 // private String name; // may be null if not yet materialized |
1042 // private String name; // may be null if not yet materialized |
1020 // private Object type; // may be null if not yet materialized |
1043 // private Object type; // may be null if not yet materialized |
1021 // private int flags; // modifier bits; see reflect.Modifier |
1044 // private int flags; // modifier bits; see reflect.Modifier |
1022 // private intptr vmtarget; // VM-specific target value |
1045 // private ResolvedMethodName method; // holds VM-specific target value |
1023 // private intptr_t vmindex; // member index within class or interface |
1046 // private intptr_t vmindex; // member index within class or interface |
1024 static int _clazz_offset; |
1047 static int _clazz_offset; |
1025 static int _name_offset; |
1048 static int _name_offset; |
1026 static int _type_offset; |
1049 static int _type_offset; |
1027 static int _flags_offset; |
1050 static int _flags_offset; |
1028 static int _vmtarget_offset; |
1051 static int _method_offset; |
1029 static int _vmloader_offset; |
|
1030 static int _vmindex_offset; |
1052 static int _vmindex_offset; |
1031 |
1053 |
1032 static void compute_offsets(); |
1054 static void compute_offsets(); |
1033 |
1055 |
1034 public: |
1056 public: |
1043 static void set_name(oop mname, oop name); |
1065 static void set_name(oop mname, oop name); |
1044 |
1066 |
1045 static int flags(oop mname); |
1067 static int flags(oop mname); |
1046 static void set_flags(oop mname, int flags); |
1068 static void set_flags(oop mname, int flags); |
1047 |
1069 |
1048 static Metadata* vmtarget(oop mname); |
1070 // Link through ResolvedMethodName field to get Method* |
1049 static void set_vmtarget(oop mname, Metadata* target); |
1071 static Method* vmtarget(oop mname); |
|
1072 static void set_method(oop mname, oop method); |
1050 |
1073 |
1051 static intptr_t vmindex(oop mname); |
1074 static intptr_t vmindex(oop mname); |
1052 static void set_vmindex(oop mname, intptr_t index); |
1075 static void set_vmindex(oop mname, intptr_t index); |
1053 |
1076 |
1054 // Testers |
1077 // Testers |
1076 // Accessors for code generation: |
1099 // Accessors for code generation: |
1077 static int clazz_offset_in_bytes() { return _clazz_offset; } |
1100 static int clazz_offset_in_bytes() { return _clazz_offset; } |
1078 static int type_offset_in_bytes() { return _type_offset; } |
1101 static int type_offset_in_bytes() { return _type_offset; } |
1079 static int name_offset_in_bytes() { return _name_offset; } |
1102 static int name_offset_in_bytes() { return _name_offset; } |
1080 static int flags_offset_in_bytes() { return _flags_offset; } |
1103 static int flags_offset_in_bytes() { return _flags_offset; } |
1081 static int vmtarget_offset_in_bytes() { return _vmtarget_offset; } |
1104 static int method_offset_in_bytes() { return _method_offset; } |
1082 static int vmindex_offset_in_bytes() { return _vmindex_offset; } |
1105 static int vmindex_offset_in_bytes() { return _vmindex_offset; } |
1083 |
|
1084 static bool equals(oop mt1, oop mt2); |
|
1085 }; |
1106 }; |
1086 |
1107 |
1087 |
1108 |
1088 // Interface to java.lang.invoke.MethodType objects |
1109 // Interface to java.lang.invoke.MethodType objects |
1089 |
1110 |
1356 static Method* get_method(Handle stackFrame, InstanceKlass* holder, TRAPS); |
1377 static Method* get_method(Handle stackFrame, InstanceKlass* holder, TRAPS); |
1357 |
1378 |
1358 public: |
1379 public: |
1359 // Setters |
1380 // Setters |
1360 static void set_declaringClass(oop info, oop value); |
1381 static void set_declaringClass(oop info, oop value); |
1361 static void set_method_and_bci(Handle stackFrame, const methodHandle& method, int bci); |
1382 static void set_method_and_bci(Handle stackFrame, const methodHandle& method, int bci, TRAPS); |
1362 static void set_bci(oop info, int value); |
1383 static void set_bci(oop info, int value); |
1363 |
1384 |
1364 static void set_version(oop info, short value); |
1385 static void set_version(oop info, short value); |
1365 |
1386 |
1366 static void compute_offsets(); |
1387 static void compute_offsets(); |
1470 klass##_##name##_enum, |
1491 klass##_##name##_enum, |
1471 |
1492 |
1472 #define ALL_INJECTED_FIELDS(macro) \ |
1493 #define ALL_INJECTED_FIELDS(macro) \ |
1473 CLASS_INJECTED_FIELDS(macro) \ |
1494 CLASS_INJECTED_FIELDS(macro) \ |
1474 CLASSLOADER_INJECTED_FIELDS(macro) \ |
1495 CLASSLOADER_INJECTED_FIELDS(macro) \ |
|
1496 RESOLVEDMETHOD_INJECTED_FIELDS(macro) \ |
1475 MEMBERNAME_INJECTED_FIELDS(macro) \ |
1497 MEMBERNAME_INJECTED_FIELDS(macro) \ |
1476 CALLSITECONTEXT_INJECTED_FIELDS(macro) \ |
1498 CALLSITECONTEXT_INJECTED_FIELDS(macro) \ |
1477 STACKFRAMEINFO_INJECTED_FIELDS(macro) \ |
1499 STACKFRAMEINFO_INJECTED_FIELDS(macro) \ |
1478 MODULE_INJECTED_FIELDS(macro) |
1500 MODULE_INJECTED_FIELDS(macro) |
1479 |
1501 |