summaryrefslogtreecommitdiff
path: root/compiler/optimizing/handle_cache.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2024-10-10 14:07:05 +0200
committer VladimĂ­r Marko <vmarko@google.com> 2024-10-11 11:23:41 +0000
commit23cfc82c8eaad0b7e613dcbc2447061c06f310a0 (patch)
tree907bbbefefb75a7af8c0a8bb17e6483f8446df6a /compiler/optimizing/handle_cache.cc
parent5701a59d182cee01885717d48110903fe740159a (diff)
Refactor `HandleCache` out of `nodes.{h,cc}`.
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I4989657309b46c1e8fec3e9eb4024f1fc329fbe0
Diffstat (limited to 'compiler/optimizing/handle_cache.cc')
-rw-r--r--compiler/optimizing/handle_cache.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/compiler/optimizing/handle_cache.cc b/compiler/optimizing/handle_cache.cc
new file mode 100644
index 0000000000..fbdc8bbf32
--- /dev/null
+++ b/compiler/optimizing/handle_cache.cc
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+#include "handle_cache.h"
+
+#include "class_root-inl.h"
+#include "handle_scope-inl.h"
+#include "scoped_thread_state_change-inl.h"
+#include "thread-current-inl.h"
+
+namespace art HIDDEN {
+
+ReferenceTypeInfo::TypeHandle HandleCache::CreateRootHandle(VariableSizedHandleScope* handles,
+ ClassRoot class_root) {
+ // Mutator lock is required for NewHandle and GetClassRoot().
+ ScopedObjectAccess soa(Thread::Current());
+ return handles->NewHandle(GetClassRoot(class_root));
+}
+
+} // namespace art