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

Unified Diff: src/parser.h

Issue 527763002: Refactor Parser to make it usable on a background thread. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 6 years, 4 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
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index e2ccd0370b75f684dbc2a58fba8763c0f7295473..2d444d6191c74c690e80b53cb119a7d3d16aba71 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -597,7 +597,11 @@ class ParserTraits {
class Parser : public ParserBase<ParserTraits> {
public:
- explicit Parser(CompilationInfo* info);
+ // Note that the passed hash seed must be the hash seed from the Isolate's
+ // heap, otherwise the heap will be in an inconsistent state once the strings
+ // created by the Parser are internalized.
+ Parser(CompilationInfo* info, uintptr_t stack_limit, uint32_t hash_seed,
rossberg 2014/09/02 08:47:40 Would it be worth introducing a struct to collect
marja 2014/09/02 09:48:40 Ok. Ultimately, we'd want is separate structs for
+ UnicodeCache* unicode_cache);
~Parser() {
delete reusable_preparser_;
reusable_preparser_ = NULL;
@@ -610,7 +614,9 @@ class Parser : public ParserBase<ParserTraits> {
// nodes) if parsing failed.
static bool Parse(CompilationInfo* info,
bool allow_lazy = false) {
- Parser parser(info);
+ Parser parser(info, info->isolate()->stack_guard()->real_climit(),
+ info->isolate()->heap()->HashSeed(),
+ info->isolate()->unicode_cache());
parser.set_allow_lazy(allow_lazy);
return parser.Parse();
}
@@ -797,7 +803,9 @@ class Parser : public ParserBase<ParserTraits> {
void ThrowPendingError();
- void InternalizeUseCounts();
+ // Handle errors detected during parsing, move statistics to Isolate,
+ // internalize strings (move them to the heap).
+ void Internalize();
Isolate* isolate_;
@@ -819,7 +827,14 @@ class Parser : public ParserBase<ParserTraits> {
const char* pending_error_char_arg_;
bool pending_error_is_reference_error_;
+ // Other information which will be stored in Parser and moved to Isolate after
+ // parsing.
int use_counts_[v8::Isolate::kUseCounterFeatureCount];
+ int total_preparse_skipped_;
+ HistogramTimer* pre_parse_timer_;
+
+ // Hash seed of the heap where strings will eventually get internalized.
+ uint32_t hash_seed_;
};
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698