Chromium Code Reviews| 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 2952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2963 // WASM semantics throw on OOB. Introduce explicit bounds check. | 2963 // WASM semantics throw on OOB. Introduce explicit bounds check. |
| 2964 if (!FLAG_wasm_trap_handler) { | 2964 if (!FLAG_wasm_trap_handler) { |
| 2965 BoundsCheckMem(memtype, index, offset, position); | 2965 BoundsCheckMem(memtype, index, offset, position); |
| 2966 } | 2966 } |
| 2967 bool aligned = static_cast<int>(alignment) >= | 2967 bool aligned = static_cast<int>(alignment) >= |
| 2968 ElementSizeLog2Of(memtype.representation()); | 2968 ElementSizeLog2Of(memtype.representation()); |
| 2969 | 2969 |
| 2970 if (aligned || | 2970 if (aligned || |
| 2971 jsgraph()->machine()->UnalignedLoadSupported(memtype, alignment)) { | 2971 jsgraph()->machine()->UnalignedLoadSupported(memtype, alignment)) { |
| 2972 if (FLAG_wasm_trap_handler) { | 2972 if (FLAG_wasm_trap_handler) { |
| 2973 DCHECK(FLAG_wasm_guard_pages); | |
|
titzer
2016/11/09 19:23:47
Generally want to avoid DCHECK'ing flags IMO.
| |
| 2973 Node* context = HeapConstant(module_->instance->context); | 2974 Node* context = HeapConstant(module_->instance->context); |
| 2974 Node* position_node = jsgraph()->Int32Constant(position); | 2975 Node* position_node = jsgraph()->Int32Constant(position); |
| 2975 load = graph()->NewNode(jsgraph()->machine()->ProtectedLoad(memtype), | 2976 load = graph()->NewNode(jsgraph()->machine()->ProtectedLoad(memtype), |
| 2976 MemBuffer(offset), index, context, position_node, | 2977 MemBuffer(offset), index, context, position_node, |
| 2977 *effect_, *control_); | 2978 *effect_, *control_); |
| 2978 } else { | 2979 } else { |
| 2979 load = graph()->NewNode(jsgraph()->machine()->Load(memtype), | 2980 load = graph()->NewNode(jsgraph()->machine()->Load(memtype), |
| 2980 MemBuffer(offset), index, *effect_, *control_); | 2981 MemBuffer(offset), index, *effect_, *control_); |
| 2981 } | 2982 } |
| 2982 } else { | 2983 } else { |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3495 function_->code_start_offset), | 3496 function_->code_start_offset), |
| 3496 compile_ms); | 3497 compile_ms); |
| 3497 } | 3498 } |
| 3498 | 3499 |
| 3499 return code; | 3500 return code; |
| 3500 } | 3501 } |
| 3501 | 3502 |
| 3502 } // namespace compiler | 3503 } // namespace compiler |
| 3503 } // namespace internal | 3504 } // namespace internal |
| 3504 } // namespace v8 | 3505 } // namespace v8 |
| OLD | NEW |