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_; |
}; |