Revision: 21164
Author: [email protected]
Date: Tue May 6 11:22:54 2014 UTC
Log: 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
LOG=N
Review URL: https://codereview.chromium.org/266423003
http://code.google.com/p/v8/source/detail?r=21164
Modified:
/branches/bleeding_edge/src/parser.cc
=======================================
--- /branches/bleeding_edge/src/parser.cc Mon May 5 14:55:13 2014 UTC
+++ /branches/bleeding_edge/src/parser.cc Tue May 6 11:22:54 2014 UTC
@@ -854,8 +854,10 @@
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.