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

Side by Side Diff: test/cctest/test-run-wasm-relocation-arm.cc

Issue 2732273003: Disentangle assembler from isolate. (Closed)
Patch Set: Address feedback. Created 3 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 <iostream> // NOLINT(readability/streams) 5 #include <iostream> // NOLINT(readability/streams)
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 #include "test/cctest/cctest.h" 8 #include "test/cctest/cctest.h"
9 9
10 #include "src/arm/assembler-arm-inl.h" 10 #include "src/arm/assembler-arm-inl.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 code->Print(os); 50 code->Print(os);
51 ::printf("f() = %d\n\n", ret_value); 51 ::printf("f() = %d\n\n", ret_value);
52 #endif 52 #endif
53 int offset = 1234; 53 int offset = 1234;
54 54
55 // Relocating references by offset 55 // Relocating references by offset
56 int mode_mask = (1 << RelocInfo::WASM_MEMORY_REFERENCE); 56 int mode_mask = (1 << RelocInfo::WASM_MEMORY_REFERENCE);
57 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { 57 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
58 DCHECK(RelocInfo::IsWasmMemoryReference(it.rinfo()->rmode())); 58 DCHECK(RelocInfo::IsWasmMemoryReference(it.rinfo()->rmode()));
59 it.rinfo()->update_wasm_memory_reference( 59 it.rinfo()->update_wasm_memory_reference(
60 it.rinfo()->wasm_memory_reference(), 60 isolate, it.rinfo()->wasm_memory_reference(),
61 it.rinfo()->wasm_memory_reference() + offset, SKIP_ICACHE_FLUSH); 61 it.rinfo()->wasm_memory_reference() + offset, SKIP_ICACHE_FLUSH);
62 } 62 }
63 63
64 // Call into relocated code object 64 // Call into relocated code object
65 ret_value = runnable.Call(); 65 ret_value = runnable.Call();
66 CHECK_EQ((imm + offset), ret_value); 66 CHECK_EQ((imm + offset), ret_value);
67 67
68 #ifdef DEBUG 68 #ifdef DEBUG
69 code->Print(os); 69 code->Print(os);
70 ::printf("f() = %d\n\n", ret_value); 70 ::printf("f() = %d\n\n", ret_value);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 OFStream os(stdout); 104 OFStream os(stdout);
105 code->Print(os); 105 code->Print(os);
106 ::printf("f() = %d\n\n", ret_value); 106 ::printf("f() = %d\n\n", ret_value);
107 #endif 107 #endif
108 size_t diff = 512; 108 size_t diff = 512;
109 109
110 int mode_mask = (1 << RelocInfo::WASM_MEMORY_SIZE_REFERENCE); 110 int mode_mask = (1 << RelocInfo::WASM_MEMORY_SIZE_REFERENCE);
111 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { 111 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
112 DCHECK(RelocInfo::IsWasmMemorySizeReference(it.rinfo()->rmode())); 112 DCHECK(RelocInfo::IsWasmMemorySizeReference(it.rinfo()->rmode()));
113 it.rinfo()->update_wasm_memory_size( 113 it.rinfo()->update_wasm_memory_size(
114 it.rinfo()->wasm_memory_size_reference(), 114 isolate, it.rinfo()->wasm_memory_size_reference(),
115 it.rinfo()->wasm_memory_size_reference() + diff, SKIP_ICACHE_FLUSH); 115 it.rinfo()->wasm_memory_size_reference() + diff, SKIP_ICACHE_FLUSH);
116 } 116 }
117 117
118 ret_value = runnable.Call(); 118 ret_value = runnable.Call();
119 CHECK_NE(ret_value, bit_cast<int32_t>(0xdeadbeef)); 119 CHECK_NE(ret_value, bit_cast<int32_t>(0xdeadbeef));
120 120
121 #ifdef DEBUG 121 #ifdef DEBUG
122 code->Print(os); 122 code->Print(os);
123 ::printf("f() = %d\n\n", ret_value); 123 ::printf("f() = %d\n\n", ret_value);
124 #endif 124 #endif
125 } 125 }
126 #undef __ 126 #undef __
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-run-wasm-machops.cc ('k') | test/cctest/test-run-wasm-relocation-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698