| 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 2944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2955 // WASM semantics throw on OOB. Introduce explicit bounds check. | 2955 // WASM semantics throw on OOB. Introduce explicit bounds check. |
| 2956 if (!FLAG_wasm_trap_handler) { | 2956 if (!FLAG_wasm_trap_handler) { |
| 2957 BoundsCheckMem(memtype, index, offset, position); | 2957 BoundsCheckMem(memtype, index, offset, position); |
| 2958 } | 2958 } |
| 2959 bool aligned = static_cast<int>(alignment) >= | 2959 bool aligned = static_cast<int>(alignment) >= |
| 2960 ElementSizeLog2Of(memtype.representation()); | 2960 ElementSizeLog2Of(memtype.representation()); |
| 2961 | 2961 |
| 2962 if (aligned || | 2962 if (aligned || |
| 2963 jsgraph()->machine()->UnalignedLoadSupported(memtype, alignment)) { | 2963 jsgraph()->machine()->UnalignedLoadSupported(memtype, alignment)) { |
| 2964 if (FLAG_wasm_trap_handler) { | 2964 if (FLAG_wasm_trap_handler) { |
| 2965 DCHECK(FLAG_wasm_guard_pages); |
| 2965 Node* context = HeapConstant(module_->instance->context); | 2966 Node* context = HeapConstant(module_->instance->context); |
| 2966 Node* position_node = jsgraph()->Int32Constant(position); | 2967 Node* position_node = jsgraph()->Int32Constant(position); |
| 2967 load = graph()->NewNode(jsgraph()->machine()->ProtectedLoad(memtype), | 2968 load = graph()->NewNode(jsgraph()->machine()->ProtectedLoad(memtype), |
| 2968 MemBuffer(offset), index, context, position_node, | 2969 MemBuffer(offset), index, context, position_node, |
| 2969 *effect_, *control_); | 2970 *effect_, *control_); |
| 2970 } else { | 2971 } else { |
| 2971 load = graph()->NewNode(jsgraph()->machine()->Load(memtype), | 2972 load = graph()->NewNode(jsgraph()->machine()->Load(memtype), |
| 2972 MemBuffer(offset), index, *effect_, *control_); | 2973 MemBuffer(offset), index, *effect_, *control_); |
| 2973 } | 2974 } |
| 2974 } else { | 2975 } else { |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3487 function_->code_start_offset), | 3488 function_->code_start_offset), |
| 3488 compile_ms); | 3489 compile_ms); |
| 3489 } | 3490 } |
| 3490 | 3491 |
| 3491 return code; | 3492 return code; |
| 3492 } | 3493 } |
| 3493 | 3494 |
| 3494 } // namespace compiler | 3495 } // namespace compiler |
| 3495 } // namespace internal | 3496 } // namespace internal |
| 3496 } // namespace v8 | 3497 } // namespace v8 |
| OLD | NEW |