55 // Indexes into methodHandles:
56 static final int
57 MH_BASIC_INV = 0, // cached instance of MH.invokeBasic
58 MH_NF_INV = 1, // cached helper for LF.NamedFunction
59 MH_UNINIT_CS = 2, // uninitialized call site
60 MH_LIMIT = 3;
61
62 // Cached lambda form information, for basic types only:
63 final @Stable LambdaForm[] lambdaForms;
64 // Indexes into lambdaForms:
65 static final int
66 LF_INVVIRTUAL = 0, // DMH invokeVirtual
67 LF_INVSTATIC = 1,
68 LF_INVSPECIAL = 2,
69 LF_NEWINVSPECIAL = 3,
70 LF_INVINTERFACE = 4,
71 LF_INVSTATIC_INIT = 5, // DMH invokeStatic with <clinit> barrier
72 LF_INTERPRET = 6, // LF interpreter
73 LF_REBIND = 7, // BoundMethodHandle
74 LF_DELEGATE = 8, // DelegatingMethodHandle
75 LF_EX_LINKER = 9, // invokeExact_MT (for invokehandle)
76 LF_EX_INVOKER = 10, // MHs.invokeExact
77 LF_GEN_LINKER = 11, // generic invoke_MT (for invokehandle)
78 LF_GEN_INVOKER = 12, // generic MHs.invoke
79 LF_CS_LINKER = 13, // linkToCallSite_CS
80 LF_MH_LINKER = 14, // linkToCallSite_MH
81 LF_GWC = 15, // guardWithCatch (catchException)
82 LF_GWT = 16, // guardWithTest
83 LF_LIMIT = 17;
84
85 /** Return the type corresponding uniquely (1-1) to this MT-form.
86 * It might have any primitive returns or arguments, but will have no references except Object.
87 */
88 public MethodType erasedType() {
89 return erasedType;
90 }
91
92 /** Return the basic type derived from the erased type of this MT-form.
93 * A basic type is erased (all references Object) and also has all primitive
94 * types (except int, long, float, double, void) normalized to int.
95 * Such basic types correspond to low-level JVM calling sequences.
96 */
97 public MethodType basicType() {
98 return basicType;
99 }
100
101 private boolean assertIsBasicType() {
102 // primitives must be flattened also
103 assert(erasedType == basicType)
|
55 // Indexes into methodHandles:
56 static final int
57 MH_BASIC_INV = 0, // cached instance of MH.invokeBasic
58 MH_NF_INV = 1, // cached helper for LF.NamedFunction
59 MH_UNINIT_CS = 2, // uninitialized call site
60 MH_LIMIT = 3;
61
62 // Cached lambda form information, for basic types only:
63 final @Stable LambdaForm[] lambdaForms;
64 // Indexes into lambdaForms:
65 static final int
66 LF_INVVIRTUAL = 0, // DMH invokeVirtual
67 LF_INVSTATIC = 1,
68 LF_INVSPECIAL = 2,
69 LF_NEWINVSPECIAL = 3,
70 LF_INVINTERFACE = 4,
71 LF_INVSTATIC_INIT = 5, // DMH invokeStatic with <clinit> barrier
72 LF_INTERPRET = 6, // LF interpreter
73 LF_REBIND = 7, // BoundMethodHandle
74 LF_DELEGATE = 8, // DelegatingMethodHandle
75 LF_DELEGATE_BLOCK_INLINING = 9, // Counting DelegatingMethodHandle w/ @DontInline
76 LF_EX_LINKER = 10, // invokeExact_MT (for invokehandle)
77 LF_EX_INVOKER = 11, // MHs.invokeExact
78 LF_GEN_LINKER = 12, // generic invoke_MT (for invokehandle)
79 LF_GEN_INVOKER = 13, // generic MHs.invoke
80 LF_CS_LINKER = 14, // linkToCallSite_CS
81 LF_MH_LINKER = 15, // linkToCallSite_MH
82 LF_GWC = 16, // guardWithCatch (catchException)
83 LF_GWT = 17, // guardWithTest
84 LF_LIMIT = 18;
85
86 /** Return the type corresponding uniquely (1-1) to this MT-form.
87 * It might have any primitive returns or arguments, but will have no references except Object.
88 */
89 public MethodType erasedType() {
90 return erasedType;
91 }
92
93 /** Return the basic type derived from the erased type of this MT-form.
94 * A basic type is erased (all references Object) and also has all primitive
95 * types (except int, long, float, double, void) normalized to int.
96 * Such basic types correspond to low-level JVM calling sequences.
97 */
98 public MethodType basicType() {
99 return basicType;
100 }
101
102 private boolean assertIsBasicType() {
103 // primitives must be flattened also
104 assert(erasedType == basicType)
|