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

Side by Side Diff: runtime/vm/assembler_ia32.h

Issue 593363003: Expands the use of Immediate and Operand wrappers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_ASSEMBLER_IA32_H_ 5 #ifndef VM_ASSEMBLER_IA32_H_
6 #define VM_ASSEMBLER_IA32_H_ 6 #define VM_ASSEMBLER_IA32_H_
7 7
8 #ifndef VM_ASSEMBLER_H_ 8 #ifndef VM_ASSEMBLER_H_
9 #error Do not include assembler_ia32.h directly; use assembler.h instead. 9 #error Do not include assembler_ia32.h directly; use assembler.h instead.
10 #endif 10 #endif
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 } 158 }
159 } 159 }
160 160
161 Address(Register index, ScaleFactor scale, int32_t disp) { 161 Address(Register index, ScaleFactor scale, int32_t disp) {
162 ASSERT(index != ESP); // Illegal addressing mode. 162 ASSERT(index != ESP); // Illegal addressing mode.
163 SetModRM(0, ESP); 163 SetModRM(0, ESP);
164 SetSIB(scale, index, EBP); 164 SetSIB(scale, index, EBP);
165 SetDisp32(disp); 165 SetDisp32(disp);
166 } 166 }
167 167
168 // This addressing mode does not exist.
169 Address(Register index, ScaleFactor scale, Register r);
170
168 Address(Register base, Register index, ScaleFactor scale, int32_t disp) { 171 Address(Register base, Register index, ScaleFactor scale, int32_t disp) {
169 ASSERT(index != ESP); // Illegal addressing mode. 172 ASSERT(index != ESP); // Illegal addressing mode.
170 if (disp == 0 && base != EBP) { 173 if (disp == 0 && base != EBP) {
171 SetModRM(0, ESP); 174 SetModRM(0, ESP);
172 SetSIB(scale, index, base); 175 SetSIB(scale, index, base);
173 } else if (Utils::IsInt(8, disp)) { 176 } else if (Utils::IsInt(8, disp)) {
174 SetModRM(1, ESP); 177 SetModRM(1, ESP);
175 SetSIB(scale, index, base); 178 SetSIB(scale, index, base);
176 SetDisp8(disp); 179 SetDisp8(disp);
177 } else { 180 } else {
178 SetModRM(2, ESP); 181 SetModRM(2, ESP);
179 SetSIB(scale, index, base); 182 SetSIB(scale, index, base);
180 SetDisp32(disp); 183 SetDisp32(disp);
181 } 184 }
182 } 185 }
183 186
187 // This addressing mode does not exist.
188 Address(Register base, Register index, ScaleFactor scale, Register r);
189
184 Address(const Address& other) : Operand(other) { } 190 Address(const Address& other) : Operand(other) { }
185 191
186 Address& operator=(const Address& other) { 192 Address& operator=(const Address& other) {
187 Operand::operator=(other); 193 Operand::operator=(other);
188 return *this; 194 return *this;
189 } 195 }
190 196
191 static Address Absolute(const uword addr) { 197 static Address Absolute(const uword addr) {
192 Address result; 198 Address result;
193 result.SetModRM(0, EBP); 199 result.SetModRM(0, EBP);
194 result.SetDisp32(addr); 200 result.SetDisp32(addr);
195 return result; 201 return result;
196 } 202 }
197 203
198 private: 204 private:
199 Address() { } // Needed by Address::Absolute. 205 Address() { } // Needed by Address::Absolute.
200 }; 206 };
201 207
202 208
203 class FieldAddress : public Address { 209 class FieldAddress : public Address {
204 public: 210 public:
205 FieldAddress(Register base, int32_t disp) 211 FieldAddress(Register base, int32_t disp)
206 : Address(base, disp - kHeapObjectTag) { } 212 : Address(base, disp - kHeapObjectTag) { }
207 213
214 // This addressing mode does not exist.
215 FieldAddress(Register base, Register r) : Address(base, 0) {
216 UNREACHABLE();
Florian Schneider 2014/09/26 12:36:58 Remove definition and just leave declaration here
zra 2014/09/26 17:11:35 Done.
217 }
218
208 FieldAddress(Register base, Register index, ScaleFactor scale, int32_t disp) 219 FieldAddress(Register base, Register index, ScaleFactor scale, int32_t disp)
209 : Address(base, index, scale, disp - kHeapObjectTag) { } 220 : Address(base, index, scale, disp - kHeapObjectTag) { }
210 221
222 // This addressing mode does not exist.
223 FieldAddress(Register base, Register index, ScaleFactor scale, Register r)
224 : Address(base, index, scale, 0) {
225 UNREACHABLE();
226 }
227
211 FieldAddress(const FieldAddress& other) : Address(other) { } 228 FieldAddress(const FieldAddress& other) : Address(other) { }
212 229
213 FieldAddress& operator=(const FieldAddress& other) { 230 FieldAddress& operator=(const FieldAddress& other) {
214 Address::operator=(other); 231 Address::operator=(other);
215 return *this; 232 return *this;
216 } 233 }
217 }; 234 };
218 235
219 236
220 class Label : public ValueObject { 237 class Label : public ValueObject {
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 } 963 }
947 964
948 965
949 inline void Assembler::EmitOperandSizeOverride() { 966 inline void Assembler::EmitOperandSizeOverride() {
950 EmitUint8(0x66); 967 EmitUint8(0x66);
951 } 968 }
952 969
953 } // namespace dart 970 } // namespace dart
954 971
955 #endif // VM_ASSEMBLER_IA32_H_ 972 #endif // VM_ASSEMBLER_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698