summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2025-02-18 08:10:23 +0000
committer VladimĂ­r Marko <vmarko@google.com> 2025-02-18 01:56:44 -0800
commit70c0403aff06094c6b291fc0c3abb503beaeb1f0 (patch)
treeac0e06d53ccc7a575f6318b930fa533539070c5c /compiler
parent3dde8e37a452df27b5b9394fceaf922f618ed3a0 (diff)
Optimizing: Add comments to `HInstruction::Add{,Env}UseAt()`.
This is a follow-up for https://android-review.googlesource.com/3497214 to add some explanatory comments. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: Ibe759e2851d3d6c6c92a41c33e30798f37687b9f
Diffstat (limited to 'compiler')
-rw-r--r--compiler/optimizing/nodes.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 385fd293de..e59dcf26c1 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -2233,6 +2233,10 @@ class HInstruction : public ArenaObject<kArenaAllocInstruction> {
// Note: `old_begin` remains valid across `push_front()`.
auto old_begin = uses_.begin();
uses_.push_front(*new_node);
+ // To speed up this code, we inline the
+ // FixUpUserRecordsAfterUseInsertion(
+ // old_begin != uses_.end() ? ++old_begin : old_begin);
+ // to reduce branching as we know that we're going to fix up either one or two entries.
auto new_begin = uses_.begin();
user->SetRawInputRecordAt(index, HUserRecord<HInstruction*>(this, uses_.before_begin()));
if (old_begin != uses_.end()) {
@@ -2250,6 +2254,10 @@ class HInstruction : public ArenaObject<kArenaAllocInstruction> {
// Note: `old_env_begin` remains valid across `push_front()`.
auto old_env_begin = env_uses_.begin();
env_uses_.push_front(*new_node);
+ // To speed up this code, we inline the
+ // FixUpUserRecordsAfterEnvUseInsertion(
+ // old_env_begin != env_uses_.end() ? ++old_env_begin : old_env_begin);
+ // to reduce branching as we know that we're going to fix up either one or two entries.
auto new_env_begin = env_uses_.begin();
user->GetVRegs()[index] = HUserRecord<HEnvironment*>(this, env_uses_.before_begin());
if (old_env_begin != env_uses_.end()) {