Reviewers: ulan,
Message:
ulan, ptal
Description:
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.
[email protected]
BUG=370327
Please review this at https://codereview.chromium.org/266423003/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+4, -2 lines):
M src/parser.cc
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index
0ff11f2281612260d87e51467b7caca13f6d935b..f07f37ebb2b271cc6466ff2dde8af462adb0a9a7
100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -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;
--
--
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.