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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 1537683002: Partial revert of rest parameter desugaring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test failures. Created 5 years 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.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen.cc
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index 35e3bad8a42d0228d87f59e57bbbcadffe25c6ed..0889811e1e21fd2a5e07cda7dfb7d6bb8dea9f3d 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -4683,6 +4683,12 @@ void HOptimizedGraphBuilder::SetUpScope(Scope* scope) {
environment()->Bind(scope->arguments(), graph()->GetArgumentsObject());
}
+ int rest_index;
+ Variable* rest = scope->rest_parameter(&rest_index);
+ if (rest) {
+ return Bailout(kRestParameter);
+ }
+
if (scope->this_function_var() != nullptr ||
scope->new_target_var() != nullptr) {
return Bailout(kSuperReference);
@@ -8357,6 +8363,14 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
TraceInline(target, caller, "target has context-allocated variables");
return false;
}
+
+ int rest_index;
+ Variable* rest = target_info.scope()->rest_parameter(&rest_index);
+ if (rest) {
+ TraceInline(target, caller, "target uses rest parameters");
+ return false;
+ }
+
FunctionLiteral* function = target_info.literal();
// The following conditions must be checked again after re-parsing, because
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698