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

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

Issue 2006353003: [turbofan] Avoid unnecessary copying of nodes during inlining. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Don't use one EmptyFrameState cross functions, that gets mutated during inlining. Created 4 years, 7 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/graph.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 da8b62607c6181f8c559e5fc816aac84f4500c59..bc2f0845d34e0a0a8e939af2964f2ae5482a5d70 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -416,7 +416,7 @@ class AstGraphBuilder::FrameStateBeforeAndAfter {
FrameStateBeforeAndAfter(AstGraphBuilder* builder, BailoutId id_before)
: builder_(builder), frame_state_before_(nullptr) {
frame_state_before_ = id_before == BailoutId::None()
- ? builder_->jsgraph()->EmptyFrameState()
+ ? builder_->GetEmptyFrameState()
: builder_->environment()->Checkpoint(id_before);
}
@@ -435,7 +435,7 @@ class AstGraphBuilder::FrameStateBeforeAndAfter {
Node* frame_state_after =
id_after == BailoutId::None()
- ? builder_->jsgraph()->EmptyFrameState()
+ ? builder_->GetEmptyFrameState()
: builder_->environment()->Checkpoint(id_after, combine,
node_has_exception);
@@ -539,6 +539,18 @@ Node* AstGraphBuilder::GetNewTarget() {
return new_target_.get();
}
+Node* AstGraphBuilder::GetEmptyFrameState() {
+ if (!empty_frame_state_.is_set()) {
+ const Operator* op = common()->FrameState(
+ BailoutId::None(), OutputFrameStateCombine::Ignore(), nullptr);
+ Node* node = graph()->NewNode(
+ op, jsgraph()->EmptyStateValues(), jsgraph()->EmptyStateValues(),
+ jsgraph()->EmptyStateValues(), jsgraph()->NoContextConstant(),
+ jsgraph()->UndefinedConstant(), graph()->start());
+ empty_frame_state_.set(node);
+ }
+ return empty_frame_state_.get();
+}
bool AstGraphBuilder::CreateGraph(bool stack_check) {
Scope* scope = info()->scope();
@@ -875,7 +887,7 @@ Node* AstGraphBuilder::Environment::Checkpoint(BailoutId ast_id,
OutputFrameStateCombine combine,
bool owner_has_exception) {
if (!builder()->info()->is_deoptimization_enabled()) {
- return builder()->jsgraph()->EmptyFrameState();
+ return builder()->GetEmptyFrameState();
}
UpdateStateValues(&parameters_node_, 0, parameters_count());
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698