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