Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: src/compiler/wasm-compiler.cc

Issue 2396433008: [wasm] Add guard regions to end of WebAssembly.Memory buffers (Closed)
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/v8/v8 into guard-pages Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698