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

Side by Side Diff: src/compiler/js-graph.h

Issue 1193833002: [turbofan] Proper dead code elimination as regular reducer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Renamed DeadControl to Dead. Created 5 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 | « src/compiler/graph-visualizer.cc ('k') | src/compiler/js-graph.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_JS_GRAPH_H_ 5 #ifndef V8_COMPILER_JS_GRAPH_H_
6 #define V8_COMPILER_JS_GRAPH_H_ 6 #define V8_COMPILER_JS_GRAPH_H_
7 7
8 #include "src/compiler/common-node-cache.h" 8 #include "src/compiler/common-node-cache.h"
9 #include "src/compiler/common-operator.h" 9 #include "src/compiler/common-operator.h"
10 #include "src/compiler/graph.h" 10 #include "src/compiler/graph.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 } 110 }
111 111
112 // Creates a dummy Constant node, used to satisfy calling conventions of 112 // Creates a dummy Constant node, used to satisfy calling conventions of
113 // stubs and runtime functions that do not require a context. 113 // stubs and runtime functions that do not require a context.
114 Node* NoContextConstant() { return ZeroConstant(); } 114 Node* NoContextConstant() { return ZeroConstant(); }
115 115
116 // Creates an empty frame states for cases where we know that a function 116 // Creates an empty frame states for cases where we know that a function
117 // cannot deopt. 117 // cannot deopt.
118 Node* EmptyFrameState(); 118 Node* EmptyFrameState();
119 119
120 // Creates a value node that servers as value input for dead nodes. 120 // Create a control node that serves as dependency for dead nodes.
121 Node* DeadValue(); 121 Node* Dead();
122
123 // Creates a control node that serves as control dependency for dead nodes.
124 Node* DeadControl();
125 122
126 JSOperatorBuilder* javascript() const { return javascript_; } 123 JSOperatorBuilder* javascript() const { return javascript_; }
127 CommonOperatorBuilder* common() const { return common_; } 124 CommonOperatorBuilder* common() const { return common_; }
128 MachineOperatorBuilder* machine() const { return machine_; } 125 MachineOperatorBuilder* machine() const { return machine_; }
129 Graph* graph() const { return graph_; } 126 Graph* graph() const { return graph_; }
130 Zone* zone() const { return graph()->zone(); } 127 Zone* zone() const { return graph()->zone(); }
131 Isolate* isolate() const { return isolate_; } 128 Isolate* isolate() const { return isolate_; }
132 Factory* factory() const { return isolate()->factory(); } 129 Factory* factory() const { return isolate()->factory(); }
133 130
134 void GetCachedNodes(NodeVector* nodes); 131 void GetCachedNodes(NodeVector* nodes);
135 132
136 private: 133 private:
137 enum CachedNode { 134 enum CachedNode {
138 kCEntryStubConstant, 135 kCEntryStubConstant,
139 kUndefinedConstant, 136 kUndefinedConstant,
140 kTheHoleConstant, 137 kTheHoleConstant,
141 kTrueConstant, 138 kTrueConstant,
142 kFalseConstant, 139 kFalseConstant,
143 kNullConstant, 140 kNullConstant,
144 kZeroConstant, 141 kZeroConstant,
145 kOneConstant, 142 kOneConstant,
146 kNaNConstant, 143 kNaNConstant,
147 kEmptyFrameState, 144 kEmptyFrameState,
148 kDeadValue, 145 kDead,
149 kDeadControl,
150 kNumCachedNodes // Must remain last. 146 kNumCachedNodes // Must remain last.
151 }; 147 };
152 148
153 Isolate* isolate_; 149 Isolate* isolate_;
154 Graph* graph_; 150 Graph* graph_;
155 CommonOperatorBuilder* common_; 151 CommonOperatorBuilder* common_;
156 JSOperatorBuilder* javascript_; 152 JSOperatorBuilder* javascript_;
157 MachineOperatorBuilder* machine_; 153 MachineOperatorBuilder* machine_;
158 CommonNodeCache cache_; 154 CommonNodeCache cache_;
159 Node* cached_nodes_[kNumCachedNodes]; 155 Node* cached_nodes_[kNumCachedNodes];
160 156
161 Node* ImmovableHeapConstant(Handle<HeapObject> value); 157 Node* ImmovableHeapConstant(Handle<HeapObject> value);
162 Node* NumberConstant(double value); 158 Node* NumberConstant(double value);
163 159
164 DISALLOW_COPY_AND_ASSIGN(JSGraph); 160 DISALLOW_COPY_AND_ASSIGN(JSGraph);
165 }; 161 };
166 162
167 } // namespace compiler 163 } // namespace compiler
168 } // namespace internal 164 } // namespace internal
169 } // namespace v8 165 } // namespace v8
170 166
171 #endif 167 #endif
OLDNEW
« no previous file with comments | « src/compiler/graph-visualizer.cc ('k') | src/compiler/js-graph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698