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

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

Issue 1008213002: [turbofan] Cache for reusing value vector nodes in frame states. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Embed StateValueCache in AstGraphBuilder Created 5 years, 9 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 | « BUILD.gn ('k') | src/compiler/ast-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 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/state-values-utils.h"
10 11
11 namespace v8 { 12 namespace v8 {
12 namespace internal { 13 namespace internal {
13 14
14 class BitVector; 15 class BitVector;
15 16
16 namespace compiler { 17 namespace compiler {
17 18
18 class ControlBuilder; 19 class ControlBuilder;
19 class Graph; 20 class Graph;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // Temporary storage for building node input lists. 91 // Temporary storage for building node input lists.
91 int input_buffer_size_; 92 int input_buffer_size_;
92 Node** input_buffer_; 93 Node** input_buffer_;
93 94
94 // Merge of all control nodes that exit the function body. 95 // Merge of all control nodes that exit the function body.
95 Node* exit_control_; 96 Node* exit_control_;
96 97
97 // Result of loop assignment analysis performed before graph creation. 98 // Result of loop assignment analysis performed before graph creation.
98 LoopAssignmentAnalysis* loop_assignment_analysis_; 99 LoopAssignmentAnalysis* loop_assignment_analysis_;
99 100
101 // Cache for StateValues nodes for frame states.
102 StateValuesCache state_values_cache_;
103
100 // Growth increment for the temporary buffer used to construct input lists to 104 // Growth increment for the temporary buffer used to construct input lists to
101 // new nodes. 105 // new nodes.
102 static const int kInputBufferSizeIncrement = 64; 106 static const int kInputBufferSizeIncrement = 64;
103 107
104 Zone* local_zone() const { return local_zone_; } 108 Zone* local_zone() const { return local_zone_; }
105 Environment* environment() const { return environment_; } 109 Environment* environment() const { return environment_; }
106 AstContext* ast_context() const { return ast_context_; } 110 AstContext* ast_context() const { return ast_context_; }
107 ControlScope* execution_control() const { return execution_control_; } 111 ControlScope* execution_control() const { return execution_control_; }
108 ContextScope* execution_context() const { return execution_context_; } 112 ContextScope* execution_context() const { return execution_context_; }
109 CommonOperatorBuilder* common() const { return jsgraph_->common(); } 113 CommonOperatorBuilder* common() const { return jsgraph_->common(); }
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 NodeVector contexts_; 487 NodeVector contexts_;
484 Node* control_dependency_; 488 Node* control_dependency_;
485 Node* effect_dependency_; 489 Node* effect_dependency_;
486 Node* parameters_node_; 490 Node* parameters_node_;
487 Node* locals_node_; 491 Node* locals_node_;
488 Node* stack_node_; 492 Node* stack_node_;
489 493
490 explicit Environment(const Environment* copy); 494 explicit Environment(const Environment* copy);
491 Environment* Copy() { return new (zone()) Environment(this); } 495 Environment* Copy() { return new (zone()) Environment(this); }
492 void UpdateStateValues(Node** state_values, int offset, int count); 496 void UpdateStateValues(Node** state_values, int offset, int count);
497 void UpdateStateValuesWithCache(Node** state_values, int offset, int count);
493 Zone* zone() const { return builder_->local_zone(); } 498 Zone* zone() const { return builder_->local_zone(); }
494 Graph* graph() const { return builder_->graph(); } 499 Graph* graph() const { return builder_->graph(); }
495 AstGraphBuilder* builder() const { return builder_; } 500 AstGraphBuilder* builder() const { return builder_; }
496 CommonOperatorBuilder* common() { return builder_->common(); } 501 CommonOperatorBuilder* common() { return builder_->common(); }
497 NodeVector* values() { return &values_; } 502 NodeVector* values() { return &values_; }
498 NodeVector* contexts() { return &contexts_; } 503 NodeVector* contexts() { return &contexts_; }
499 504
500 // Prepare environment to be used as loop header. 505 // Prepare environment to be used as loop header.
501 void PrepareForLoop(BitVector* assigned, bool is_osr = false); 506 void PrepareForLoop(BitVector* assigned, bool is_osr = false);
502 }; 507 };
503 508
504 } // namespace compiler 509 } // namespace compiler
505 } // namespace internal 510 } // namespace internal
506 } // namespace v8 511 } // namespace v8
507 512
508 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ 513 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698