| 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 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1232 | 1232 |
| 1233 // Calls directly to the given address using a relative offset. | 1233 // Calls directly to the given address using a relative offset. |
| 1234 // Should only ever be used in Code objects for calls within the | 1234 // Should only ever be used in Code objects for calls within the |
| 1235 // same Code object. Should not be used when generating new code (use labels), | 1235 // same Code object. Should not be used when generating new code (use labels), |
| 1236 // but only when patching existing code. | 1236 // but only when patching existing code. |
| 1237 void call(Address target); | 1237 void call(Address target); |
| 1238 | 1238 |
| 1239 // Call near absolute indirect, address in register | 1239 // Call near absolute indirect, address in register |
| 1240 void call(Register adr); | 1240 void call(Register adr); |
| 1241 | 1241 |
| 1242 // Call near indirect | |
| 1243 void call(const Operand& operand); | |
| 1244 | |
| 1245 // Jumps | 1242 // Jumps |
| 1246 // Jump short or near relative. | 1243 // Jump short or near relative. |
| 1247 // Use a 32-bit signed displacement. | 1244 // Use a 32-bit signed displacement. |
| 1248 // Unconditional jump to L | 1245 // Unconditional jump to L |
| 1249 void jmp(Label* L, Label::Distance distance = Label::kFar); | 1246 void jmp(Label* L, Label::Distance distance = Label::kFar); |
| 1250 void jmp(Address entry, RelocInfo::Mode rmode); | 1247 void jmp(Address entry, RelocInfo::Mode rmode); |
| 1251 void jmp(Handle<Code> target, RelocInfo::Mode rmode); | 1248 void jmp(Handle<Code> target, RelocInfo::Mode rmode); |
| 1252 | 1249 |
| 1253 // Jump near absolute indirect (r64) | 1250 // Jump near absolute indirect (r64) |
| 1254 void jmp(Register adr); | 1251 void jmp(Register adr); |
| 1255 | 1252 |
| 1256 // Jump near absolute indirect (m64) | |
| 1257 void jmp(const Operand& src); | |
| 1258 | |
| 1259 // Conditional jumps | 1253 // Conditional jumps |
| 1260 void j(Condition cc, | 1254 void j(Condition cc, |
| 1261 Label* L, | 1255 Label* L, |
| 1262 Label::Distance distance = Label::kFar); | 1256 Label::Distance distance = Label::kFar); |
| 1263 void j(Condition cc, Address entry, RelocInfo::Mode rmode); | 1257 void j(Condition cc, Address entry, RelocInfo::Mode rmode); |
| 1264 void j(Condition cc, Handle<Code> target, RelocInfo::Mode rmode); | 1258 void j(Condition cc, Handle<Code> target, RelocInfo::Mode rmode); |
| 1265 | 1259 |
| 1266 // Floating-point operations | 1260 // Floating-point operations |
| 1267 void fld(int i); | 1261 void fld(int i); |
| 1268 | 1262 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1471 } | 1465 } |
| 1472 | 1466 |
| 1473 static bool IsNop(Address addr); | 1467 static bool IsNop(Address addr); |
| 1474 | 1468 |
| 1475 // Avoid overflows for displacements etc. | 1469 // Avoid overflows for displacements etc. |
| 1476 static const int kMaximalBufferSize = 512*MB; | 1470 static const int kMaximalBufferSize = 512*MB; |
| 1477 | 1471 |
| 1478 byte byte_at(int pos) { return buffer_[pos]; } | 1472 byte byte_at(int pos) { return buffer_[pos]; } |
| 1479 void set_byte_at(int pos, byte value) { buffer_[pos] = value; } | 1473 void set_byte_at(int pos, byte value) { buffer_[pos] = value; } |
| 1480 | 1474 |
| 1475 protected: |
| 1476 // Call near indirect |
| 1477 void call(const Operand& operand); |
| 1478 |
| 1479 // Jump near absolute indirect (m64) |
| 1480 void jmp(const Operand& src); |
| 1481 |
| 1481 private: | 1482 private: |
| 1482 byte* addr_at(int pos) { return buffer_ + pos; } | 1483 byte* addr_at(int pos) { return buffer_ + pos; } |
| 1483 uint32_t long_at(int pos) { | 1484 uint32_t long_at(int pos) { |
| 1484 return *reinterpret_cast<uint32_t*>(addr_at(pos)); | 1485 return *reinterpret_cast<uint32_t*>(addr_at(pos)); |
| 1485 } | 1486 } |
| 1486 void long_at_put(int pos, uint32_t x) { | 1487 void long_at_put(int pos, uint32_t x) { |
| 1487 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; | 1488 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; |
| 1488 } | 1489 } |
| 1489 | 1490 |
| 1490 // code emission | 1491 // code emission |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1731 private: | 1732 private: |
| 1732 Assembler* assembler_; | 1733 Assembler* assembler_; |
| 1733 #ifdef DEBUG | 1734 #ifdef DEBUG |
| 1734 int space_before_; | 1735 int space_before_; |
| 1735 #endif | 1736 #endif |
| 1736 }; | 1737 }; |
| 1737 | 1738 |
| 1738 } } // namespace v8::internal | 1739 } } // namespace v8::internal |
| 1739 | 1740 |
| 1740 #endif // V8_X64_ASSEMBLER_X64_H_ | 1741 #endif // V8_X64_ASSEMBLER_X64_H_ |
| OLD | NEW |