OLD | NEW |
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 byte* end = begin + code->instruction_size(); | 54 byte* end = begin + code->instruction_size(); |
55 disasm::Disassembler::Disassemble(stdout, begin, end); | 55 disasm::Disassembler::Disassemble(stdout, begin, end); |
56 #endif | 56 #endif |
57 int offset = 1234; | 57 int offset = 1234; |
58 | 58 |
59 // Relocating references by offset | 59 // Relocating references by offset |
60 int mode_mask = (1 << RelocInfo::WASM_MEMORY_REFERENCE); | 60 int mode_mask = (1 << RelocInfo::WASM_MEMORY_REFERENCE); |
61 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { | 61 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { |
62 DCHECK(RelocInfo::IsWasmMemoryReference(it.rinfo()->rmode())); | 62 DCHECK(RelocInfo::IsWasmMemoryReference(it.rinfo()->rmode())); |
63 it.rinfo()->update_wasm_memory_reference( | 63 it.rinfo()->update_wasm_memory_reference( |
64 it.rinfo()->wasm_memory_reference(), | 64 isolate, it.rinfo()->wasm_memory_reference(), |
65 it.rinfo()->wasm_memory_reference() + offset, SKIP_ICACHE_FLUSH); | 65 it.rinfo()->wasm_memory_reference() + offset, SKIP_ICACHE_FLUSH); |
66 } | 66 } |
67 | 67 |
68 // Check if immediate is updated correctly | 68 // Check if immediate is updated correctly |
69 ret_value = runnable.Call(); | 69 ret_value = runnable.Call(); |
70 CHECK_EQ(ret_value, imm + offset); | 70 CHECK_EQ(ret_value, imm + offset); |
71 | 71 |
72 #ifdef OBJECT_PRINT | 72 #ifdef OBJECT_PRINT |
73 code->Print(os); | 73 code->Print(os); |
74 begin = code->instruction_start(); | 74 begin = code->instruction_start(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 byte* begin = code->instruction_start(); | 112 byte* begin = code->instruction_start(); |
113 byte* end = begin + code->instruction_size(); | 113 byte* end = begin + code->instruction_size(); |
114 disasm::Disassembler::Disassemble(stdout, begin, end); | 114 disasm::Disassembler::Disassemble(stdout, begin, end); |
115 #endif | 115 #endif |
116 int32_t diff = 512; | 116 int32_t diff = 512; |
117 | 117 |
118 int mode_mask = (1 << RelocInfo::WASM_MEMORY_SIZE_REFERENCE); | 118 int mode_mask = (1 << RelocInfo::WASM_MEMORY_SIZE_REFERENCE); |
119 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { | 119 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { |
120 DCHECK(RelocInfo::IsWasmMemorySizeReference(it.rinfo()->rmode())); | 120 DCHECK(RelocInfo::IsWasmMemorySizeReference(it.rinfo()->rmode())); |
121 it.rinfo()->update_wasm_memory_size( | 121 it.rinfo()->update_wasm_memory_size( |
122 it.rinfo()->wasm_memory_size_reference(), | 122 isolate, it.rinfo()->wasm_memory_size_reference(), |
123 it.rinfo()->wasm_memory_size_reference() + diff, SKIP_ICACHE_FLUSH); | 123 it.rinfo()->wasm_memory_size_reference() + diff, SKIP_ICACHE_FLUSH); |
124 } | 124 } |
125 | 125 |
126 ret_value = runnable.Call(); | 126 ret_value = runnable.Call(); |
127 CHECK_NE(ret_value, bit_cast<uint32_t>(0xdeadbeef)); | 127 CHECK_NE(ret_value, bit_cast<uint32_t>(0xdeadbeef)); |
128 | 128 |
129 #ifdef OBJECT_PRINT | 129 #ifdef OBJECT_PRINT |
130 code->Print(os); | 130 code->Print(os); |
131 begin = code->instruction_start(); | 131 begin = code->instruction_start(); |
132 end = begin + code->instruction_size(); | 132 end = begin + code->instruction_size(); |
133 disasm::Disassembler::Disassemble(stdout, begin, end); | 133 disasm::Disassembler::Disassemble(stdout, begin, end); |
134 #endif | 134 #endif |
135 } | 135 } |
136 #undef __ | 136 #undef __ |
OLD | NEW |