| 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 2848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2859 } | 2859 } |
| 2860 | 2860 |
| 2861 void WasmGraphBuilder::SetSourcePosition(Node* node, | 2861 void WasmGraphBuilder::SetSourcePosition(Node* node, |
| 2862 wasm::WasmCodePosition position) { | 2862 wasm::WasmCodePosition position) { |
| 2863 DCHECK_NE(position, wasm::kNoCodePosition); | 2863 DCHECK_NE(position, wasm::kNoCodePosition); |
| 2864 compiler::SourcePosition pos(position); | 2864 compiler::SourcePosition pos(position); |
| 2865 if (source_position_table_) | 2865 if (source_position_table_) |
| 2866 source_position_table_->SetSourcePosition(node, pos); | 2866 source_position_table_->SetSourcePosition(node, pos); |
| 2867 } | 2867 } |
| 2868 | 2868 |
| 2869 Node* WasmGraphBuilder::DefaultS128Value() { |
| 2870 // TODO(gdeepti): Introduce Simd128Constant to common-operator.h and use |
| 2871 // instead of creating a SIMD Value. |
| 2872 return graph()->NewNode(jsgraph()->machine()->CreateInt32x4(), |
| 2873 Int32Constant(0), Int32Constant(0), Int32Constant(0), |
| 2874 Int32Constant(0)); |
| 2875 } |
| 2876 |
| 2869 Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode, | 2877 Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode, |
| 2870 const NodeVector& inputs) { | 2878 const NodeVector& inputs) { |
| 2871 switch (opcode) { | 2879 switch (opcode) { |
| 2872 case wasm::kExprI32x4ExtractLane: | 2880 case wasm::kExprI32x4ExtractLane: |
| 2873 return graph()->NewNode(jsgraph()->machine()->Int32x4ExtractLane(), | 2881 return graph()->NewNode(jsgraph()->machine()->Int32x4ExtractLane(), |
| 2874 inputs[0], inputs[1]); | 2882 inputs[0], inputs[1]); |
| 2875 case wasm::kExprI32x4Splat: | 2883 case wasm::kExprI32x4Splat: |
| 2876 return graph()->NewNode(jsgraph()->machine()->Int32x4ExtractLane(), | 2884 return graph()->NewNode(jsgraph()->machine()->CreateInt32x4(), inputs[0], |
| 2877 inputs[0], inputs[0], inputs[0], inputs[0]); | 2885 inputs[0], inputs[0], inputs[0]); |
| 2878 default: | 2886 default: |
| 2879 return graph()->NewNode(UnsupportedOpcode(opcode), nullptr); | 2887 return graph()->NewNode(UnsupportedOpcode(opcode), nullptr); |
| 2880 } | 2888 } |
| 2881 } | 2889 } |
| 2882 | 2890 |
| 2883 static void RecordFunctionCompilation(CodeEventListener::LogEventsAndTags tag, | 2891 static void RecordFunctionCompilation(CodeEventListener::LogEventsAndTags tag, |
| 2884 Isolate* isolate, Handle<Code> code, | 2892 Isolate* isolate, Handle<Code> code, |
| 2885 const char* message, uint32_t index, | 2893 const char* message, uint32_t index, |
| 2886 const wasm::WasmName& module_name, | 2894 const wasm::WasmName& module_name, |
| 2887 const wasm::WasmName& func_name) { | 2895 const wasm::WasmName& func_name) { |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3228 function_->code_start_offset), | 3236 function_->code_start_offset), |
| 3229 compile_ms); | 3237 compile_ms); |
| 3230 } | 3238 } |
| 3231 | 3239 |
| 3232 return code; | 3240 return code; |
| 3233 } | 3241 } |
| 3234 | 3242 |
| 3235 } // namespace compiler | 3243 } // namespace compiler |
| 3236 } // namespace internal | 3244 } // namespace internal |
| 3237 } // namespace v8 | 3245 } // namespace v8 |
| OLD | NEW |