Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/preparser.cc

Issue 214883002: Two-threaded parser (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 18 matching lines...) Expand all
29 29
30 #include "../include/v8stdint.h" 30 #include "../include/v8stdint.h"
31 31
32 #include "allocation.h" 32 #include "allocation.h"
33 #include "checks.h" 33 #include "checks.h"
34 #include "conversions.h" 34 #include "conversions.h"
35 #include "conversions-inl.h" 35 #include "conversions-inl.h"
36 #include "globals.h" 36 #include "globals.h"
37 #include "hashmap.h" 37 #include "hashmap.h"
38 #include "list.h" 38 #include "list.h"
39 #include "parser-thread.h"
39 #include "preparse-data-format.h" 40 #include "preparse-data-format.h"
40 #include "preparse-data.h" 41 #include "preparse-data.h"
41 #include "preparser.h" 42 #include "preparser.h"
42 #include "unicode.h" 43 #include "unicode.h"
43 #include "utils.h" 44 #include "utils.h"
44 45
45 #if V8_LIBC_MSVCRT && (_MSC_VER < 1800) 46 #if V8_LIBC_MSVCRT && (_MSC_VER < 1800)
46 namespace std { 47 namespace std {
47 48
48 // Usually defined in math.h, but not in MSVC until VS2013+. 49 // Usually defined in math.h, but not in MSVC until VS2013+.
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 930
930 931
931 void PreParser::ParseLazyFunctionLiteralBody(bool* ok) { 932 void PreParser::ParseLazyFunctionLiteralBody(bool* ok) {
932 int body_start = position(); 933 int body_start = position();
933 ParseSourceElements(Token::RBRACE, ok); 934 ParseSourceElements(Token::RBRACE, ok);
934 if (!*ok) return; 935 if (!*ok) return;
935 936
936 // Position right after terminal '}'. 937 // Position right after terminal '}'.
937 ASSERT_EQ(Token::RBRACE, scanner()->peek()); 938 ASSERT_EQ(Token::RBRACE, scanner()->peek());
938 int body_end = scanner()->peek_location().end_pos; 939 int body_end = scanner()->peek_location().end_pos;
939 log_->LogFunction(body_start, body_end, 940 if (thread_) {
940 function_state_->materialized_literal_count(), 941 // This is PreParser ran in a separate thread.
941 function_state_->expected_property_count(), 942 thread_->Produce(body_start, body_end,
942 strict_mode()); 943 function_state_->materialized_literal_count(),
944 function_state_->expected_property_count(), strict_mode());
945 } else {
946 log_->LogFunction(body_start, body_end,
947 function_state_->materialized_literal_count(),
948 function_state_->expected_property_count(),
949 strict_mode());
950 }
943 } 951 }
944 952
945 953
946 PreParser::Expression PreParser::ParseV8Intrinsic(bool* ok) { 954 PreParser::Expression PreParser::ParseV8Intrinsic(bool* ok) {
947 // CallRuntime :: 955 // CallRuntime ::
948 // '%' Identifier Arguments 956 // '%' Identifier Arguments
949 Expect(Token::MOD, CHECK_OK); 957 Expect(Token::MOD, CHECK_OK);
950 if (!allow_natives_syntax()) { 958 if (!allow_natives_syntax()) {
951 *ok = false; 959 *ok = false;
952 return Expression::Default(); 960 return Expression::Default();
953 } 961 }
954 // Allow "eval" or "arguments" for backward compatibility. 962 // Allow "eval" or "arguments" for backward compatibility.
955 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK); 963 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK);
956 ParseArguments(ok); 964 ParseArguments(ok);
957 965
958 return Expression::Default(); 966 return Expression::Default();
959 } 967 }
960 968
961 #undef CHECK_OK 969 #undef CHECK_OK
962 970
963 971
964 } } // v8::internal 972 } } // v8::internal
OLDNEW
« src/preparse-data.h ('K') | « src/preparser.h ('k') | src/scanner-character-streams.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698