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

Side by Side Diff: test/cctest/compiler/test-run-wasm-machops.cc

Issue 1921203002: Add new relocation type WASM_MEMORY_SIZE_REFERENCE, use relocatable pointers to update wasm memory … (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 2016 the V8 project authors. All rights reserved. Use of this 1 // Copyright 2016 the V8 project authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include <cmath> 5 #include <cmath>
6 #include <functional> 6 #include <functional>
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/utils/random-number-generator.h" 10 #include "src/base/utils/random-number-generator.h"
11 #include "src/codegen.h" 11 #include "src/codegen.h"
12 #include "test/cctest/cctest.h" 12 #include "test/cctest/cctest.h"
13 #include "test/cctest/compiler/codegen-tester.h" 13 #include "test/cctest/compiler/codegen-tester.h"
14 #include "test/cctest/compiler/graph-builder-tester.h" 14 #include "test/cctest/compiler/graph-builder-tester.h"
15 #include "test/cctest/compiler/value-helper.h" 15 #include "test/cctest/compiler/value-helper.h"
16 16
17 using namespace v8::internal; 17 using namespace v8::internal;
18 using namespace v8::internal::compiler; 18 using namespace v8::internal::compiler;
19 19
20 static void UpdateMemoryReferences(Handle<Code> code, Address old_base, 20 static void UpdateMemoryReferences(Handle<Code> code, Address old_base,
21 Address new_base, size_t old_size, 21 Address new_base, int32_t old_size,
22 size_t new_size) { 22 int32_t new_size) {
23 Isolate* isolate = CcTest::i_isolate(); 23 Isolate* isolate = CcTest::i_isolate();
24 bool modified = false; 24 bool modified = false;
25 int mode_mask = (1 << RelocInfo::WASM_MEMORY_REFERENCE); 25 int mode_mask = (1 << RelocInfo::WASM_MEMORY_REFERENCE);
26 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { 26 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
27 RelocInfo::Mode mode = it.rinfo()->rmode(); 27 RelocInfo::Mode mode = it.rinfo()->rmode();
28 if (RelocInfo::IsWasmMemoryReference(mode)) { 28 if (RelocInfo::IsWasmMemoryReference(mode)) {
29 // Patch addresses with change in memory start address 29 // Patch addresses with change in memory start address
30 it.rinfo()->update_wasm_memory_reference(old_base, new_base, old_size, 30 it.rinfo()->update_wasm_memory_reference(old_base, new_base, old_size,
31 new_size); 31 new_size);
32 modified = true; 32 modified = true;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 RunLoadStoreRelocationOffset<int8_t>(MachineType::Int8()); 136 RunLoadStoreRelocationOffset<int8_t>(MachineType::Int8());
137 RunLoadStoreRelocationOffset<uint8_t>(MachineType::Uint8()); 137 RunLoadStoreRelocationOffset<uint8_t>(MachineType::Uint8());
138 RunLoadStoreRelocationOffset<int16_t>(MachineType::Int16()); 138 RunLoadStoreRelocationOffset<int16_t>(MachineType::Int16());
139 RunLoadStoreRelocationOffset<uint16_t>(MachineType::Uint16()); 139 RunLoadStoreRelocationOffset<uint16_t>(MachineType::Uint16());
140 RunLoadStoreRelocationOffset<int32_t>(MachineType::Int32()); 140 RunLoadStoreRelocationOffset<int32_t>(MachineType::Int32());
141 RunLoadStoreRelocationOffset<uint32_t>(MachineType::Uint32()); 141 RunLoadStoreRelocationOffset<uint32_t>(MachineType::Uint32());
142 RunLoadStoreRelocationOffset<void*>(MachineType::AnyTagged()); 142 RunLoadStoreRelocationOffset<void*>(MachineType::AnyTagged());
143 RunLoadStoreRelocationOffset<float>(MachineType::Float32()); 143 RunLoadStoreRelocationOffset<float>(MachineType::Float32());
144 RunLoadStoreRelocationOffset<double>(MachineType::Float64()); 144 RunLoadStoreRelocationOffset<double>(MachineType::Float64());
145 } 145 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698