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 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 pre_parse_timer_(NULL) { | 803 pre_parse_timer_(NULL) { |
804 DCHECK(!script().is_null() || info->source_stream() != NULL); | 804 DCHECK(!script().is_null() || info->source_stream() != NULL); |
805 set_allow_harmony_scoping(!info->is_native() && FLAG_harmony_scoping); | 805 set_allow_harmony_scoping(!info->is_native() && FLAG_harmony_scoping); |
806 set_allow_modules(!info->is_native() && FLAG_harmony_modules); | 806 set_allow_modules(!info->is_native() && FLAG_harmony_modules); |
807 set_allow_natives_syntax(FLAG_allow_natives_syntax || info->is_native()); | 807 set_allow_natives_syntax(FLAG_allow_natives_syntax || info->is_native()); |
808 set_allow_lazy(false); // Must be explicitly enabled. | 808 set_allow_lazy(false); // Must be explicitly enabled. |
809 set_allow_arrow_functions(FLAG_harmony_arrow_functions); | 809 set_allow_arrow_functions(FLAG_harmony_arrow_functions); |
810 set_allow_harmony_numeric_literals(FLAG_harmony_numeric_literals); | 810 set_allow_harmony_numeric_literals(FLAG_harmony_numeric_literals); |
811 set_allow_classes(FLAG_harmony_classes); | 811 set_allow_classes(FLAG_harmony_classes); |
812 set_allow_harmony_object_literals(FLAG_harmony_object_literals); | 812 set_allow_harmony_object_literals(FLAG_harmony_object_literals); |
| 813 set_allow_harmony_unicode(FLAG_harmony_unicode); |
813 for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount; | 814 for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount; |
814 ++feature) { | 815 ++feature) { |
815 use_counts_[feature] = 0; | 816 use_counts_[feature] = 0; |
816 } | 817 } |
817 if (info->ast_value_factory() == NULL) { | 818 if (info->ast_value_factory() == NULL) { |
818 // info takes ownership of AstValueFactory. | 819 // info takes ownership of AstValueFactory. |
819 info->SetAstValueFactory( | 820 info->SetAstValueFactory( |
820 new AstValueFactory(zone(), parse_info->hash_seed)); | 821 new AstValueFactory(zone(), parse_info->hash_seed)); |
821 } | 822 } |
822 } | 823 } |
(...skipping 3069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3892 reusable_preparser_->set_allow_harmony_scoping(allow_harmony_scoping()); | 3893 reusable_preparser_->set_allow_harmony_scoping(allow_harmony_scoping()); |
3893 reusable_preparser_->set_allow_modules(allow_modules()); | 3894 reusable_preparser_->set_allow_modules(allow_modules()); |
3894 reusable_preparser_->set_allow_natives_syntax(allow_natives_syntax()); | 3895 reusable_preparser_->set_allow_natives_syntax(allow_natives_syntax()); |
3895 reusable_preparser_->set_allow_lazy(true); | 3896 reusable_preparser_->set_allow_lazy(true); |
3896 reusable_preparser_->set_allow_arrow_functions(allow_arrow_functions()); | 3897 reusable_preparser_->set_allow_arrow_functions(allow_arrow_functions()); |
3897 reusable_preparser_->set_allow_harmony_numeric_literals( | 3898 reusable_preparser_->set_allow_harmony_numeric_literals( |
3898 allow_harmony_numeric_literals()); | 3899 allow_harmony_numeric_literals()); |
3899 reusable_preparser_->set_allow_classes(allow_classes()); | 3900 reusable_preparser_->set_allow_classes(allow_classes()); |
3900 reusable_preparser_->set_allow_harmony_object_literals( | 3901 reusable_preparser_->set_allow_harmony_object_literals( |
3901 allow_harmony_object_literals()); | 3902 allow_harmony_object_literals()); |
| 3903 reusable_preparser_->set_allow_harmony_unicode(allow_harmony_unicode()); |
3902 } | 3904 } |
3903 PreParser::PreParseResult result = | 3905 PreParser::PreParseResult result = |
3904 reusable_preparser_->PreParseLazyFunction(strict_mode(), | 3906 reusable_preparser_->PreParseLazyFunction(strict_mode(), |
3905 is_generator(), | 3907 is_generator(), |
3906 logger); | 3908 logger); |
3907 if (pre_parse_timer_ != NULL) { | 3909 if (pre_parse_timer_ != NULL) { |
3908 pre_parse_timer_->Stop(); | 3910 pre_parse_timer_->Stop(); |
3909 } | 3911 } |
3910 return result; | 3912 return result; |
3911 } | 3913 } |
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5011 | 5013 |
5012 // We cannot internalize on a background thread; a foreground task will take | 5014 // We cannot internalize on a background thread; a foreground task will take |
5013 // care of calling Parser::Internalize just before compilation. | 5015 // care of calling Parser::Internalize just before compilation. |
5014 | 5016 |
5015 if (compile_options() == ScriptCompiler::kProduceParserCache) { | 5017 if (compile_options() == ScriptCompiler::kProduceParserCache) { |
5016 if (result != NULL) *info_->cached_data() = recorder.GetScriptData(); | 5018 if (result != NULL) *info_->cached_data() = recorder.GetScriptData(); |
5017 log_ = NULL; | 5019 log_ = NULL; |
5018 } | 5020 } |
5019 } | 5021 } |
5020 } } // namespace v8::internal | 5022 } } // namespace v8::internal |
OLD | NEW |