equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
792 static jlong clock(); |
792 static jlong clock(); |
793 static void set_clock(jlong value); |
793 static void set_clock(jlong value); |
794 }; |
794 }; |
795 |
795 |
796 |
796 |
797 // Interface to java.dyn.MethodHandle objects |
797 // Interface to java.lang.invoke.MethodHandle objects |
798 |
798 |
799 class MethodHandleEntry; |
799 class MethodHandleEntry; |
800 |
800 |
801 class java_dyn_MethodHandle: AllStatic { |
801 class java_lang_invoke_MethodHandle: AllStatic { |
802 friend class JavaClasses; |
802 friend class JavaClasses; |
803 |
803 |
804 private: |
804 private: |
805 static int _vmentry_offset; // assembly code trampoline for MH |
805 static int _vmentry_offset; // assembly code trampoline for MH |
806 static int _vmtarget_offset; // class-specific target reference |
806 static int _vmtarget_offset; // class-specific target reference |
837 static int vmtarget_offset_in_bytes() { return _vmtarget_offset; } |
837 static int vmtarget_offset_in_bytes() { return _vmtarget_offset; } |
838 static int vmentry_offset_in_bytes() { return _vmentry_offset; } |
838 static int vmentry_offset_in_bytes() { return _vmentry_offset; } |
839 static int vmslots_offset_in_bytes() { return _vmslots_offset; } |
839 static int vmslots_offset_in_bytes() { return _vmslots_offset; } |
840 }; |
840 }; |
841 |
841 |
842 class sun_dyn_DirectMethodHandle: public java_dyn_MethodHandle { |
842 class java_lang_invoke_DirectMethodHandle: public java_lang_invoke_MethodHandle { |
843 friend class JavaClasses; |
843 friend class JavaClasses; |
844 |
844 |
845 private: |
845 private: |
846 // _vmtarget_offset; // method or class or interface |
846 // _vmtarget_offset; // method or class or interface |
847 static int _vmindex_offset; // negative or vtable idx or itable idx |
847 static int _vmindex_offset; // negative or vtable idx or itable idx |
862 |
862 |
863 // Accessors for code generation: |
863 // Accessors for code generation: |
864 static int vmindex_offset_in_bytes() { return _vmindex_offset; } |
864 static int vmindex_offset_in_bytes() { return _vmindex_offset; } |
865 }; |
865 }; |
866 |
866 |
867 class sun_dyn_BoundMethodHandle: public java_dyn_MethodHandle { |
867 class java_lang_invoke_BoundMethodHandle: public java_lang_invoke_MethodHandle { |
868 friend class JavaClasses; |
868 friend class JavaClasses; |
869 |
869 |
870 private: |
870 private: |
871 static int _argument_offset; // argument value bound into this MH |
871 static int _argument_offset; // argument value bound into this MH |
872 static int _vmargslot_offset; // relevant argument slot (<= vmslots) |
872 static int _vmargslot_offset; // relevant argument slot (<= vmslots) |
889 |
889 |
890 static int argument_offset_in_bytes() { return _argument_offset; } |
890 static int argument_offset_in_bytes() { return _argument_offset; } |
891 static int vmargslot_offset_in_bytes() { return _vmargslot_offset; } |
891 static int vmargslot_offset_in_bytes() { return _vmargslot_offset; } |
892 }; |
892 }; |
893 |
893 |
894 class sun_dyn_AdapterMethodHandle: public sun_dyn_BoundMethodHandle { |
894 class java_lang_invoke_AdapterMethodHandle: public java_lang_invoke_BoundMethodHandle { |
895 friend class JavaClasses; |
895 friend class JavaClasses; |
896 |
896 |
897 private: |
897 private: |
898 static int _conversion_offset; // type of conversion to apply |
898 static int _conversion_offset; // type of conversion to apply |
899 static void compute_offsets(); |
899 static void compute_offsets(); |
940 |
940 |
941 static int conversion_offset_in_bytes() { return _conversion_offset; } |
941 static int conversion_offset_in_bytes() { return _conversion_offset; } |
942 }; |
942 }; |
943 |
943 |
944 |
944 |
945 // Interface to sun.dyn.MemberName objects |
945 // Interface to java.lang.invoke.MemberName objects |
946 // (These are a private interface for Java code to query the class hierarchy.) |
946 // (These are a private interface for Java code to query the class hierarchy.) |
947 |
947 |
948 class sun_dyn_MemberName: AllStatic { |
948 class java_lang_invoke_MemberName: AllStatic { |
949 friend class JavaClasses; |
949 friend class JavaClasses; |
950 |
950 |
951 private: |
951 private: |
952 // From java.dyn.MemberName: |
952 // From java.lang.invoke.MemberName: |
953 // private Class<?> clazz; // class in which the method is defined |
953 // private Class<?> clazz; // class in which the method is defined |
954 // private String name; // may be null if not yet materialized |
954 // private String name; // may be null if not yet materialized |
955 // private Object type; // may be null if not yet materialized |
955 // private Object type; // may be null if not yet materialized |
956 // private int flags; // modifier bits; see reflect.Modifier |
956 // private int flags; // modifier bits; see reflect.Modifier |
957 // private Object vmtarget; // VM-specific target value |
957 // private Object vmtarget; // VM-specific target value |
1016 static int vmtarget_offset_in_bytes() { return _vmtarget_offset; } |
1016 static int vmtarget_offset_in_bytes() { return _vmtarget_offset; } |
1017 static int vmindex_offset_in_bytes() { return _vmindex_offset; } |
1017 static int vmindex_offset_in_bytes() { return _vmindex_offset; } |
1018 }; |
1018 }; |
1019 |
1019 |
1020 |
1020 |
1021 // Interface to java.dyn.MethodType objects |
1021 // Interface to java.lang.invoke.MethodType objects |
1022 |
1022 |
1023 class java_dyn_MethodType: AllStatic { |
1023 class java_lang_invoke_MethodType: AllStatic { |
1024 friend class JavaClasses; |
1024 friend class JavaClasses; |
1025 |
1025 |
1026 private: |
1026 private: |
1027 static int _rtype_offset; |
1027 static int _rtype_offset; |
1028 static int _ptypes_offset; |
1028 static int _ptypes_offset; |
1050 static int rtype_offset_in_bytes() { return _rtype_offset; } |
1050 static int rtype_offset_in_bytes() { return _rtype_offset; } |
1051 static int ptypes_offset_in_bytes() { return _ptypes_offset; } |
1051 static int ptypes_offset_in_bytes() { return _ptypes_offset; } |
1052 static int form_offset_in_bytes() { return _form_offset; } |
1052 static int form_offset_in_bytes() { return _form_offset; } |
1053 }; |
1053 }; |
1054 |
1054 |
1055 class java_dyn_MethodTypeForm: AllStatic { |
1055 class java_lang_invoke_MethodTypeForm: AllStatic { |
1056 friend class JavaClasses; |
1056 friend class JavaClasses; |
1057 |
1057 |
1058 private: |
1058 private: |
1059 static int _vmslots_offset; // number of argument slots needed |
1059 static int _vmslots_offset; // number of argument slots needed |
1060 static int _erasedType_offset; // erasedType = canonical MethodType |
1060 static int _erasedType_offset; // erasedType = canonical MethodType |
1073 static int erasedType_offset_in_bytes() { return _erasedType_offset; } |
1073 static int erasedType_offset_in_bytes() { return _erasedType_offset; } |
1074 static int genericInvoker_offset_in_bytes() { return _genericInvoker_offset; } |
1074 static int genericInvoker_offset_in_bytes() { return _genericInvoker_offset; } |
1075 }; |
1075 }; |
1076 |
1076 |
1077 |
1077 |
1078 // Interface to java.dyn.CallSite objects |
1078 // Interface to java.lang.invoke.CallSite objects |
1079 |
1079 |
1080 class java_dyn_CallSite: AllStatic { |
1080 class java_lang_invoke_CallSite: AllStatic { |
1081 friend class JavaClasses; |
1081 friend class JavaClasses; |
1082 |
1082 |
1083 private: |
1083 private: |
1084 static int _target_offset; |
1084 static int _target_offset; |
1085 static int _caller_method_offset; |
1085 static int _caller_method_offset; |