| OLD | NEW |
| 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 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 // Parser - this makes sure that Isolate is not accidentally accessed via | 913 // Parser - this makes sure that Isolate is not accidentally accessed via |
| 914 // ParseInfo during background parsing. | 914 // ParseInfo during background parsing. |
| 915 DCHECK(!info->script().is_null() || info->source_stream() != NULL); | 915 DCHECK(!info->script().is_null() || info->source_stream() != NULL); |
| 916 set_allow_lazy(info->allow_lazy_parsing()); | 916 set_allow_lazy(info->allow_lazy_parsing()); |
| 917 set_allow_natives(FLAG_allow_natives_syntax || info->is_native()); | 917 set_allow_natives(FLAG_allow_natives_syntax || info->is_native()); |
| 918 set_allow_harmony_sloppy(FLAG_harmony_sloppy); | 918 set_allow_harmony_sloppy(FLAG_harmony_sloppy); |
| 919 set_allow_harmony_sloppy_function(FLAG_harmony_sloppy_function); | 919 set_allow_harmony_sloppy_function(FLAG_harmony_sloppy_function); |
| 920 set_allow_harmony_sloppy_let(FLAG_harmony_sloppy_let); | 920 set_allow_harmony_sloppy_let(FLAG_harmony_sloppy_let); |
| 921 set_allow_harmony_rest_parameters(FLAG_harmony_rest_parameters); | 921 set_allow_harmony_rest_parameters(FLAG_harmony_rest_parameters); |
| 922 set_allow_harmony_default_parameters(FLAG_harmony_default_parameters); | 922 set_allow_harmony_default_parameters(FLAG_harmony_default_parameters); |
| 923 set_allow_harmony_spread_calls(FLAG_harmony_spread_calls); | |
| 924 set_allow_harmony_destructuring(FLAG_harmony_destructuring); | 923 set_allow_harmony_destructuring(FLAG_harmony_destructuring); |
| 925 set_allow_harmony_spread_arrays(FLAG_harmony_spread_arrays); | |
| 926 set_allow_harmony_new_target(FLAG_harmony_new_target); | 924 set_allow_harmony_new_target(FLAG_harmony_new_target); |
| 927 set_allow_strong_mode(FLAG_strong_mode); | 925 set_allow_strong_mode(FLAG_strong_mode); |
| 928 set_allow_legacy_const(FLAG_legacy_const); | 926 set_allow_legacy_const(FLAG_legacy_const); |
| 929 set_allow_harmony_do_expressions(FLAG_harmony_do_expressions); | 927 set_allow_harmony_do_expressions(FLAG_harmony_do_expressions); |
| 930 for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount; | 928 for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount; |
| 931 ++feature) { | 929 ++feature) { |
| 932 use_counts_[feature] = 0; | 930 use_counts_[feature] = 0; |
| 933 } | 931 } |
| 934 if (info->ast_value_factory() == NULL) { | 932 if (info->ast_value_factory() == NULL) { |
| 935 // info takes ownership of AstValueFactory. | 933 // info takes ownership of AstValueFactory. |
| (...skipping 3869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4805 if (reusable_preparser_ == NULL) { | 4803 if (reusable_preparser_ == NULL) { |
| 4806 reusable_preparser_ = new PreParser(zone(), &scanner_, ast_value_factory(), | 4804 reusable_preparser_ = new PreParser(zone(), &scanner_, ast_value_factory(), |
| 4807 NULL, stack_limit_); | 4805 NULL, stack_limit_); |
| 4808 reusable_preparser_->set_allow_lazy(true); | 4806 reusable_preparser_->set_allow_lazy(true); |
| 4809 #define SET_ALLOW(name) reusable_preparser_->set_allow_##name(allow_##name()); | 4807 #define SET_ALLOW(name) reusable_preparser_->set_allow_##name(allow_##name()); |
| 4810 SET_ALLOW(natives); | 4808 SET_ALLOW(natives); |
| 4811 SET_ALLOW(harmony_sloppy); | 4809 SET_ALLOW(harmony_sloppy); |
| 4812 SET_ALLOW(harmony_sloppy_let); | 4810 SET_ALLOW(harmony_sloppy_let); |
| 4813 SET_ALLOW(harmony_rest_parameters); | 4811 SET_ALLOW(harmony_rest_parameters); |
| 4814 SET_ALLOW(harmony_default_parameters); | 4812 SET_ALLOW(harmony_default_parameters); |
| 4815 SET_ALLOW(harmony_spread_calls); | |
| 4816 SET_ALLOW(harmony_destructuring); | 4813 SET_ALLOW(harmony_destructuring); |
| 4817 SET_ALLOW(harmony_spread_arrays); | |
| 4818 SET_ALLOW(harmony_new_target); | 4814 SET_ALLOW(harmony_new_target); |
| 4819 SET_ALLOW(strong_mode); | 4815 SET_ALLOW(strong_mode); |
| 4820 SET_ALLOW(harmony_do_expressions); | 4816 SET_ALLOW(harmony_do_expressions); |
| 4821 #undef SET_ALLOW | 4817 #undef SET_ALLOW |
| 4822 } | 4818 } |
| 4823 PreParser::PreParseResult result = reusable_preparser_->PreParseLazyFunction( | 4819 PreParser::PreParseResult result = reusable_preparser_->PreParseLazyFunction( |
| 4824 language_mode(), function_state_->kind(), scope_->has_simple_parameters(), | 4820 language_mode(), function_state_->kind(), scope_->has_simple_parameters(), |
| 4825 logger, bookmark); | 4821 logger, bookmark); |
| 4826 if (pre_parse_timer_ != NULL) { | 4822 if (pre_parse_timer_ != NULL) { |
| 4827 pre_parse_timer_->Stop(); | 4823 pre_parse_timer_->Stop(); |
| (...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6387 | 6383 |
| 6388 Expression* Parser::SpreadCallNew(Expression* function, | 6384 Expression* Parser::SpreadCallNew(Expression* function, |
| 6389 ZoneList<v8::internal::Expression*>* args, | 6385 ZoneList<v8::internal::Expression*>* args, |
| 6390 int pos) { | 6386 int pos) { |
| 6391 args->InsertAt(0, function, zone()); | 6387 args->InsertAt(0, function, zone()); |
| 6392 | 6388 |
| 6393 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); | 6389 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); |
| 6394 } | 6390 } |
| 6395 } // namespace internal | 6391 } // namespace internal |
| 6396 } // namespace v8 | 6392 } // namespace v8 |
| OLD | NEW |