summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2024-04-22 16:49:25 +0200
committer VladimĂ­r Marko <vmarko@google.com> 2024-04-25 14:14:58 +0000
commit20668496dda44e4877d3c29afc22cd098701d461 (patch)
treec71c813881f24ee578ce238c90ece97259844c76 /compiler/optimizing/code_generator.h
parentfd7441229120ceaf5ea36d9dbfab86e3ade638db (diff)
Fast-path for `HInstanceOf`/`kInterfaceCheck`.
Implemented for arm, arm64, x86 and x86-64 for now. The implementation for riscv64 shall be added later. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 333690895 Change-Id: I43f9820c9928601ecebf172b38df17fa13d35fab
Diffstat (limited to 'compiler/optimizing/code_generator.h')
-rw-r--r--compiler/optimizing/code_generator.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h
index 970da76c43..3ac4bd7dcc 100644
--- a/compiler/optimizing/code_generator.h
+++ b/compiler/optimizing/code_generator.h
@@ -461,11 +461,13 @@ class CodeGenerator : public DeletableArenaObject<kArenaAllocCodeGenerator> {
DataType::Type type2);
bool InstanceOfNeedsReadBarrier(HInstanceOf* instance_of) {
- // Used only for kExactCheck, kAbstractClassCheck, kClassHierarchyCheck and kArrayObjectCheck.
+ // Used only for `kExactCheck`, `kAbstractClassCheck`, `kClassHierarchyCheck`,
+ // `kArrayObjectCheck` and `kInterfaceCheck`.
DCHECK(instance_of->GetTypeCheckKind() == TypeCheckKind::kExactCheck ||
instance_of->GetTypeCheckKind() == TypeCheckKind::kAbstractClassCheck ||
instance_of->GetTypeCheckKind() == TypeCheckKind::kClassHierarchyCheck ||
- instance_of->GetTypeCheckKind() == TypeCheckKind::kArrayObjectCheck)
+ instance_of->GetTypeCheckKind() == TypeCheckKind::kArrayObjectCheck ||
+ instance_of->GetTypeCheckKind() == TypeCheckKind::kInterfaceCheck)
<< instance_of->GetTypeCheckKind();
// If the target class is in the boot or app image, it's non-moveable and it doesn't matter
// if we compare it with a from-space or to-space reference, the result is the same.