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

Side by Side Diff: test/cctest/test-run-wasm-relocation-ia32.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 <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/disasm.h" 10 #include "src/disasm.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 disasm::Disassembler::Disassemble(stdout, begin, end); 56 disasm::Disassembler::Disassemble(stdout, begin, end);
57 #endif 57 #endif
58 58
59 int offset = 1234; 59 int offset = 1234;
60 60
61 // Relocating references by offset 61 // Relocating references by offset
62 int mode_mask = (1 << RelocInfo::WASM_MEMORY_REFERENCE); 62 int mode_mask = (1 << RelocInfo::WASM_MEMORY_REFERENCE);
63 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { 63 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
64 DCHECK(RelocInfo::IsWasmMemoryReference(it.rinfo()->rmode())); 64 DCHECK(RelocInfo::IsWasmMemoryReference(it.rinfo()->rmode()));
65 it.rinfo()->update_wasm_memory_reference( 65 it.rinfo()->update_wasm_memory_reference(
66 it.rinfo()->wasm_memory_reference(), 66 isolate, it.rinfo()->wasm_memory_reference(),
67 it.rinfo()->wasm_memory_reference() + offset, SKIP_ICACHE_FLUSH); 67 it.rinfo()->wasm_memory_reference() + offset, SKIP_ICACHE_FLUSH);
68 } 68 }
69 69
70 // Check if immediate is updated correctly 70 // Check if immediate is updated correctly
71 ret_value = runnable.Call(); 71 ret_value = runnable.Call();
72 CHECK_EQ(ret_value, imm + offset); 72 CHECK_EQ(ret_value, imm + offset);
73 73
74 #ifdef OBJECT_PRINT 74 #ifdef OBJECT_PRINT
75 code->Print(os); 75 code->Print(os);
76 begin = code->instruction_start(); 76 begin = code->instruction_start();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 byte* end = begin + code->instruction_size(); 118 byte* end = begin + code->instruction_size();
119 disasm::Disassembler::Disassemble(stdout, begin, end); 119 disasm::Disassembler::Disassemble(stdout, begin, end);
120 #endif 120 #endif
121 121
122 size_t offset = 10; 122 size_t offset = 10;
123 123
124 int mode_mask = (1 << RelocInfo::WASM_MEMORY_SIZE_REFERENCE); 124 int mode_mask = (1 << RelocInfo::WASM_MEMORY_SIZE_REFERENCE);
125 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { 125 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
126 DCHECK(RelocInfo::IsWasmMemorySizeReference(it.rinfo()->rmode())); 126 DCHECK(RelocInfo::IsWasmMemorySizeReference(it.rinfo()->rmode()));
127 it.rinfo()->update_wasm_memory_size( 127 it.rinfo()->update_wasm_memory_size(
128 it.rinfo()->wasm_memory_size_reference(), 128 isolate, it.rinfo()->wasm_memory_size_reference(),
129 it.rinfo()->wasm_memory_size_reference() + offset, SKIP_ICACHE_FLUSH); 129 it.rinfo()->wasm_memory_size_reference() + offset, SKIP_ICACHE_FLUSH);
130 } 130 }
131 131
132 ret_value = runnable.Call(); 132 ret_value = runnable.Call();
133 CHECK_NE(ret_value, bit_cast<int32_t>(0xdeadbeef)); 133 CHECK_NE(ret_value, bit_cast<int32_t>(0xdeadbeef));
134 134
135 #ifdef OBJECT_PRINT 135 #ifdef OBJECT_PRINT
136 code->Print(os); 136 code->Print(os);
137 begin = code->instruction_start(); 137 begin = code->instruction_start();
138 end = begin + code->instruction_size(); 138 end = begin + code->instruction_size();
139 disasm::Disassembler::Disassemble(stdout, begin, end); 139 disasm::Disassembler::Disassemble(stdout, begin, end);
140 #endif 140 #endif
141 } 141 }
142 #undef __ 142 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-run-wasm-relocation-arm64.cc ('k') | test/cctest/test-run-wasm-relocation-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698