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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 return Runtime::kNumFunctions; | 183 return Runtime::kNumFunctions; |
184 } | 184 } |
185 } else { | 185 } else { |
186 // We use Runtime::kNumFunctions as a marker to tell the code generator | 186 // We use Runtime::kNumFunctions as a marker to tell the code generator |
187 // to generate a call to a testing c-function instead of a runtime | 187 // to generate a call to a testing c-function instead of a runtime |
188 // function. This code should only be called from a cctest. | 188 // function. This code should only be called from a cctest. |
189 return Runtime::kNumFunctions; | 189 return Runtime::kNumFunctions; |
190 } | 190 } |
191 } | 191 } |
192 | 192 |
193 #if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM || \ | 193 #if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM || \ |
194 V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 | 194 V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || \ |
| 195 V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64 || V8_TARGET_ARCH_S390 || \ |
| 196 V8_TARGET_ARCH_S390X |
195 #define WASM_TRAP_IF_SUPPORTED | 197 #define WASM_TRAP_IF_SUPPORTED |
196 #endif | 198 #endif |
197 | 199 |
198 // Add a trap if {cond} is true. | 200 // Add a trap if {cond} is true. |
199 void AddTrapIfTrue(wasm::TrapReason reason, Node* cond, | 201 void AddTrapIfTrue(wasm::TrapReason reason, Node* cond, |
200 wasm::WasmCodePosition position) { | 202 wasm::WasmCodePosition position) { |
201 #ifdef WASM_TRAP_IF_SUPPORTED | 203 #ifdef WASM_TRAP_IF_SUPPORTED |
202 if (FLAG_wasm_trap_if) { | 204 if (FLAG_wasm_trap_if) { |
203 int32_t trap_id = GetFunctionIdForTrap(reason); | 205 int32_t trap_id = GetFunctionIdForTrap(reason); |
204 Node* node = graph()->NewNode(common()->TrapIf(trap_id), cond, | 206 Node* node = graph()->NewNode(common()->TrapIf(trap_id), cond, |
(...skipping 3830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4035 Smi::FromInt(instruction.instr_offset)); | 4037 Smi::FromInt(instruction.instr_offset)); |
4036 fn_protected->set(Code::kTrapDataSize * i + Code::kTrapLandingOffset, | 4038 fn_protected->set(Code::kTrapDataSize * i + Code::kTrapLandingOffset, |
4037 Smi::FromInt(instruction.landing_offset)); | 4039 Smi::FromInt(instruction.landing_offset)); |
4038 } | 4040 } |
4039 return fn_protected; | 4041 return fn_protected; |
4040 } | 4042 } |
4041 | 4043 |
4042 } // namespace compiler | 4044 } // namespace compiler |
4043 } // namespace internal | 4045 } // namespace internal |
4044 } // namespace v8 | 4046 } // namespace v8 |
OLD | NEW |