Commit 05dfa289 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by V8 LUCI CQ

[inspector] Do not resurrect Script objects.

Previously, the inspector would resurrect `v8::internal::Script` objects
when the weak callback is invoked, in order to access their fields and
read out the source (either a String in case of JavaScript or the module
bytes in case of WebAssembly). With https://crrev.com/c/3494242 we no
longer need to access the `v8::internal::Script` now, and so we can stop
relying on the `WeakCallbackType::kFinalizer` logic.

Bug: chromium:1295659
Fixed: chromium:1302195
Doc: https://bit.ly/v8-inspector-script-caching
Change-Id: I6a444bfcdf6cd23b30043f7386d6c18b7afec659
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497324Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79366}
parent 7f5c3f7b
......@@ -326,11 +326,11 @@ class ActualScript : public V8DebuggerScript {
[](const v8::WeakCallbackInfo<ActualScript>& data) {
data.GetParameter()->WeakCallback();
},
v8::WeakCallbackType::kFinalizer);
v8::WeakCallbackType::kParameter);
}
void WeakCallback() {
m_script.ClearWeak();
m_script.Reset();
m_agent->ScriptCollected(this);
}
......
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