Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Side by Side Diff: src/compiler/checkpoint-elimination.cc

Issue 2022033004: [turbofan] Rename {CheckPoint} to {Checkpoint} everywhere. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_turbofan-checkpoint-reduce
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/common-operator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/checkpoint-elimination.h" 5 #include "src/compiler/checkpoint-elimination.h"
6 6
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
11 namespace compiler { 11 namespace compiler {
12 12
13 CheckpointElimination::CheckpointElimination(Editor* editor) 13 CheckpointElimination::CheckpointElimination(Editor* editor)
14 : AdvancedReducer(editor) {} 14 : AdvancedReducer(editor) {}
15 15
16 namespace { 16 namespace {
17 17
18 // The given checkpoint is redundant if it is effect-wise dominated by another 18 // The given checkpoint is redundant if it is effect-wise dominated by another
19 // checkpoint and there is no observable write in between. For now we consider 19 // checkpoint and there is no observable write in between. For now we consider
20 // a linear effect chain only instead of true effect-wise dominance. 20 // a linear effect chain only instead of true effect-wise dominance.
21 bool IsRedundantCheckPoint(Node* node) { 21 bool IsRedundantCheckpoint(Node* node) {
22 Node* effect = NodeProperties::GetEffectInput(node); 22 Node* effect = NodeProperties::GetEffectInput(node);
23 while (effect->op()->HasProperty(Operator::kNoWrite) && 23 while (effect->op()->HasProperty(Operator::kNoWrite) &&
24 effect->op()->EffectInputCount() == 1) { 24 effect->op()->EffectInputCount() == 1) {
25 if (effect->opcode() == IrOpcode::kCheckPoint) return true; 25 if (effect->opcode() == IrOpcode::kCheckpoint) return true;
26 effect = NodeProperties::GetEffectInput(effect); 26 effect = NodeProperties::GetEffectInput(effect);
27 } 27 }
28 return false; 28 return false;
29 } 29 }
30 30
31 } // namespace 31 } // namespace
32 32
33 Reduction CheckpointElimination::Reduce(Node* node) { 33 Reduction CheckpointElimination::Reduce(Node* node) {
34 if (node->opcode() != IrOpcode::kCheckPoint) return NoChange(); 34 if (node->opcode() != IrOpcode::kCheckpoint) return NoChange();
35 if (IsRedundantCheckPoint(node)) { 35 if (IsRedundantCheckpoint(node)) {
36 return Replace(NodeProperties::GetEffectInput(node)); 36 return Replace(NodeProperties::GetEffectInput(node));
37 } 37 }
38 return NoChange(); 38 return NoChange();
39 } 39 }
40 40
41 } // namespace compiler 41 } // namespace compiler
42 } // namespace internal 42 } // namespace internal
43 } // namespace v8 43 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/common-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698