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

Side by Side Diff: src/compiler/redundancy-elimination.h

Issue 2527083002: [turbofan] Use bounds checks to eliminate subsequent inc/dec overflow checks. (Closed)
Patch Set: Remove dead code Created 4 years 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/redundancy-elimination.cc » ('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 #ifndef V8_COMPILER_REDUNDANCY_ELIMINATION_H_ 5 #ifndef V8_COMPILER_REDUNDANCY_ELIMINATION_H_
6 #define V8_COMPILER_REDUNDANCY_ELIMINATION_H_ 6 #define V8_COMPILER_REDUNDANCY_ELIMINATION_H_
7 7
8 #include "src/compiler/graph-reducer.h" 8 #include "src/compiler/graph-reducer.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 16 matching lines...) Expand all
27 27
28 class EffectPathChecks final { 28 class EffectPathChecks final {
29 public: 29 public:
30 static EffectPathChecks* Copy(Zone* zone, EffectPathChecks const* checks); 30 static EffectPathChecks* Copy(Zone* zone, EffectPathChecks const* checks);
31 static EffectPathChecks const* Empty(Zone* zone); 31 static EffectPathChecks const* Empty(Zone* zone);
32 bool Equals(EffectPathChecks const* that) const; 32 bool Equals(EffectPathChecks const* that) const;
33 void Merge(EffectPathChecks const* that); 33 void Merge(EffectPathChecks const* that);
34 34
35 EffectPathChecks const* AddCheck(Zone* zone, Node* node) const; 35 EffectPathChecks const* AddCheck(Zone* zone, Node* node) const;
36 Node* LookupCheck(Node* node) const; 36 Node* LookupCheck(Node* node) const;
37 Node* LookupBoundsCheckFor(Node* node) const;
37 38
38 private: 39 private:
39 EffectPathChecks(Check* head, size_t size) : head_(head), size_(size) {} 40 EffectPathChecks(Check* head, size_t size) : head_(head), size_(size) {}
40 41
41 // We keep track of the list length so that we can find the longest 42 // We keep track of the list length so that we can find the longest
42 // common tail easily. 43 // common tail easily.
43 Check* head_; 44 Check* head_;
44 size_t size_; 45 size_t size_;
45 }; 46 };
46 47
47 class PathChecksForEffectNodes final { 48 class PathChecksForEffectNodes final {
48 public: 49 public:
49 explicit PathChecksForEffectNodes(Zone* zone) : info_for_node_(zone) {} 50 explicit PathChecksForEffectNodes(Zone* zone) : info_for_node_(zone) {}
50 EffectPathChecks const* Get(Node* node) const; 51 EffectPathChecks const* Get(Node* node) const;
51 void Set(Node* node, EffectPathChecks const* checks); 52 void Set(Node* node, EffectPathChecks const* checks);
52 53
53 private: 54 private:
54 ZoneVector<EffectPathChecks const*> info_for_node_; 55 ZoneVector<EffectPathChecks const*> info_for_node_;
55 }; 56 };
56 57
57 Reduction ReduceCheckNode(Node* node); 58 Reduction ReduceCheckNode(Node* node);
58 Reduction ReduceEffectPhi(Node* node); 59 Reduction ReduceEffectPhi(Node* node);
59 Reduction ReduceStart(Node* node); 60 Reduction ReduceStart(Node* node);
60 Reduction ReduceOtherNode(Node* node); 61 Reduction ReduceOtherNode(Node* node);
61 62
62 Reduction TakeChecksFromFirstEffect(Node* node); 63 Reduction TakeChecksFromFirstEffect(Node* node);
63 Reduction UpdateChecks(Node* node, EffectPathChecks const* checks); 64 Reduction UpdateChecks(Node* node, EffectPathChecks const* checks);
64 65
66 Reduction TryReuseBoundsCheckForFirstInput(Node* node);
67
65 Zone* zone() const { return zone_; } 68 Zone* zone() const { return zone_; }
66 69
67 PathChecksForEffectNodes node_checks_; 70 PathChecksForEffectNodes node_checks_;
68 Zone* const zone_; 71 Zone* const zone_;
69 72
70 DISALLOW_COPY_AND_ASSIGN(RedundancyElimination); 73 DISALLOW_COPY_AND_ASSIGN(RedundancyElimination);
71 }; 74 };
72 75
73 } // namespace compiler 76 } // namespace compiler
74 } // namespace internal 77 } // namespace internal
75 } // namespace v8 78 } // namespace v8
76 79
77 #endif // V8_COMPILER_REDUNDANCY_ELIMINATION_H_ 80 #endif // V8_COMPILER_REDUNDANCY_ELIMINATION_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/redundancy-elimination.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698