| 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 2916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2927 // WASM semantics throw on OOB. Introduce explicit bounds check. | 2927 // WASM semantics throw on OOB. Introduce explicit bounds check. |
| 2928 if (!FLAG_wasm_trap_handler) { | 2928 if (!FLAG_wasm_trap_handler) { |
| 2929 BoundsCheckMem(memtype, index, offset, position); | 2929 BoundsCheckMem(memtype, index, offset, position); |
| 2930 } | 2930 } |
| 2931 bool aligned = static_cast<int>(alignment) >= | 2931 bool aligned = static_cast<int>(alignment) >= |
| 2932 ElementSizeLog2Of(memtype.representation()); | 2932 ElementSizeLog2Of(memtype.representation()); |
| 2933 | 2933 |
| 2934 if (aligned || | 2934 if (aligned || |
| 2935 jsgraph()->machine()->UnalignedLoadSupported(memtype, alignment)) { | 2935 jsgraph()->machine()->UnalignedLoadSupported(memtype, alignment)) { |
| 2936 if (FLAG_wasm_trap_handler) { | 2936 if (FLAG_wasm_trap_handler) { |
| 2937 DCHECK(FLAG_wasm_guard_pages); |
| 2937 Node* context = HeapConstant(module_->instance->context); | 2938 Node* context = HeapConstant(module_->instance->context); |
| 2938 Node* position_node = jsgraph()->Int32Constant(position); | 2939 Node* position_node = jsgraph()->Int32Constant(position); |
| 2939 load = graph()->NewNode(jsgraph()->machine()->ProtectedLoad(memtype), | 2940 load = graph()->NewNode(jsgraph()->machine()->ProtectedLoad(memtype), |
| 2940 MemBuffer(offset), index, context, position_node, | 2941 MemBuffer(offset), index, context, position_node, |
| 2941 *effect_, *control_); | 2942 *effect_, *control_); |
| 2942 } else { | 2943 } else { |
| 2943 load = graph()->NewNode(jsgraph()->machine()->Load(memtype), | 2944 load = graph()->NewNode(jsgraph()->machine()->Load(memtype), |
| 2944 MemBuffer(offset), index, *effect_, *control_); | 2945 MemBuffer(offset), index, *effect_, *control_); |
| 2945 } | 2946 } |
| 2946 } else { | 2947 } else { |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3459 function_->code_start_offset), | 3460 function_->code_start_offset), |
| 3460 compile_ms); | 3461 compile_ms); |
| 3461 } | 3462 } |
| 3462 | 3463 |
| 3463 return code; | 3464 return code; |
| 3464 } | 3465 } |
| 3465 | 3466 |
| 3466 } // namespace compiler | 3467 } // namespace compiler |
| 3467 } // namespace internal | 3468 } // namespace internal |
| 3468 } // namespace v8 | 3469 } // namespace v8 |
| OLD | NEW |