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 3317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3328 | 3328 |
3329 void WasmGraphBuilder::Int64LoweringForTesting() { | 3329 void WasmGraphBuilder::Int64LoweringForTesting() { |
3330 if (jsgraph()->machine()->Is32()) { | 3330 if (jsgraph()->machine()->Is32()) { |
3331 Int64Lowering r(jsgraph()->graph(), jsgraph()->machine(), | 3331 Int64Lowering r(jsgraph()->graph(), jsgraph()->machine(), |
3332 jsgraph()->common(), jsgraph()->zone(), sig_); | 3332 jsgraph()->common(), jsgraph()->zone(), sig_); |
3333 r.LowerGraph(); | 3333 r.LowerGraph(); |
3334 } | 3334 } |
3335 } | 3335 } |
3336 | 3336 |
3337 void WasmGraphBuilder::SimdScalarLoweringForTesting() { | 3337 void WasmGraphBuilder::SimdScalarLoweringForTesting() { |
3338 SimdScalarLowering(jsgraph()->graph(), jsgraph()->machine(), | 3338 SimdScalarLowering(jsgraph(), sig_).LowerGraph(); |
3339 jsgraph()->common(), jsgraph()->zone(), sig_) | |
3340 .LowerGraph(); | |
3341 } | 3339 } |
3342 | 3340 |
3343 void WasmGraphBuilder::SetSourcePosition(Node* node, | 3341 void WasmGraphBuilder::SetSourcePosition(Node* node, |
3344 wasm::WasmCodePosition position) { | 3342 wasm::WasmCodePosition position) { |
3345 DCHECK_NE(position, wasm::kNoCodePosition); | 3343 DCHECK_NE(position, wasm::kNoCodePosition); |
3346 if (source_position_table_) | 3344 if (source_position_table_) |
3347 source_position_table_->SetSourcePosition(node, SourcePosition(position)); | 3345 source_position_table_->SetSourcePosition(node, SourcePosition(position)); |
3348 } | 3346 } |
3349 | 3347 |
3350 Node* WasmGraphBuilder::Simd128Zero() { | 3348 Node* WasmGraphBuilder::Simd128Zero() { |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4056 } | 4054 } |
4057 return nullptr; | 4055 return nullptr; |
4058 } | 4056 } |
4059 | 4057 |
4060 if (machine->Is32()) { | 4058 if (machine->Is32()) { |
4061 Int64Lowering(graph, machine, common, jsgraph_->zone(), function_->sig) | 4059 Int64Lowering(graph, machine, common, jsgraph_->zone(), function_->sig) |
4062 .LowerGraph(); | 4060 .LowerGraph(); |
4063 } | 4061 } |
4064 | 4062 |
4065 if (builder.has_simd() && !CpuFeatures::SupportsSimd128()) { | 4063 if (builder.has_simd() && !CpuFeatures::SupportsSimd128()) { |
4066 SimdScalarLowering(graph, machine, common, jsgraph_->zone(), function_->sig) | 4064 SimdScalarLowering(jsgraph_, function_->sig).LowerGraph(); |
4067 .LowerGraph(); | |
4068 } | 4065 } |
4069 | 4066 |
4070 int index = static_cast<int>(function_->func_index); | 4067 int index = static_cast<int>(function_->func_index); |
4071 | 4068 |
4072 if (index >= FLAG_trace_wasm_ast_start && index < FLAG_trace_wasm_ast_end) { | 4069 if (index >= FLAG_trace_wasm_ast_start && index < FLAG_trace_wasm_ast_end) { |
4073 OFStream os(stdout); | 4070 OFStream os(stdout); |
4074 PrintRawWasmCode(isolate_->allocator(), body, | 4071 PrintRawWasmCode(isolate_->allocator(), body, |
4075 module_env_->module_env.module); | 4072 module_env_->module_env.module); |
4076 } | 4073 } |
4077 if (index >= FLAG_trace_wasm_text_start && index < FLAG_trace_wasm_text_end) { | 4074 if (index >= FLAG_trace_wasm_text_start && index < FLAG_trace_wasm_text_end) { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4217 function_->code_end_offset - function_->code_start_offset, | 4214 function_->code_end_offset - function_->code_start_offset, |
4218 codegen_ms); | 4215 codegen_ms); |
4219 } | 4216 } |
4220 | 4217 |
4221 return code; | 4218 return code; |
4222 } | 4219 } |
4223 | 4220 |
4224 } // namespace compiler | 4221 } // namespace compiler |
4225 } // namespace internal | 4222 } // namespace internal |
4226 } // namespace v8 | 4223 } // namespace v8 |
OLD | NEW |