Revision: 21488
Author: [email protected]
Date: Mon May 26 11:04:32 2014 UTC
Log: Fix mem leaks in tests & ScriptCompiler::CompileUnbound.
- Leak in test-parsing/DontRegressPreParserDataSizes
- Leak in test-api/EventLogging
- Leak in ScriptCompiler::CompileUnbound which won't happen during normal
operation, but exposed by test-apöi/CompiledWithInvalidCachedData.
[email protected]
BUG=
Review URL: https://codereview.chromium.org/302603002
http://code.google.com/p/v8/source/detail?r=21488
Modified:
/branches/bleeding_edge/src/api.cc
/branches/bleeding_edge/test/cctest/test-api.cc
/branches/bleeding_edge/test/cctest/test-parsing.cc
=======================================
--- /branches/bleeding_edge/src/api.cc Fri May 23 11:12:25 2014 UTC
+++ /branches/bleeding_edge/src/api.cc Mon May 26 11:04:32 2014 UTC
@@ -1728,6 +1728,13 @@
cached_data_mode,
i::NOT_NATIVES_CODE);
has_pending_exception = result.is_null();
+ if (has_pending_exception && cached_data_mode ==
i::CONSUME_CACHED_DATA) {
+ // This case won't happen during normal operation; we have compiled
+ // successfully and produced cached data, and but the second
compilation
+ // of the same source code fails.
+ delete script_data_impl;
+ script_data_impl = NULL;
+ }
EXCEPTION_BAILOUT_CHECK(isolate, Local<UnboundScript>());
raw_result = *result;
if ((options & kProduceDataToCache) && script_data_impl != NULL) {
=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc Fri May 23 14:01:17
2014 UTC
+++ /branches/bleeding_edge/test/cctest/test-api.cc Mon May 26 11:04:32
2014 UTC
@@ -22431,14 +22431,13 @@
TEST(EventLogging) {
v8::Isolate* isolate = CcTest::isolate();
isolate->SetEventLogger(StoringEventLoggerCallback);
- v8::internal::HistogramTimer* histogramTimer =
- new v8::internal::HistogramTimer(
- "V8.Test", 0, 10000, 50,
- reinterpret_cast<v8::internal::Isolate*>(isolate));
- histogramTimer->Start();
+ v8::internal::HistogramTimer histogramTimer(
+ "V8.Test", 0, 10000, 50,
+ reinterpret_cast<v8::internal::Isolate*>(isolate));
+ histogramTimer.Start();
CHECK_EQ("V8.Test", last_event_message);
CHECK_EQ(0, last_event_status);
- histogramTimer->Stop();
+ histogramTimer.Stop();
CHECK_EQ("V8.Test", last_event_message);
CHECK_EQ(1, last_event_status);
}
=======================================
--- /branches/bleeding_edge/test/cctest/test-parsing.cc Thu May 15 09:44:57
2014 UTC
+++ /branches/bleeding_edge/test/cctest/test-parsing.cc Mon May 26 11:04:32
2014 UTC
@@ -2009,6 +2009,7 @@
data->function_count());
CHECK(false);
}
+ delete data;
}
}
--
--
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.