Commit fca5a7f3 authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[wasm] Remove custom DeserializationTimeScope

Use the standard TimedHistogramScope instead.

R=ahaas@chromium.org

Bug: v8:12281
Change-Id: Ib404f8e60999bc5c1871d4dce25f8ba7cc3cadfe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3437048Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78942}
parent c65c71b5
......@@ -2957,30 +2957,13 @@ void AsyncStreamingProcessor::OnAbort() {
job_->Abort();
}
namespace {
class DeserializationTimeScope {
public:
explicit DeserializationTimeScope(TimedHistogram* counter)
: counter_(counter), start_(base::TimeTicks::Now()) {}
~DeserializationTimeScope() {
base::TimeDelta duration = base::TimeTicks::Now() - start_;
int duration_usecs = static_cast<int>(duration.InMilliseconds());
counter_->AddSample(duration_usecs);
}
private:
TimedHistogram* counter_;
base::TimeTicks start_;
};
} // namespace
bool AsyncStreamingProcessor::Deserialize(
base::Vector<const uint8_t> module_bytes,
base::Vector<const uint8_t> wire_bytes) {
TRACE_EVENT0("v8.wasm", "wasm.Deserialize");
DeserializationTimeScope time_scope(
job_->isolate()->counters()->wasm_deserialization_time());
TimedHistogramScope time_scope(
job_->isolate()->counters()->wasm_deserialization_time(),
job_->isolate());
// DeserializeNativeModule and FinishCompile assume that they are executed in
// a HandleScope, and that a context is set on the isolate.
HandleScope scope(job_->isolate_);
......
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