Commit d8a457cb authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[global-handles] Do not clear finalization callback on moving

Bug: chromium:923361
Change-Id: Id4a0f6515f6b17cec2732df561c1e82080dc29c8
Reviewed-on: https://chromium-review.googlesource.com/c/1462963Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59498}
parent 7d8bb4ae
......@@ -660,6 +660,7 @@ class GlobalHandles::TracedNode final
set_parameter(parameter);
callback_ = callback;
}
bool HasFinalizationCallback() const { return callback_ != nullptr; }
void CollectPhantomCallbackData(
std::vector<std::pair<TracedNode*, PendingPhantomCallback>>*
......@@ -775,7 +776,12 @@ void GlobalHandles::MoveTracedGlobal(Address** from, Address** to) {
DCHECK_NOT_NULL(*to);
DCHECK_EQ(*from, *to);
TracedNode* node = TracedNode::FromLocation(*from);
// Only set the backpointer for clearing a phantom handle when there is no
// finalization callback attached. As soon as a callback is attached to a node
// the embedder is on its own when resetting a handle.
if (!node->HasFinalizationCallback()) {
node->set_parameter(to);
}
}
void GlobalHandles::Destroy(Address* location) {
......
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