Commit 115c79bd authored by Nate Chapin's avatar Nate Chapin Committed by Commit Bot

Don't call StoreContextElement for undefined continuation perserved embedder data

Bug: chromium:1060935
Change-Id: Ie2d92edbc9b83bf54f9009d610c13274aea32b93
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2119221Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66875}
parent 47cdcc4a
......@@ -226,9 +226,13 @@ void MicrotaskQueueBuiltinsAssembler::RunSingleMicrotask(
TNode<Object> preserved_embedder_data = LoadObjectField(
microtask,
PromiseReactionJobTask::kContinuationPreservedEmbedderDataOffset);
Label preserved_data_done(this);
GotoIf(IsUndefined(preserved_embedder_data), &preserved_data_done);
StoreContextElement(native_context,
Context::CONTINUATION_PRESERVED_EMBEDDER_DATA_INDEX,
preserved_embedder_data);
Goto(&preserved_data_done);
BIND(&preserved_data_done);
// Run the promise before/debug hook if enabled.
RunPromiseHook(Runtime::kPromiseHookBefore, microtask_context,
......@@ -244,9 +248,13 @@ void MicrotaskQueueBuiltinsAssembler::RunSingleMicrotask(
RunPromiseHook(Runtime::kPromiseHookAfter, microtask_context,
promise_or_capability);
Label preserved_data_reset_done(this);
GotoIf(IsUndefined(preserved_embedder_data), &preserved_data_reset_done);
StoreContextElement(native_context,
Context::CONTINUATION_PRESERVED_EMBEDDER_DATA_INDEX,
UndefinedConstant());
Goto(&preserved_data_reset_done);
BIND(&preserved_data_reset_done);
RewindEnteredContext(saved_entered_context_count);
SetCurrentContext(current_context);
......@@ -271,9 +279,13 @@ void MicrotaskQueueBuiltinsAssembler::RunSingleMicrotask(
TNode<Object> preserved_embedder_data = LoadObjectField(
microtask,
PromiseReactionJobTask::kContinuationPreservedEmbedderDataOffset);
Label preserved_data_done(this);
GotoIf(IsUndefined(preserved_embedder_data), &preserved_data_done);
StoreContextElement(native_context,
Context::CONTINUATION_PRESERVED_EMBEDDER_DATA_INDEX,
preserved_embedder_data);
Goto(&preserved_data_done);
BIND(&preserved_data_done);
// Run the promise before/debug hook if enabled.
RunPromiseHook(Runtime::kPromiseHookBefore, microtask_context,
......@@ -289,9 +301,13 @@ void MicrotaskQueueBuiltinsAssembler::RunSingleMicrotask(
RunPromiseHook(Runtime::kPromiseHookAfter, microtask_context,
promise_or_capability);
Label preserved_data_reset_done(this);
GotoIf(IsUndefined(preserved_embedder_data), &preserved_data_reset_done);
StoreContextElement(native_context,
Context::CONTINUATION_PRESERVED_EMBEDDER_DATA_INDEX,
UndefinedConstant());
Goto(&preserved_data_reset_done);
BIND(&preserved_data_reset_done);
RewindEnteredContext(saved_entered_context_count);
SetCurrentContext(current_context);
......
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