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

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: Removing additional check Created 4 years, 9 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
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 2164 matching lines...) Expand 10 before | Expand all | Expand 10 after
2175 Node* ret = graph()->NewNode(jsgraph()->common()->Return(), val, call, start); 2175 Node* ret = graph()->NewNode(jsgraph()->common()->Return(), val, call, start);
2176 2176
2177 MergeControlToEnd(jsgraph(), ret); 2177 MergeControlToEnd(jsgraph(), ret);
2178 } 2178 }
2179 2179
2180 2180
2181 Node* WasmGraphBuilder::MemBuffer(uint32_t offset) { 2181 Node* WasmGraphBuilder::MemBuffer(uint32_t offset) {
2182 DCHECK(module_ && module_->instance); 2182 DCHECK(module_ && module_->instance);
2183 if (offset == 0) { 2183 if (offset == 0) {
2184 if (!mem_buffer_) { 2184 if (!mem_buffer_) {
2185 mem_buffer_ = jsgraph()->IntPtrConstant( 2185 mem_buffer_ = jsgraph()->RelocatableIntPtrConstant(
2186 reinterpret_cast<uintptr_t>(module_->instance->mem_start)); 2186 reinterpret_cast<uintptr_t>(module_->instance->mem_start),
2187 RelocInfo::WASM_MEMORY_REFERENCE);
2187 } 2188 }
2188 return mem_buffer_; 2189 return mem_buffer_;
2189 } else { 2190 } else {
2190 return jsgraph()->IntPtrConstant( 2191 return jsgraph()->RelocatableIntPtrConstant(
2191 reinterpret_cast<uintptr_t>(module_->instance->mem_start + offset)); 2192 reinterpret_cast<uintptr_t>(module_->instance->mem_start + offset),
2193 RelocInfo::WASM_MEMORY_REFERENCE);
2192 } 2194 }
2193 } 2195 }
2194 2196
2195 2197
2196 Node* WasmGraphBuilder::MemSize(uint32_t offset) { 2198 Node* WasmGraphBuilder::MemSize(uint32_t offset) {
2197 DCHECK(module_ && module_->instance); 2199 DCHECK(module_ && module_->instance);
2198 uint32_t size = static_cast<uint32_t>(module_->instance->mem_size); 2200 uint32_t size = static_cast<uint32_t>(module_->instance->mem_size);
2199 if (offset == 0) { 2201 if (offset == 0) {
2200 if (!mem_size_) mem_size_ = jsgraph()->Int32Constant(size); 2202 if (!mem_size_) mem_size_ = jsgraph()->Int32Constant(size);
2201 return mem_size_; 2203 return mem_size_;
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
2653 static_cast<int>(function.code_end_offset - function.code_start_offset), 2655 static_cast<int>(function.code_end_offset - function.code_start_offset),
2654 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms); 2656 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms);
2655 } 2657 }
2656 return code; 2658 return code;
2657 } 2659 }
2658 2660
2659 2661
2660 } // namespace compiler 2662 } // namespace compiler
2661 } // namespace internal 2663 } // namespace internal
2662 } // namespace v8 2664 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698