| 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 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1253 | 1253 |
| 1254 // Calls directly to the given address using a relative offset. | 1254 // Calls directly to the given address using a relative offset. |
| 1255 // Should only ever be used in Code objects for calls within the | 1255 // Should only ever be used in Code objects for calls within the |
| 1256 // same Code object. Should not be used when generating new code (use labels), | 1256 // same Code object. Should not be used when generating new code (use labels), |
| 1257 // but only when patching existing code. | 1257 // but only when patching existing code. |
| 1258 void call(Address target); | 1258 void call(Address target); |
| 1259 | 1259 |
| 1260 // Call near absolute indirect, address in register | 1260 // Call near absolute indirect, address in register |
| 1261 void call(Register adr); | 1261 void call(Register adr); |
| 1262 | 1262 |
| 1263 // Call near indirect | |
| 1264 void call(const Operand& operand); | |
| 1265 | |
| 1266 // Jumps | 1263 // Jumps |
| 1267 // Jump short or near relative. | 1264 // Jump short or near relative. |
| 1268 // Use a 32-bit signed displacement. | 1265 // Use a 32-bit signed displacement. |
| 1269 // Unconditional jump to L | 1266 // Unconditional jump to L |
| 1270 void jmp(Label* L, Label::Distance distance = Label::kFar); | 1267 void jmp(Label* L, Label::Distance distance = Label::kFar); |
| 1271 void jmp(Address entry, RelocInfo::Mode rmode); | 1268 void jmp(Address entry, RelocInfo::Mode rmode); |
| 1272 void jmp(Handle<Code> target, RelocInfo::Mode rmode); | 1269 void jmp(Handle<Code> target, RelocInfo::Mode rmode); |
| 1273 | 1270 |
| 1274 // Jump near absolute indirect (r64) | 1271 // Jump near absolute indirect (r64) |
| 1275 void jmp(Register adr); | 1272 void jmp(Register adr); |
| 1276 | 1273 |
| 1277 // Jump near absolute indirect (m64) | |
| 1278 void jmp(const Operand& src); | |
| 1279 | |
| 1280 // Conditional jumps | 1274 // Conditional jumps |
| 1281 void j(Condition cc, | 1275 void j(Condition cc, |
| 1282 Label* L, | 1276 Label* L, |
| 1283 Label::Distance distance = Label::kFar); | 1277 Label::Distance distance = Label::kFar); |
| 1284 void j(Condition cc, Address entry, RelocInfo::Mode rmode); | 1278 void j(Condition cc, Address entry, RelocInfo::Mode rmode); |
| 1285 void j(Condition cc, Handle<Code> target, RelocInfo::Mode rmode); | 1279 void j(Condition cc, Handle<Code> target, RelocInfo::Mode rmode); |
| 1286 | 1280 |
| 1287 // Floating-point operations | 1281 // Floating-point operations |
| 1288 void fld(int i); | 1282 void fld(int i); |
| 1289 | 1283 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1492 } | 1486 } |
| 1493 | 1487 |
| 1494 static bool IsNop(Address addr); | 1488 static bool IsNop(Address addr); |
| 1495 | 1489 |
| 1496 // Avoid overflows for displacements etc. | 1490 // Avoid overflows for displacements etc. |
| 1497 static const int kMaximalBufferSize = 512*MB; | 1491 static const int kMaximalBufferSize = 512*MB; |
| 1498 | 1492 |
| 1499 byte byte_at(int pos) { return buffer_[pos]; } | 1493 byte byte_at(int pos) { return buffer_[pos]; } |
| 1500 void set_byte_at(int pos, byte value) { buffer_[pos] = value; } | 1494 void set_byte_at(int pos, byte value) { buffer_[pos] = value; } |
| 1501 | 1495 |
| 1496 protected: |
| 1497 // Call near indirect |
| 1498 void call(const Operand& operand); |
| 1499 |
| 1500 // Jump near absolute indirect (m64) |
| 1501 void jmp(const Operand& src); |
| 1502 |
| 1502 private: | 1503 private: |
| 1503 byte* addr_at(int pos) { return buffer_ + pos; } | 1504 byte* addr_at(int pos) { return buffer_ + pos; } |
| 1504 uint32_t long_at(int pos) { | 1505 uint32_t long_at(int pos) { |
| 1505 return *reinterpret_cast<uint32_t*>(addr_at(pos)); | 1506 return *reinterpret_cast<uint32_t*>(addr_at(pos)); |
| 1506 } | 1507 } |
| 1507 void long_at_put(int pos, uint32_t x) { | 1508 void long_at_put(int pos, uint32_t x) { |
| 1508 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; | 1509 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; |
| 1509 } | 1510 } |
| 1510 | 1511 |
| 1511 // code emission | 1512 // code emission |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1752 private: | 1753 private: |
| 1753 Assembler* assembler_; | 1754 Assembler* assembler_; |
| 1754 #ifdef DEBUG | 1755 #ifdef DEBUG |
| 1755 int space_before_; | 1756 int space_before_; |
| 1756 #endif | 1757 #endif |
| 1757 }; | 1758 }; |
| 1758 | 1759 |
| 1759 } } // namespace v8::internal | 1760 } } // namespace v8::internal |
| 1760 | 1761 |
| 1761 #endif // V8_X64_ASSEMBLER_X64_H_ | 1762 #endif // V8_X64_ASSEMBLER_X64_H_ |
| OLD | NEW |