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

Side by Side Diff: src/parser.cc

Issue 1371963002: [es6] Ship rest parameters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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
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/parser.h" 5 #include "src/parser.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/ast-literal-reindexer.h" 9 #include "src/ast-literal-reindexer.h"
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 // ParseInfo during background parsing. 912 // ParseInfo during background parsing.
913 DCHECK(!info->script().is_null() || info->source_stream() != NULL); 913 DCHECK(!info->script().is_null() || info->source_stream() != NULL);
914 set_allow_lazy(info->allow_lazy_parsing()); 914 set_allow_lazy(info->allow_lazy_parsing());
915 set_allow_natives(FLAG_allow_natives_syntax || info->is_native()); 915 set_allow_natives(FLAG_allow_natives_syntax || info->is_native());
916 set_allow_harmony_arrow_functions(FLAG_harmony_arrow_functions); 916 set_allow_harmony_arrow_functions(FLAG_harmony_arrow_functions);
917 set_allow_harmony_sloppy(FLAG_harmony_sloppy); 917 set_allow_harmony_sloppy(FLAG_harmony_sloppy);
918 set_allow_harmony_sloppy_function(FLAG_harmony_sloppy_function); 918 set_allow_harmony_sloppy_function(FLAG_harmony_sloppy_function);
919 set_allow_harmony_sloppy_let(FLAG_harmony_sloppy_let); 919 set_allow_harmony_sloppy_let(FLAG_harmony_sloppy_let);
920 set_allow_harmony_rest_parameters(FLAG_harmony_rest_parameters); 920 set_allow_harmony_rest_parameters(FLAG_harmony_rest_parameters);
921 set_allow_harmony_default_parameters(FLAG_harmony_default_parameters); 921 set_allow_harmony_default_parameters(FLAG_harmony_default_parameters);
922 set_allow_harmony_spreadcalls(FLAG_harmony_spreadcalls); 922 set_allow_harmony_spread_calls(FLAG_harmony_spread_calls);
923 set_allow_harmony_destructuring(FLAG_harmony_destructuring); 923 set_allow_harmony_destructuring(FLAG_harmony_destructuring);
924 set_allow_harmony_spread_arrays(FLAG_harmony_spread_arrays); 924 set_allow_harmony_spread_arrays(FLAG_harmony_spread_arrays);
925 set_allow_harmony_new_target(FLAG_harmony_new_target); 925 set_allow_harmony_new_target(FLAG_harmony_new_target);
926 set_allow_strong_mode(FLAG_strong_mode); 926 set_allow_strong_mode(FLAG_strong_mode);
927 set_allow_legacy_const(FLAG_legacy_const); 927 set_allow_legacy_const(FLAG_legacy_const);
928 for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount; 928 for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount;
929 ++feature) { 929 ++feature) {
930 use_counts_[feature] = 0; 930 use_counts_[feature] = 0;
931 } 931 }
932 if (info->ast_value_factory() == NULL) { 932 if (info->ast_value_factory() == NULL) {
(...skipping 3797 matching lines...) Expand 10 before | Expand all | Expand 10 after
4730 reusable_preparser_ = new PreParser(zone(), &scanner_, ast_value_factory(), 4730 reusable_preparser_ = new PreParser(zone(), &scanner_, ast_value_factory(),
4731 NULL, stack_limit_); 4731 NULL, stack_limit_);
4732 reusable_preparser_->set_allow_lazy(true); 4732 reusable_preparser_->set_allow_lazy(true);
4733 #define SET_ALLOW(name) reusable_preparser_->set_allow_##name(allow_##name()); 4733 #define SET_ALLOW(name) reusable_preparser_->set_allow_##name(allow_##name());
4734 SET_ALLOW(natives); 4734 SET_ALLOW(natives);
4735 SET_ALLOW(harmony_arrow_functions); 4735 SET_ALLOW(harmony_arrow_functions);
4736 SET_ALLOW(harmony_sloppy); 4736 SET_ALLOW(harmony_sloppy);
4737 SET_ALLOW(harmony_sloppy_let); 4737 SET_ALLOW(harmony_sloppy_let);
4738 SET_ALLOW(harmony_rest_parameters); 4738 SET_ALLOW(harmony_rest_parameters);
4739 SET_ALLOW(harmony_default_parameters); 4739 SET_ALLOW(harmony_default_parameters);
4740 SET_ALLOW(harmony_spreadcalls); 4740 SET_ALLOW(harmony_spread_calls);
4741 SET_ALLOW(harmony_destructuring); 4741 SET_ALLOW(harmony_destructuring);
4742 SET_ALLOW(harmony_spread_arrays); 4742 SET_ALLOW(harmony_spread_arrays);
4743 SET_ALLOW(harmony_new_target); 4743 SET_ALLOW(harmony_new_target);
4744 SET_ALLOW(strong_mode); 4744 SET_ALLOW(strong_mode);
4745 #undef SET_ALLOW 4745 #undef SET_ALLOW
4746 } 4746 }
4747 PreParser::PreParseResult result = reusable_preparser_->PreParseLazyFunction( 4747 PreParser::PreParseResult result = reusable_preparser_->PreParseLazyFunction(
4748 language_mode(), function_state_->kind(), scope_->has_simple_parameters(), 4748 language_mode(), function_state_->kind(), scope_->has_simple_parameters(),
4749 logger, bookmark); 4749 logger, bookmark);
4750 if (pre_parse_timer_ != NULL) { 4750 if (pre_parse_timer_ != NULL) {
(...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after
6289 6289
6290 Expression* Parser::SpreadCallNew(Expression* function, 6290 Expression* Parser::SpreadCallNew(Expression* function,
6291 ZoneList<v8::internal::Expression*>* args, 6291 ZoneList<v8::internal::Expression*>* args,
6292 int pos) { 6292 int pos) {
6293 args->InsertAt(0, function, zone()); 6293 args->InsertAt(0, function, zone());
6294 6294
6295 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); 6295 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos);
6296 } 6296 }
6297 } // namespace internal 6297 } // namespace internal
6298 } // namespace v8 6298 } // namespace v8
OLDNEW
« src/flag-definitions.h ('K') | « src/flag-definitions.h ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698