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

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

Issue 1198263004: [turbofan] Avoid embedding type feedback vector into code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « no previous file | src/compiler/ast-graph-builder.cc » ('j') | src/compiler/ast-graph-builder.cc » ('J')
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_GRAPH_BUILDER_H_ 5 #ifndef V8_COMPILER_AST_GRAPH_BUILDER_H_
6 #define V8_COMPILER_AST_GRAPH_BUILDER_H_ 6 #define V8_COMPILER_AST_GRAPH_BUILDER_H_
7 7
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/liveness-analyzer.h" 10 #include "src/compiler/liveness-analyzer.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 // Stack of control scopes currently entered by the visitor. 82 // Stack of control scopes currently entered by the visitor.
83 ControlScope* execution_control_; 83 ControlScope* execution_control_;
84 84
85 // Stack of context objects pushed onto the chain by the visitor. 85 // Stack of context objects pushed onto the chain by the visitor.
86 ContextScope* execution_context_; 86 ContextScope* execution_context_;
87 87
88 // Nodes representing values in the activation record. 88 // Nodes representing values in the activation record.
89 SetOncePointer<Node> function_closure_; 89 SetOncePointer<Node> function_closure_;
90 SetOncePointer<Node> function_context_; 90 SetOncePointer<Node> function_context_;
91 SetOncePointer<Node> feedback_vector_;
92 91
93 // Tracks how many try-blocks are currently entered. 92 // Tracks how many try-blocks are currently entered.
94 int try_catch_nesting_level_; 93 int try_catch_nesting_level_;
95 int try_nesting_level_; 94 int try_nesting_level_;
96 95
97 // Temporary storage for building node input lists. 96 // Temporary storage for building node input lists.
98 int input_buffer_size_; 97 int input_buffer_size_;
99 Node** input_buffer_; 98 Node** input_buffer_;
100 99
100 // Optimization to cache loaded feedback vector.
101 // TODO(mstarzinger): Can we let GVN take care of that?
Michael Starzinger 2015/06/22 14:57:56 Is there particular reason why machine loads are n
Benedikt Meurer 2015/06/23 04:12:38 I'm not sure if we can mark Load as idempotent. We
Michael Starzinger 2015/06/23 07:59:22 Acknowledged. Removed the TODO.
102 SetOncePointer<Node> feedback_vector_;
103
101 // Control nodes that exit the function body. 104 // Control nodes that exit the function body.
102 ZoneVector<Node*> exit_controls_; 105 ZoneVector<Node*> exit_controls_;
103 106
104 // Result of loop assignment analysis performed before graph creation. 107 // Result of loop assignment analysis performed before graph creation.
105 LoopAssignmentAnalysis* loop_assignment_analysis_; 108 LoopAssignmentAnalysis* loop_assignment_analysis_;
106 109
107 // Cache for StateValues nodes for frame states. 110 // Cache for StateValues nodes for frame states.
108 StateValuesCache state_values_cache_; 111 StateValuesCache state_values_cache_;
109 112
110 // Analyzer of local variable liveness. 113 // Analyzer of local variable liveness.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // Create the main graph body by visiting the AST. 145 // Create the main graph body by visiting the AST.
143 void CreateGraphBody(bool stack_check); 146 void CreateGraphBody(bool stack_check);
144 147
145 // Create the node that represents the outer context of the function. 148 // Create the node that represents the outer context of the function.
146 void CreateFunctionContext(bool constant_context); 149 void CreateFunctionContext(bool constant_context);
147 150
148 // Get or create the node that represents the outer function closure. 151 // Get or create the node that represents the outer function closure.
149 Node* GetFunctionClosureForContext(); 152 Node* GetFunctionClosureForContext();
150 Node* GetFunctionClosure(); 153 Node* GetFunctionClosure();
151 154
152 // Get or create the node that represents the functions type feedback vector.
153 Node* GetFeedbackVector();
154
155 // Node creation helpers. 155 // Node creation helpers.
156 Node* NewNode(const Operator* op, bool incomplete = false) { 156 Node* NewNode(const Operator* op, bool incomplete = false) {
157 return MakeNode(op, 0, static_cast<Node**>(NULL), incomplete); 157 return MakeNode(op, 0, static_cast<Node**>(NULL), incomplete);
158 } 158 }
159 159
160 Node* NewNode(const Operator* op, Node* n1) { 160 Node* NewNode(const Operator* op, Node* n1) {
161 return MakeNode(op, 1, &n1, false); 161 return MakeNode(op, 1, &n1, false);
162 } 162 }
163 163
164 Node* NewNode(const Operator* op, Node* n1, Node* n2) { 164 Node* NewNode(const Operator* op, Node* n1, Node* n2) {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 Handle<Name> name, Node* value, TypeFeedbackId id); 299 Handle<Name> name, Node* value, TypeFeedbackId id);
300 Node* BuildNamedSuperLoad(Node* receiver, Node* home_object, 300 Node* BuildNamedSuperLoad(Node* receiver, Node* home_object,
301 Handle<Name> name, const VectorSlotPair& feedback); 301 Handle<Name> name, const VectorSlotPair& feedback);
302 Node* BuildKeyedSuperLoad(Node* receiver, Node* home_object, Node* key, 302 Node* BuildKeyedSuperLoad(Node* receiver, Node* home_object, Node* key,
303 const VectorSlotPair& feedback); 303 const VectorSlotPair& feedback);
304 304
305 // Builders for accessing the function context. 305 // Builders for accessing the function context.
306 Node* BuildLoadBuiltinsObject(); 306 Node* BuildLoadBuiltinsObject();
307 Node* BuildLoadGlobalObject(); 307 Node* BuildLoadGlobalObject();
308 Node* BuildLoadGlobalProxy(); 308 Node* BuildLoadGlobalProxy();
309 Node* BuildLoadClosure(); 309 Node* BuildLoadFeedbackVector();
310 Node* BuildLoadObjectField(Node* object, int offset); 310
311 // Builder for accessing a (potentially immutable) object field.
312 Node* BuildLoadObjectField(Node* object, int offset, bool immutable = false);
311 313
312 // Builders for accessing external references. 314 // Builders for accessing external references.
313 Node* BuildLoadExternal(ExternalReference ref, MachineType type); 315 Node* BuildLoadExternal(ExternalReference ref, MachineType type);
314 Node* BuildStoreExternal(ExternalReference ref, MachineType type, Node* val); 316 Node* BuildStoreExternal(ExternalReference ref, MachineType type, Node* val);
315 317
316 // Builders for automatic type conversion. 318 // Builders for automatic type conversion.
317 Node* BuildToBoolean(Node* input); 319 Node* BuildToBoolean(Node* input);
318 Node* BuildToName(Node* input, BailoutId bailout_id); 320 Node* BuildToName(Node* input, BailoutId bailout_id);
319 Node* BuildToObject(Node* input, BailoutId bailout_id); 321 Node* BuildToObject(Node* input, BailoutId bailout_id);
320 322
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 537
536 // Prepare environment to be used as loop header. 538 // Prepare environment to be used as loop header.
537 void PrepareForLoop(BitVector* assigned, bool is_osr = false); 539 void PrepareForLoop(BitVector* assigned, bool is_osr = false);
538 }; 540 };
539 541
540 } // namespace compiler 542 } // namespace compiler
541 } // namespace internal 543 } // namespace internal
542 } // namespace v8 544 } // namespace v8
543 545
544 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ 546 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/ast-graph-builder.cc » ('j') | src/compiler/ast-graph-builder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698