summaryrefslogtreecommitdiff
path: root/runtime/class_linker_test.cc
diff options
context:
space:
mode:
author Orion Hodson <oth@google.com> 2022-01-05 14:29:05 +0000
committer Treehugger Robot <treehugger-gerrit@google.com> 2022-01-17 15:56:37 +0000
commitb08e11586f27cd5902ded2043727dacac2835ff9 (patch)
tree62da6cf6cbcc53e4c689c14ca13e0730b613bed0 /runtime/class_linker_test.cc
parent3a7d0d8da758471e090f87b32f15ed610cb818f8 (diff)
MethodHandles: change asType() / invoke() implementation
This CL changes how we deal with non-exact invokes and asType(). Specifically: 1. It drops the concept of `nominalType` from our implementation and adds an AsTypeAdapter transformer for performing pairwise conversions. This means asType() conversions are orthogonal to other transforms and easier to reason about. 2. It switches to use the asTypeCache to reduce the cost of non-exact invokes. 3. It adds MethodType::IsInPlaceConvertible in the fast-path for MethodHandle.invoke() to avoid an asTypeAdapter transformer when the required conversions can be performed in-place with no-ops. This is possible because the ShadowFrame deals in 32-bit vregs so conversions like byte -> int are no-ops. Bug: 207844518 Test: art/test.py --host Test: atest CtsLibcoreTestCases Change-Id: I2faf260b164767104c7ae0bc061fbf4f6579bbff
Diffstat (limited to 'runtime/class_linker_test.cc')
-rw-r--r--runtime/class_linker_test.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc
index 2400f9fb8e..a789831238 100644
--- a/runtime/class_linker_test.cc
+++ b/runtime/class_linker_test.cc
@@ -743,10 +743,10 @@ struct MethodHandleOffsets : public CheckOffsets<mirror::MethodHandle> {
MethodHandleOffsets() : CheckOffsets<mirror::MethodHandle>(
false, "Ljava/lang/invoke/MethodHandle;") {
addOffset(OFFSETOF_MEMBER(mirror::MethodHandle, art_field_or_method_), "artFieldOrMethod");
+ addOffset(OFFSETOF_MEMBER(mirror::MethodHandle, as_type_cache_), "asTypeCache");
addOffset(OFFSETOF_MEMBER(mirror::MethodHandle, cached_spread_invoker_),
"cachedSpreadInvoker");
addOffset(OFFSETOF_MEMBER(mirror::MethodHandle, handle_kind_), "handleKind");
- addOffset(OFFSETOF_MEMBER(mirror::MethodHandle, nominal_type_), "nominalType");
addOffset(OFFSETOF_MEMBER(mirror::MethodHandle, method_type_), "type");
}
};