Index: test/cctest/test-heap.cc |
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc |
index d9d2a861ebf30d4644d91f71ee49ceaf10627f47..c49e29abbf10a31f2f918c40a93f4fcb160ead70 100644 |
--- a/test/cctest/test-heap.cc |
+++ b/test/cctest/test-heap.cc |
@@ -5558,3 +5558,37 @@ TEST(NewSpaceAllocationThroughput2) { |
bytes = tracer->NewSpaceAllocatedBytesInLast(100); |
CHECK_EQ((counter3 - counter1) * 100 / (time3 - time1), bytes); |
} |
+ |
+ |
+static void CheckLeak(const v8::FunctionCallbackInfo<v8::Value>& args) { |
+ Isolate* isolate = CcTest::i_isolate(); |
+ Object* message = |
+ *reinterpret_cast<Object**>(isolate->pending_message_obj_address()); |
+ CHECK(message->IsTheHole()); |
+} |
+ |
+ |
+TEST(MessageObjectLeak) { |
+ CcTest::InitializeVM(); |
+ v8::Isolate* isolate = CcTest::isolate(); |
+ v8::HandleScope scope(isolate); |
+ v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate); |
+ global->Set(v8::String::NewFromUtf8(isolate, "check"), |
+ v8::FunctionTemplate::New(isolate, CheckLeak)); |
+ v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global); |
+ v8::Context::Scope cscope(context); |
+ |
+ const char* test = |
+ "try {" |
+ " throw 'message';" |
Michael Starzinger
2015/05/22 13:02:29
As discussed offline: We should have the same prob
|
+ "} catch (e) {" |
+ "}" |
+ "check();"; |
+ CompileRun(test); |
+ |
+ FLAG_turbo_filter = "*"; |
+ FLAG_always_opt = true; |
+ FLAG_turbo_exceptions = true; |
+ |
+ CompileRun(test); |
+} |