Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: src/compiler/wasm-compiler.cc

Issue 1866873002: [wasm] Adding metrics for Asm/Wasm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/counters.h » ('j') | src/counters.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/wasm-compiler.h" 5 #include "src/compiler/wasm-compiler.h"
6 6
7 #include "src/isolate-inl.h" 7 #include "src/isolate-inl.h"
8 8
9 #include "src/base/platform/elapsed-timer.h" 9 #include "src/base/platform/elapsed-timer.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 2659 matching lines...) Expand 10 before | Expand all | Expand 10 after
2670 module_name); 2670 module_name);
2671 } 2671 }
2672 return code; 2672 return code;
2673 } 2673 }
2674 2674
2675 2675
2676 // Helper function to compile a single function. 2676 // Helper function to compile a single function.
2677 Handle<Code> CompileWasmFunction(wasm::ErrorThrower& thrower, Isolate* isolate, 2677 Handle<Code> CompileWasmFunction(wasm::ErrorThrower& thrower, Isolate* isolate,
2678 wasm::ModuleEnv* module_env, 2678 wasm::ModuleEnv* module_env,
2679 const wasm::WasmFunction& function) { 2679 const wasm::WasmFunction& function) {
2680 HistogramTimerScope wasm_compile_function_time_scope(
2681 isolate->counters()->wasm_compile_function_time());
2680 if (FLAG_trace_wasm_compiler) { 2682 if (FLAG_trace_wasm_compiler) {
2681 OFStream os(stdout); 2683 OFStream os(stdout);
2682 os << "Compiling WASM function " 2684 os << "Compiling WASM function "
2683 << wasm::WasmFunctionName(&function, module_env) << std::endl; 2685 << wasm::WasmFunctionName(&function, module_env) << std::endl;
2684 os << std::endl; 2686 os << std::endl;
2685 } 2687 }
2686 2688
2687 double decode_ms = 0; 2689 double decode_ms = 0;
2688 base::ElapsedTimer decode_timer; 2690 base::ElapsedTimer decode_timer;
2689 if (FLAG_trace_wasm_decode_time) { 2691 if (FLAG_trace_wasm_decode_time) {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
2773 } 2775 }
2774 2776
2775 if (FLAG_trace_wasm_decode_time) { 2777 if (FLAG_trace_wasm_decode_time) {
2776 double compile_ms = compile_timer.Elapsed().InMillisecondsF(); 2778 double compile_ms = compile_timer.Elapsed().InMillisecondsF();
2777 PrintF( 2779 PrintF(
2778 "wasm-compile ok: %d bytes, %0.3f ms decode, %d nodes, %0.3f ms " 2780 "wasm-compile ok: %d bytes, %0.3f ms decode, %d nodes, %0.3f ms "
2779 "compile\n", 2781 "compile\n",
2780 static_cast<int>(function.code_end_offset - function.code_start_offset), 2782 static_cast<int>(function.code_end_offset - function.code_start_offset),
2781 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms); 2783 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms);
2782 } 2784 }
2785 // TODO(bradnelson): Improve histogram handling of size_t.
2786 isolate->counters()->wasm_compile_function_peak_memory_bytes()->AddSample(
2787 static_cast<int>(zone.allocation_size()));
2783 return code; 2788 return code;
2784 } 2789 }
2785 2790
2786 2791
2787 } // namespace compiler 2792 } // namespace compiler
2788 } // namespace internal 2793 } // namespace internal
2789 } // namespace v8 2794 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/counters.h » ('j') | src/counters.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698