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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: src/preparser.cc
diff --git a/src/preparser.cc b/src/preparser.cc
index 2f329764600427e0fc52e3bc223ec031af7097f1..c324fad32c4453dd840af9bc9baca3593c417f8a 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -36,6 +36,7 @@
#include "globals.h"
#include "hashmap.h"
#include "list.h"
+#include "parser-thread.h"
#include "preparse-data-format.h"
#include "preparse-data.h"
#include "preparser.h"
@@ -936,10 +937,17 @@ void PreParser::ParseLazyFunctionLiteralBody(bool* ok) {
// Position right after terminal '}'.
ASSERT_EQ(Token::RBRACE, scanner()->peek());
int body_end = scanner()->peek_location().end_pos;
- log_->LogFunction(body_start, body_end,
- function_state_->materialized_literal_count(),
- function_state_->expected_property_count(),
- strict_mode());
+ if (thread_) {
+ // This is PreParser ran in a separate thread.
+ thread_->Produce(body_start, body_end,
+ function_state_->materialized_literal_count(),
+ function_state_->expected_property_count(), strict_mode());
+ } else {
+ log_->LogFunction(body_start, body_end,
+ function_state_->materialized_literal_count(),
+ function_state_->expected_property_count(),
+ strict_mode());
+ }
}
« 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