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/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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 pre_parse_timer_(NULL), | 900 pre_parse_timer_(NULL), |
901 parsing_on_main_thread_(true) { | 901 parsing_on_main_thread_(true) { |
902 // Even though we were passed ParseInfo, we should not store it in | 902 // Even though we were passed ParseInfo, we should not store it in |
903 // Parser - this makes sure that Isolate is not accidentally accessed via | 903 // Parser - this makes sure that Isolate is not accidentally accessed via |
904 // ParseInfo during background parsing. | 904 // ParseInfo during background parsing. |
905 DCHECK(!info->script().is_null() || info->source_stream() != NULL); | 905 DCHECK(!info->script().is_null() || info->source_stream() != NULL); |
906 set_allow_lazy(info->allow_lazy_parsing()); | 906 set_allow_lazy(info->allow_lazy_parsing()); |
907 set_allow_natives(FLAG_allow_natives_syntax || info->is_native()); | 907 set_allow_natives(FLAG_allow_natives_syntax || info->is_native()); |
908 set_allow_harmony_modules(!info->is_native() && FLAG_harmony_modules); | 908 set_allow_harmony_modules(!info->is_native() && FLAG_harmony_modules); |
909 set_allow_harmony_arrow_functions(FLAG_harmony_arrow_functions); | 909 set_allow_harmony_arrow_functions(FLAG_harmony_arrow_functions); |
910 set_allow_harmony_classes(FLAG_harmony_classes); | |
911 set_allow_harmony_sloppy(FLAG_harmony_sloppy); | 910 set_allow_harmony_sloppy(FLAG_harmony_sloppy); |
912 set_allow_harmony_unicode(FLAG_harmony_unicode); | 911 set_allow_harmony_unicode(FLAG_harmony_unicode); |
913 set_allow_harmony_computed_property_names( | 912 set_allow_harmony_computed_property_names( |
914 FLAG_harmony_computed_property_names); | 913 FLAG_harmony_computed_property_names); |
915 set_allow_harmony_rest_params(FLAG_harmony_rest_parameters); | 914 set_allow_harmony_rest_params(FLAG_harmony_rest_parameters); |
916 set_allow_harmony_spreadcalls(FLAG_harmony_spreadcalls); | 915 set_allow_harmony_spreadcalls(FLAG_harmony_spreadcalls); |
917 set_allow_harmony_destructuring(FLAG_harmony_destructuring); | 916 set_allow_harmony_destructuring(FLAG_harmony_destructuring); |
918 set_allow_harmony_spread_arrays(FLAG_harmony_spread_arrays); | 917 set_allow_harmony_spread_arrays(FLAG_harmony_spread_arrays); |
919 set_allow_harmony_new_target(FLAG_harmony_new_target); | 918 set_allow_harmony_new_target(FLAG_harmony_new_target); |
920 set_allow_strong_mode(FLAG_strong_mode); | 919 set_allow_strong_mode(FLAG_strong_mode); |
(...skipping 3439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4360 DCHECK_EQ(Token::LBRACE, scanner()->current_token()); | 4359 DCHECK_EQ(Token::LBRACE, scanner()->current_token()); |
4361 | 4360 |
4362 if (reusable_preparser_ == NULL) { | 4361 if (reusable_preparser_ == NULL) { |
4363 reusable_preparser_ = new PreParser(zone(), &scanner_, ast_value_factory(), | 4362 reusable_preparser_ = new PreParser(zone(), &scanner_, ast_value_factory(), |
4364 NULL, stack_limit_); | 4363 NULL, stack_limit_); |
4365 reusable_preparser_->set_allow_lazy(true); | 4364 reusable_preparser_->set_allow_lazy(true); |
4366 #define SET_ALLOW(name) reusable_preparser_->set_allow_##name(allow_##name()); | 4365 #define SET_ALLOW(name) reusable_preparser_->set_allow_##name(allow_##name()); |
4367 SET_ALLOW(natives); | 4366 SET_ALLOW(natives); |
4368 SET_ALLOW(harmony_modules); | 4367 SET_ALLOW(harmony_modules); |
4369 SET_ALLOW(harmony_arrow_functions); | 4368 SET_ALLOW(harmony_arrow_functions); |
4370 SET_ALLOW(harmony_classes); | |
4371 SET_ALLOW(harmony_sloppy); | 4369 SET_ALLOW(harmony_sloppy); |
4372 SET_ALLOW(harmony_unicode); | 4370 SET_ALLOW(harmony_unicode); |
4373 SET_ALLOW(harmony_computed_property_names); | 4371 SET_ALLOW(harmony_computed_property_names); |
4374 SET_ALLOW(harmony_rest_params); | 4372 SET_ALLOW(harmony_rest_params); |
4375 SET_ALLOW(harmony_spreadcalls); | 4373 SET_ALLOW(harmony_spreadcalls); |
4376 SET_ALLOW(harmony_destructuring); | 4374 SET_ALLOW(harmony_destructuring); |
4377 SET_ALLOW(harmony_spread_arrays); | 4375 SET_ALLOW(harmony_spread_arrays); |
4378 SET_ALLOW(harmony_new_target); | 4376 SET_ALLOW(harmony_new_target); |
4379 SET_ALLOW(strong_mode); | 4377 SET_ALLOW(strong_mode); |
4380 #undef SET_ALLOW | 4378 #undef SET_ALLOW |
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5894 Expression* Parser::SpreadCallNew(Expression* function, | 5892 Expression* Parser::SpreadCallNew(Expression* function, |
5895 ZoneList<v8::internal::Expression*>* args, | 5893 ZoneList<v8::internal::Expression*>* args, |
5896 int pos) { | 5894 int pos) { |
5897 args->InsertAt(0, function, zone()); | 5895 args->InsertAt(0, function, zone()); |
5898 | 5896 |
5899 return factory()->NewCallRuntime( | 5897 return factory()->NewCallRuntime( |
5900 ast_value_factory()->reflect_construct_string(), NULL, args, pos); | 5898 ast_value_factory()->reflect_construct_string(), NULL, args, pos); |
5901 } | 5899 } |
5902 } // namespace internal | 5900 } // namespace internal |
5903 } // namespace v8 | 5901 } // namespace v8 |
OLD | NEW |