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

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

Issue 2396433008: [wasm] Add guard regions to end of WebAssembly.Memory buffers (Closed)
Patch Set: Merging with master 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
« no previous file with comments | « src/base/platform/platform-win32.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2946 matching lines...) Expand 10 before | Expand all | Expand 10 after
2957 // WASM semantics throw on OOB. Introduce explicit bounds check. 2957 // WASM semantics throw on OOB. Introduce explicit bounds check.
2958 if (!FLAG_wasm_trap_handler) { 2958 if (!FLAG_wasm_trap_handler) {
2959 BoundsCheckMem(memtype, index, offset, position); 2959 BoundsCheckMem(memtype, index, offset, position);
2960 } 2960 }
2961 bool aligned = static_cast<int>(alignment) >= 2961 bool aligned = static_cast<int>(alignment) >=
2962 ElementSizeLog2Of(memtype.representation()); 2962 ElementSizeLog2Of(memtype.representation());
2963 2963
2964 if (aligned || 2964 if (aligned ||
2965 jsgraph()->machine()->UnalignedLoadSupported(memtype, alignment)) { 2965 jsgraph()->machine()->UnalignedLoadSupported(memtype, alignment)) {
2966 if (FLAG_wasm_trap_handler) { 2966 if (FLAG_wasm_trap_handler) {
2967 DCHECK(FLAG_wasm_guard_pages);
2967 Node* context = HeapConstant(module_->instance->context); 2968 Node* context = HeapConstant(module_->instance->context);
2968 Node* position_node = jsgraph()->Int32Constant(position); 2969 Node* position_node = jsgraph()->Int32Constant(position);
2969 load = graph()->NewNode(jsgraph()->machine()->ProtectedLoad(memtype), 2970 load = graph()->NewNode(jsgraph()->machine()->ProtectedLoad(memtype),
2970 MemBuffer(offset), index, context, position_node, 2971 MemBuffer(offset), index, context, position_node,
2971 *effect_, *control_); 2972 *effect_, *control_);
2972 } else { 2973 } else {
2973 load = graph()->NewNode(jsgraph()->machine()->Load(memtype), 2974 load = graph()->NewNode(jsgraph()->machine()->Load(memtype),
2974 MemBuffer(offset), index, *effect_, *control_); 2975 MemBuffer(offset), index, *effect_, *control_);
2975 } 2976 }
2976 } else { 2977 } else {
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
3488 function_->code_start_offset), 3489 function_->code_start_offset),
3489 compile_ms); 3490 compile_ms);
3490 } 3491 }
3491 3492
3492 return code; 3493 return code;
3493 } 3494 }
3494 3495
3495 } // namespace compiler 3496 } // namespace compiler
3496 } // namespace internal 3497 } // namespace internal
3497 } // namespace v8 3498 } // namespace v8
OLDNEW
« no previous file with comments | « src/base/platform/platform-win32.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698