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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 }; | 371 }; |
372 } | 372 } |
373 | 373 |
374 | 374 |
375 // ----------------------------------------------------------------------------- | 375 // ----------------------------------------------------------------------------- |
376 // Machine instruction Immediates | 376 // Machine instruction Immediates |
377 | 377 |
378 class Immediate BASE_EMBEDDED { | 378 class Immediate BASE_EMBEDDED { |
379 public: | 379 public: |
380 explicit Immediate(int32_t value) : value_(value) {} | 380 explicit Immediate(int32_t value) : value_(value) {} |
381 #ifdef V8_TARGET_ARCH_X32 | |
382 explicit Immediate(Smi* value) { | |
383 value_ = reinterpret_cast<intptr_t>(value); | |
384 } | |
385 #endif | |
381 | 386 |
382 private: | 387 private: |
383 int32_t value_; | 388 int32_t value_; |
384 | 389 |
385 friend class Assembler; | 390 friend class Assembler; |
386 }; | 391 }; |
387 | 392 |
388 | 393 |
389 // ----------------------------------------------------------------------------- | 394 // ----------------------------------------------------------------------------- |
390 // Machine instruction Operands | 395 // Machine instruction Operands |
391 | 396 |
392 enum ScaleFactor { | 397 enum ScaleFactor { |
393 times_1 = 0, | 398 times_1 = 0, |
394 times_2 = 1, | 399 times_2 = 1, |
395 times_4 = 2, | 400 times_4 = 2, |
396 times_8 = 3, | 401 times_8 = 3, |
397 times_int_size = times_4, | 402 times_int_size = times_4, |
403 #ifndef V8_TARGET_ARCH_X32 | |
398 times_pointer_size = times_8 | 404 times_pointer_size = times_8 |
danno
2013/07/17 13:33:21
Make this cross platform with:
times_pointer_size
| |
405 #else | |
406 times_pointer_size = times_4 | |
407 #endif | |
399 }; | 408 }; |
400 | 409 |
401 | 410 |
402 class Operand BASE_EMBEDDED { | 411 class Operand BASE_EMBEDDED { |
403 public: | 412 public: |
404 // [base + disp/r] | 413 // [base + disp/r] |
405 Operand(Register base, int32_t disp); | 414 Operand(Register base, int32_t disp); |
406 | 415 |
407 // [base + index*scale + disp/r] | 416 // [base + index*scale + disp/r] |
408 Operand(Register base, | 417 Operand(Register base, |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
576 inline Address runtime_entry_at(Address pc); | 585 inline Address runtime_entry_at(Address pc); |
577 // Number of bytes taken up by the branch target in the code. | 586 // Number of bytes taken up by the branch target in the code. |
578 static const int kSpecialTargetSize = 4; // Use 32-bit displacement. | 587 static const int kSpecialTargetSize = 4; // Use 32-bit displacement. |
579 // Distance between the address of the code target in the call instruction | 588 // Distance between the address of the code target in the call instruction |
580 // and the return address pushed on the stack. | 589 // and the return address pushed on the stack. |
581 static const int kCallTargetAddressOffset = 4; // Use 32-bit displacement. | 590 static const int kCallTargetAddressOffset = 4; // Use 32-bit displacement. |
582 // Distance between the start of the JS return sequence and where the | 591 // Distance between the start of the JS return sequence and where the |
583 // 32-bit displacement of a near call would be, relative to the pushed | 592 // 32-bit displacement of a near call would be, relative to the pushed |
584 // return address. TODO: Use return sequence length instead. | 593 // return address. TODO: Use return sequence length instead. |
585 // Should equal Debug::kX64JSReturnSequenceLength - kCallTargetAddressOffset; | 594 // Should equal Debug::kX64JSReturnSequenceLength - kCallTargetAddressOffset; |
595 #ifndef V8_TARGET_ARCH_X32 | |
586 static const int kPatchReturnSequenceAddressOffset = 13 - 4; | 596 static const int kPatchReturnSequenceAddressOffset = 13 - 4; |
597 #else | |
598 static const int kPatchReturnSequenceAddressOffset = 9 - 4; | |
danno
2013/07/17 13:33:21
In these constants and below, you can use kRegiste
| |
599 #endif | |
587 // Distance between start of patched debug break slot and where the | 600 // Distance between start of patched debug break slot and where the |
588 // 32-bit displacement of a near call would be, relative to the pushed | 601 // 32-bit displacement of a near call would be, relative to the pushed |
589 // return address. TODO: Use return sequence length instead. | 602 // return address. TODO: Use return sequence length instead. |
590 // Should equal Debug::kX64JSReturnSequenceLength - kCallTargetAddressOffset; | 603 // Should equal Debug::kX64JSReturnSequenceLength - kCallTargetAddressOffset; |
604 #ifndef V8_TARGET_ARCH_X32 | |
591 static const int kPatchDebugBreakSlotAddressOffset = 13 - 4; | 605 static const int kPatchDebugBreakSlotAddressOffset = 13 - 4; |
606 #else | |
607 static const int kPatchDebugBreakSlotAddressOffset = 9 - 4; | |
608 #endif | |
592 // TODO(X64): Rename this, removing the "Real", after changing the above. | 609 // TODO(X64): Rename this, removing the "Real", after changing the above. |
593 static const int kRealPatchReturnSequenceAddressOffset = 2; | 610 static const int kRealPatchReturnSequenceAddressOffset = 2; |
594 | 611 |
595 // Some x64 JS code is padded with int3 to make it large | 612 // Some x64 JS code is padded with int3 to make it large |
596 // enough to hold an instruction when the debugger patches it. | 613 // enough to hold an instruction when the debugger patches it. |
597 static const int kJumpInstructionLength = 13; | 614 static const int kJumpInstructionLength = 13; |
615 #ifndef V8_TARGET_ARCH_X32 | |
598 static const int kCallInstructionLength = 13; | 616 static const int kCallInstructionLength = 13; |
599 static const int kJSReturnSequenceLength = 13; | 617 static const int kJSReturnSequenceLength = 13; |
618 #else | |
619 static const int kCallInstructionLength = 9; | |
620 static const int kJSReturnSequenceLength = 9; | |
621 #endif | |
600 static const int kShortCallInstructionLength = 5; | 622 static const int kShortCallInstructionLength = 5; |
601 static const int kPatchDebugBreakSlotReturnOffset = 4; | 623 static const int kPatchDebugBreakSlotReturnOffset = 4; |
602 | 624 |
603 // The debug break slot must be able to contain a call instruction. | 625 // The debug break slot must be able to contain a call instruction. |
604 static const int kDebugBreakSlotLength = kCallInstructionLength; | 626 static const int kDebugBreakSlotLength = kCallInstructionLength; |
605 | 627 |
606 // One byte opcode for test eax,0xXXXXXXXX. | 628 // One byte opcode for test eax,0xXXXXXXXX. |
607 static const byte kTestEaxByte = 0xA9; | 629 static const byte kTestEaxByte = 0xA9; |
608 // One byte opcode for test al, 0xXX. | 630 // One byte opcode for test al, 0xXX. |
609 static const byte kTestAlByte = 0xA8; | 631 static const byte kTestAlByte = 0xA8; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
681 // Move 64 bit register value to 64-bit memory location. | 703 // Move 64 bit register value to 64-bit memory location. |
682 void movq(const Operand& dst, Register src); | 704 void movq(const Operand& dst, Register src); |
683 // Move 64 bit memory location to 64-bit register value. | 705 // Move 64 bit memory location to 64-bit register value. |
684 void movq(Register dst, const Operand& src); | 706 void movq(Register dst, const Operand& src); |
685 void movq(Register dst, Register src); | 707 void movq(Register dst, Register src); |
686 // Sign extends immediate 32-bit value to 64 bits. | 708 // Sign extends immediate 32-bit value to 64 bits. |
687 void movq(Register dst, Immediate x); | 709 void movq(Register dst, Immediate x); |
688 // Move the offset of the label location relative to the current | 710 // Move the offset of the label location relative to the current |
689 // position (after the move) to the destination. | 711 // position (after the move) to the destination. |
690 void movl(const Operand& dst, Label* src); | 712 void movl(const Operand& dst, Label* src); |
713 #ifdef V8_TARGET_ARCH_X32 | |
714 void movl(Register dst, int32_t value, RelocInfo::Mode rmode); | |
715 #endif | |
691 | 716 |
692 // Move sign extended immediate to memory location. | 717 // Move sign extended immediate to memory location. |
693 void movq(const Operand& dst, Immediate value); | 718 void movq(const Operand& dst, Immediate value); |
694 // Instructions to load a 64-bit immediate into a register. | 719 // Instructions to load a 64-bit immediate into a register. |
695 // All 64-bit immediates must have a relocation mode. | 720 // All 64-bit immediates must have a relocation mode. |
721 void movq(Register dst, int64_t value, RelocInfo::Mode rmode); | |
722 #ifndef V8_TARGET_ARCH_X32 | |
696 void movq(Register dst, void* ptr, RelocInfo::Mode rmode); | 723 void movq(Register dst, void* ptr, RelocInfo::Mode rmode); |
697 void movq(Register dst, int64_t value, RelocInfo::Mode rmode); | |
698 void movq(Register dst, const char* s, RelocInfo::Mode rmode); | 724 void movq(Register dst, const char* s, RelocInfo::Mode rmode); |
699 // Moves the address of the external reference into the register. | 725 // Moves the address of the external reference into the register. |
700 void movq(Register dst, ExternalReference ext); | 726 void movq(Register dst, ExternalReference ext); |
701 void movq(Register dst, Handle<Object> handle, RelocInfo::Mode rmode); | 727 void movq(Register dst, Handle<Object> handle, RelocInfo::Mode rmode); |
728 #else | |
729 void movl(Register dst, void* ptr, RelocInfo::Mode rmode); | |
730 void movl(Register dst, const char* s, RelocInfo::Mode rmode); | |
731 void movl(Register dst, ExternalReference ext); | |
732 void movl(Register dst, Handle<Object> handle, RelocInfo::Mode rmode); | |
733 #endif | |
702 | 734 |
703 void movsxbq(Register dst, const Operand& src); | 735 void movsxbq(Register dst, const Operand& src); |
704 void movsxwq(Register dst, const Operand& src); | 736 void movsxwq(Register dst, const Operand& src); |
705 void movsxlq(Register dst, Register src); | 737 void movsxlq(Register dst, Register src); |
706 void movsxlq(Register dst, const Operand& src); | 738 void movsxlq(Register dst, const Operand& src); |
707 void movzxbq(Register dst, const Operand& src); | 739 void movzxbq(Register dst, const Operand& src); |
708 void movzxbl(Register dst, const Operand& src); | 740 void movzxbl(Register dst, const Operand& src); |
709 void movzxwq(Register dst, const Operand& src); | 741 void movzxwq(Register dst, const Operand& src); |
710 void movzxwl(Register dst, const Operand& src); | 742 void movzxwl(Register dst, const Operand& src); |
711 void movzxwl(Register dst, Register src); | 743 void movzxwl(Register dst, Register src); |
(...skipping 10 matching lines...) Expand all Loading... | |
722 void load_rax(ExternalReference ext); | 754 void load_rax(ExternalReference ext); |
723 | 755 |
724 // Conditional moves. | 756 // Conditional moves. |
725 void cmovq(Condition cc, Register dst, Register src); | 757 void cmovq(Condition cc, Register dst, Register src); |
726 void cmovq(Condition cc, Register dst, const Operand& src); | 758 void cmovq(Condition cc, Register dst, const Operand& src); |
727 void cmovl(Condition cc, Register dst, Register src); | 759 void cmovl(Condition cc, Register dst, Register src); |
728 void cmovl(Condition cc, Register dst, const Operand& src); | 760 void cmovl(Condition cc, Register dst, const Operand& src); |
729 | 761 |
730 // Exchange two registers | 762 // Exchange two registers |
731 void xchg(Register dst, Register src); | 763 void xchg(Register dst, Register src); |
764 #ifdef V8_TARGET_ARCH_X32 | |
765 void xchgl(Register dst, Register src); | |
766 #endif | |
732 | 767 |
733 // Arithmetics | 768 // Arithmetics |
734 void addl(Register dst, Register src) { | 769 void addl(Register dst, Register src) { |
735 arithmetic_op_32(0x03, dst, src); | 770 arithmetic_op_32(0x03, dst, src); |
736 } | 771 } |
737 | 772 |
738 void addl(Register dst, Immediate src) { | 773 void addl(Register dst, Immediate src) { |
739 immediate_arithmetic_op_32(0x0, dst, src); | 774 immediate_arithmetic_op_32(0x0, dst, src); |
740 } | 775 } |
741 | 776 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
956 } | 991 } |
957 | 992 |
958 void orl(Register dst, const Operand& src) { | 993 void orl(Register dst, const Operand& src) { |
959 arithmetic_op_32(0x0B, dst, src); | 994 arithmetic_op_32(0x0B, dst, src); |
960 } | 995 } |
961 | 996 |
962 void or_(const Operand& dst, Register src) { | 997 void or_(const Operand& dst, Register src) { |
963 arithmetic_op(0x09, src, dst); | 998 arithmetic_op(0x09, src, dst); |
964 } | 999 } |
965 | 1000 |
1001 #ifdef V8_TARGET_ARCH_X32 | |
1002 void orl(const Operand& dst, Register src) { | |
1003 arithmetic_op_32(0x09, src, dst); | |
1004 } | |
1005 #endif | |
1006 | |
966 void or_(Register dst, Immediate src) { | 1007 void or_(Register dst, Immediate src) { |
967 immediate_arithmetic_op(0x1, dst, src); | 1008 immediate_arithmetic_op(0x1, dst, src); |
968 } | 1009 } |
969 | 1010 |
970 void orl(Register dst, Immediate src) { | 1011 void orl(Register dst, Immediate src) { |
971 immediate_arithmetic_op_32(0x1, dst, src); | 1012 immediate_arithmetic_op_32(0x1, dst, src); |
972 } | 1013 } |
973 | 1014 |
974 void or_(const Operand& dst, Immediate src) { | 1015 void or_(const Operand& dst, Immediate src) { |
975 immediate_arithmetic_op(0x1, dst, src); | 1016 immediate_arithmetic_op(0x1, dst, src); |
976 } | 1017 } |
977 | 1018 |
978 void orl(const Operand& dst, Immediate src) { | 1019 void orl(const Operand& dst, Immediate src) { |
979 immediate_arithmetic_op_32(0x1, dst, src); | 1020 immediate_arithmetic_op_32(0x1, dst, src); |
980 } | 1021 } |
981 | 1022 |
982 | |
983 void rcl(Register dst, Immediate imm8) { | 1023 void rcl(Register dst, Immediate imm8) { |
984 shift(dst, imm8, 0x2); | 1024 shift(dst, imm8, 0x2); |
985 } | 1025 } |
986 | 1026 |
987 void rol(Register dst, Immediate imm8) { | 1027 void rol(Register dst, Immediate imm8) { |
988 shift(dst, imm8, 0x0); | 1028 shift(dst, imm8, 0x0); |
989 } | 1029 } |
990 | 1030 |
1031 #ifdef V8_TARGET_ARCH_X32 | |
1032 void roll(Register dst, Immediate imm8) { | |
1033 shift_32(dst, imm8, 0x0); | |
1034 } | |
1035 #endif | |
1036 | |
991 void rcr(Register dst, Immediate imm8) { | 1037 void rcr(Register dst, Immediate imm8) { |
992 shift(dst, imm8, 0x3); | 1038 shift(dst, imm8, 0x3); |
993 } | 1039 } |
994 | 1040 |
995 void ror(Register dst, Immediate imm8) { | 1041 void ror(Register dst, Immediate imm8) { |
996 shift(dst, imm8, 0x1); | 1042 shift(dst, imm8, 0x1); |
997 } | 1043 } |
998 | 1044 |
999 void rorl(Register dst, Immediate imm8) { | 1045 void rorl(Register dst, Immediate imm8) { |
1000 shift_32(dst, imm8, 0x1); | 1046 shift_32(dst, imm8, 0x1); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1088 } | 1134 } |
1089 | 1135 |
1090 void subl(Register dst, Register src) { | 1136 void subl(Register dst, Register src) { |
1091 arithmetic_op_32(0x2B, dst, src); | 1137 arithmetic_op_32(0x2B, dst, src); |
1092 } | 1138 } |
1093 | 1139 |
1094 void subl(Register dst, const Operand& src) { | 1140 void subl(Register dst, const Operand& src) { |
1095 arithmetic_op_32(0x2B, dst, src); | 1141 arithmetic_op_32(0x2B, dst, src); |
1096 } | 1142 } |
1097 | 1143 |
1144 #ifdef V8_TARGET_ARCH_X32 | |
1145 void subl(const Operand& dst, Register src) { | |
1146 arithmetic_op_32(0x29, src, dst); | |
1147 } | |
1148 #endif | |
1149 | |
1098 void subl(const Operand& dst, Immediate src) { | 1150 void subl(const Operand& dst, Immediate src) { |
1099 immediate_arithmetic_op_32(0x5, dst, src); | 1151 immediate_arithmetic_op_32(0x5, dst, src); |
1100 } | 1152 } |
1101 | 1153 |
1102 void subl(Register dst, Immediate src) { | 1154 void subl(Register dst, Immediate src) { |
1103 immediate_arithmetic_op_32(0x5, dst, src); | 1155 immediate_arithmetic_op_32(0x5, dst, src); |
1104 } | 1156 } |
1105 | 1157 |
1106 void subb(Register dst, Immediate src) { | 1158 void subb(Register dst, Immediate src) { |
1107 immediate_arithmetic_op_8(0x5, dst, src); | 1159 immediate_arithmetic_op_8(0x5, dst, src); |
1108 } | 1160 } |
1109 | 1161 |
1110 void testb(Register dst, Register src); | 1162 void testb(Register dst, Register src); |
1111 void testb(Register reg, Immediate mask); | 1163 void testb(Register reg, Immediate mask); |
1112 void testb(const Operand& op, Immediate mask); | 1164 void testb(const Operand& op, Immediate mask); |
1113 void testb(const Operand& op, Register reg); | 1165 void testb(const Operand& op, Register reg); |
1114 void testl(Register dst, Register src); | 1166 void testl(Register dst, Register src); |
1115 void testl(Register reg, Immediate mask); | 1167 void testl(Register reg, Immediate mask); |
1116 void testl(const Operand& op, Immediate mask); | 1168 void testl(const Operand& op, Immediate mask); |
1169 #ifdef V8_TARGET_ARCH_X32 | |
1170 void testl(const Operand& op, Register reg); | |
1171 #endif | |
1117 void testq(const Operand& op, Register reg); | 1172 void testq(const Operand& op, Register reg); |
1118 void testq(Register dst, Register src); | 1173 void testq(Register dst, Register src); |
1119 void testq(Register dst, Immediate mask); | 1174 void testq(Register dst, Immediate mask); |
1120 | 1175 |
1121 void xor_(Register dst, Register src) { | 1176 void xor_(Register dst, Register src) { |
1122 if (dst.code() == src.code()) { | 1177 if (dst.code() == src.code()) { |
1123 arithmetic_op_32(0x33, dst, src); | 1178 arithmetic_op_32(0x33, dst, src); |
1124 } else { | 1179 } else { |
1125 arithmetic_op(0x33, dst, src); | 1180 arithmetic_op(0x33, dst, src); |
1126 } | 1181 } |
1127 } | 1182 } |
1128 | 1183 |
1129 void xorl(Register dst, Register src) { | 1184 void xorl(Register dst, Register src) { |
1130 arithmetic_op_32(0x33, dst, src); | 1185 arithmetic_op_32(0x33, dst, src); |
1131 } | 1186 } |
1132 | 1187 |
1133 void xorl(Register dst, const Operand& src) { | 1188 void xorl(Register dst, const Operand& src) { |
1134 arithmetic_op_32(0x33, dst, src); | 1189 arithmetic_op_32(0x33, dst, src); |
1135 } | 1190 } |
1136 | 1191 |
1137 void xorl(Register dst, Immediate src) { | 1192 void xorl(Register dst, Immediate src) { |
1138 immediate_arithmetic_op_32(0x6, dst, src); | 1193 immediate_arithmetic_op_32(0x6, dst, src); |
1139 } | 1194 } |
1140 | 1195 |
1196 #ifdef V8_TARGET_ARCH_X32 | |
1197 void xorl(const Operand& dst, Register src) { | |
1198 arithmetic_op_32(0x31, src, dst); | |
1199 } | |
1200 #endif | |
1201 | |
1141 void xorl(const Operand& dst, Immediate src) { | 1202 void xorl(const Operand& dst, Immediate src) { |
1142 immediate_arithmetic_op_32(0x6, dst, src); | 1203 immediate_arithmetic_op_32(0x6, dst, src); |
1143 } | 1204 } |
1144 | 1205 |
1145 void xor_(Register dst, const Operand& src) { | 1206 void xor_(Register dst, const Operand& src) { |
1146 arithmetic_op(0x33, dst, src); | 1207 arithmetic_op(0x33, dst, src); |
1147 } | 1208 } |
1148 | 1209 |
1149 void xor_(const Operand& dst, Register src) { | 1210 void xor_(const Operand& dst, Register src) { |
1150 arithmetic_op(0x31, src, dst); | 1211 arithmetic_op(0x31, src, dst); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1371 kRoundToNearest = 0x0, | 1432 kRoundToNearest = 0x0, |
1372 kRoundDown = 0x1, | 1433 kRoundDown = 0x1, |
1373 kRoundUp = 0x2, | 1434 kRoundUp = 0x2, |
1374 kRoundToZero = 0x3 | 1435 kRoundToZero = 0x3 |
1375 }; | 1436 }; |
1376 | 1437 |
1377 void roundsd(XMMRegister dst, XMMRegister src, RoundingMode mode); | 1438 void roundsd(XMMRegister dst, XMMRegister src, RoundingMode mode); |
1378 | 1439 |
1379 void movmskpd(Register dst, XMMRegister src); | 1440 void movmskpd(Register dst, XMMRegister src); |
1380 void movmskps(Register dst, XMMRegister src); | 1441 void movmskps(Register dst, XMMRegister src); |
1442 #ifdef V8_TARGET_ARCH_X32 | |
1443 void pcmpeqd(XMMRegister dst, XMMRegister src); | |
1444 #endif | |
1381 | 1445 |
1382 // The first argument is the reg field, the second argument is the r/m field. | 1446 // The first argument is the reg field, the second argument is the r/m field. |
1383 void emit_sse_operand(XMMRegister dst, XMMRegister src); | 1447 void emit_sse_operand(XMMRegister dst, XMMRegister src); |
1384 void emit_sse_operand(XMMRegister reg, const Operand& adr); | 1448 void emit_sse_operand(XMMRegister reg, const Operand& adr); |
1385 void emit_sse_operand(XMMRegister dst, Register src); | 1449 void emit_sse_operand(XMMRegister dst, Register src); |
1386 void emit_sse_operand(Register dst, XMMRegister src); | 1450 void emit_sse_operand(Register dst, XMMRegister src); |
1387 | 1451 |
1388 // Debugging | 1452 // Debugging |
1389 void Print(); | 1453 void Print(); |
1390 | 1454 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1437 } | 1501 } |
1438 void long_at_put(int pos, uint32_t x) { | 1502 void long_at_put(int pos, uint32_t x) { |
1439 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; | 1503 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; |
1440 } | 1504 } |
1441 | 1505 |
1442 // code emission | 1506 // code emission |
1443 void GrowBuffer(); | 1507 void GrowBuffer(); |
1444 | 1508 |
1445 void emit(byte x) { *pc_++ = x; } | 1509 void emit(byte x) { *pc_++ = x; } |
1446 inline void emitl(uint32_t x); | 1510 inline void emitl(uint32_t x); |
1511 #ifdef V8_TARGET_ARCH_X32 | |
1512 inline void emitl(uint32_t x, RelocInfo::Mode rmode); | |
1513 #endif | |
1447 inline void emitq(uint64_t x, RelocInfo::Mode rmode); | 1514 inline void emitq(uint64_t x, RelocInfo::Mode rmode); |
1448 inline void emitw(uint16_t x); | 1515 inline void emitw(uint16_t x); |
1449 inline void emit_code_target(Handle<Code> target, | 1516 inline void emit_code_target(Handle<Code> target, |
1450 RelocInfo::Mode rmode, | 1517 RelocInfo::Mode rmode, |
1451 TypeFeedbackId ast_id = TypeFeedbackId::None()); | 1518 TypeFeedbackId ast_id = TypeFeedbackId::None()); |
1452 inline void emit_runtime_entry(Address entry, RelocInfo::Mode rmode); | 1519 inline void emit_runtime_entry(Address entry, RelocInfo::Mode rmode); |
1453 void emit(Immediate x) { emitl(x.value_); } | 1520 void emit(Immediate x) { emitl(x.value_); } |
1454 | 1521 |
1455 // Emits a REX prefix that encodes a 64-bit operand size and | 1522 // Emits a REX prefix that encodes a 64-bit operand size and |
1456 // the top bit of both register codes. | 1523 // the top bit of both register codes. |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1651 private: | 1718 private: |
1652 Assembler* assembler_; | 1719 Assembler* assembler_; |
1653 #ifdef DEBUG | 1720 #ifdef DEBUG |
1654 int space_before_; | 1721 int space_before_; |
1655 #endif | 1722 #endif |
1656 }; | 1723 }; |
1657 | 1724 |
1658 } } // namespace v8::internal | 1725 } } // namespace v8::internal |
1659 | 1726 |
1660 #endif // V8_X64_ASSEMBLER_X64_H_ | 1727 #endif // V8_X64_ASSEMBLER_X64_H_ |
OLD | NEW |