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

Side by Side Diff: src/compiler/ast-loop-assignment-analyzer.h

Issue 1578723002: [turbofan] Build s/NULL/nullptr/g and CHECK(x != nullptr) to CHECK_NOT_NULL(x). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/ast-loop-assignment-analyzer.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_AST_LOOP_ASSIGNMENT_ANALYZER_H_ 5 #ifndef V8_COMPILER_AST_LOOP_ASSIGNMENT_ANALYZER_H_
6 #define V8_COMPILER_AST_LOOP_ASSIGNMENT_ANALYZER_H_ 6 #define V8_COMPILER_AST_LOOP_ASSIGNMENT_ANALYZER_H_
7 7
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/bit-vector.h" 9 #include "src/bit-vector.h"
10 #include "src/zone-containers.h" 10 #include "src/zone-containers.h"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 14
15 class Variable; 15 class Variable;
16 class Scope; 16 class Scope;
17 17
18 namespace compiler { 18 namespace compiler {
19 19
20 // The result of analyzing loop assignments. 20 // The result of analyzing loop assignments.
21 class LoopAssignmentAnalysis : public ZoneObject { 21 class LoopAssignmentAnalysis : public ZoneObject {
22 public: 22 public:
23 BitVector* GetVariablesAssignedInLoop(IterationStatement* loop) { 23 BitVector* GetVariablesAssignedInLoop(IterationStatement* loop) {
24 for (size_t i = 0; i < list_.size(); i++) { 24 for (size_t i = 0; i < list_.size(); i++) {
25 // TODO(turbofan): hashmap or binary search for loop assignments. 25 // TODO(turbofan): hashmap or binary search for loop assignments.
26 if (list_[i].first == loop) return list_[i].second; 26 if (list_[i].first == loop) return list_[i].second;
27 } 27 }
28 UNREACHABLE(); // should never ask for loops that aren't here! 28 UNREACHABLE(); // should never ask for loops that aren't here!
29 return NULL; 29 return nullptr;
30 } 30 }
31 31
32 int GetAssignmentCountForTesting(Scope* scope, Variable* var); 32 int GetAssignmentCountForTesting(Scope* scope, Variable* var);
33 33
34 private: 34 private:
35 friend class AstLoopAssignmentAnalyzer; 35 friend class AstLoopAssignmentAnalyzer;
36 explicit LoopAssignmentAnalysis(Zone* zone) : list_(zone) {} 36 explicit LoopAssignmentAnalysis(Zone* zone) : list_(zone) {}
37 ZoneVector<std::pair<IterationStatement*, BitVector*>> list_; 37 ZoneVector<std::pair<IterationStatement*, BitVector*>> list_;
38 }; 38 };
39 39
(...skipping 16 matching lines...) Expand all
56 Zone* zone_; 56 Zone* zone_;
57 ZoneDeque<BitVector*> loop_stack_; 57 ZoneDeque<BitVector*> loop_stack_;
58 LoopAssignmentAnalysis* result_; 58 LoopAssignmentAnalysis* result_;
59 59
60 CompilationInfo* info() { return info_; } 60 CompilationInfo* info() { return info_; }
61 61
62 void Enter(IterationStatement* loop); 62 void Enter(IterationStatement* loop);
63 void Exit(IterationStatement* loop); 63 void Exit(IterationStatement* loop);
64 64
65 void VisitIfNotNull(AstNode* node) { 65 void VisitIfNotNull(AstNode* node) {
66 if (node != NULL) Visit(node); 66 if (node != nullptr) Visit(node);
67 } 67 }
68 68
69 void AnalyzeAssignment(Variable* var); 69 void AnalyzeAssignment(Variable* var);
70 70
71 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); 71 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
72 DISALLOW_COPY_AND_ASSIGN(AstLoopAssignmentAnalyzer); 72 DISALLOW_COPY_AND_ASSIGN(AstLoopAssignmentAnalyzer);
73 }; 73 };
74 } // namespace compiler 74 } // namespace compiler
75 } // namespace internal 75 } // namespace internal
76 } // namespace v8 76 } // namespace v8
77 77
78 #endif // V8_COMPILER_AST_LOOP_ASSIGNMENT_ANALYZER_H_ 78 #endif // V8_COMPILER_AST_LOOP_ASSIGNMENT_ANALYZER_H_
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/ast-loop-assignment-analyzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698