OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 emit_operand(Register::toRegister(subcode), dst); | 335 emit_operand(Register::toRegister(subcode), dst); |
336 emit(src.value_); | 336 emit(src.value_); |
337 } else { | 337 } else { |
338 emit(0x81); | 338 emit(0x81); |
339 emit_operand(Register::toRegister(subcode), dst); | 339 emit_operand(Register::toRegister(subcode), dst); |
340 emitl(src.value_); | 340 emitl(src.value_); |
341 } | 341 } |
342 } | 342 } |
343 | 343 |
344 | 344 |
| 345 void Assembler::shift(Register dst, Immediate shift_amount, int subcode) { |
| 346 EnsureSpace ensure_space(this); |
| 347 last_pc_ = pc_; |
| 348 ASSERT(is_uint6(shift_amount.value_)); // illegal shift count |
| 349 if (shift_amount.value_ == 1) { |
| 350 emit_rex_64(dst); |
| 351 emit(0xD1); |
| 352 emit(0xC0 | (subcode << 3) | (dst.code() & 0x7)); |
| 353 } else { |
| 354 emit_rex_64(dst); |
| 355 emit(0xC1); |
| 356 emit(0xC0 | (subcode << 3) | (dst.code() & 0x7)); |
| 357 emit(shift_amount.value_); |
| 358 } |
| 359 } |
| 360 |
| 361 |
| 362 void Assembler::shift(Register dst, int subcode) { |
| 363 EnsureSpace ensure_space(this); |
| 364 last_pc_ = pc_; |
| 365 emit_rex_64(dst); |
| 366 emit(0xD3); |
| 367 emit(0xC0 | (subcode << 3) | (dst.code() & 0x7)); |
| 368 } |
| 369 |
| 370 |
345 void Assembler::call(Label* L) { | 371 void Assembler::call(Label* L) { |
346 EnsureSpace ensure_space(this); | 372 EnsureSpace ensure_space(this); |
347 last_pc_ = pc_; | 373 last_pc_ = pc_; |
348 // 1110 1000 #32-bit disp | 374 // 1110 1000 #32-bit disp |
349 emit(0xE8); | 375 emit(0xE8); |
350 if (L->is_bound()) { | 376 if (L->is_bound()) { |
351 int offset = L->pos() - pc_offset() - sizeof(int32_t); | 377 int offset = L->pos() - pc_offset() - sizeof(int32_t); |
352 ASSERT(offset <= 0); | 378 ASSERT(offset <= 0); |
353 emitl(offset); | 379 emitl(offset); |
354 } else if (L->is_linked()) { | 380 } else if (L->is_linked()) { |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 UNIMPLEMENTED(); | 1141 UNIMPLEMENTED(); |
1116 return NULL; | 1142 return NULL; |
1117 } | 1143 } |
1118 | 1144 |
1119 byte* JavaScriptFrame::GetCallerStackPointer() const { | 1145 byte* JavaScriptFrame::GetCallerStackPointer() const { |
1120 UNIMPLEMENTED(); | 1146 UNIMPLEMENTED(); |
1121 return NULL; | 1147 return NULL; |
1122 } | 1148 } |
1123 | 1149 |
1124 } } // namespace v8::internal | 1150 } } // namespace v8::internal |
OLD | NEW |