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
This commit is contained in:
marja@chromium.org 2014-10-01 16:54:42 +00:00
parent 2b6280a13b
commit e1a5abb6c8
2 changed files with 17 additions and 0 deletions

View File

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

View File

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