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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/assembler-inl.h" | 9 #include "src/assembler-inl.h" |
10 #include "src/base/platform/elapsed-timer.h" | 10 #include "src/base/platform/elapsed-timer.h" |
(...skipping 3994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4005 // the code object of the c-entry stub. | 4005 // the code object of the c-entry stub. |
4006 jsgraph_->CEntryStubConstant(1); | 4006 jsgraph_->CEntryStubConstant(1); |
4007 DCHECK(!handles_initialized_); | 4007 DCHECK(!handles_initialized_); |
4008 #if DEBUG | 4008 #if DEBUG |
4009 handles_initialized_ = true; | 4009 handles_initialized_ = true; |
4010 #endif // DEBUG | 4010 #endif // DEBUG |
4011 } | 4011 } |
4012 | 4012 |
4013 void WasmCompilationUnit::ExecuteCompilation() { | 4013 void WasmCompilationUnit::ExecuteCompilation() { |
4014 DCHECK(handles_initialized_); | 4014 DCHECK(handles_initialized_); |
4015 if (is_sync_) { | 4015 TimedHistogramScope wasm_compile_function_time_scope( |
4016 // TODO(karlschimpf): Make this work when asynchronous. | 4016 isolate_->counters()->wasm_compile_function_time()); |
4017 // https://bugs.chromium.org/p/v8/issues/detail?id=6361 | |
4018 HistogramTimerScope wasm_compile_function_time_scope( | |
4019 isolate_->counters()->wasm_compile_function_time()); | |
4020 ExecuteCompilationInternal(); | |
4021 return; | |
4022 } | |
4023 ExecuteCompilationInternal(); | |
4024 } | |
4025 | |
4026 void WasmCompilationUnit::ExecuteCompilationInternal() { | |
4027 if (FLAG_trace_wasm_compiler) { | 4017 if (FLAG_trace_wasm_compiler) { |
4028 if (func_name_.start() != nullptr) { | 4018 if (func_name_.start() != nullptr) { |
4029 PrintF("Compiling WASM function %d:'%.*s'\n\n", func_index(), | 4019 PrintF("Compiling WASM function %d:'%.*s'\n\n", func_index(), |
4030 func_name_.length(), func_name_.start()); | 4020 func_name_.length(), func_name_.start()); |
4031 } else { | 4021 } else { |
4032 PrintF("Compiling WASM function %d:<unnamed>\n\n", func_index()); | 4022 PrintF("Compiling WASM function %d:<unnamed>\n\n", func_index()); |
4033 } | 4023 } |
4034 } | 4024 } |
4035 | 4025 |
4036 double decode_ms = 0; | 4026 double decode_ms = 0; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4129 wasm::ModuleBytesEnv* module_env, const wasm::WasmFunction* function) { | 4119 wasm::ModuleBytesEnv* module_env, const wasm::WasmFunction* function) { |
4130 WasmCompilationUnit unit(isolate, module_env, function); | 4120 WasmCompilationUnit unit(isolate, module_env, function); |
4131 unit.InitializeHandles(); | 4121 unit.InitializeHandles(); |
4132 unit.ExecuteCompilation(); | 4122 unit.ExecuteCompilation(); |
4133 return unit.FinishCompilation(thrower); | 4123 return unit.FinishCompilation(thrower); |
4134 } | 4124 } |
4135 | 4125 |
4136 } // namespace compiler | 4126 } // namespace compiler |
4137 } // namespace internal | 4127 } // namespace internal |
4138 } // namespace v8 | 4128 } // namespace v8 |
OLD | NEW |