summaryrefslogtreecommitdiff
path: root/runtime/lambda/art_lambda_method.h
diff options
context:
space:
mode:
author Igor Murashkin <iam@google.com> 2015-10-22 17:37:50 -0700
committer Igor Murashkin <iam@google.com> 2015-11-20 16:33:06 -0800
commit457e874459ae638145cab6d572e34d48480e39d2 (patch)
treeb192c4698c4889ae90db6abe2652199802213fe6 /runtime/lambda/art_lambda_method.h
parent3944f7175dcf60316ba58a42698ccf23c65ac57c (diff)
lambda: Add support for invoke-interface for boxed innate lambdas
Lambda closures created with the 'create-lambda' instruction (termed "innate lambdas") can be turned into an object with 'box-lambda'. This CL enables support for those kinds of lambdas to work with 'invoke-interface' by generating a proxy class for the lambda. Note: MIPS32/64 support not included. Bug: 24618608 Bug: 25107649 Change-Id: Ic8f1bb66ebeaed4097e758a50becf1cff6ccaefb
Diffstat (limited to 'runtime/lambda/art_lambda_method.h')
-rw-r--r--runtime/lambda/art_lambda_method.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/lambda/art_lambda_method.h b/runtime/lambda/art_lambda_method.h
index ea13eb7af6..a858bf945d 100644
--- a/runtime/lambda/art_lambda_method.h
+++ b/runtime/lambda/art_lambda_method.h
@@ -90,6 +90,17 @@ class ArtLambdaMethod {
return strlen(captured_variables_shorty_);
}
+ // Return the offset in bytes from the start of ArtLambdaMethod to the method_.
+ // -- Only should be used by assembly (stubs) support code and compiled code.
+ static constexpr size_t GetArtMethodOffset() {
+ return offsetof(ArtLambdaMethod, method_);
+ }
+
+ // Calculate how many vregs all the arguments will use when doing an invoke.
+ // (Most primitives are 1 vregs, double/long are 2, reference is 1, lambda is 2).
+ // -- This is used to know how big to set up shadow frame when invoking into the target method.
+ size_t GetArgumentVRegCount() const SHARED_REQUIRES(Locks::mutator_lock_);
+
private:
// TODO: ArtMethod, or at least the entry points should be inlined into this struct
// to avoid an extra indirect load when doing invokes.