| 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 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 cached_parse_data_(NULL), | 906 cached_parse_data_(NULL), |
| 907 total_preparse_skipped_(0), | 907 total_preparse_skipped_(0), |
| 908 pre_parse_timer_(NULL), | 908 pre_parse_timer_(NULL), |
| 909 parsing_on_main_thread_(true) { | 909 parsing_on_main_thread_(true) { |
| 910 // Even though we were passed ParseInfo, we should not store it in | 910 // Even though we were passed ParseInfo, we should not store it in |
| 911 // Parser - this makes sure that Isolate is not accidentally accessed via | 911 // Parser - this makes sure that Isolate is not accidentally accessed via |
| 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); | |
| 917 set_allow_harmony_sloppy(FLAG_harmony_sloppy); | 916 set_allow_harmony_sloppy(FLAG_harmony_sloppy); |
| 918 set_allow_harmony_sloppy_function(FLAG_harmony_sloppy_function); | 917 set_allow_harmony_sloppy_function(FLAG_harmony_sloppy_function); |
| 919 set_allow_harmony_sloppy_let(FLAG_harmony_sloppy_let); | 918 set_allow_harmony_sloppy_let(FLAG_harmony_sloppy_let); |
| 920 set_allow_harmony_rest_parameters(FLAG_harmony_rest_parameters); | 919 set_allow_harmony_rest_parameters(FLAG_harmony_rest_parameters); |
| 921 set_allow_harmony_default_parameters(FLAG_harmony_default_parameters); | 920 set_allow_harmony_default_parameters(FLAG_harmony_default_parameters); |
| 922 set_allow_harmony_spread_calls(FLAG_harmony_spread_calls); | 921 set_allow_harmony_spread_calls(FLAG_harmony_spread_calls); |
| 923 set_allow_harmony_destructuring(FLAG_harmony_destructuring); | 922 set_allow_harmony_destructuring(FLAG_harmony_destructuring); |
| 924 set_allow_harmony_spread_arrays(FLAG_harmony_spread_arrays); | 923 set_allow_harmony_spread_arrays(FLAG_harmony_spread_arrays); |
| 925 set_allow_harmony_new_target(FLAG_harmony_new_target); | 924 set_allow_harmony_new_target(FLAG_harmony_new_target); |
| 926 set_allow_strong_mode(FLAG_strong_mode); | 925 set_allow_strong_mode(FLAG_strong_mode); |
| (...skipping 3798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4725 pre_parse_timer_->Start(); | 4724 pre_parse_timer_->Start(); |
| 4726 } | 4725 } |
| 4727 DCHECK_EQ(Token::LBRACE, scanner()->current_token()); | 4726 DCHECK_EQ(Token::LBRACE, scanner()->current_token()); |
| 4728 | 4727 |
| 4729 if (reusable_preparser_ == NULL) { | 4728 if (reusable_preparser_ == NULL) { |
| 4730 reusable_preparser_ = new PreParser(zone(), &scanner_, ast_value_factory(), | 4729 reusable_preparser_ = new PreParser(zone(), &scanner_, ast_value_factory(), |
| 4731 NULL, stack_limit_); | 4730 NULL, stack_limit_); |
| 4732 reusable_preparser_->set_allow_lazy(true); | 4731 reusable_preparser_->set_allow_lazy(true); |
| 4733 #define SET_ALLOW(name) reusable_preparser_->set_allow_##name(allow_##name()); | 4732 #define SET_ALLOW(name) reusable_preparser_->set_allow_##name(allow_##name()); |
| 4734 SET_ALLOW(natives); | 4733 SET_ALLOW(natives); |
| 4735 SET_ALLOW(harmony_arrow_functions); | |
| 4736 SET_ALLOW(harmony_sloppy); | 4734 SET_ALLOW(harmony_sloppy); |
| 4737 SET_ALLOW(harmony_sloppy_let); | 4735 SET_ALLOW(harmony_sloppy_let); |
| 4738 SET_ALLOW(harmony_rest_parameters); | 4736 SET_ALLOW(harmony_rest_parameters); |
| 4739 SET_ALLOW(harmony_default_parameters); | 4737 SET_ALLOW(harmony_default_parameters); |
| 4740 SET_ALLOW(harmony_spread_calls); | 4738 SET_ALLOW(harmony_spread_calls); |
| 4741 SET_ALLOW(harmony_destructuring); | 4739 SET_ALLOW(harmony_destructuring); |
| 4742 SET_ALLOW(harmony_spread_arrays); | 4740 SET_ALLOW(harmony_spread_arrays); |
| 4743 SET_ALLOW(harmony_new_target); | 4741 SET_ALLOW(harmony_new_target); |
| 4744 SET_ALLOW(strong_mode); | 4742 SET_ALLOW(strong_mode); |
| 4745 #undef SET_ALLOW | 4743 #undef SET_ALLOW |
| (...skipping 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6289 | 6287 |
| 6290 Expression* Parser::SpreadCallNew(Expression* function, | 6288 Expression* Parser::SpreadCallNew(Expression* function, |
| 6291 ZoneList<v8::internal::Expression*>* args, | 6289 ZoneList<v8::internal::Expression*>* args, |
| 6292 int pos) { | 6290 int pos) { |
| 6293 args->InsertAt(0, function, zone()); | 6291 args->InsertAt(0, function, zone()); |
| 6294 | 6292 |
| 6295 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); | 6293 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); |
| 6296 } | 6294 } |
| 6297 } // namespace internal | 6295 } // namespace internal |
| 6298 } // namespace v8 | 6296 } // namespace v8 |
| OLD | NEW |