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

Unified Diff: src/compiler/ast-graph-builder.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/instruction-selector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index 9ba7236e4200b3bd7f9074140dda6066064c35b4..63696e45cd2e7f2dbe932a2ac415e1c76e30053e 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -12,6 +12,7 @@
#include "src/compiler/node-matchers.h"
#include "src/compiler/node-properties.h"
#include "src/compiler/operator-properties.h"
+#include "src/compiler/state-values-utils.h"
#include "src/full-codegen.h"
#include "src/parser.h"
#include "src/scopes.h"
@@ -392,7 +393,8 @@ AstGraphBuilder::AstGraphBuilder(Zone* local_zone, CompilationInfo* info,
input_buffer_size_(0),
input_buffer_(nullptr),
exit_control_(nullptr),
- loop_assignment_analysis_(loop) {
+ loop_assignment_analysis_(loop),
+ state_values_cache_(jsgraph) {
InitializeAstVisitor(info->isolate(), local_zone);
}
@@ -602,7 +604,7 @@ AstGraphBuilder::Environment::Environment(
void AstGraphBuilder::Environment::UpdateStateValues(Node** state_values,
int offset, int count) {
bool should_update = false;
- Node** env_values = (count == 0) ? NULL : &values()->at(offset);
+ Node** env_values = (count == 0) ? nullptr : &values()->at(offset);
if (*state_values == NULL || (*state_values)->InputCount() != count) {
should_update = true;
} else {
@@ -621,12 +623,20 @@ void AstGraphBuilder::Environment::UpdateStateValues(Node** state_values,
}
+void AstGraphBuilder::Environment::UpdateStateValuesWithCache(
+ Node** state_values, int offset, int count) {
+ Node** env_values = (count == 0) ? nullptr : &values()->at(offset);
+ *state_values = builder_->state_values_cache_.GetNodeForValues(
+ env_values, static_cast<size_t>(count));
+}
+
+
Node* AstGraphBuilder::Environment::Checkpoint(
BailoutId ast_id, OutputFrameStateCombine combine) {
if (!FLAG_turbo_deoptimization) return nullptr;
UpdateStateValues(&parameters_node_, 0, parameters_count());
- UpdateStateValues(&locals_node_, parameters_count(), locals_count());
+ UpdateStateValuesWithCache(&locals_node_, parameters_count(), locals_count());
UpdateStateValues(&stack_node_, parameters_count() + locals_count(),
stack_height());
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/instruction-selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698