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

Unified Diff: src/parser.cc

Issue 816913003: Implement ES6 rest parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable optimization of functions with rest parameters in parser 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/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 3c72dd0f72c7b47b05c08da86de112bee65468eb..253b971c051a6cceaaafb6d497c01e681b4a9a4c 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -3860,6 +3860,11 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
FunctionLiteral::kIsFunction, parenthesized, kind, pos);
function_literal->set_function_token_position(function_token_pos);
+ if (scope->has_rest_parameter()) {
+ // TODO(caitp): enable optimization of functions with rest params
+ function_literal->set_dont_optimize_reason(kRestParameter);
+ }
+
if (fni_ != NULL && should_infer_name) fni_->AddFunction(function_literal);
return function_literal;
}

Powered by Google App Engine
This is Rietveld 408576698