Commit a42e067e authored by Camillo Bruni's avatar Camillo Bruni Committed by V8 LUCI CQ

[snapshot] Add SnapshotDecompress RCS scope

We do have snapshot decompression trace events, let's also add a
runtime call stats scope for easy comparison.

Bug: chromium:1269494, chromium:1270039
Change-Id: If467cc38f37a0ea9d84e501b4984bf72736c8fa4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3279962
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77898}
parent 76b4ebe1
......@@ -388,13 +388,13 @@ class RuntimeCallTimer final {
V(BoundFunctionLengthGetter) \
V(BoundFunctionNameGetter) \
V(CodeGenerationFromStringsCallbacks) \
V(CompileBackgroundBaselinePreVisit) \
V(CompileBackgroundBaselineVisit) \
V(CompileBackgroundCompileTask) \
V(CompileBaseline) \
V(CompileBaselineFinalization) \
V(CompileBaselinePreVisit) \
V(CompileBaselineVisit) \
V(CompileBackgroundBaselinePreVisit) \
V(CompileBackgroundBaselineVisit) \
V(CompileBaselineFinalization) \
V(CompileCollectSourcePositions) \
V(CompileDeserialize) \
V(CompileEnqueueOnDispatcher) \
......@@ -469,6 +469,7 @@ class RuntimeCallTimer final {
V(PrototypeMap_TransitionToDataProperty) \
V(PrototypeObject_DeleteProperty) \
V(ReconfigureToDataProperty) \
V(SnapshotDecompress) \
V(StringLengthGetter) \
V(TestCounter1) \
V(TestCounter2) \
......@@ -476,10 +477,10 @@ class RuntimeCallTimer final {
V(UpdateProtector) \
V(WebSnapshotDeserialize) \
V(WebSnapshotDeserialize_Arrays) \
V(WebSnapshotDeserialize_Classes) \
V(WebSnapshotDeserialize_Contexts) \
V(WebSnapshotDeserialize_Exports) \
V(WebSnapshotDeserialize_Functions) \
V(WebSnapshotDeserialize_Classes) \
V(WebSnapshotDeserialize_Maps) \
V(WebSnapshotDeserialize_Objects) \
V(WebSnapshotDeserialize_Strings)
......
......@@ -120,9 +120,11 @@ class SnapshotImpl : public AllStatic {
} // namespace
SnapshotData MaybeDecompress(const base::Vector<const byte>& snapshot_data) {
TRACE_EVENT0("v8", "V8.SnapshotDecompress");
SnapshotData MaybeDecompress(Isolate* isolate,
const base::Vector<const byte>& snapshot_data) {
#ifdef V8_SNAPSHOT_COMPRESSION
TRACE_EVENT0("v8", "V8.SnapshotDecompress");
RCS_SCOPE(isolate, RuntimeCallCounterId::kSnapshotDecompress);
return SnapshotCompression::Decompress(snapshot_data);
#else
return SnapshotData(snapshot_data);
......@@ -182,9 +184,11 @@ bool Snapshot::Initialize(Isolate* isolate) {
decompress_histogram.emplace(isolate->counters()->snapshot_decompress());
}
#endif
SnapshotData startup_snapshot_data(MaybeDecompress(startup_data));
SnapshotData read_only_snapshot_data(MaybeDecompress(read_only_data));
SnapshotData shared_heap_snapshot_data(MaybeDecompress(shared_heap_data));
SnapshotData startup_snapshot_data(MaybeDecompress(isolate, startup_data));
SnapshotData read_only_snapshot_data(
MaybeDecompress(isolate, read_only_data));
SnapshotData shared_heap_snapshot_data(
MaybeDecompress(isolate, shared_heap_data));
#ifdef V8_SNAPSHOT_COMPRESSION
decompress_histogram.reset();
#endif
......@@ -222,7 +226,7 @@ MaybeHandle<Context> Snapshot::NewContextFromSnapshot(
isolate->counters()->context_snapshot_decompress());
}
#endif
snapshot_data.emplace(MaybeDecompress(context_data));
snapshot_data.emplace(MaybeDecompress(isolate, context_data));
}
MaybeHandle<Context> maybe_result = ContextDeserializer::DeserializeContext(
......
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