OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 emit_modrm(0, dst); | 1208 emit_modrm(0, dst); |
1209 } | 1209 } |
1210 | 1210 |
1211 | 1211 |
1212 void Assembler::int3() { | 1212 void Assembler::int3() { |
1213 EnsureSpace ensure_space(this); | 1213 EnsureSpace ensure_space(this); |
1214 emit(0xCC); | 1214 emit(0xCC); |
1215 } | 1215 } |
1216 | 1216 |
1217 | 1217 |
1218 void Assembler::j(Condition cc, Label* L, Hint hint, Label::Distance distance) { | 1218 void Assembler::j(Condition cc, Label* L, Label::Distance distance) { |
1219 if (cc == always) { | 1219 if (cc == always) { |
1220 jmp(L); | 1220 jmp(L); |
1221 return; | 1221 return; |
1222 } else if (cc == never) { | 1222 } else if (cc == never) { |
1223 return; | 1223 return; |
1224 } | 1224 } |
1225 EnsureSpace ensure_space(this); | 1225 EnsureSpace ensure_space(this); |
1226 ASSERT(is_uint4(cc)); | 1226 ASSERT(is_uint4(cc)); |
1227 if (FLAG_emit_branch_hints && hint != no_hint) emit(hint); | |
1228 if (L->is_bound()) { | 1227 if (L->is_bound()) { |
1229 const int short_size = 2; | 1228 const int short_size = 2; |
1230 const int long_size = 6; | 1229 const int long_size = 6; |
1231 int offs = L->pos() - pc_offset(); | 1230 int offs = L->pos() - pc_offset(); |
1232 ASSERT(offs <= 0); | 1231 ASSERT(offs <= 0); |
1233 if (is_int8(offs - short_size)) { | 1232 if (is_int8(offs - short_size)) { |
1234 // 0111 tttn #8-bit disp. | 1233 // 0111 tttn #8-bit disp. |
1235 emit(0x70 | cc); | 1234 emit(0x70 | cc); |
1236 emit((offs - short_size) & 0xFF); | 1235 emit((offs - short_size) & 0xFF); |
1237 } else { | 1236 } else { |
(...skipping 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3019 // specially coded on x64 means that it is a relative 32 bit address, as used | 3018 // specially coded on x64 means that it is a relative 32 bit address, as used |
3020 // by branch instructions. | 3019 // by branch instructions. |
3021 return (1 << rmode_) & kApplyMask; | 3020 return (1 << rmode_) & kApplyMask; |
3022 } | 3021 } |
3023 | 3022 |
3024 | 3023 |
3025 | 3024 |
3026 } } // namespace v8::internal | 3025 } } // namespace v8::internal |
3027 | 3026 |
3028 #endif // V8_TARGET_ARCH_X64 | 3027 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |