| 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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 // Assembler functions are invoked in between GetCode() calls. | 548 // Assembler functions are invoked in between GetCode() calls. |
| 549 void GetCode(CodeDesc* desc); | 549 void GetCode(CodeDesc* desc); |
| 550 | 550 |
| 551 // Read/Modify the code target in the relative branch/call instruction at pc. | 551 // Read/Modify the code target in the relative branch/call instruction at pc. |
| 552 // On the x64 architecture, we use relative jumps with a 32-bit displacement | 552 // On the x64 architecture, we use relative jumps with a 32-bit displacement |
| 553 // to jump to other Code objects in the Code space in the heap. | 553 // to jump to other Code objects in the Code space in the heap. |
| 554 // Jumps to C functions are done indirectly through a 64-bit register holding | 554 // Jumps to C functions are done indirectly through a 64-bit register holding |
| 555 // the absolute address of the target. | 555 // the absolute address of the target. |
| 556 // These functions convert between absolute Addresses of Code objects and | 556 // These functions convert between absolute Addresses of Code objects and |
| 557 // the relative displacements stored in the code. | 557 // the relative displacements stored in the code. |
| 558 static inline Address target_address_at(Address pc); | 558 static inline Address target_address_at(Address pc, |
| 559 static inline void set_target_address_at(Address pc, Address target); | 559 ConstantPoolArray* constant_pool); |
| 560 static inline void set_target_address_at(Address pc, |
| 561 ConstantPoolArray* constant_pool, |
| 562 Address target); |
| 563 static inline Address target_address_at(Address pc, Code* code) { |
| 564 ConstantPoolArray* constant_pool = code ? code->constant_pool() : NULL; |
| 565 return target_address_at(pc, constant_pool); |
| 566 } |
| 567 static inline void set_target_address_at(Address pc, |
| 568 Code* code, |
| 569 Address target) { |
| 570 ConstantPoolArray* constant_pool = code ? code->constant_pool() : NULL; |
| 571 set_target_address_at(pc, constant_pool, target); |
| 572 } |
| 560 | 573 |
| 561 // Return the code target address at a call site from the return address | 574 // Return the code target address at a call site from the return address |
| 562 // of that call in the instruction stream. | 575 // of that call in the instruction stream. |
| 563 static inline Address target_address_from_return_address(Address pc); | 576 static inline Address target_address_from_return_address(Address pc); |
| 564 | 577 |
| 565 // This sets the branch destination (which is in the instruction on x64). | 578 // This sets the branch destination (which is in the instruction on x64). |
| 566 // This is for calls and branches within generated code. | 579 // This is for calls and branches within generated code. |
| 567 inline static void deserialization_set_special_target_at( | 580 inline static void deserialization_set_special_target_at( |
| 568 Address instruction_payload, Address target) { | 581 Address instruction_payload, Code* code, Address target) { |
| 569 set_target_address_at(instruction_payload, target); | 582 set_target_address_at(instruction_payload, code, target); |
| 570 } | 583 } |
| 571 | 584 |
| 572 static inline RelocInfo::Mode RelocInfoNone() { | 585 static inline RelocInfo::Mode RelocInfoNone() { |
| 573 if (kPointerSize == kInt64Size) { | 586 if (kPointerSize == kInt64Size) { |
| 574 return RelocInfo::NONE64; | 587 return RelocInfo::NONE64; |
| 575 } else { | 588 } else { |
| 576 ASSERT(kPointerSize == kInt32Size); | 589 ASSERT(kPointerSize == kInt32Size); |
| 577 return RelocInfo::NONE32; | 590 return RelocInfo::NONE32; |
| 578 } | 591 } |
| 579 } | 592 } |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 void idivq(Register src); | 943 void idivq(Register src); |
| 931 // Divide edx:eax by lower 32 bits of src. Quotient in eax, rem. in edx. | 944 // Divide edx:eax by lower 32 bits of src. Quotient in eax, rem. in edx. |
| 932 void idivl(Register src); | 945 void idivl(Register src); |
| 933 | 946 |
| 934 // Signed multiply instructions. | 947 // Signed multiply instructions. |
| 935 void imul(Register src); // rdx:rax = rax * src. | 948 void imul(Register src); // rdx:rax = rax * src. |
| 936 void imul(Register dst, Register src); // dst = dst * src. | 949 void imul(Register dst, Register src); // dst = dst * src. |
| 937 void imul(Register dst, const Operand& src); // dst = dst * src. | 950 void imul(Register dst, const Operand& src); // dst = dst * src. |
| 938 void imul(Register dst, Register src, Immediate imm); // dst = src * imm. | 951 void imul(Register dst, Register src, Immediate imm); // dst = src * imm. |
| 939 // Signed 32-bit multiply instructions. | 952 // Signed 32-bit multiply instructions. |
| 953 void imull(Register src); // edx:eax = eax * src. |
| 940 void imull(Register dst, Register src); // dst = dst * src. | 954 void imull(Register dst, Register src); // dst = dst * src. |
| 941 void imull(Register dst, const Operand& src); // dst = dst * src. | 955 void imull(Register dst, const Operand& src); // dst = dst * src. |
| 942 void imull(Register dst, Register src, Immediate imm); // dst = src * imm. | 956 void imull(Register dst, Register src, Immediate imm); // dst = src * imm. |
| 943 | 957 |
| 944 void incq(Register dst); | 958 void incq(Register dst); |
| 945 void incq(const Operand& dst); | 959 void incq(const Operand& dst); |
| 946 void incl(Register dst); | 960 void incl(Register dst); |
| 947 void incl(const Operand& dst); | 961 void incl(const Operand& dst); |
| 948 | 962 |
| 949 void lea(Register dst, const Operand& src); | 963 void lea(Register dst, const Operand& src); |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1374 void movsd(XMMRegister dst, const Operand& src); | 1388 void movsd(XMMRegister dst, const Operand& src); |
| 1375 | 1389 |
| 1376 void movdqa(const Operand& dst, XMMRegister src); | 1390 void movdqa(const Operand& dst, XMMRegister src); |
| 1377 void movdqa(XMMRegister dst, const Operand& src); | 1391 void movdqa(XMMRegister dst, const Operand& src); |
| 1378 | 1392 |
| 1379 void movdqu(const Operand& dst, XMMRegister src); | 1393 void movdqu(const Operand& dst, XMMRegister src); |
| 1380 void movdqu(XMMRegister dst, const Operand& src); | 1394 void movdqu(XMMRegister dst, const Operand& src); |
| 1381 | 1395 |
| 1382 void movapd(XMMRegister dst, XMMRegister src); | 1396 void movapd(XMMRegister dst, XMMRegister src); |
| 1383 | 1397 |
| 1398 void psllq(XMMRegister reg, byte imm8); |
| 1399 |
| 1384 void cvttsd2si(Register dst, const Operand& src); | 1400 void cvttsd2si(Register dst, const Operand& src); |
| 1385 void cvttsd2si(Register dst, XMMRegister src); | 1401 void cvttsd2si(Register dst, XMMRegister src); |
| 1386 void cvttsd2siq(Register dst, XMMRegister src); | 1402 void cvttsd2siq(Register dst, XMMRegister src); |
| 1387 | 1403 |
| 1388 void cvtlsi2sd(XMMRegister dst, const Operand& src); | 1404 void cvtlsi2sd(XMMRegister dst, const Operand& src); |
| 1389 void cvtlsi2sd(XMMRegister dst, Register src); | 1405 void cvtlsi2sd(XMMRegister dst, Register src); |
| 1390 void cvtqsi2sd(XMMRegister dst, const Operand& src); | 1406 void cvtqsi2sd(XMMRegister dst, const Operand& src); |
| 1391 void cvtqsi2sd(XMMRegister dst, Register src); | 1407 void cvtqsi2sd(XMMRegister dst, Register src); |
| 1392 | 1408 |
| 1393 | 1409 |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1733 private: | 1749 private: |
| 1734 Assembler* assembler_; | 1750 Assembler* assembler_; |
| 1735 #ifdef DEBUG | 1751 #ifdef DEBUG |
| 1736 int space_before_; | 1752 int space_before_; |
| 1737 #endif | 1753 #endif |
| 1738 }; | 1754 }; |
| 1739 | 1755 |
| 1740 } } // namespace v8::internal | 1756 } } // namespace v8::internal |
| 1741 | 1757 |
| 1742 #endif // V8_X64_ASSEMBLER_X64_H_ | 1758 #endif // V8_X64_ASSEMBLER_X64_H_ |
| OLD | NEW |