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

Side by Side Diff: src/parsing/parser.cc

Issue 2606833002: [ESnext] Implement Object spread (Closed)
Patch Set: fix build Created 3 years, 11 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/parsing/parser.h" 5 #include "src/parsing/parser.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/ast/ast-expression-rewriter.h" 10 #include "src/ast/ast-expression-rewriter.h"
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 info->extension() == nullptr && can_compile_lazily; 547 info->extension() == nullptr && can_compile_lazily;
548 set_allow_natives(FLAG_allow_natives_syntax || info->is_native()); 548 set_allow_natives(FLAG_allow_natives_syntax || info->is_native());
549 set_allow_tailcalls(FLAG_harmony_tailcalls && !info->is_native() && 549 set_allow_tailcalls(FLAG_harmony_tailcalls && !info->is_native() &&
550 info->isolate()->is_tail_call_elimination_enabled()); 550 info->isolate()->is_tail_call_elimination_enabled());
551 set_allow_harmony_do_expressions(FLAG_harmony_do_expressions); 551 set_allow_harmony_do_expressions(FLAG_harmony_do_expressions);
552 set_allow_harmony_function_sent(FLAG_harmony_function_sent); 552 set_allow_harmony_function_sent(FLAG_harmony_function_sent);
553 set_allow_harmony_async_await(FLAG_harmony_async_await); 553 set_allow_harmony_async_await(FLAG_harmony_async_await);
554 set_allow_harmony_restrictive_generators(FLAG_harmony_restrictive_generators); 554 set_allow_harmony_restrictive_generators(FLAG_harmony_restrictive_generators);
555 set_allow_harmony_trailing_commas(FLAG_harmony_trailing_commas); 555 set_allow_harmony_trailing_commas(FLAG_harmony_trailing_commas);
556 set_allow_harmony_class_fields(FLAG_harmony_class_fields); 556 set_allow_harmony_class_fields(FLAG_harmony_class_fields);
557 set_allow_harmony_object_spread(FLAG_harmony_object_spread);
557 for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount; 558 for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount;
558 ++feature) { 559 ++feature) {
559 use_counts_[feature] = 0; 560 use_counts_[feature] = 0;
560 } 561 }
561 if (info->ast_value_factory() == NULL) { 562 if (info->ast_value_factory() == NULL) {
562 // info takes ownership of AstValueFactory. 563 // info takes ownership of AstValueFactory.
563 info->set_ast_value_factory(new AstValueFactory(zone(), info->hash_seed())); 564 info->set_ast_value_factory(new AstValueFactory(zone(), info->hash_seed()));
564 info->set_ast_value_factory_owned(); 565 info->set_ast_value_factory_owned();
565 ast_value_factory_ = info->ast_value_factory(); 566 ast_value_factory_ = info->ast_value_factory();
566 ast_node_factory_.set_ast_value_factory(ast_value_factory_); 567 ast_node_factory_.set_ast_value_factory(ast_value_factory_);
(...skipping 2181 matching lines...) Expand 10 before | Expand all | Expand 10 after
2748 reusable_preparser_ = new PreParser( 2749 reusable_preparser_ = new PreParser(
2749 zone(), &scanner_, stack_limit_, ast_value_factory(), 2750 zone(), &scanner_, stack_limit_, ast_value_factory(),
2750 &pending_error_handler_, runtime_call_stats_, parsing_on_main_thread_); 2751 &pending_error_handler_, runtime_call_stats_, parsing_on_main_thread_);
2751 #define SET_ALLOW(name) reusable_preparser_->set_allow_##name(allow_##name()); 2752 #define SET_ALLOW(name) reusable_preparser_->set_allow_##name(allow_##name());
2752 SET_ALLOW(natives); 2753 SET_ALLOW(natives);
2753 SET_ALLOW(harmony_do_expressions); 2754 SET_ALLOW(harmony_do_expressions);
2754 SET_ALLOW(harmony_function_sent); 2755 SET_ALLOW(harmony_function_sent);
2755 SET_ALLOW(harmony_async_await); 2756 SET_ALLOW(harmony_async_await);
2756 SET_ALLOW(harmony_trailing_commas); 2757 SET_ALLOW(harmony_trailing_commas);
2757 SET_ALLOW(harmony_class_fields); 2758 SET_ALLOW(harmony_class_fields);
2759 SET_ALLOW(harmony_object_spread);
2758 #undef SET_ALLOW 2760 #undef SET_ALLOW
2759 } 2761 }
2760 // Aborting inner function preparsing would leave scopes in an inconsistent 2762 // Aborting inner function preparsing would leave scopes in an inconsistent
2761 // state; we don't parse inner functions in the abortable mode anyway. 2763 // state; we don't parse inner functions in the abortable mode anyway.
2762 DCHECK(!is_inner_function || !may_abort); 2764 DCHECK(!is_inner_function || !may_abort);
2763 2765
2764 PreParser::PreParseResult result = reusable_preparser_->PreParseFunction( 2766 PreParser::PreParseResult result = reusable_preparser_->PreParseFunction(
2765 kind, function_scope, parsing_module_, is_inner_function, may_abort, 2767 kind, function_scope, parsing_module_, is_inner_function, may_abort,
2766 use_counts_); 2768 use_counts_);
2767 2769
(...skipping 2366 matching lines...) Expand 10 before | Expand all | Expand 10 after
5134 5136
5135 return final_loop; 5137 return final_loop;
5136 } 5138 }
5137 5139
5138 #undef CHECK_OK 5140 #undef CHECK_OK
5139 #undef CHECK_OK_VOID 5141 #undef CHECK_OK_VOID
5140 #undef CHECK_FAILED 5142 #undef CHECK_FAILED
5141 5143
5142 } // namespace internal 5144 } // namespace internal
5143 } // namespace v8 5145 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698