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

Side by Side Diff: src/parser.cc

Issue 816913003: Implement ES6 rest parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix typo in ARM port 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 unified diff | Download patch
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 3820 matching lines...) Expand 10 before | Expand all | Expand 10 after
3831 } 3831 }
3832 } 3832 }
3833 3833
3834 FunctionLiteral* function_literal = factory()->NewFunctionLiteral( 3834 FunctionLiteral* function_literal = factory()->NewFunctionLiteral(
3835 function_name, ast_value_factory(), scope, body, 3835 function_name, ast_value_factory(), scope, body,
3836 materialized_literal_count, expected_property_count, handler_count, 3836 materialized_literal_count, expected_property_count, handler_count,
3837 num_parameters, duplicate_parameters, function_type, 3837 num_parameters, duplicate_parameters, function_type,
3838 FunctionLiteral::kIsFunction, parenthesized, kind, pos); 3838 FunctionLiteral::kIsFunction, parenthesized, kind, pos);
3839 function_literal->set_function_token_position(function_token_pos); 3839 function_literal->set_function_token_position(function_token_pos);
3840 3840
3841 if (scope->has_rest_parameter()) {
3842 // TODO(caitp): enable optimization of functions with rest params
3843 function_literal->set_dont_optimize_reason(kRestParameter);
3844 }
3845
3841 if (fni_ != NULL && should_infer_name) fni_->AddFunction(function_literal); 3846 if (fni_ != NULL && should_infer_name) fni_->AddFunction(function_literal);
3842 return function_literal; 3847 return function_literal;
3843 } 3848 }
3844 3849
3845 3850
3846 void Parser::SkipLazyFunctionBody(const AstRawString* function_name, 3851 void Parser::SkipLazyFunctionBody(const AstRawString* function_name,
3847 int* materialized_literal_count, 3852 int* materialized_literal_count,
3848 int* expected_property_count, 3853 int* expected_property_count,
3849 bool* ok) { 3854 bool* ok) {
3850 if (produce_cached_parse_data()) CHECK(log_); 3855 if (produce_cached_parse_data()) CHECK(log_);
(...skipping 1612 matching lines...) Expand 10 before | Expand all | Expand 10 after
5463 } else { 5468 } else {
5464 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); 5469 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data());
5465 running_hash = StringHasher::ComputeRunningHash(running_hash, data, 5470 running_hash = StringHasher::ComputeRunningHash(running_hash, data,
5466 raw_string->length()); 5471 raw_string->length());
5467 } 5472 }
5468 } 5473 }
5469 5474
5470 return running_hash; 5475 return running_hash;
5471 } 5476 }
5472 } } // namespace v8::internal 5477 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698