| 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 | 5 // modification, are permitted provided that the following conditions |
| 6 // are met: | 6 // are 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 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1291 | 1291 |
| 1292 // Post-indexed addressing requires W == 1; different than in addrmod2/3. | 1292 // Post-indexed addressing requires W == 1; different than in addrmod2/3. |
| 1293 if ((am & P) == 0) | 1293 if ((am & P) == 0) |
| 1294 am |= W; | 1294 am |= W; |
| 1295 | 1295 |
| 1296 DCHECK(offset_8 >= 0); // no masking needed | 1296 DCHECK(offset_8 >= 0); // no masking needed |
| 1297 emit(instr | am | x.rn_.code()*B16 | crd.code()*B12 | offset_8); | 1297 emit(instr | am | x.rn_.code()*B16 | crd.code()*B12 | offset_8); |
| 1298 } | 1298 } |
| 1299 | 1299 |
| 1300 | 1300 |
| 1301 int Assembler::branch_offset(Label* L, bool jump_elimination_allowed) { | 1301 int Assembler::branch_offset(Label* L) { |
| 1302 int target_pos; | 1302 int target_pos; |
| 1303 if (L->is_bound()) { | 1303 if (L->is_bound()) { |
| 1304 target_pos = L->pos(); | 1304 target_pos = L->pos(); |
| 1305 } else { | 1305 } else { |
| 1306 if (L->is_linked()) { | 1306 if (L->is_linked()) { |
| 1307 // Point to previous instruction that uses the link. | 1307 // Point to previous instruction that uses the link. |
| 1308 target_pos = L->pos(); | 1308 target_pos = L->pos(); |
| 1309 } else { | 1309 } else { |
| 1310 // First entry of the link chain points to itself. | 1310 // First entry of the link chain points to itself. |
| 1311 target_pos = pc_offset(); | 1311 target_pos = pc_offset(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 } | 1360 } |
| 1361 | 1361 |
| 1362 | 1362 |
| 1363 void Assembler::bx(Register target, Condition cond) { // v5 and above, plus v4t | 1363 void Assembler::bx(Register target, Condition cond) { // v5 and above, plus v4t |
| 1364 positions_recorder()->WriteRecordedPositions(); | 1364 positions_recorder()->WriteRecordedPositions(); |
| 1365 DCHECK(!target.is(pc)); // use of pc is actually allowed, but discouraged | 1365 DCHECK(!target.is(pc)); // use of pc is actually allowed, but discouraged |
| 1366 emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BX | target.code()); | 1366 emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BX | target.code()); |
| 1367 } | 1367 } |
| 1368 | 1368 |
| 1369 | 1369 |
| 1370 void Assembler::b(Label* L, Condition cond) { |
| 1371 CheckBuffer(); |
| 1372 b(branch_offset(L), cond); |
| 1373 } |
| 1374 |
| 1375 |
| 1376 void Assembler::bl(Label* L, Condition cond) { |
| 1377 CheckBuffer(); |
| 1378 bl(branch_offset(L), cond); |
| 1379 } |
| 1380 |
| 1381 |
| 1382 void Assembler::blx(Label* L) { |
| 1383 CheckBuffer(); |
| 1384 blx(branch_offset(L)); |
| 1385 } |
| 1386 |
| 1387 |
| 1370 // Data-processing instructions. | 1388 // Data-processing instructions. |
| 1371 | 1389 |
| 1372 void Assembler::and_(Register dst, Register src1, const Operand& src2, | 1390 void Assembler::and_(Register dst, Register src1, const Operand& src2, |
| 1373 SBit s, Condition cond) { | 1391 SBit s, Condition cond) { |
| 1374 addrmod1(cond | AND | s, src1, dst, src2); | 1392 addrmod1(cond | AND | s, src1, dst, src2); |
| 1375 } | 1393 } |
| 1376 | 1394 |
| 1377 | 1395 |
| 1378 void Assembler::eor(Register dst, Register src1, const Operand& src2, | 1396 void Assembler::eor(Register dst, Register src1, const Operand& src2, |
| 1379 SBit s, Condition cond) { | 1397 SBit s, Condition cond) { |
| (...skipping 2384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3764 int needed_space = size + kGap; | 3782 int needed_space = size + kGap; |
| 3765 while (buffer_space() <= needed_space) GrowBuffer(); | 3783 while (buffer_space() <= needed_space) GrowBuffer(); |
| 3766 | 3784 |
| 3767 { | 3785 { |
| 3768 // Block recursive calls to CheckConstPool. | 3786 // Block recursive calls to CheckConstPool. |
| 3769 BlockConstPoolScope block_const_pool(this); | 3787 BlockConstPoolScope block_const_pool(this); |
| 3770 RecordComment("[ Constant Pool"); | 3788 RecordComment("[ Constant Pool"); |
| 3771 RecordConstPool(size); | 3789 RecordConstPool(size); |
| 3772 | 3790 |
| 3773 // Emit jump over constant pool if necessary. | 3791 // Emit jump over constant pool if necessary. |
| 3774 Label after_pool; | 3792 if (require_jump) b(size - kPcLoadDelta); |
| 3775 if (require_jump) { | |
| 3776 b(&after_pool); | |
| 3777 } | |
| 3778 | 3793 |
| 3779 // Put down constant pool marker "Undefined instruction". | 3794 // Put down constant pool marker "Undefined instruction". |
| 3780 // The data size helps disassembly know what to print. | 3795 // The data size helps disassembly know what to print. |
| 3781 emit(kConstantPoolMarker | | 3796 emit(kConstantPoolMarker | |
| 3782 EncodeConstantPoolLength(size_after_marker / kPointerSize)); | 3797 EncodeConstantPoolLength(size_after_marker / kPointerSize)); |
| 3783 | 3798 |
| 3784 if (require_64_bit_align) { | 3799 if (require_64_bit_align) { |
| 3785 emit(kConstantPoolMarker); | 3800 emit(kConstantPoolMarker); |
| 3786 } | 3801 } |
| 3787 | 3802 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3874 DCHECK(IsMovW(instr)); | 3889 DCHECK(IsMovW(instr)); |
| 3875 } | 3890 } |
| 3876 } | 3891 } |
| 3877 | 3892 |
| 3878 num_pending_32_bit_reloc_info_ = 0; | 3893 num_pending_32_bit_reloc_info_ = 0; |
| 3879 num_pending_64_bit_reloc_info_ = 0; | 3894 num_pending_64_bit_reloc_info_ = 0; |
| 3880 first_const_pool_32_use_ = -1; | 3895 first_const_pool_32_use_ = -1; |
| 3881 first_const_pool_64_use_ = -1; | 3896 first_const_pool_64_use_ = -1; |
| 3882 | 3897 |
| 3883 RecordComment("]"); | 3898 RecordComment("]"); |
| 3884 | |
| 3885 if (after_pool.is_linked()) { | |
| 3886 bind(&after_pool); | |
| 3887 } | |
| 3888 } | 3899 } |
| 3889 | 3900 |
| 3890 // Since a constant pool was just emitted, move the check offset forward by | 3901 // Since a constant pool was just emitted, move the check offset forward by |
| 3891 // the standard interval. | 3902 // the standard interval. |
| 3892 next_buffer_check_ = pc_offset() + kCheckPoolInterval; | 3903 next_buffer_check_ = pc_offset() + kCheckPoolInterval; |
| 3893 } | 3904 } |
| 3894 | 3905 |
| 3895 | 3906 |
| 3896 Handle<ConstantPoolArray> Assembler::NewConstantPool(Isolate* isolate) { | 3907 Handle<ConstantPoolArray> Assembler::NewConstantPool(Isolate* isolate) { |
| 3897 if (!FLAG_enable_ool_constant_pool) { | 3908 if (!FLAG_enable_ool_constant_pool) { |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4112 assm->instr_at_put( | 4123 assm->instr_at_put( |
| 4113 rinfo.pc(), Assembler::SetLdrRegisterImmediateOffset(instr, offset)); | 4124 rinfo.pc(), Assembler::SetLdrRegisterImmediateOffset(instr, offset)); |
| 4114 } | 4125 } |
| 4115 } | 4126 } |
| 4116 } | 4127 } |
| 4117 | 4128 |
| 4118 | 4129 |
| 4119 } } // namespace v8::internal | 4130 } } // namespace v8::internal |
| 4120 | 4131 |
| 4121 #endif // V8_TARGET_ARCH_ARM | 4132 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |