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

Unified Diff: src/hydrogen.cc

Issue 908883002: new classes: implement new.target passing to superclass constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Test Created 5 years, 10 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
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 47cddd0a10dce599dd3f353e7d19fbfa99abca92..c53ff7ae0293e53079bb69144c8f06f9315da5ca 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -4281,6 +4281,11 @@ void HOptimizedGraphBuilder::VisitExpressions(ZoneList<Expression*>* exprs,
bool HOptimizedGraphBuilder::BuildGraph() {
+ if (IsSubclassConstructor(current_info()->function()->kind())) {
+ Bailout(kSuperReference);
+ return false;
+ }
+
Scope* scope = current_info()->scope();
SetUpScope(scope);
@@ -7565,7 +7570,8 @@ HInstruction* HOptimizedGraphBuilder::BuildCallConstantFunction(
HValue* target = Add<HConstant>(jsfun);
// For constant functions, we try to avoid calling the
// argument adaptor and instead call the function directly
- int formal_parameter_count = jsfun->shared()->formal_parameter_count();
+ int formal_parameter_count =
+ jsfun->shared()->internal_formal_parameter_count();
bool dont_adapt_arguments =
(formal_parameter_count ==
SharedFunctionInfo::kDontAdaptArgumentsSentinel);

Powered by Google App Engine
This is Rietveld 408576698