Reviewers: jochen,
Message:
jochen, ptal.
Description:
Debug a mystery crash bug in script streaming.
This adds a bunch of checks so we hopefully get more detailed information
about
what exactly goes wrong.
[email protected]
BUG=
Please review this at https://codereview.chromium.org/619583005/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+17, -0 lines):
M src/parser.h
M src/parser.cc
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index
9d1a40d39b9ebb7b47730b4f287d0abcca684276..a735283346d41e4e5006afe0eb55574979085b12
100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -807,6 +807,7 @@ FunctionLiteral* Parser::ParseProgram() {
// Initialize parser state.
CompleteParserRecorder recorder;
+ debug_saved_compile_options_ = compile_options();
if (compile_options() == ScriptCompiler::kProduceParserCache) {
log_ = &recorder;
} else if (compile_options() == ScriptCompiler::kConsumeParserCache) {
@@ -3702,6 +3703,17 @@ void Parser::SkipLazyFunctionBody(const
AstRawString* function_name,
int* materialized_literal_count,
int* expected_property_count,
bool* ok) {
+ // Temporary debugging code for tracking down a mystery crash which
should
+ // never happen. The crash happens on the line where we log the function
in
+ // the preparse data: log_->LogFunction(...). TODO(marja): remove this
once
+ // done.
+ CHECK(materialized_literal_count != NULL);
+ CHECK(expected_property_count != NULL);
+ CHECK(debug_saved_compile_options_ == compile_options());
+ if (compile_options() == ScriptCompiler::kProduceParserCache) {
+ CHECK(log_ != NULL);
+ }
+
int function_block_pos = position();
if (compile_options() == ScriptCompiler::kConsumeParserCache) {
// If we have cached data, we use it to skip parsing the function
body. The
@@ -4926,6 +4938,7 @@ void Parser::ParseOnBackground() {
fni_ = new (zone()) FuncNameInferrer(ast_value_factory(), zone());
CompleteParserRecorder recorder;
+ debug_saved_compile_options_ = compile_options();
if (compile_options() == ScriptCompiler::kProduceParserCache) {
log_ = &recorder;
}
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index
40886f669d828eca47abfa81a808bd310cec3c63..5cbb19aabb43aeece712e35d80b409ce90c51a84
100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -850,6 +850,10 @@ class Parser : public ParserBase<ParserTraits> {
int use_counts_[v8::Isolate::kUseCounterFeatureCount];
int total_preparse_skipped_;
HistogramTimer* pre_parse_timer_;
+
+ // Temporary; for debugging. See Parser::SkipLazyFunctionBody.
TODO(marja):
+ // remove this once done.
+ ScriptCompiler::CompileOptions debug_saved_compile_options_;
};
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.