Commit 43f9c678 authored by marja@chromium.org's avatar marja@chromium.org

Produce cached data only for scripts which compile without errors.

ScriptCompiler::CompileUnbound handles cached data only when there was no
compilation error, so, if we produce the data for erroneous scripts, the
ScriptData object is leaked.

In addition, producing cached data for erroneous scripts makes little sense.

R=ulan@chromium.org
BUG=370327
LOG=N

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21164 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 00702723
......@@ -854,8 +854,10 @@ FunctionLiteral* Parser::ParseProgram() {
PrintF(" - took %0.3f ms]\n", ms);
}
if (cached_data_mode_ == PRODUCE_CACHED_DATA) {
Vector<unsigned> store = recorder.ExtractData();
*cached_data_ = new ScriptData(store);
if (result != NULL) {
Vector<unsigned> store = recorder.ExtractData();
*cached_data_ = new ScriptData(store);
}
log_ = NULL;
}
return result;
......
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