| 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, RelocInfo::Mode rmode); | 1186 void call(Handle<Code> target, |
| 1187 RelocInfo::Mode rmode, |
| 1188 unsigned ast_id = kNoASTId); |
| 1187 | 1189 |
| 1188 // Calls directly to the given address using a relative offset. | 1190 // Calls directly to the given address using a relative offset. |
| 1189 // Should only ever be used in Code objects for calls within the | 1191 // Should only ever be used in Code objects for calls within the |
| 1190 // same Code object. Should not be used when generating new code (use labels), | 1192 // same Code object. Should not be used when generating new code (use labels), |
| 1191 // but only when patching existing code. | 1193 // but only when patching existing code. |
| 1192 void call(Address target); | 1194 void call(Address target); |
| 1193 | 1195 |
| 1194 // Call near absolute indirect, address in register | 1196 // Call near absolute indirect, address in register |
| 1195 void call(Register adr); | 1197 void call(Register adr); |
| 1196 | 1198 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1410 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; | 1412 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; |
| 1411 } | 1413 } |
| 1412 | 1414 |
| 1413 // code emission | 1415 // code emission |
| 1414 void GrowBuffer(); | 1416 void GrowBuffer(); |
| 1415 | 1417 |
| 1416 void emit(byte x) { *pc_++ = x; } | 1418 void emit(byte x) { *pc_++ = x; } |
| 1417 inline void emitl(uint32_t x); | 1419 inline void emitl(uint32_t x); |
| 1418 inline void emitq(uint64_t x, RelocInfo::Mode rmode); | 1420 inline void emitq(uint64_t x, RelocInfo::Mode rmode); |
| 1419 inline void emitw(uint16_t x); | 1421 inline void emitw(uint16_t x); |
| 1420 inline void emit_code_target(Handle<Code> target, RelocInfo::Mode rmode); | 1422 inline void emit_code_target(Handle<Code> target, |
| 1423 RelocInfo::Mode rmode, |
| 1424 unsigned ast_id = kNoASTId); |
| 1421 void emit(Immediate x) { emitl(x.value_); } | 1425 void emit(Immediate x) { emitl(x.value_); } |
| 1422 | 1426 |
| 1423 // Emits a REX prefix that encodes a 64-bit operand size and | 1427 // Emits a REX prefix that encodes a 64-bit operand size and |
| 1424 // the top bit of both register codes. | 1428 // the top bit of both register codes. |
| 1425 // High bit of reg goes to REX.R, high bit of rm_reg goes to REX.B. | 1429 // High bit of reg goes to REX.R, high bit of rm_reg goes to REX.B. |
| 1426 // REX.W is set. | 1430 // REX.W is set. |
| 1427 inline void emit_rex_64(XMMRegister reg, Register rm_reg); | 1431 inline void emit_rex_64(XMMRegister reg, Register rm_reg); |
| 1428 inline void emit_rex_64(Register reg, XMMRegister rm_reg); | 1432 inline void emit_rex_64(Register reg, XMMRegister rm_reg); |
| 1429 inline void emit_rex_64(Register reg, Register rm_reg); | 1433 inline void emit_rex_64(Register reg, Register rm_reg); |
| 1430 | 1434 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1630 private: | 1634 private: |
| 1631 Assembler* assembler_; | 1635 Assembler* assembler_; |
| 1632 #ifdef DEBUG | 1636 #ifdef DEBUG |
| 1633 int space_before_; | 1637 int space_before_; |
| 1634 #endif | 1638 #endif |
| 1635 }; | 1639 }; |
| 1636 | 1640 |
| 1637 } } // namespace v8::internal | 1641 } } // namespace v8::internal |
| 1638 | 1642 |
| 1639 #endif // V8_X64_ASSEMBLER_X64_H_ | 1643 #endif // V8_X64_ASSEMBLER_X64_H_ |
| OLD | NEW |