| 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 2885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2896 // TODO(gdeepti): Introduce Simd128Constant to common-operator.h and use | 2896 // TODO(gdeepti): Introduce Simd128Constant to common-operator.h and use |
| 2897 // instead of creating a SIMD Value. | 2897 // instead of creating a SIMD Value. |
| 2898 return graph()->NewNode(jsgraph()->machine()->CreateInt32x4(), | 2898 return graph()->NewNode(jsgraph()->machine()->CreateInt32x4(), |
| 2899 Int32Constant(0), Int32Constant(0), Int32Constant(0), | 2899 Int32Constant(0), Int32Constant(0), Int32Constant(0), |
| 2900 Int32Constant(0)); | 2900 Int32Constant(0)); |
| 2901 } | 2901 } |
| 2902 | 2902 |
| 2903 Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode, | 2903 Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode, |
| 2904 const NodeVector& inputs) { | 2904 const NodeVector& inputs) { |
| 2905 switch (opcode) { | 2905 switch (opcode) { |
| 2906 case wasm::kExprI32x4ExtractLane: | |
| 2907 return graph()->NewNode(jsgraph()->machine()->Int32x4ExtractLane(), | |
| 2908 inputs[0], inputs[1]); | |
| 2909 case wasm::kExprI32x4Splat: | 2906 case wasm::kExprI32x4Splat: |
| 2910 return graph()->NewNode(jsgraph()->machine()->CreateInt32x4(), inputs[0], | 2907 return graph()->NewNode(jsgraph()->machine()->CreateInt32x4(), inputs[0], |
| 2911 inputs[0], inputs[0], inputs[0]); | 2908 inputs[0], inputs[0], inputs[0]); |
| 2912 default: | 2909 default: |
| 2913 return graph()->NewNode(UnsupportedOpcode(opcode), nullptr); | 2910 return graph()->NewNode(UnsupportedOpcode(opcode), nullptr); |
| 2914 } | 2911 } |
| 2915 } | 2912 } |
| 2916 | 2913 |
| 2914 Node* WasmGraphBuilder::SimdExtractLane(wasm::WasmOpcode opcode, uint8_t lane, |
| 2915 Node* input) { |
| 2916 switch (opcode) { |
| 2917 case wasm::kExprI32x4ExtractLane: |
| 2918 return graph()->NewNode(jsgraph()->machine()->Int32x4ExtractLane(), input, |
| 2919 Int32Constant(lane)); |
| 2920 default: |
| 2921 return graph()->NewNode(UnsupportedOpcode(opcode), nullptr); |
| 2922 } |
| 2923 } |
| 2924 |
| 2917 static void RecordFunctionCompilation(CodeEventListener::LogEventsAndTags tag, | 2925 static void RecordFunctionCompilation(CodeEventListener::LogEventsAndTags tag, |
| 2918 Isolate* isolate, Handle<Code> code, | 2926 Isolate* isolate, Handle<Code> code, |
| 2919 const char* message, uint32_t index, | 2927 const char* message, uint32_t index, |
| 2920 const wasm::WasmName& module_name, | 2928 const wasm::WasmName& module_name, |
| 2921 const wasm::WasmName& func_name) { | 2929 const wasm::WasmName& func_name) { |
| 2922 DCHECK(isolate->logger()->is_logging_code_events() || | 2930 DCHECK(isolate->logger()->is_logging_code_events() || |
| 2923 isolate->is_profiling()); | 2931 isolate->is_profiling()); |
| 2924 | 2932 |
| 2925 ScopedVector<char> buffer(128); | 2933 ScopedVector<char> buffer(128); |
| 2926 SNPrintF(buffer, "%s#%d:%.*s:%.*s", message, index, module_name.length(), | 2934 SNPrintF(buffer, "%s#%d:%.*s:%.*s", message, index, module_name.length(), |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3262 function_->code_start_offset), | 3270 function_->code_start_offset), |
| 3263 compile_ms); | 3271 compile_ms); |
| 3264 } | 3272 } |
| 3265 | 3273 |
| 3266 return code; | 3274 return code; |
| 3267 } | 3275 } |
| 3268 | 3276 |
| 3269 } // namespace compiler | 3277 } // namespace compiler |
| 3270 } // namespace internal | 3278 } // namespace internal |
| 3271 } // namespace v8 | 3279 } // namespace v8 |
| OLD | NEW |