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

Side by Side Diff: src/x87/assembler-x87.cc

Issue 1947413003: X87: Add new relocation type WASM_MEMORY_SIZE_REFERENCE, use relocatable pointers to update wasm me… (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
« no previous file with comments | « src/compiler/x87/code-generator-x87.cc ('k') | src/x87/assembler-x87-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // branch instructions. These are also the ones that need changing when a 94 // branch instructions. These are also the ones that need changing when a
95 // code object moves. 95 // code object moves.
96 return (1 << rmode_) & kApplyMask; 96 return (1 << rmode_) & kApplyMask;
97 } 97 }
98 98
99 99
100 bool RelocInfo::IsInConstantPool() { 100 bool RelocInfo::IsInConstantPool() {
101 return false; 101 return false;
102 } 102 }
103 103
104 Address RelocInfo::wasm_memory_reference() {
105 DCHECK(IsWasmMemoryReference(rmode_));
106 return Memory::Address_at(pc_);
107 }
108
109 uint32_t RelocInfo::wasm_memory_size_reference() {
110 DCHECK(IsWasmMemorySizeReference(rmode_));
111 return Memory::uint32_at(pc_);
112 }
113
114 void RelocInfo::update_wasm_memory_reference(
115 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size,
116 ICacheFlushMode icache_flush_mode) {
117 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_));
118 if (IsWasmMemoryReference(rmode_)) {
119 Address updated_reference;
120 DCHECK(old_base <= wasm_memory_reference() &&
121 wasm_memory_reference() < old_base + old_size);
122 updated_reference = new_base + (wasm_memory_reference() - old_base);
123 DCHECK(new_base <= updated_reference &&
124 updated_reference < new_base + new_size);
125 Memory::Address_at(pc_) = updated_reference;
126 } else if (IsWasmMemorySizeReference(rmode_)) {
127 uint32_t updated_size_reference;
128 DCHECK(wasm_memory_size_reference() <= old_size);
129 updated_size_reference =
130 new_size + (wasm_memory_size_reference() - old_size);
131 DCHECK(updated_size_reference <= new_size);
132 Memory::uint32_at(pc_) = updated_size_reference;
133 } else {
134 UNREACHABLE();
135 }
136 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
137 Assembler::FlushICache(isolate_, pc_, sizeof(int32_t));
138 }
139 }
104 140
105 // ----------------------------------------------------------------------------- 141 // -----------------------------------------------------------------------------
106 // Implementation of Operand 142 // Implementation of Operand
107 143
108 Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) { 144 Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) {
109 // [base + disp/r] 145 // [base + disp/r]
110 if (disp == 0 && RelocInfo::IsNone(rmode) && !base.is(ebp)) { 146 if (disp == 0 && RelocInfo::IsNone(rmode) && !base.is(ebp)) {
111 // [base] 147 // [base]
112 set_modrm(0, base); 148 set_modrm(0, base);
113 if (base.is(esp)) set_sib(times_1, esp, base); 149 if (base.is(esp)) set_sib(times_1, esp, base);
(...skipping 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after
2184 fflush(coverage_log); 2220 fflush(coverage_log);
2185 } 2221 }
2186 } 2222 }
2187 2223
2188 #endif 2224 #endif
2189 2225
2190 } // namespace internal 2226 } // namespace internal
2191 } // namespace v8 2227 } // namespace v8
2192 2228
2193 #endif // V8_TARGET_ARCH_X87 2229 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/compiler/x87/code-generator-x87.cc ('k') | src/x87/assembler-x87-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698