Home
last modified time | relevance | path

Searched refs:MethodHandle (Results 1 – 25 of 94) sorted by relevance

1234

/art/runtime/mirror/
Dmethod_handle_impl-inl.h28 inline MethodHandle::Kind MethodHandle::GetHandleKind() REQUIRES_SHARED(Locks::mutator_lock_) { in GetHandleKind()
29 const int32_t handle_kind = GetField32(OFFSET_OF_OBJECT_MEMBER(MethodHandle, handle_kind_)); in GetHandleKind()
34 inline ObjPtr<mirror::MethodType> MethodHandle::GetMethodType() in GetMethodType()
36 return GetFieldObject<mirror::MethodType>(OFFSET_OF_OBJECT_MEMBER(MethodHandle, method_type_)); in GetMethodType()
39 inline ObjPtr<mirror::MethodHandle> MethodHandle::GetAsTypeCache() in GetAsTypeCache()
41 return GetFieldObject<mirror::MethodHandle>( in GetAsTypeCache()
42 OFFSET_OF_OBJECT_MEMBER(MethodHandle, as_type_cache_)); in GetAsTypeCache()
45 inline ArtField* MethodHandle::GetTargetField() REQUIRES_SHARED(Locks::mutator_lock_) { in GetTargetField()
47 GetField64(OFFSET_OF_OBJECT_MEMBER(MethodHandle, art_field_or_method_))); in GetTargetField()
50 inline ArtMethod* MethodHandle::GetTargetMethod() REQUIRES_SHARED(Locks::mutator_lock_) { in GetTargetMethod()
[all …]
Dmethod_handle_impl.h36 class MANAGED MethodHandle : public Object {
69 ObjPtr<mirror::MethodHandle> GetAsTypeCache() REQUIRES_SHARED(Locks::mutator_lock_);
88 HeapReference<mirror::MethodHandle> as_type_cache_;
89 HeapReference<mirror::MethodHandle> cached_spread_invoker_;
96 return MemberOffset(OFFSETOF_MEMBER(MethodHandle, cached_spread_invoker_)); in CachedSpreadInvokerOffset()
99 return MemberOffset(OFFSETOF_MEMBER(MethodHandle, as_type_cache_)); in AsTypeCacheOffset()
102 return MemberOffset(OFFSETOF_MEMBER(MethodHandle, method_type_)); in MethodTypeOffset()
105 return MemberOffset(OFFSETOF_MEMBER(MethodHandle, art_field_or_method_)); in ArtFieldOrMethodOffset()
108 return MemberOffset(OFFSETOF_MEMBER(MethodHandle, handle_kind_)); in HandleKindOffset()
112 DISALLOW_IMPLICIT_CONSTRUCTORS(MethodHandle);
[all …]
Dmethod_handle_impl.cc25 const char* MethodHandle::GetReturnTypeDescriptor(const char* invoke_method_name) { in GetReturnTypeDescriptor()
33 void MethodHandle::Initialize(uintptr_t art_field_or_method, in Initialize()
47 MethodHandle::Kind kind, in Create()
57 void MethodHandle::VisitTarget(ReflectiveValueVisitor* v) { in VisitTarget()
Dcall_site-inl.h27 inline ObjPtr<MethodHandle> CallSite::GetTarget() { in GetTarget()
28 return GetFieldObject<MethodHandle>(TargetOffset()); in GetTarget()
/art/test/1981-structural-redef-private-method-handles/
Dexpected_no_mh.txt2 Reading field FOO using (ID: 0) MethodHandle()Object = (ID: 1) value of <FOO FIELD>
3 Reading field BAR using (ID: 2) MethodHandle()Object = (ID: 3) value of <BAR FIELD>
6 Reading field FOO using (ID: 0) MethodHandle()Object = (ID: 1) value of <FOO FIELD>
7 Reading field BAR using (ID: 2) MethodHandle()Object = (ID: 3) value of <BAR FIELD>
8 Reading new field BAZ using (ID: 4) MethodHandle()Object = (ID: 5) <NULL>
9 Reading new field FOO using (ID: 6) MethodHandle()Object = (ID: 1) value of <FOO FIELD>
10 Reading new field BAR using (ID: 7) MethodHandle()Object = (ID: 3) value of <BAR FIELD>
17 Reading field FOO using (ID: 0) MethodHandle()Object = (ID: 9) class art.Test1981$Transform
18 Reading field BAR using (ID: 2) MethodHandle()Object = (ID: 3) value of <BAR FIELD>
19 Reading new field BAZ using (ID: 4) MethodHandle()Object = (ID: 10) 42
[all …]
Dexpected-stdout.txt2 Reading field FOO using (ID: 0) MethodHandle()Object = (ID: 1) value of <FOO FIELD>
4 Reading field BAR using (ID: 3) MethodHandle()Object = (ID: 4) value of <BAR FIELD>
8 Reading field FOO using (ID: 0) MethodHandle()Object = (ID: 1) value of <FOO FIELD>
10 Reading field BAR using (ID: 3) MethodHandle()Object = (ID: 4) value of <BAR FIELD>
12 Reading new field BAZ using (ID: 6) MethodHandle()Object = (ID: 7) <NULL>
14 Reading new field FOO using (ID: 9) MethodHandle()Object = (ID: 1) value of <FOO FIELD>
16 Reading new field BAR using (ID: 11) MethodHandle()Object = (ID: 4) value of <BAR FIELD>
28 Reading field FOO using (ID: 0) MethodHandle()Object = (ID: 15) new_value object
30 Reading field BAR using (ID: 3) MethodHandle()Object = (ID: 4) value of <BAR FIELD>
32 Reading new field BAZ using (ID: 6) MethodHandle()Object = (ID: 16) 42
[all …]
/art/test/957-methodhandle-transforms/src/
DMain.java17 import java.lang.invoke.MethodHandle;
49 MethodHandle handle = MethodHandles.throwException(String.class, in testThrowException()
73 MethodHandle delegate = MethodHandles.lookup().findStatic(Main.class, in testDropArguments()
77 MethodHandle transform = MethodHandles.dropArguments(delegate, 0, int.class, Object.class); in testDropArguments()
159 MethodHandle target = MethodHandles.lookup().findStatic(Main.class, in testCatchException()
163 MethodHandle handler = MethodHandles.lookup().findStatic(Main.class, in testCatchException()
168 MethodHandle adapter = MethodHandles.catchException(target, IllegalArgumentException.class, in testCatchException()
234 MethodHandle test = MethodHandles.lookup().findStatic(Main.class, in testGuardWithTest()
241 final MethodHandle target = MethodHandles.lookup().findStatic(Main.class, in testGuardWithTest()
243 final MethodHandle fallback = MethodHandles.lookup().findStatic(Main.class, in testGuardWithTest()
[all …]
/art/test/1975-hello-structural-transformation/
Dexpected-stdout.txt3 Saving MethodHandle object (ID: 2) MethodHandle()Class for later
4 Saving MethodHandle object (ID: 3) MethodHandle()byte[] for later
5 Saving writable MethodHandle (ID: 4) MethodHandle(Class)void for later
20 (ID: 7) MethodHandle()Class (public static java.lang.Class art.Transform1975.CUR_CLASS) = (ID: 5) c…
21 (ID: 8) MethodHandle()byte[] (public static byte[] art.Transform1975.REDEFINED_DEX_BYTES) = (ID: 6)…
37 (ID: 9) MethodHandle()Class (public static java.lang.Class art.Transform1975.CUR_CLASS) = (ID: 5) c…
38 (ID: 10) MethodHandle()byte[] (public static byte[] art.Transform1975.REDEFINED_DEX_BYTES) = (ID: 6…
57 (ID: 12) MethodHandle()Class (public static java.lang.Class art.Transform1975.CUR_CLASS) = (ID: 5) …
58 (ID: 13) MethodHandle()String (public static java.lang.String art.Transform1975.NEW_STRING) = (ID: …
59 (ID: 14) MethodHandle()byte[] (public static byte[] art.Transform1975.REDEFINED_DEX_BYTES) = (ID: 6…
[all …]
/art/test/716-jli-jit-samples/src-art/
DMain.java17 import java.lang.invoke.MethodHandle;
82 MethodHandle mh = in testMethodHandleCounters()
88 assertEquals(initialHotnessCounter, getHotnessCounter(MethodHandle.class, "invoke")); in testMethodHandleCounters()
89 … assertEquals(initialHotnessCounter, getHotnessCounter(MethodHandle.class, "invokeExact")); in testMethodHandleCounters()
94 Method invokeMethod = MethodHandle.class.getMethod(methodName, Object[].class); in testMethodHandleCounters()
95 MethodHandle instance = in testMethodHandleCounters()
107 getHotnessCounter(MethodHandle.class, "invoke")); in testMethodHandleCounters()
109 getHotnessCounter(MethodHandle.class, "invokeExact")); in testMethodHandleCounters()
/art/test/979-const-method-handle/src/
DMain.java19 import java.lang.invoke.MethodHandle;
113 private static MethodHandle printHelloHandle() { in printHelloHandle()
123 private static MethodHandle setNameHandle() { in setNameHandle()
133 private static MethodHandle getNameHandle() { in getNameHandle()
143 private static MethodHandle getMathE() { in getMathE()
153 private static MethodHandle putMathE() { in putMathE()
163 private static MethodHandle getSval() { in getSval()
175 private static MethodHandle putPeekc() { in putPeekc()
185 private static MethodHandle stackPop() { in stackPop()
195 private static MethodHandle stackTrim() { in stackTrim()
[all …]
/art/test/959-invoke-polymorphic-accessors/src/
DMain.java16 import java.lang.invoke.MethodHandle;
103 static void setByte(MethodHandle m, ValueHolder v, byte value, boolean expectFailure) in setByte()
120 static void setByte(MethodHandle m, byte value, boolean expectFailure) throws Throwable { in setByte()
124 static void getByte(MethodHandle m, ValueHolder v, byte value, boolean expectFailure) in getByte()
142 static void getByte(MethodHandle m, byte value, boolean expectFailure) throws Throwable { in getByte()
146 static void setChar(MethodHandle m, ValueHolder v, char value, boolean expectFailure) in setChar()
163 static void setChar(MethodHandle m, char value, boolean expectFailure) throws Throwable { in setChar()
167 static void getChar(MethodHandle m, ValueHolder v, char value, boolean expectFailure) in getChar()
185 static void getChar(MethodHandle m, char value, boolean expectFailure) throws Throwable { in getChar()
189 static void setShort(MethodHandle m, ValueHolder v, short value, boolean expectFailure) in setShort()
[all …]
/art/test/953-invoke-polymorphic-compiler/src/
DMain.java17 import java.lang.invoke.MethodHandle;
114 MethodHandle mh; in $opt$BasicTest()
174 MethodHandle mh0 = null; in $opt$BasicTest()
228 MethodHandle mh = in $opt$ReturnBooleanTest()
256 MethodHandle mh = lookup.findStatic(Main.class, "Next", in $opt$ReturnCharTest()
265 MethodHandle mh = lookup.findStatic(Main.class, "Multiply", in $opt$ReturnByteTest()
274 MethodHandle mh = lookup.findStatic(Main.class, "Multiply", in $opt$ReturnShortTest()
283 MethodHandle mh = lookup.findStatic(Main.class, "Multiply", in $opt$ReturnIntTest()
292 MethodHandle mh = lookup.findStatic(Main.class, "Multiply", in $opt$ReturnLongTest()
301 MethodHandle mh = lookup.findStatic(Main.class, "Multiply", in $opt$ReturnFloatTest()
[all …]
/art/runtime/
Dmethod_handles.cc369 Handle<mirror::MethodHandle> method_handle, in MethodHandleInvokeTransform()
446 const mirror::MethodHandle::Kind& handle_kind, in RefineTargetMethod()
450 if (handle_kind == mirror::MethodHandle::Kind::kInvokeVirtual || in RefineTargetMethod()
451 handle_kind == mirror::MethodHandle::Kind::kInvokeInterface) { in RefineTargetMethod()
466 } else if (handle_kind == mirror::MethodHandle::Kind::kInvokeDirect) { in RefineTargetMethod()
473 } else if (handle_kind == mirror::MethodHandle::Kind::kInvokeSuper) { in RefineTargetMethod()
622 Handle<mirror::MethodHandle> method_handle, in MethodHandleFieldAccess()
627 const mirror::MethodHandle::Kind handle_kind = method_handle->GetHandleKind(); in MethodHandleFieldAccess()
631 case mirror::MethodHandle::kInstanceGet: { in MethodHandleFieldAccess()
641 case mirror::MethodHandle::kStaticGet: { in MethodHandleFieldAccess()
[all …]
Dmethod_handles.h33 class MethodHandle; variable
140 Handle<mirror::MethodHandle> method_handle,
148 Handle<mirror::MethodHandle> method_handle,
155 Handle<mirror::MethodHandle> method_handle,
/art/test/955-methodhandles-smali/smali/
DMain.smali18 # MethodHandle Main.getHandleForVirtual(Class<?> defc, String name, MethodType type);
22 …al(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/MethodHandle;
30 …al(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/MethodHandle;
35 # MethodHandle Main.getHandleForStatic(Class<?> defc, String name, MethodType type);
39 …ic(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/MethodHandle;
47 …ic(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/MethodHandle;
53 .method public static getStringConcatHandle()Ljava/lang/invoke/MethodHandle;
64 …al(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/MethodHandle;
70 .method public static getLongCompareToHandle()Ljava/lang/invoke/MethodHandle;
87 …al(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/MethodHandle;
[all …]
/art/test/952-invoke-custom/src/
DTestInvocationKinds.java21 import java.lang.invoke.MethodHandle;
32 MethodHandle mh = in lookupStaticFieldGetter()
54 MethodHandle mh = in lookupStaticFieldSetter()
78 MethodHandle mh = in lookupInstanceFieldSetter()
101 MethodHandle mh = in lookupInstanceFieldGetter()
147 MethodHandle mh = lookup.findVirtual(TestInvocationKinds.class, name, mt); in lookupVirtual()
185 MethodHandle mh = lookup.findConstructor(cls, constructorMethodType); in lookupConstructor()
/art/test/1976-hello-structural-static-methods/
Dexpected-stdout.txt17 Invoking MethodHandle()void (public static void art.Transform1976.sayEverything())
19 Invoking MethodHandle()void (public static void art.Transform1976.sayHi())
58 Invoking MethodHandle()void (public static void art.Transform1976.sayEverything())
61 Invoking MethodHandle()void (public static void art.Transform1976.sayHi())
64 Invoking MethodHandle()void (public static void art.Transform1976.sayBye())
66 Invoking MethodHandle()void (public static void art.Transform1976.sayEverything())
69 Invoking MethodHandle()void (public static void art.Transform1976.sayHi())
/art/test/958-methodhandle-stackframe/src-art/
DMain.java17 import java.lang.invoke.MethodHandle;
70 private final MethodHandle delegate;
72 public DelegatingTransformer(MethodHandle delegate) { in DelegatingTransformer()
84 MethodHandle specialFunctionHandle = MethodHandles.lookup().findStatic( in main()
89 MethodHandle delegate = new DelegatingTransformer(specialFunctionHandle); in main()
118 MethodHandle returner = MethodHandles.lookup().findStatic( in main()
/art/test/954-invoke-polymorphic-verifier/smali/
DMethodHandleToString.smali24 invoke-static {}, LMethodHandleToString;->getMethodHandle()Ljava/lang/invoke/MethodHandle;
26 # Attempt invoke-polymorphic on MethodHandle.toString().
27 …invoke-polymorphic {v0}, Ljava/lang/invoke/MethodHandle;->toString()Ljava/lang/String;, ()Ljava/la…
31 .method public static getMethodHandle()Ljava/lang/invoke/MethodHandle;
DMethodHandleNotInvoke.smali24 invoke-static {}, LMethodHandleNotInvoke;->getMethodHandle()Ljava/lang/invoke/MethodHandle;
28 # Attempt invoke-polymorphic on MethodHandle.notInvoke().
29 …invoke-polymorphic {v0, v1}, Ljava/lang/invoke/MethodHandle;->notInvoke([Ljava/lang/Object;)Ljava/…
33 .method public static getMethodHandle()Ljava/lang/invoke/MethodHandle;
DTooFewArguments.smali24 # Set up v0 as a null MethodHandle
27 …invoke-virtual {v0}, Ljava/lang/invoke/MethodHandle;->asFixedArity()Ljava/lang/invoke/MethodHandle;
31 …invoke-polymorphic {v0, v1}, Ljava/lang/invoke/MethodHandle;->invoke([Ljava/lang/Object;)Ljava/lan…
DSubclass.smali25 # Get a MethodHandleImpl instance (subclass of MethodHandle).
30 # Calling MethodHandle.invoke() on MethodHandleImpl instance (subclass of MethodHandle) => Okay
31 …invoke-polymorphic {v0, v1, v2}, Ljava/lang/invoke/MethodHandle;->invoke([Ljava/lang/Object;)Ljava…
32 …# Calling MethodHandleImpl.invoke() rather than MethodHandle.invoke() [ declaring class is okay ] …
DTooManyArguments.smali24 # Set up v0 as a null MethodHandle
27 …invoke-virtual {v0}, Ljava/lang/invoke/MethodHandle;->asFixedArity()Ljava/lang/invoke/MethodHandle;
33 …invoke-polymorphic {v0, v1, v2, v3}, Ljava/lang/invoke/MethodHandle;->invoke([Ljava/lang/Object;)L…
/art/test/1948-obsolete-const-method-handle/util-src/src/art/
DTest1948.java21 import java.lang.invoke.MethodHandle;
35 MethodHandle getClassBase64 = MethodHandles.lookup().findStatic(
37 MethodHandle getDexBase64 = MethodHandles.lookup().findStatic(
/art/test/959-invoke-polymorphic-accessors/
Dexpected-stdout.txt3 Passed MethodHandle.invokeExact() tests for accessors.
4 Passed MethodHandle.invoke() tests for accessors.

1234