v8/tools/wasm/wasm-import-profiler-end.js
Ben L. Titzer 4eb53245f0 [wasm/tools] Add import profiler
Add a profiler for functions imported to WASM instances. This profiler
is implemented entirely in JavaScript and monkey-patches
WebAssembly.instantiate() and new WebAssembly.Instance() to instrument
the imported functions to each instance in order to count their
invocations and cumulative time.

R=mstarzinger@chromium.org

Bug: v8:8423
Change-Id: If456355aba07dc69c5500bafbe35fc56b31486af
Reviewed-on: https://chromium-review.googlesource.com/c/1347488
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57746}
2018-11-22 15:36:21 +00:00

7 lines
323 B
JavaScript

// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Code to run at shutdown: print out the profiles for all instances.
if (typeof WebAssembly.dumpAllProfiles == "function") WebAssembly.dumpAllProfiles();