Commit 83c3489d authored by Andreas Haas's avatar Andreas Haas Committed by V8 LUCI CQ

[wasm] Cleanup Callback removal

The changes were requested in https://crrev.com/c/3264288 after the CL
landed.

R=clemensb@chromium.org

Bug: v8:12289
Change-Id: I863c7253ffb28ac878f5f91f24d6d1f0236da9a4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3285405Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77939}
parent 573759da
......@@ -138,8 +138,6 @@ class V8_EXPORT_PRIVATE CompilationEventCallback {
// This is the PIMPL interface to that private class.
class V8_EXPORT_PRIVATE CompilationState {
public:
using callback_t = std::function<void(CompilationEvent)>;
~CompilationState();
void InitCompileJob();
......
......@@ -3574,16 +3574,14 @@ void CompilationStateImpl::TriggerCallbacks(
if (outstanding_baseline_units_ == 0 && outstanding_export_wrappers_ == 0 &&
outstanding_top_tier_functions_ == 0 &&
outstanding_recompilation_functions_ == 0) {
for (auto it = callbacks_.begin(); it != callbacks_.end();) {
if ((*it)->release_after_final_event() ==
CompilationEventCallback::ReleaseAfterFinalEvent::kRelease) {
// Release all callbacks that can be released after the initial set of
// functions finished compilation.
it = callbacks_.erase(it);
} else {
++it;
}
}
callbacks_.erase(
std::remove_if(
callbacks_.begin(), callbacks_.end(),
[](std::unique_ptr<CompilationEventCallback>& event) {
return event->release_after_final_event() ==
CompilationEventCallback::ReleaseAfterFinalEvent::kRelease;
}),
callbacks_.end());
}
}
......
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