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 { ...@@ -138,8 +138,6 @@ class V8_EXPORT_PRIVATE CompilationEventCallback {
// This is the PIMPL interface to that private class. // This is the PIMPL interface to that private class.
class V8_EXPORT_PRIVATE CompilationState { class V8_EXPORT_PRIVATE CompilationState {
public: public:
using callback_t = std::function<void(CompilationEvent)>;
~CompilationState(); ~CompilationState();
void InitCompileJob(); void InitCompileJob();
......
...@@ -3574,16 +3574,14 @@ void CompilationStateImpl::TriggerCallbacks( ...@@ -3574,16 +3574,14 @@ void CompilationStateImpl::TriggerCallbacks(
if (outstanding_baseline_units_ == 0 && outstanding_export_wrappers_ == 0 && if (outstanding_baseline_units_ == 0 && outstanding_export_wrappers_ == 0 &&
outstanding_top_tier_functions_ == 0 && outstanding_top_tier_functions_ == 0 &&
outstanding_recompilation_functions_ == 0) { outstanding_recompilation_functions_ == 0) {
for (auto it = callbacks_.begin(); it != callbacks_.end();) { callbacks_.erase(
if ((*it)->release_after_final_event() == std::remove_if(
CompilationEventCallback::ReleaseAfterFinalEvent::kRelease) { callbacks_.begin(), callbacks_.end(),
// Release all callbacks that can be released after the initial set of [](std::unique_ptr<CompilationEventCallback>& event) {
// functions finished compilation. return event->release_after_final_event() ==
it = callbacks_.erase(it); CompilationEventCallback::ReleaseAfterFinalEvent::kRelease;
} else { }),
++it; 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