| OLD | NEW |
| 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 are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 case greater_equal: | 326 case greater_equal: |
| 327 return less_equal; | 327 return less_equal; |
| 328 case less_equal: | 328 case less_equal: |
| 329 return greater_equal; | 329 return greater_equal; |
| 330 default: | 330 default: |
| 331 return cc; | 331 return cc; |
| 332 }; | 332 }; |
| 333 } | 333 } |
| 334 | 334 |
| 335 | 335 |
| 336 enum Hint { | |
| 337 no_hint = 0, | |
| 338 not_taken = 0x2e, | |
| 339 taken = 0x3e | |
| 340 }; | |
| 341 | |
| 342 // The result of negating a hint is as if the corresponding condition | |
| 343 // were negated by NegateCondition. That is, no_hint is mapped to | |
| 344 // itself and not_taken and taken are mapped to each other. | |
| 345 inline Hint NegateHint(Hint hint) { | |
| 346 return (hint == no_hint) | |
| 347 ? no_hint | |
| 348 : ((hint == not_taken) ? taken : not_taken); | |
| 349 } | |
| 350 | |
| 351 | |
| 352 // ----------------------------------------------------------------------------- | 336 // ----------------------------------------------------------------------------- |
| 353 // Machine instruction Immediates | 337 // Machine instruction Immediates |
| 354 | 338 |
| 355 class Immediate BASE_EMBEDDED { | 339 class Immediate BASE_EMBEDDED { |
| 356 public: | 340 public: |
| 357 explicit Immediate(int32_t value) : value_(value) {} | 341 explicit Immediate(int32_t value) : value_(value) {} |
| 358 | 342 |
| 359 private: | 343 private: |
| 360 int32_t value_; | 344 int32_t value_; |
| 361 | 345 |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 // Label L; // unbound label | 1161 // Label L; // unbound label |
| 1178 // j(cc, &L); // forward branch to unbound label | 1162 // j(cc, &L); // forward branch to unbound label |
| 1179 // bind(&L); // bind label to the current pc | 1163 // bind(&L); // bind label to the current pc |
| 1180 // j(cc, &L); // backward branch to bound label | 1164 // j(cc, &L); // backward branch to bound label |
| 1181 // bind(&L); // illegal: a label may be bound only once | 1165 // bind(&L); // illegal: a label may be bound only once |
| 1182 // | 1166 // |
| 1183 // Note: The same Label can be used for forward and backward branches | 1167 // Note: The same Label can be used for forward and backward branches |
| 1184 // but it may be bound only once. | 1168 // but it may be bound only once. |
| 1185 | 1169 |
| 1186 void bind(Label* L); // binds an unbound label L to the current code position | 1170 void bind(Label* L); // binds an unbound label L to the current code position |
| 1187 void bind(NearLabel* L); | |
| 1188 | 1171 |
| 1189 // Calls | 1172 // Calls |
| 1190 // Call near relative 32-bit displacement, relative to next instruction. | 1173 // Call near relative 32-bit displacement, relative to next instruction. |
| 1191 void call(Label* L); | 1174 void call(Label* L); |
| 1192 void call(Handle<Code> target, | 1175 void call(Handle<Code> target, |
| 1193 RelocInfo::Mode rmode, | 1176 RelocInfo::Mode rmode, |
| 1194 unsigned ast_id = kNoASTId); | 1177 unsigned ast_id = kNoASTId); |
| 1195 | 1178 |
| 1196 // Calls directly to the given address using a relative offset. | 1179 // Calls directly to the given address using a relative offset. |
| 1197 // Should only ever be used in Code objects for calls within the | 1180 // Should only ever be used in Code objects for calls within the |
| 1198 // same Code object. Should not be used when generating new code (use labels), | 1181 // same Code object. Should not be used when generating new code (use labels), |
| 1199 // but only when patching existing code. | 1182 // but only when patching existing code. |
| 1200 void call(Address target); | 1183 void call(Address target); |
| 1201 | 1184 |
| 1202 // Call near absolute indirect, address in register | 1185 // Call near absolute indirect, address in register |
| 1203 void call(Register adr); | 1186 void call(Register adr); |
| 1204 | 1187 |
| 1205 // Call near indirect | 1188 // Call near indirect |
| 1206 void call(const Operand& operand); | 1189 void call(const Operand& operand); |
| 1207 | 1190 |
| 1208 // Jumps | 1191 // Jumps |
| 1209 // Jump short or near relative. | 1192 // Jump short or near relative. |
| 1210 // Use a 32-bit signed displacement. | 1193 // Use a 32-bit signed displacement. |
| 1211 void jmp(Label* L); // unconditional jump to L | 1194 // Unconditional jump to L |
| 1195 void jmp(Label* L, Label::Distance distance = Label::kFar); |
| 1212 void jmp(Handle<Code> target, RelocInfo::Mode rmode); | 1196 void jmp(Handle<Code> target, RelocInfo::Mode rmode); |
| 1213 | 1197 |
| 1214 // Jump near absolute indirect (r64) | 1198 // Jump near absolute indirect (r64) |
| 1215 void jmp(Register adr); | 1199 void jmp(Register adr); |
| 1216 | 1200 |
| 1217 // Jump near absolute indirect (m64) | 1201 // Jump near absolute indirect (m64) |
| 1218 void jmp(const Operand& src); | 1202 void jmp(const Operand& src); |
| 1219 | 1203 |
| 1220 // Short jump | |
| 1221 void jmp(NearLabel* L); | |
| 1222 | |
| 1223 // Conditional jumps | 1204 // Conditional jumps |
| 1224 void j(Condition cc, Label* L); | 1205 void j(Condition cc, |
| 1206 Label* L, |
| 1207 Label::Distance distance = Label::kFar); |
| 1225 void j(Condition cc, Handle<Code> target, RelocInfo::Mode rmode); | 1208 void j(Condition cc, Handle<Code> target, RelocInfo::Mode rmode); |
| 1226 | 1209 |
| 1227 // Conditional short jump | |
| 1228 void j(Condition cc, NearLabel* L, Hint hint = no_hint); | |
| 1229 | |
| 1230 // Floating-point operations | 1210 // Floating-point operations |
| 1231 void fld(int i); | 1211 void fld(int i); |
| 1232 | 1212 |
| 1233 void fld1(); | 1213 void fld1(); |
| 1234 void fldz(); | 1214 void fldz(); |
| 1235 void fldpi(); | 1215 void fldpi(); |
| 1236 void fldln2(); | 1216 void fldln2(); |
| 1237 | 1217 |
| 1238 void fld_s(const Operand& adr); | 1218 void fld_s(const Operand& adr); |
| 1239 void fld_d(const Operand& adr); | 1219 void fld_d(const Operand& adr); |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1650 private: | 1630 private: |
| 1651 Assembler* assembler_; | 1631 Assembler* assembler_; |
| 1652 #ifdef DEBUG | 1632 #ifdef DEBUG |
| 1653 int space_before_; | 1633 int space_before_; |
| 1654 #endif | 1634 #endif |
| 1655 }; | 1635 }; |
| 1656 | 1636 |
| 1657 } } // namespace v8::internal | 1637 } } // namespace v8::internal |
| 1658 | 1638 |
| 1659 #endif // V8_X64_ASSEMBLER_X64_H_ | 1639 #endif // V8_X64_ASSEMBLER_X64_H_ |
| OLD | NEW |