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

Side by Side Diff: src/compiler/bytecode-graph-builder.h

Issue 1489863002: [Interpreter] Add support for context slot loads / stores to BytecodeGraphBuilder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 5 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/bytecode-graph-builder.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_BYTECODE_GRAPH_BUILDER_H_ 5 #ifndef V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_
6 #define V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ 6 #define V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_
7 7
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/interpreter/bytecode-array-iterator.h" 10 #include "src/interpreter/bytecode-array-iterator.h"
(...skipping 22 matching lines...) Expand all
33 void VisitBytecodes(); 33 void VisitBytecodes();
34 34
35 Node* LoadAccumulator(Node* value); 35 Node* LoadAccumulator(Node* value);
36 36
37 // Get or create the node that represents the outer function closure. 37 // Get or create the node that represents the outer function closure.
38 Node* GetFunctionClosure(); 38 Node* GetFunctionClosure();
39 39
40 // Get or create the node that represents the outer function context. 40 // Get or create the node that represents the outer function context.
41 Node* GetFunctionContext(); 41 Node* GetFunctionContext();
42 42
43 // Get or create the node that represents the incoming new target value.
44 Node* GetNewTarget();
45
43 // Builder for accessing a (potentially immutable) object field. 46 // Builder for accessing a (potentially immutable) object field.
44 Node* BuildLoadObjectField(Node* object, int offset); 47 Node* BuildLoadObjectField(Node* object, int offset);
45 Node* BuildLoadImmutableObjectField(Node* object, int offset); 48 Node* BuildLoadImmutableObjectField(Node* object, int offset);
46 49
47 // Builder for accessing type feedback vector. 50 // Builder for accessing type feedback vector.
48 Node* BuildLoadFeedbackVector(); 51 Node* BuildLoadFeedbackVector();
49 52
50 // Builder for loading the a native context field. 53 // Builder for loading the a native context field.
51 Node* BuildLoadNativeContextField(int index); 54 Node* BuildLoadNativeContextField(int index);
52 55
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 Handle<BytecodeArray> bytecode_array_; 154 Handle<BytecodeArray> bytecode_array_;
152 Environment* environment_; 155 Environment* environment_;
153 156
154 // Temporary storage for building node input lists. 157 // Temporary storage for building node input lists.
155 int input_buffer_size_; 158 int input_buffer_size_;
156 Node** input_buffer_; 159 Node** input_buffer_;
157 160
158 // Nodes representing values in the activation record. 161 // Nodes representing values in the activation record.
159 SetOncePointer<Node> function_context_; 162 SetOncePointer<Node> function_context_;
160 SetOncePointer<Node> function_closure_; 163 SetOncePointer<Node> function_closure_;
164 SetOncePointer<Node> new_target_;
161 165
162 // Optimization to cache loaded feedback vector. 166 // Optimization to cache loaded feedback vector.
163 SetOncePointer<Node> feedback_vector_; 167 SetOncePointer<Node> feedback_vector_;
164 168
165 // Control nodes that exit the function body. 169 // Control nodes that exit the function body.
166 ZoneVector<Node*> exit_controls_; 170 ZoneVector<Node*> exit_controls_;
167 171
168 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder); 172 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder);
169 }; 173 };
170 174
(...skipping 21 matching lines...) Expand all
192 effect_dependency_ = dependency; 196 effect_dependency_ = dependency;
193 } 197 }
194 198
195 // Control dependency tracked by this environment. 199 // Control dependency tracked by this environment.
196 Node* GetControlDependency() const { return control_dependency_; } 200 Node* GetControlDependency() const { return control_dependency_; }
197 void UpdateControlDependency(Node* dependency) { 201 void UpdateControlDependency(Node* dependency) {
198 control_dependency_ = dependency; 202 control_dependency_ = dependency;
199 } 203 }
200 204
201 Node* Context() const { return context_; } 205 Node* Context() const { return context_; }
206 void SetContext(Node* new_context) { context_ = new_context; }
202 207
203 private: 208 private:
204 int RegisterToValuesIndex(interpreter::Register the_register) const; 209 int RegisterToValuesIndex(interpreter::Register the_register) const;
205 210
206 Zone* zone() const { return builder_->local_zone(); } 211 Zone* zone() const { return builder_->local_zone(); }
207 Graph* graph() const { return builder_->graph(); } 212 Graph* graph() const { return builder_->graph(); }
208 CommonOperatorBuilder* common() const { return builder_->common(); } 213 CommonOperatorBuilder* common() const { return builder_->common(); }
209 BytecodeGraphBuilder* builder() const { return builder_; } 214 BytecodeGraphBuilder* builder() const { return builder_; }
210 const NodeVector* values() const { return &values_; } 215 const NodeVector* values() const { return &values_; }
211 NodeVector* values() { return &values_; } 216 NodeVector* values() { return &values_; }
(...skipping 10 matching lines...) Expand all
222 NodeVector values_; 227 NodeVector values_;
223 int register_base_; 228 int register_base_;
224 }; 229 };
225 230
226 231
227 } // namespace compiler 232 } // namespace compiler
228 } // namespace internal 233 } // namespace internal
229 } // namespace v8 234 } // namespace v8
230 235
231 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ 236 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698