| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 <cmath> | 5 #include <cmath> |
| 6 | 6 |
| 7 #include "../include/v8stdint.h" | 7 #include "../include/v8stdint.h" |
| 8 | 8 |
| 9 #include "allocation.h" | 9 #include "allocation.h" |
| 10 #include "checks.h" | 10 #include "checks.h" |
| 11 #include "conversions.h" | 11 #include "conversions.h" |
| 12 #include "conversions-inl.h" | 12 #include "conversions-inl.h" |
| 13 #include "globals.h" | 13 #include "globals.h" |
| 14 #include "hashmap.h" | 14 #include "hashmap.h" |
| 15 #include "list.h" | 15 #include "list.h" |
| 16 #include "parser-thread.h" |
| 16 #include "preparse-data-format.h" | 17 #include "preparse-data-format.h" |
| 17 #include "preparse-data.h" | 18 #include "preparse-data.h" |
| 18 #include "preparser.h" | 19 #include "preparser.h" |
| 19 #include "unicode.h" | 20 #include "unicode.h" |
| 20 #include "utils.h" | 21 #include "utils.h" |
| 21 | 22 |
| 22 #if V8_LIBC_MSVCRT && (_MSC_VER < 1800) | 23 #if V8_LIBC_MSVCRT && (_MSC_VER < 1800) |
| 23 namespace std { | 24 namespace std { |
| 24 | 25 |
| 25 // Usually defined in math.h, but not in MSVC until VS2013+. | 26 // Usually defined in math.h, but not in MSVC until VS2013+. |
| (...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 | 897 |
| 897 | 898 |
| 898 void PreParser::ParseLazyFunctionLiteralBody(bool* ok) { | 899 void PreParser::ParseLazyFunctionLiteralBody(bool* ok) { |
| 899 int body_start = position(); | 900 int body_start = position(); |
| 900 ParseSourceElements(Token::RBRACE, ok); | 901 ParseSourceElements(Token::RBRACE, ok); |
| 901 if (!*ok) return; | 902 if (!*ok) return; |
| 902 | 903 |
| 903 // Position right after terminal '}'. | 904 // Position right after terminal '}'. |
| 904 ASSERT_EQ(Token::RBRACE, scanner()->peek()); | 905 ASSERT_EQ(Token::RBRACE, scanner()->peek()); |
| 905 int body_end = scanner()->peek_location().end_pos; | 906 int body_end = scanner()->peek_location().end_pos; |
| 906 log_->LogFunction(body_start, body_end, | 907 if (thread_) { |
| 907 function_state_->materialized_literal_count(), | 908 // This is PreParser ran in a separate thread. |
| 908 function_state_->expected_property_count(), | 909 thread_->Produce(body_start, body_end, |
| 909 strict_mode()); | 910 function_state_->materialized_literal_count(), |
| 911 function_state_->expected_property_count(), strict_mode()); |
| 912 } else { |
| 913 log_->LogFunction(body_start, body_end, |
| 914 function_state_->materialized_literal_count(), |
| 915 function_state_->expected_property_count(), |
| 916 strict_mode()); |
| 917 } |
| 910 } | 918 } |
| 911 | 919 |
| 912 | 920 |
| 913 PreParser::Expression PreParser::ParseV8Intrinsic(bool* ok) { | 921 PreParser::Expression PreParser::ParseV8Intrinsic(bool* ok) { |
| 914 // CallRuntime :: | 922 // CallRuntime :: |
| 915 // '%' Identifier Arguments | 923 // '%' Identifier Arguments |
| 916 Expect(Token::MOD, CHECK_OK); | 924 Expect(Token::MOD, CHECK_OK); |
| 917 if (!allow_natives_syntax()) { | 925 if (!allow_natives_syntax()) { |
| 918 *ok = false; | 926 *ok = false; |
| 919 return Expression::Default(); | 927 return Expression::Default(); |
| 920 } | 928 } |
| 921 // Allow "eval" or "arguments" for backward compatibility. | 929 // Allow "eval" or "arguments" for backward compatibility. |
| 922 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK); | 930 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK); |
| 923 ParseArguments(ok); | 931 ParseArguments(ok); |
| 924 | 932 |
| 925 return Expression::Default(); | 933 return Expression::Default(); |
| 926 } | 934 } |
| 927 | 935 |
| 928 #undef CHECK_OK | 936 #undef CHECK_OK |
| 929 | 937 |
| 930 | 938 |
| 931 } } // v8::internal | 939 } } // v8::internal |
| OLD | NEW |