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 2998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3009 &compilation_zone_, function_->sig); | 3009 &compilation_zone_, function_->sig); |
3010 if (jsgraph->machine()->Is32()) { | 3010 if (jsgraph->machine()->Is32()) { |
3011 descriptor = | 3011 descriptor = |
3012 module_env_->GetI32WasmCallDescriptor(&compilation_zone_, descriptor); | 3012 module_env_->GetI32WasmCallDescriptor(&compilation_zone_, descriptor); |
3013 } | 3013 } |
3014 job_.Reset(Pipeline::NewWasmCompilationJob(&info_, jsgraph->graph(), | 3014 job_.Reset(Pipeline::NewWasmCompilationJob(&info_, jsgraph->graph(), |
3015 descriptor, source_positions)); | 3015 descriptor, source_positions)); |
3016 ok_ = job_->OptimizeGraph() == CompilationJob::SUCCEEDED; | 3016 ok_ = job_->OptimizeGraph() == CompilationJob::SUCCEEDED; |
3017 // TODO(bradnelson): Improve histogram handling of size_t. | 3017 // TODO(bradnelson): Improve histogram handling of size_t. |
3018 // TODO(ahaas): The counters are not thread-safe at the moment. | 3018 // TODO(ahaas): The counters are not thread-safe at the moment. |
3019 // isolate_->counters()->wasm_compile_function_peak_memory_bytes()->AddSa
mple( | 3019 // isolate_->counters()->wasm_compile_function_peak_memory_bytes() |
| 3020 // ->AddSample( |
3020 // static_cast<int>(jsgraph->graph()->zone()->allocation_size())); | 3021 // static_cast<int>(jsgraph->graph()->zone()->allocation_size())); |
3021 | 3022 |
3022 if (FLAG_trace_wasm_decode_time) { | 3023 if (FLAG_trace_wasm_decode_time) { |
3023 double pipeline_ms = pipeline_timer.Elapsed().InMillisecondsF(); | 3024 double pipeline_ms = pipeline_timer.Elapsed().InMillisecondsF(); |
3024 PrintF( | 3025 PrintF( |
3025 "wasm-compilation phase 1 ok: %d bytes, %0.3f ms decode, %zu nodes, " | 3026 "wasm-compilation phase 1 ok: %d bytes, %0.3f ms decode, %zu nodes, " |
3026 "%0.3f ms pipeline\n", | 3027 "%0.3f ms pipeline\n", |
3027 static_cast<int>(function_->code_end_offset - | 3028 static_cast<int>(function_->code_end_offset - |
3028 function_->code_start_offset), | 3029 function_->code_start_offset), |
3029 decode_ms, node_count, pipeline_ms); | 3030 decode_ms, node_count, pipeline_ms); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3110 const wasm::WasmFunction* function) { | 3111 const wasm::WasmFunction* function) { |
3111 WasmCompilationUnit* unit = | 3112 WasmCompilationUnit* unit = |
3112 CreateWasmCompilationUnit(thrower, isolate, module_env, function, 0); | 3113 CreateWasmCompilationUnit(thrower, isolate, module_env, function, 0); |
3113 ExecuteCompilation(unit); | 3114 ExecuteCompilation(unit); |
3114 return FinishCompilation(unit); | 3115 return FinishCompilation(unit); |
3115 } | 3116 } |
3116 | 3117 |
3117 } // namespace compiler | 3118 } // namespace compiler |
3118 } // namespace internal | 3119 } // namespace internal |
3119 } // namespace v8 | 3120 } // namespace v8 |
OLD | NEW |