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 2942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2953 // WASM semantics throw on OOB. Introduce explicit bounds check. | 2953 // WASM semantics throw on OOB. Introduce explicit bounds check. |
2954 if (!FLAG_wasm_trap_handler) { | 2954 if (!FLAG_wasm_trap_handler) { |
2955 BoundsCheckMem(memtype, index, offset, position); | 2955 BoundsCheckMem(memtype, index, offset, position); |
2956 } | 2956 } |
2957 bool aligned = static_cast<int>(alignment) >= | 2957 bool aligned = static_cast<int>(alignment) >= |
2958 ElementSizeLog2Of(memtype.representation()); | 2958 ElementSizeLog2Of(memtype.representation()); |
2959 | 2959 |
2960 if (aligned || | 2960 if (aligned || |
2961 jsgraph()->machine()->UnalignedLoadSupported(memtype, alignment)) { | 2961 jsgraph()->machine()->UnalignedLoadSupported(memtype, alignment)) { |
2962 if (FLAG_wasm_trap_handler) { | 2962 if (FLAG_wasm_trap_handler) { |
2963 DCHECK(FLAG_wasm_guard_pages); | |
titzer
2016/11/07 19:54:52
I think it's better to have FLAG_wasm_trap_handler
Eric Holk
2016/11/08 23:58:15
Done.
| |
2963 Node* context = HeapConstant(module_->instance->context); | 2964 Node* context = HeapConstant(module_->instance->context); |
2964 Node* position_node = jsgraph()->Int32Constant(position); | 2965 Node* position_node = jsgraph()->Int32Constant(position); |
2965 load = graph()->NewNode(jsgraph()->machine()->ProtectedLoad(memtype), | 2966 load = graph()->NewNode(jsgraph()->machine()->ProtectedLoad(memtype), |
2966 MemBuffer(offset), index, context, position_node, | 2967 MemBuffer(offset), index, context, position_node, |
2967 *effect_, *control_); | 2968 *effect_, *control_); |
2968 } else { | 2969 } else { |
2969 load = graph()->NewNode(jsgraph()->machine()->Load(memtype), | 2970 load = graph()->NewNode(jsgraph()->machine()->Load(memtype), |
2970 MemBuffer(offset), index, *effect_, *control_); | 2971 MemBuffer(offset), index, *effect_, *control_); |
2971 } | 2972 } |
2972 } else { | 2973 } else { |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3485 function_->code_start_offset), | 3486 function_->code_start_offset), |
3486 compile_ms); | 3487 compile_ms); |
3487 } | 3488 } |
3488 | 3489 |
3489 return code; | 3490 return code; |
3490 } | 3491 } |
3491 | 3492 |
3492 } // namespace compiler | 3493 } // namespace compiler |
3493 } // namespace internal | 3494 } // namespace internal |
3494 } // namespace v8 | 3495 } // namespace v8 |
OLD | NEW |