diff options
| author | 2015-11-21 00:55:35 +0000 | |
|---|---|---|
| committer | 2015-11-21 00:55:35 +0000 | |
| commit | b48cb936e6fa52d0ded29bac4f1f654cdf112ac6 (patch) | |
| tree | b192c4698c4889ae90db6abe2652199802213fe6 /runtime/lambda/box_class_table-inl.h | |
| parent | 3944f7175dcf60316ba58a42698ccf23c65ac57c (diff) | |
| parent | 457e874459ae638145cab6d572e34d48480e39d2 (diff) | |
Merge "lambda: Add support for invoke-interface for boxed innate lambdas"
Diffstat (limited to 'runtime/lambda/box_class_table-inl.h')
| -rw-r--r-- | runtime/lambda/box_class_table-inl.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/runtime/lambda/box_class_table-inl.h b/runtime/lambda/box_class_table-inl.h new file mode 100644 index 0000000000..2fc34a7b2c --- /dev/null +++ b/runtime/lambda/box_class_table-inl.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2015 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ART_RUNTIME_LAMBDA_BOX_CLASS_TABLE_INL_H_ +#define ART_RUNTIME_LAMBDA_BOX_CLASS_TABLE_INL_H_ + +#include "lambda/box_class_table.h" +#include "thread.h" + +namespace art { +namespace lambda { + +template <typename Visitor> +inline void BoxClassTable::VisitRoots(const Visitor& visitor) { + MutexLock mu(Thread::Current(), *Locks::lambda_class_table_lock_); + for (std::pair<UnorderedMapKeyType, ValueType>& key_value : map_) { + ValueType& gc_root = key_value.second; + visitor.VisitRoot(gc_root.AddressWithoutBarrier()); + } +} + +} // namespace lambda +} // namespace art + +#endif // ART_RUNTIME_LAMBDA_BOX_CLASS_TABLE_INL_H_ |