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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 void GetCode(CodeDesc* desc); | 436 void GetCode(CodeDesc* desc); |
437 | 437 |
438 // Read/Modify the code target in the branch/call instruction at pc. | 438 // Read/Modify the code target in the branch/call instruction at pc. |
439 // On the x64 architecture, the address is absolute, not relative. | 439 // On the x64 architecture, the address is absolute, not relative. |
440 static inline Address target_address_at(Address pc); | 440 static inline Address target_address_at(Address pc); |
441 static inline void set_target_address_at(Address pc, Address target); | 441 static inline void set_target_address_at(Address pc, Address target); |
442 | 442 |
443 // Distance between the address of the code target in the call instruction | 443 // Distance between the address of the code target in the call instruction |
444 // and the return address. Checked in the debug build. | 444 // and the return address. Checked in the debug build. |
445 static const int kTargetAddrToReturnAddrDist = 3 + kPointerSize; | 445 static const int kTargetAddrToReturnAddrDist = 3 + kPointerSize; |
446 | 446 // Distance between start of patched return sequence and the emitted address |
| 447 // to jump to. |
| 448 static const int kReturnAddrPatchPrefixSize = 2; // movq = REX.W 0xB8+r. |
447 | 449 |
448 // --------------------------------------------------------------------------- | 450 // --------------------------------------------------------------------------- |
449 // Code generation | 451 // Code generation |
450 // | 452 // |
451 // Function names correspond one-to-one to x64 instruction mnemonics. | 453 // Function names correspond one-to-one to x64 instruction mnemonics. |
452 // Unless specified otherwise, instructions operate on 64-bit operands. | 454 // Unless specified otherwise, instructions operate on 64-bit operands. |
453 // | 455 // |
454 // If we need versions of an assembly instruction that operate on different | 456 // If we need versions of an assembly instruction that operate on different |
455 // width arguments, we add a single-letter suffix specifying the width. | 457 // width arguments, we add a single-letter suffix specifying the width. |
456 // This is done for the following instructions: mov, cmp, inc, dec, | 458 // This is done for the following instructions: mov, cmp, inc, dec, |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 // Call near indirect | 912 // Call near indirect |
911 void call(const Operand& operand); | 913 void call(const Operand& operand); |
912 | 914 |
913 // Jumps | 915 // Jumps |
914 // Jump short or near relative. | 916 // Jump short or near relative. |
915 void jmp(Label* L); // unconditional jump to L | 917 void jmp(Label* L); // unconditional jump to L |
916 | 918 |
917 // Jump near absolute indirect (r64) | 919 // Jump near absolute indirect (r64) |
918 void jmp(Register adr); | 920 void jmp(Register adr); |
919 | 921 |
| 922 // Jump near absolute indirect (m64) |
| 923 void jmp(const Operand& src); |
| 924 |
920 // Conditional jumps | 925 // Conditional jumps |
921 void j(Condition cc, Label* L); | 926 void j(Condition cc, Label* L); |
922 | 927 |
923 // Floating-point operations | 928 // Floating-point operations |
924 void fld(int i); | 929 void fld(int i); |
925 | 930 |
926 void fld1(); | 931 void fld1(); |
927 void fldz(); | 932 void fldz(); |
928 | 933 |
929 void fld_s(const Operand& adr); | 934 void fld_s(const Operand& adr); |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 private: | 1290 private: |
1286 Assembler* assembler_; | 1291 Assembler* assembler_; |
1287 #ifdef DEBUG | 1292 #ifdef DEBUG |
1288 int space_before_; | 1293 int space_before_; |
1289 #endif | 1294 #endif |
1290 }; | 1295 }; |
1291 | 1296 |
1292 } } // namespace v8::internal | 1297 } } // namespace v8::internal |
1293 | 1298 |
1294 #endif // V8_X64_ASSEMBLER_X64_H_ | 1299 #endif // V8_X64_ASSEMBLER_X64_H_ |
OLD | NEW |