Commit d187b070 authored by Ben L. Titzer's avatar Ben L. Titzer Committed by Commit Bot

[d8] Add handlescope within message loop

D8 workers were leaking all messages due to a missing HandleScope
within the message loop. Add one to fix leaks.

R=verwaest@chromium.org
BUG=v8:9524

Change-Id: I2f2f6ba0b8c58bf38bf68b7464dffdf1d826a29d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1724212Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62992}
parent 207d6b35
......@@ -2699,6 +2699,7 @@ void Worker::ExecuteInThread() {
.ToLocalChecked();
if (onmessage->IsFunction()) {
Local<Function> onmessage_fun = Local<Function>::Cast(onmessage);
SealHandleScope shs(isolate);
// Now wait for messages
while (true) {
in_semaphore_.Wait();
......@@ -2708,6 +2709,7 @@ void Worker::ExecuteInThread() {
break;
}
v8::TryCatch try_catch(isolate);
HandleScope scope(isolate);
Local<Value> value;
if (Shell::DeserializeValue(isolate, std::move(data))
.ToLocal(&value)) {
......
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