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

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

Issue 1759383003: [compiler] Add relocatable pointer constants for wasm memory references. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix uninitialized variable causing msan failure Created 4 years, 8 months 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/compiler/verifier.cc ('k') | src/compiler/x64/code-generator-x64.cc » ('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 "src/isolate-inl.h" 7 #include "src/isolate-inl.h"
8 8
9 #include "src/base/platform/elapsed-timer.h" 9 #include "src/base/platform/elapsed-timer.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 2276 matching lines...) Expand 10 before | Expand all | Expand 10 after
2287 Node* ret = graph()->NewNode(jsgraph()->common()->Return(), val, call, start); 2287 Node* ret = graph()->NewNode(jsgraph()->common()->Return(), val, call, start);
2288 2288
2289 MergeControlToEnd(jsgraph(), ret); 2289 MergeControlToEnd(jsgraph(), ret);
2290 } 2290 }
2291 2291
2292 2292
2293 Node* WasmGraphBuilder::MemBuffer(uint32_t offset) { 2293 Node* WasmGraphBuilder::MemBuffer(uint32_t offset) {
2294 DCHECK(module_ && module_->instance); 2294 DCHECK(module_ && module_->instance);
2295 if (offset == 0) { 2295 if (offset == 0) {
2296 if (!mem_buffer_) { 2296 if (!mem_buffer_) {
2297 mem_buffer_ = jsgraph()->IntPtrConstant( 2297 mem_buffer_ = jsgraph()->RelocatableIntPtrConstant(
2298 reinterpret_cast<uintptr_t>(module_->instance->mem_start)); 2298 reinterpret_cast<uintptr_t>(module_->instance->mem_start),
2299 RelocInfo::WASM_MEMORY_REFERENCE);
2299 } 2300 }
2300 return mem_buffer_; 2301 return mem_buffer_;
2301 } else { 2302 } else {
2302 return jsgraph()->IntPtrConstant( 2303 return jsgraph()->RelocatableIntPtrConstant(
2303 reinterpret_cast<uintptr_t>(module_->instance->mem_start + offset)); 2304 reinterpret_cast<uintptr_t>(module_->instance->mem_start + offset),
2305 RelocInfo::WASM_MEMORY_REFERENCE);
2304 } 2306 }
2305 } 2307 }
2306 2308
2307 2309
2308 Node* WasmGraphBuilder::MemSize(uint32_t offset) { 2310 Node* WasmGraphBuilder::MemSize(uint32_t offset) {
2309 DCHECK(module_ && module_->instance); 2311 DCHECK(module_ && module_->instance);
2310 uint32_t size = static_cast<uint32_t>(module_->instance->mem_size); 2312 uint32_t size = static_cast<uint32_t>(module_->instance->mem_size);
2311 if (offset == 0) { 2313 if (offset == 0) {
2312 if (!mem_size_) mem_size_ = jsgraph()->Int32Constant(size); 2314 if (!mem_size_) mem_size_ = jsgraph()->Int32Constant(size);
2313 return mem_size_; 2315 return mem_size_;
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
2778 static_cast<int>(function.code_end_offset - function.code_start_offset), 2780 static_cast<int>(function.code_end_offset - function.code_start_offset),
2779 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms); 2781 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms);
2780 } 2782 }
2781 return code; 2783 return code;
2782 } 2784 }
2783 2785
2784 2786
2785 } // namespace compiler 2787 } // namespace compiler
2786 } // namespace internal 2788 } // namespace internal
2787 } // namespace v8 2789 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/verifier.cc ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698