Commit e1a5abb6 authored by marja@chromium.org's avatar marja@chromium.org

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.

R=jochen@chromium.org
BUG=

Review URL: https://codereview.chromium.org/619583005

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24373 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 2b6280a1
......@@ -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);
CHECK(expected_property_count);
CHECK(debug_saved_compile_options_ == compile_options());
if (compile_options() == ScriptCompiler::kProduceParserCache) {
CHECK(log_);
}
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;
}
......
......@@ -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_;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment