From 6918bf13eb855b3aa8ccdddda2d27ae8c60cec56 Mon Sep 17 00:00:00 2001 From: Igor Murashkin Date: Sun, 27 Sep 2015 19:19:06 -0700 Subject: Revert "Revert "lambda: Experimental support for capture-variable and liberate-variable"" This reverts commit 7bbb80ab52c203e44d2ded2c947b3b03b4b31ec4. Change-Id: If806ce5c6c5e96fdb2c3761dee096f74e7e5b001 --- runtime/lambda/closure_builder.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'runtime/lambda/closure_builder.h') diff --git a/runtime/lambda/closure_builder.h b/runtime/lambda/closure_builder.h index 542e12afaa..23eb484529 100644 --- a/runtime/lambda/closure_builder.h +++ b/runtime/lambda/closure_builder.h @@ -40,13 +40,12 @@ class ArtLambdaMethod; // forward declaration // // The mutator lock must be held for the duration of the lifetime of this object, // since it needs to temporarily store heap references into an internal list. -class ClosureBuilder : ValueObject { +class ClosureBuilder { public: using ShortyTypeEnum = decltype(ShortyFieldType::kByte); - // Mark this primitive value to be captured as the specified type. - template + template ::value> void CaptureVariablePrimitive(T value); // Mark this object reference to be captured. @@ -63,6 +62,9 @@ class ClosureBuilder : ValueObject { // Returns how many variables have been captured so far. size_t GetCaptureCount() const; + // Get the list of captured variables' shorty field types. + const std::string& GetCapturedVariableShortyTypes() const; + // Creates a closure in-place and writes out the data into 'memory'. // Memory must be at least 'GetSize' bytes large. // All previously marked data to be captured is now written out. @@ -93,6 +95,7 @@ class ClosureBuilder : ValueObject { size_t size_ = kInitialSize; bool is_dynamic_size_ = false; std::vector values_; + std::string shorty_types_; }; } // namespace lambda -- cgit v1.2.3-59-g8ed1b