OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 isolate->counters()->wasm_compile_function_peak_memory()->AddSample( | |
Mircea Trofin
2016/04/13 17:51:25
I'm a bit concerned with the downcast here from si
bradnelson
2016/04/14 07:05:22
Agreed, but as above, the static_casts for these f
| |
2786 static_cast<int>(zone.allocation_size())); | |
2783 return code; | 2787 return code; |
2784 } | 2788 } |
2785 | 2789 |
2786 | 2790 |
2787 } // namespace compiler | 2791 } // namespace compiler |
2788 } // namespace internal | 2792 } // namespace internal |
2789 } // namespace v8 | 2793 } // namespace v8 |
OLD | NEW |