| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 return Runtime::kNumFunctions; | 181 return Runtime::kNumFunctions; |
| 182 } | 182 } |
| 183 } else { | 183 } else { |
| 184 // We use Runtime::kNumFunctions as a marker to tell the code generator | 184 // We use Runtime::kNumFunctions as a marker to tell the code generator |
| 185 // to generate a call to a testing c-function instead of a runtime | 185 // to generate a call to a testing c-function instead of a runtime |
| 186 // function. This code should only be called from a cctest. | 186 // function. This code should only be called from a cctest. |
| 187 return Runtime::kNumFunctions; | 187 return Runtime::kNumFunctions; |
| 188 } | 188 } |
| 189 } | 189 } |
| 190 | 190 |
| 191 #if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 | 191 #if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM |
| 192 #define WASM_TRAP_IF_SUPPORTED | 192 #define WASM_TRAP_IF_SUPPORTED |
| 193 #endif | 193 #endif |
| 194 | 194 |
| 195 // Add a trap if {cond} is true. | 195 // Add a trap if {cond} is true. |
| 196 void AddTrapIfTrue(wasm::TrapReason reason, Node* cond, | 196 void AddTrapIfTrue(wasm::TrapReason reason, Node* cond, |
| 197 wasm::WasmCodePosition position) { | 197 wasm::WasmCodePosition position) { |
| 198 #ifdef WASM_TRAP_IF_SUPPORTED | 198 #ifdef WASM_TRAP_IF_SUPPORTED |
| 199 if (FLAG_wasm_trap_if) { | 199 if (FLAG_wasm_trap_if) { |
| 200 int32_t trap_id = GetFunctionIdForTrap(reason); | 200 int32_t trap_id = GetFunctionIdForTrap(reason); |
| 201 Node* node = graph()->NewNode(common()->TrapIf(trap_id), cond, | 201 Node* node = graph()->NewNode(common()->TrapIf(trap_id), cond, |
| (...skipping 3457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3659 Smi::FromInt(instruction.instr_offset)); | 3659 Smi::FromInt(instruction.instr_offset)); |
| 3660 fn_protected->set(Code::kTrapDataSize * i + Code::kTrapLandingOffset, | 3660 fn_protected->set(Code::kTrapDataSize * i + Code::kTrapLandingOffset, |
| 3661 Smi::FromInt(instruction.landing_offset)); | 3661 Smi::FromInt(instruction.landing_offset)); |
| 3662 } | 3662 } |
| 3663 return fn_protected; | 3663 return fn_protected; |
| 3664 } | 3664 } |
| 3665 | 3665 |
| 3666 } // namespace compiler | 3666 } // namespace compiler |
| 3667 } // namespace internal | 3667 } // namespace internal |
| 3668 } // namespace v8 | 3668 } // namespace v8 |
| OLD | NEW |