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 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1176 // | 1176 // |
1177 // Note: The same Label can be used for forward and backward branches | 1177 // Note: The same Label can be used for forward and backward branches |
1178 // but it may be bound only once. | 1178 // but it may be bound only once. |
1179 | 1179 |
1180 void bind(Label* L); // binds an unbound label L to the current code position | 1180 void bind(Label* L); // binds an unbound label L to the current code position |
1181 void bind(NearLabel* L); | 1181 void bind(NearLabel* L); |
1182 | 1182 |
1183 // Calls | 1183 // Calls |
1184 // Call near relative 32-bit displacement, relative to next instruction. | 1184 // Call near relative 32-bit displacement, relative to next instruction. |
1185 void call(Label* L); | 1185 void call(Label* L); |
1186 void call(Handle<Code> target, | 1186 void call(Handle<Code> target, RelocInfo::Mode rmode); |
1187 RelocInfo::Mode rmode, | |
1188 unsigned ast_id = kNoASTId); | |
1189 | 1187 |
1190 // Calls directly to the given address using a relative offset. | 1188 // Calls directly to the given address using a relative offset. |
1191 // Should only ever be used in Code objects for calls within the | 1189 // Should only ever be used in Code objects for calls within the |
1192 // same Code object. Should not be used when generating new code (use labels), | 1190 // same Code object. Should not be used when generating new code (use labels), |
1193 // but only when patching existing code. | 1191 // but only when patching existing code. |
1194 void call(Address target); | 1192 void call(Address target); |
1195 | 1193 |
1196 // Call near absolute indirect, address in register | 1194 // Call near absolute indirect, address in register |
1197 void call(Register adr); | 1195 void call(Register adr); |
1198 | 1196 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1422 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; | 1420 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; |
1423 } | 1421 } |
1424 | 1422 |
1425 // code emission | 1423 // code emission |
1426 void GrowBuffer(); | 1424 void GrowBuffer(); |
1427 | 1425 |
1428 void emit(byte x) { *pc_++ = x; } | 1426 void emit(byte x) { *pc_++ = x; } |
1429 inline void emitl(uint32_t x); | 1427 inline void emitl(uint32_t x); |
1430 inline void emitq(uint64_t x, RelocInfo::Mode rmode); | 1428 inline void emitq(uint64_t x, RelocInfo::Mode rmode); |
1431 inline void emitw(uint16_t x); | 1429 inline void emitw(uint16_t x); |
1432 inline void emit_code_target(Handle<Code> target, | 1430 inline void emit_code_target(Handle<Code> target, RelocInfo::Mode rmode); |
1433 RelocInfo::Mode rmode, | |
1434 unsigned ast_id = kNoASTId); | |
1435 void emit(Immediate x) { emitl(x.value_); } | 1431 void emit(Immediate x) { emitl(x.value_); } |
1436 | 1432 |
1437 // Emits a REX prefix that encodes a 64-bit operand size and | 1433 // Emits a REX prefix that encodes a 64-bit operand size and |
1438 // the top bit of both register codes. | 1434 // the top bit of both register codes. |
1439 // High bit of reg goes to REX.R, high bit of rm_reg goes to REX.B. | 1435 // High bit of reg goes to REX.R, high bit of rm_reg goes to REX.B. |
1440 // REX.W is set. | 1436 // REX.W is set. |
1441 inline void emit_rex_64(XMMRegister reg, Register rm_reg); | 1437 inline void emit_rex_64(XMMRegister reg, Register rm_reg); |
1442 inline void emit_rex_64(Register reg, XMMRegister rm_reg); | 1438 inline void emit_rex_64(Register reg, XMMRegister rm_reg); |
1443 inline void emit_rex_64(Register reg, Register rm_reg); | 1439 inline void emit_rex_64(Register reg, Register rm_reg); |
1444 | 1440 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1644 private: | 1640 private: |
1645 Assembler* assembler_; | 1641 Assembler* assembler_; |
1646 #ifdef DEBUG | 1642 #ifdef DEBUG |
1647 int space_before_; | 1643 int space_before_; |
1648 #endif | 1644 #endif |
1649 }; | 1645 }; |
1650 | 1646 |
1651 } } // namespace v8::internal | 1647 } } // namespace v8::internal |
1652 | 1648 |
1653 #endif // V8_X64_ASSEMBLER_X64_H_ | 1649 #endif // V8_X64_ASSEMBLER_X64_H_ |
OLD | NEW |