diff options
author | 2015-09-27 19:50:40 +0000 | |
---|---|---|
committer | 2015-09-27 19:50:40 +0000 | |
commit | 7bbb80ab52c203e44d2ded2c947b3b03b4b31ec4 (patch) | |
tree | eb54c557467f1401c4bd5729fa2b9e8ae91e8ffd /runtime/lambda/closure.cc | |
parent | b72123440d8541362ebdb131436f9dbdda5fd329 (diff) |
Revert "lambda: Experimental support for capture-variable and liberate-variable"
Test fails.
This reverts commit b72123440d8541362ebdb131436f9dbdda5fd329.
Change-Id: Ic9ed92f8c826d8465eb36b746dc44af05caf041c
Diffstat (limited to 'runtime/lambda/closure.cc')
-rw-r--r-- | runtime/lambda/closure.cc | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/runtime/lambda/closure.cc b/runtime/lambda/closure.cc index 179e4ee7f2..95a17c660c 100644 --- a/runtime/lambda/closure.cc +++ b/runtime/lambda/closure.cc @@ -124,55 +124,6 @@ void Closure::CopyTo(void* target, size_t target_size) const { memcpy(target, this, GetSize()); } -ArtMethod* Closure::GetTargetMethod() const { - return const_cast<ArtMethod*>(lambda_info_->GetArtMethod()); -} - -uint32_t Closure::GetHashCode() const { - // Start with a non-zero constant, a prime number. - uint32_t result = 17; - - // Include the hash with the ArtMethod. - { - uintptr_t method = reinterpret_cast<uintptr_t>(GetTargetMethod()); - result = 31 * result + Low32Bits(method); - if (sizeof(method) == sizeof(uint64_t)) { - result = 31 * result + High32Bits(method); - } - } - - // Include a hash for each captured variable. - for (size_t i = 0; i < GetCapturedVariablesSize(); ++i) { - // TODO: not safe for GC-able values since the address can move and the hash code would change. - uint8_t captured_variable_raw_value; - CopyUnsafeAtOffset<uint8_t>(i, /*out*/&captured_variable_raw_value); // NOLINT: [whitespace/comma] [3] - - result = 31 * result + captured_variable_raw_value; - } - - // TODO: Fix above loop to work for objects and lambdas. - static_assert(kClosureSupportsGarbageCollection == false, - "Need to update above loop to read the hash code from the " - "objects and lambdas recursively"); - - return result; -} - -bool Closure::ReferenceEquals(const Closure* other) const { - DCHECK(other != nullptr); - - // TODO: Need rework to use read barriers once closures have references inside of them that can - // move. Until then, it's safe to just compare the data inside of it directly. - static_assert(kClosureSupportsReferences == false, - "Unsafe to use memcmp in read barrier collector"); - - if (GetSize() != other->GetSize()) { - return false; - } - - return memcmp(this, other, GetSize()); -} - size_t Closure::GetNumberOfCapturedVariables() const { // TODO: refactor into art_lambda_method.h. Parsing should only be required here as a DCHECK. VariableInfo variable_info = |