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

Unified Diff: src/compiler/js-inlining.cc

Issue 2788603002: [turbofan] Disable inlining of derived class constructors. (Closed)
Patch Set: Created 3 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 | « no previous file | test/mjsunit/regress/regress-crbug-706642.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-inlining.cc
diff --git a/src/compiler/js-inlining.cc b/src/compiler/js-inlining.cc
index 3ac5c25036139a1be7e1d1eb928afa699235693e..ebd52f6d5f945272f9ae30f55df8e896cb88f607 100644
--- a/src/compiler/js-inlining.cc
+++ b/src/compiler/js-inlining.cc
@@ -481,6 +481,18 @@ Reduction JSInliner::ReduceJSCall(Node* node) {
return NoChange();
}
+ // TODO(706642): Don't inline derived class constructors for now, as the
+ // inlining logic doesn't deal properly with derived class constructors
+ // that return a primitive, i.e. it's not in sync with what the Parser
+ // and the JSConstructSub does.
+ if (node->opcode() == IrOpcode::kJSConstruct &&
+ IsDerivedConstructor(shared_info->kind())) {
+ TRACE("Not inlining %s into %s because constructor is derived.\n",
+ shared_info->DebugName()->ToCString().get(),
+ info_->shared_info()->DebugName()->ToCString().get());
+ return NoChange();
+ }
+
// Class constructors are callable, but [[Call]] will raise an exception.
// See ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList ).
if (node->opcode() == IrOpcode::kJSCall &&
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-706642.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698