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

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

Issue 2956843002: [turbofan] Replace uninitialized JSCall nodes with SOFT deopt. (Closed)
Patch Set: Several improvements. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/compiler/js-call-reducer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index 0d1792cff775fcf978141faa9ee5742ba79cd0f6..56d24817e7cd229efc233e502c932591d331eac8 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -1374,10 +1374,17 @@ void BytecodeGraphBuilder::BuildCall(TailCallMode tail_call_mode,
VectorSlotPair feedback = CreateVectorSlotPair(slot_id);
CallFrequency frequency = ComputeCallFrequency(slot_id);
- const Operator* call = javascript()->Call(arg_count, frequency, feedback,
- receiver_mode, tail_call_mode);
- Node* value = ProcessCallArguments(call, args, static_cast<int>(arg_count));
- environment()->BindAccumulator(value, Environment::kAttachFrameState);
+ const Operator* op = javascript()->Call(arg_count, frequency, feedback,
+ receiver_mode, tail_call_mode);
+ Node* node = nullptr;
+ if (Node* simplified = TryBuildSimplifiedCall(
+ op, args, static_cast<int>(arg_count), feedback.slot())) {
+ if (environment() == nullptr) return;
+ node = simplified;
+ } else {
+ node = ProcessCallArguments(op, args, static_cast<int>(arg_count));
+ }
+ environment()->BindAccumulator(node, Environment::kAttachFrameState);
}
void BytecodeGraphBuilder::BuildCallVarArgs(TailCallMode tail_call_mode,
@@ -2663,6 +2670,25 @@ Node* BytecodeGraphBuilder::TryBuildSimplifiedToPrimitiveToString(
return nullptr;
}
+Node* BytecodeGraphBuilder::TryBuildSimplifiedCall(const Operator* op,
+ Node* const* args,
+ int arg_count,
+ FeedbackSlot slot) {
+ // TODO(mstarzinger,6112): This is a workaround for OSR loop entries being
+ // pruned from the graph by a soft-deopt. It can happen that a CallIC that
+ // control-dominates the OSR entry is still in "uninitialized" state.
+ if (!osr_ast_id_.IsNone()) return nullptr;
+ Node* effect = environment()->GetEffectDependency();
+ Node* control = environment()->GetControlDependency();
+ Reduction early_reduction = type_hint_lowering().ReduceCallOperation(
+ op, args, arg_count, effect, control, slot);
+ if (early_reduction.Changed()) {
+ ApplyEarlyReduction(early_reduction);
+ return early_reduction.replacement();
+ }
+ return nullptr;
+}
+
Node* BytecodeGraphBuilder::TryBuildSimplifiedLoadNamed(const Operator* op,
Node* receiver,
FeedbackSlot slot) {
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/compiler/js-call-reducer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698