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 3949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3960 | 3960 |
3961 // Run the compiler pipeline to generate machine code. | 3961 // Run the compiler pipeline to generate machine code. |
3962 CallDescriptor* descriptor = wasm::ModuleEnv::GetWasmCallDescriptor( | 3962 CallDescriptor* descriptor = wasm::ModuleEnv::GetWasmCallDescriptor( |
3963 &compilation_zone_, func_body_.sig); | 3963 &compilation_zone_, func_body_.sig); |
3964 if (jsgraph_->machine()->Is32()) { | 3964 if (jsgraph_->machine()->Is32()) { |
3965 descriptor = | 3965 descriptor = |
3966 module_env_->GetI32WasmCallDescriptor(&compilation_zone_, descriptor); | 3966 module_env_->GetI32WasmCallDescriptor(&compilation_zone_, descriptor); |
3967 } | 3967 } |
3968 job_.reset(Pipeline::NewWasmCompilationJob( | 3968 job_.reset(Pipeline::NewWasmCompilationJob( |
3969 &info_, jsgraph_, descriptor, source_positions, &protected_instructions_, | 3969 &info_, jsgraph_, descriptor, source_positions, &protected_instructions_, |
3970 module_env_->module->origin != wasm::kWasmOrigin)); | 3970 !module_env_->module->is_wasm())); |
3971 ok_ = job_->ExecuteJob() == CompilationJob::SUCCEEDED; | 3971 ok_ = job_->ExecuteJob() == CompilationJob::SUCCEEDED; |
3972 // TODO(bradnelson): Improve histogram handling of size_t. | 3972 // TODO(bradnelson): Improve histogram handling of size_t. |
3973 // TODO(ahaas): The counters are not thread-safe at the moment. | 3973 // TODO(ahaas): The counters are not thread-safe at the moment. |
3974 // isolate_->counters()->wasm_compile_function_peak_memory_bytes() | 3974 // isolate_->counters()->wasm_compile_function_peak_memory_bytes() |
3975 // ->AddSample( | 3975 // ->AddSample( |
3976 // static_cast<int>(jsgraph->graph()->zone()->allocation_size())); | 3976 // static_cast<int>(jsgraph->graph()->zone()->allocation_size())); |
3977 | 3977 |
3978 if (FLAG_trace_wasm_decode_time) { | 3978 if (FLAG_trace_wasm_decode_time) { |
3979 double pipeline_ms = pipeline_timer.Elapsed().InMillisecondsF(); | 3979 double pipeline_ms = pipeline_timer.Elapsed().InMillisecondsF(); |
3980 PrintF( | 3980 PrintF( |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4035 wasm::ErrorThrower* thrower, Isolate* isolate, | 4035 wasm::ErrorThrower* thrower, Isolate* isolate, |
4036 wasm::ModuleBytesEnv* module_env, const wasm::WasmFunction* function) { | 4036 wasm::ModuleBytesEnv* module_env, const wasm::WasmFunction* function) { |
4037 WasmCompilationUnit unit(isolate, module_env, function); | 4037 WasmCompilationUnit unit(isolate, module_env, function); |
4038 unit.ExecuteCompilation(); | 4038 unit.ExecuteCompilation(); |
4039 return unit.FinishCompilation(thrower); | 4039 return unit.FinishCompilation(thrower); |
4040 } | 4040 } |
4041 | 4041 |
4042 } // namespace compiler | 4042 } // namespace compiler |
4043 } // namespace internal | 4043 } // namespace internal |
4044 } // namespace v8 | 4044 } // namespace v8 |
OLD | NEW |