summaryrefslogtreecommitdiff
path: root/compiler/optimizing
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2022-11-07 12:37:32 +0100
committer VladimĂ­r Marko <vmarko@google.com> 2022-11-08 13:58:18 +0000
commit7267e1e5bc0b2faaa05bed0e8436868355e1508e (patch)
tree137ddbf7f848f60fed68b6e9731ea37eff0c9697 /compiler/optimizing
parent7769a2c600a20067ec8fa932afb56cd6a7f8c52c (diff)
Minor nterp improvements.
Do not resolve primitive field types for iput*, sput* before updating the interpreter cache. Introduce and use `ArtMethod::IsStringConstructor(), a convenience helper function where we avoid a read barrier for checking if the declaring class is the `String` class. Change one `CHECK_LE()` to `DCHECK_LE()`. Test: testrunner.py --host --interpreter Change-Id: I17b0409cee5321e0ca389f053da1f767d2913d08
Diffstat (limited to 'compiler/optimizing')
-rw-r--r--compiler/optimizing/instruction_builder.cc3
-rw-r--r--compiler/optimizing/sharpening.cc4
2 files changed, 3 insertions, 4 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index b7c4ba9e05..f9a513804c 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -985,8 +985,7 @@ static ArtMethod* ResolveMethod(uint16_t method_idx,
DCHECK_EQ(*imt_or_vtable_index, ImTable::GetImtIndex(resolved_method));
}
- *is_string_constructor =
- resolved_method->IsConstructor() && resolved_method->GetDeclaringClass()->IsStringClass();
+ *is_string_constructor = resolved_method->IsStringConstructor();
return resolved_method;
}
diff --git a/compiler/optimizing/sharpening.cc b/compiler/optimizing/sharpening.cc
index 1985b8c792..277edff33e 100644
--- a/compiler/optimizing/sharpening.cc
+++ b/compiler/optimizing/sharpening.cc
@@ -63,9 +63,9 @@ HInvokeStaticOrDirect::DispatchInfo HSharpening::SharpenLoadMethod(
bool for_interface_call,
CodeGenerator* codegen) {
if (kIsDebugBuild) {
- ScopedObjectAccess soa(Thread::Current()); // Required for GetDeclaringClass below.
+ ScopedObjectAccess soa(Thread::Current()); // Required for `IsStringConstructor()` below.
DCHECK(callee != nullptr);
- DCHECK(!(callee->IsConstructor() && callee->GetDeclaringClass()->IsStringClass()));
+ DCHECK(!callee->IsStringConstructor());
}
MethodLoadKind method_load_kind;