diff options
| author | 2025-02-18 02:45:48 -0800 | |
|---|---|---|
| committer | 2025-02-18 02:45:48 -0800 | |
| commit | db67b2502d201b0f2323d0ba25150b93764a1e8a (patch) | |
| tree | e78dc8a2c7fc92f511e356cfb102cc9ee92f499f /compiler/optimizing | |
| parent | e85d1697e2e912ce27323b26692c95accb6c347d (diff) | |
| parent | 95be52715c46d44c43601529341a26f905b84ef8 (diff) | |
Optimizing: Add comments to `HInstruction::Add{,Env}UseAt()`. am: 70c0403aff am: 95be52715c
Original change: https://android-review.googlesource.com/c/platform/art/+/3497155
Change-Id: Iaa79ae1ff45a68c62717a8550ff1e6fe0a8383b3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'compiler/optimizing')
| -rw-r--r-- | compiler/optimizing/nodes.h | 8 |
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()) { |