OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 emit(0x70 | cc); | 1271 emit(0x70 | cc); |
1272 emit((offs - short_size) & 0xFF); | 1272 emit((offs - short_size) & 0xFF); |
1273 } else { | 1273 } else { |
1274 emit(0x70 | cc); | 1274 emit(0x70 | cc); |
1275 emit(0x00); // The displacement will be resolved later. | 1275 emit(0x00); // The displacement will be resolved later. |
1276 L->link_to(pc_offset()); | 1276 L->link_to(pc_offset()); |
1277 } | 1277 } |
1278 } | 1278 } |
1279 | 1279 |
1280 | 1280 |
| 1281 void Assembler::j(Condition cc, byte* entry, RelocInfo::Mode rmode) { |
| 1282 EnsureSpace ensure_space(this); |
| 1283 RecordRelocInfo(rmode); |
| 1284 last_pc_ = pc_; |
| 1285 ASSERT((0 <= cc) && (cc < 16)); |
| 1286 // 0000 1111 1000 tttn #32-bit disp. |
| 1287 emit(0x0F); |
| 1288 emit(0x80 | cc); |
| 1289 emit(entry - (pc_ + sizeof(intptr_t))); |
| 1290 } |
| 1291 |
| 1292 |
1281 void Assembler::jmp(Label* L) { | 1293 void Assembler::jmp(Label* L) { |
1282 EnsureSpace ensure_space(this); | 1294 EnsureSpace ensure_space(this); |
1283 last_pc_ = pc_; | 1295 last_pc_ = pc_; |
1284 const int short_size = sizeof(int8_t); | 1296 const int short_size = sizeof(int8_t); |
1285 const int long_size = sizeof(int32_t); | 1297 const int long_size = sizeof(int32_t); |
1286 if (L->is_bound()) { | 1298 if (L->is_bound()) { |
1287 int offs = L->pos() - pc_offset() - 1; | 1299 int offs = L->pos() - pc_offset() - 1; |
1288 ASSERT(offs <= 0); | 1300 ASSERT(offs <= 0); |
1289 if (is_int8(offs - short_size)) { | 1301 if (is_int8(offs - short_size)) { |
1290 // 1110 1011 #8-bit disp. | 1302 // 1110 1011 #8-bit disp. |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1942 if (is_int8(value.value_)) { | 1954 if (is_int8(value.value_)) { |
1943 emit(0x6A); | 1955 emit(0x6A); |
1944 emit(value.value_); // Emit low byte of value. | 1956 emit(value.value_); // Emit low byte of value. |
1945 } else { | 1957 } else { |
1946 emit(0x68); | 1958 emit(0x68); |
1947 emitl(value.value_); | 1959 emitl(value.value_); |
1948 } | 1960 } |
1949 } | 1961 } |
1950 | 1962 |
1951 | 1963 |
| 1964 void Assembler::push_imm32(int32_t imm32) { |
| 1965 EnsureSpace ensure_space(this); |
| 1966 last_pc_ = pc_; |
| 1967 emit(0x68); |
| 1968 emitl(imm32); |
| 1969 } |
| 1970 |
| 1971 |
1952 void Assembler::pushfq() { | 1972 void Assembler::pushfq() { |
1953 EnsureSpace ensure_space(this); | 1973 EnsureSpace ensure_space(this); |
1954 last_pc_ = pc_; | 1974 last_pc_ = pc_; |
1955 emit(0x9C); | 1975 emit(0x9C); |
1956 } | 1976 } |
1957 | 1977 |
1958 | 1978 |
1959 void Assembler::rdtsc() { | 1979 void Assembler::rdtsc() { |
1960 EnsureSpace ensure_space(this); | 1980 EnsureSpace ensure_space(this); |
1961 last_pc_ = pc_; | 1981 last_pc_ = pc_; |
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3007 // specially coded on x64 means that it is a relative 32 bit address, as used | 3027 // specially coded on x64 means that it is a relative 32 bit address, as used |
3008 // by branch instructions. | 3028 // by branch instructions. |
3009 return (1 << rmode_) & kApplyMask; | 3029 return (1 << rmode_) & kApplyMask; |
3010 } | 3030 } |
3011 | 3031 |
3012 | 3032 |
3013 | 3033 |
3014 } } // namespace v8::internal | 3034 } } // namespace v8::internal |
3015 | 3035 |
3016 #endif // V8_TARGET_ARCH_X64 | 3036 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |