| 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 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1301 | 1301 |
| 1302 // Post-indexed addressing requires W == 1; different than in addrmod2/3. | 1302 // Post-indexed addressing requires W == 1; different than in addrmod2/3. |
| 1303 if ((am & P) == 0) | 1303 if ((am & P) == 0) |
| 1304 am |= W; | 1304 am |= W; |
| 1305 | 1305 |
| 1306 DCHECK(offset_8 >= 0); // no masking needed | 1306 DCHECK(offset_8 >= 0); // no masking needed |
| 1307 emit(instr | am | x.rn_.code()*B16 | crd.code()*B12 | offset_8); | 1307 emit(instr | am | x.rn_.code()*B16 | crd.code()*B12 | offset_8); |
| 1308 } | 1308 } |
| 1309 | 1309 |
| 1310 | 1310 |
| 1311 int Assembler::branch_offset(Label* L, bool jump_elimination_allowed) { | 1311 int Assembler::branch_offset(Label* L) { |
| 1312 int target_pos; | 1312 int target_pos; |
| 1313 if (L->is_bound()) { | 1313 if (L->is_bound()) { |
| 1314 target_pos = L->pos(); | 1314 target_pos = L->pos(); |
| 1315 } else { | 1315 } else { |
| 1316 if (L->is_linked()) { | 1316 if (L->is_linked()) { |
| 1317 // Point to previous instruction that uses the link. | 1317 // Point to previous instruction that uses the link. |
| 1318 target_pos = L->pos(); | 1318 target_pos = L->pos(); |
| 1319 } else { | 1319 } else { |
| 1320 // First entry of the link chain points to itself. | 1320 // First entry of the link chain points to itself. |
| 1321 target_pos = pc_offset(); | 1321 target_pos = pc_offset(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1370 } | 1370 } |
| 1371 | 1371 |
| 1372 | 1372 |
| 1373 void Assembler::bx(Register target, Condition cond) { // v5 and above, plus v4t | 1373 void Assembler::bx(Register target, Condition cond) { // v5 and above, plus v4t |
| 1374 positions_recorder()->WriteRecordedPositions(); | 1374 positions_recorder()->WriteRecordedPositions(); |
| 1375 DCHECK(!target.is(pc)); // use of pc is actually allowed, but discouraged | 1375 DCHECK(!target.is(pc)); // use of pc is actually allowed, but discouraged |
| 1376 emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BX | target.code()); | 1376 emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BX | target.code()); |
| 1377 } | 1377 } |
| 1378 | 1378 |
| 1379 | 1379 |
| 1380 void Assembler::b(Label* L, Condition cond) { |
| 1381 CheckBuffer(); |
| 1382 b(branch_offset(L), cond); |
| 1383 } |
| 1384 |
| 1385 |
| 1386 void Assembler::bl(Label* L, Condition cond) { |
| 1387 CheckBuffer(); |
| 1388 bl(branch_offset(L), cond); |
| 1389 } |
| 1390 |
| 1391 |
| 1392 void Assembler::blx(Label* L) { |
| 1393 CheckBuffer(); |
| 1394 blx(branch_offset(L)); |
| 1395 } |
| 1396 |
| 1397 |
| 1380 // Data-processing instructions. | 1398 // Data-processing instructions. |
| 1381 | 1399 |
| 1382 void Assembler::and_(Register dst, Register src1, const Operand& src2, | 1400 void Assembler::and_(Register dst, Register src1, const Operand& src2, |
| 1383 SBit s, Condition cond) { | 1401 SBit s, Condition cond) { |
| 1384 addrmod1(cond | AND | s, src1, dst, src2); | 1402 addrmod1(cond | AND | s, src1, dst, src2); |
| 1385 } | 1403 } |
| 1386 | 1404 |
| 1387 | 1405 |
| 1388 void Assembler::eor(Register dst, Register src1, const Operand& src2, | 1406 void Assembler::eor(Register dst, Register src1, const Operand& src2, |
| 1389 SBit s, Condition cond) { | 1407 SBit s, Condition cond) { |
| (...skipping 2423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3813 { | 3831 { |
| 3814 // Block recursive calls to CheckConstPool. | 3832 // Block recursive calls to CheckConstPool. |
| 3815 BlockConstPoolScope block_const_pool(this); | 3833 BlockConstPoolScope block_const_pool(this); |
| 3816 RecordComment("[ Constant Pool"); | 3834 RecordComment("[ Constant Pool"); |
| 3817 RecordConstPool(size); | 3835 RecordConstPool(size); |
| 3818 | 3836 |
| 3819 Label size_check; | 3837 Label size_check; |
| 3820 bind(&size_check); | 3838 bind(&size_check); |
| 3821 | 3839 |
| 3822 // Emit jump over constant pool if necessary. | 3840 // Emit jump over constant pool if necessary. |
| 3823 Label after_pool; | 3841 if (require_jump) b(size - kPcLoadDelta); |
| 3824 if (require_jump) { | |
| 3825 b(&after_pool); | |
| 3826 } | |
| 3827 | 3842 |
| 3828 // Put down constant pool marker "Undefined instruction". | 3843 // Put down constant pool marker "Undefined instruction". |
| 3829 // The data size helps disassembly know what to print. | 3844 // The data size helps disassembly know what to print. |
| 3830 emit(kConstantPoolMarker | | 3845 emit(kConstantPoolMarker | |
| 3831 EncodeConstantPoolLength(size_after_marker / kPointerSize)); | 3846 EncodeConstantPoolLength(size_after_marker / kPointerSize)); |
| 3832 | 3847 |
| 3833 if (require_64_bit_align) { | 3848 if (require_64_bit_align) { |
| 3834 emit(kConstantPoolMarker); | 3849 emit(kConstantPoolMarker); |
| 3835 } | 3850 } |
| 3836 | 3851 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3900 } | 3915 } |
| 3901 | 3916 |
| 3902 num_pending_32_bit_constants_ = 0; | 3917 num_pending_32_bit_constants_ = 0; |
| 3903 num_pending_64_bit_constants_ = 0; | 3918 num_pending_64_bit_constants_ = 0; |
| 3904 first_const_pool_32_use_ = -1; | 3919 first_const_pool_32_use_ = -1; |
| 3905 first_const_pool_64_use_ = -1; | 3920 first_const_pool_64_use_ = -1; |
| 3906 | 3921 |
| 3907 RecordComment("]"); | 3922 RecordComment("]"); |
| 3908 | 3923 |
| 3909 DCHECK_EQ(size, SizeOfCodeGeneratedSince(&size_check)); | 3924 DCHECK_EQ(size, SizeOfCodeGeneratedSince(&size_check)); |
| 3910 | |
| 3911 if (after_pool.is_linked()) { | |
| 3912 bind(&after_pool); | |
| 3913 } | |
| 3914 } | 3925 } |
| 3915 | 3926 |
| 3916 // Since a constant pool was just emitted, move the check offset forward by | 3927 // Since a constant pool was just emitted, move the check offset forward by |
| 3917 // the standard interval. | 3928 // the standard interval. |
| 3918 next_buffer_check_ = pc_offset() + kCheckPoolInterval; | 3929 next_buffer_check_ = pc_offset() + kCheckPoolInterval; |
| 3919 } | 3930 } |
| 3920 | 3931 |
| 3921 | 3932 |
| 3922 void Assembler::PatchConstantPoolAccessInstruction( | 3933 void Assembler::PatchConstantPoolAccessInstruction( |
| 3923 int pc_offset, int offset, ConstantPoolEntry::Access access, | 3934 int pc_offset, int offset, ConstantPoolEntry::Access access, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3970 DCHECK(is_uint12(offset)); | 3981 DCHECK(is_uint12(offset)); |
| 3971 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); | 3982 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); |
| 3972 } | 3983 } |
| 3973 } | 3984 } |
| 3974 | 3985 |
| 3975 | 3986 |
| 3976 } // namespace internal | 3987 } // namespace internal |
| 3977 } // namespace v8 | 3988 } // namespace v8 |
| 3978 | 3989 |
| 3979 #endif // V8_TARGET_ARCH_ARM | 3990 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |