Chromium Code Reviews| 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/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
| 10 | 10 |
| (...skipping 3062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3073 void WasmGraphBuilder::Int64LoweringForTesting() { | 3073 void WasmGraphBuilder::Int64LoweringForTesting() { |
| 3074 if (jsgraph()->machine()->Is32()) { | 3074 if (jsgraph()->machine()->Is32()) { |
| 3075 Int64Lowering r(jsgraph()->graph(), jsgraph()->machine(), | 3075 Int64Lowering r(jsgraph()->graph(), jsgraph()->machine(), |
| 3076 jsgraph()->common(), jsgraph()->zone(), | 3076 jsgraph()->common(), jsgraph()->zone(), |
| 3077 function_signature_); | 3077 function_signature_); |
| 3078 r.LowerGraph(); | 3078 r.LowerGraph(); |
| 3079 } | 3079 } |
| 3080 } | 3080 } |
| 3081 | 3081 |
| 3082 void WasmGraphBuilder::SimdScalarLoweringForTesting() { | 3082 void WasmGraphBuilder::SimdScalarLoweringForTesting() { |
| 3083 SimdScalarLowering(jsgraph()->graph(), jsgraph()->machine(), | 3083 if (!CpuFeatures::SupportsSimd128()) { |
|
bbudge
2016/11/21 19:48:09
Can you move the test up into TestGraphBuilder?
h
gdeepti
2016/11/21 20:56:39
Done.
| |
| 3084 jsgraph()->common(), jsgraph()->zone(), | 3084 SimdScalarLowering(jsgraph()->graph(), jsgraph()->machine(), |
| 3085 function_signature_) | 3085 jsgraph()->common(), jsgraph()->zone(), |
| 3086 .LowerGraph(); | 3086 function_signature_) |
| 3087 .LowerGraph(); | |
| 3088 } | |
| 3087 } | 3089 } |
| 3088 | 3090 |
| 3089 void WasmGraphBuilder::SetSourcePosition(Node* node, | 3091 void WasmGraphBuilder::SetSourcePosition(Node* node, |
| 3090 wasm::WasmCodePosition position) { | 3092 wasm::WasmCodePosition position) { |
| 3091 DCHECK_NE(position, wasm::kNoCodePosition); | 3093 DCHECK_NE(position, wasm::kNoCodePosition); |
| 3092 if (source_position_table_) | 3094 if (source_position_table_) |
| 3093 source_position_table_->SetSourcePosition(node, SourcePosition(position)); | 3095 source_position_table_->SetSourcePosition(node, SourcePosition(position)); |
| 3094 } | 3096 } |
| 3095 | 3097 |
| 3096 Node* WasmGraphBuilder::CreateS128Value(int32_t value) { | 3098 Node* WasmGraphBuilder::CreateS128Value(int32_t value) { |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3341 os << "Compilation failed: " << graph_construction_result_ << std::endl; | 3343 os << "Compilation failed: " << graph_construction_result_ << std::endl; |
| 3342 } | 3344 } |
| 3343 return nullptr; | 3345 return nullptr; |
| 3344 } | 3346 } |
| 3345 | 3347 |
| 3346 if (machine->Is32()) { | 3348 if (machine->Is32()) { |
| 3347 Int64Lowering r(graph, machine, common, jsgraph_->zone(), function_->sig); | 3349 Int64Lowering r(graph, machine, common, jsgraph_->zone(), function_->sig); |
| 3348 r.LowerGraph(); | 3350 r.LowerGraph(); |
| 3349 } | 3351 } |
| 3350 | 3352 |
| 3351 SimdScalarLowering(graph, machine, common, jsgraph_->zone(), function_->sig) | 3353 if (!CpuFeatures::SupportsSimd128()) { |
| 3352 .LowerGraph(); | 3354 SimdScalarLowering(graph, machine, common, jsgraph_->zone(), function_->sig) |
| 3355 .LowerGraph(); | |
| 3356 } | |
| 3353 | 3357 |
| 3354 int index = static_cast<int>(function_->func_index); | 3358 int index = static_cast<int>(function_->func_index); |
| 3355 | 3359 |
| 3356 if (index >= FLAG_trace_wasm_ast_start && index < FLAG_trace_wasm_ast_end) { | 3360 if (index >= FLAG_trace_wasm_ast_start && index < FLAG_trace_wasm_ast_end) { |
| 3357 OFStream os(stdout); | 3361 OFStream os(stdout); |
| 3358 PrintAst(isolate_->allocator(), body, os, nullptr); | 3362 PrintAst(isolate_->allocator(), body, os, nullptr); |
| 3359 } | 3363 } |
| 3360 if (FLAG_trace_wasm_decode_time) { | 3364 if (FLAG_trace_wasm_decode_time) { |
| 3361 *decode_ms = decode_timer.Elapsed().InMillisecondsF(); | 3365 *decode_ms = decode_timer.Elapsed().InMillisecondsF(); |
| 3362 } | 3366 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3489 function_->code_start_offset), | 3493 function_->code_start_offset), |
| 3490 compile_ms); | 3494 compile_ms); |
| 3491 } | 3495 } |
| 3492 | 3496 |
| 3493 return code; | 3497 return code; |
| 3494 } | 3498 } |
| 3495 | 3499 |
| 3496 } // namespace compiler | 3500 } // namespace compiler |
| 3497 } // namespace internal | 3501 } // namespace internal |
| 3498 } // namespace v8 | 3502 } // namespace v8 |
| OLD | NEW |