| 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 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(); |
| 1322 } | 1322 } |
| 1323 L->link_to(pc_offset()); | 1323 L->link_to(pc_offset()); |
| 1324 } | 1324 } |
| 1325 | 1325 |
| 1326 // Block the emission of the constant pool, since the branch instruction must | 1326 // Block the emission of the constant pool, since the branch instruction must |
| 1327 // be emitted at the pc offset recorded by the label. | 1327 // be emitted at the pc offset recorded by the label. |
| 1328 BlockConstPoolFor(1); | 1328 if (!is_const_pool_blocked()) BlockConstPoolFor(1); |
| 1329 |
| 1329 return target_pos - (pc_offset() + kPcLoadDelta); | 1330 return target_pos - (pc_offset() + kPcLoadDelta); |
| 1330 } | 1331 } |
| 1331 | 1332 |
| 1332 | 1333 |
| 1333 // Branch instructions. | 1334 // Branch instructions. |
| 1334 void Assembler::b(int branch_offset, Condition cond) { | 1335 void Assembler::b(int branch_offset, Condition cond) { |
| 1335 DCHECK((branch_offset & 3) == 0); | 1336 DCHECK((branch_offset & 3) == 0); |
| 1336 int imm24 = branch_offset >> 2; | 1337 int imm24 = branch_offset >> 2; |
| 1337 CHECK(is_int24(imm24)); | 1338 CHECK(is_int24(imm24)); |
| 1338 emit(cond | B27 | B25 | (imm24 & kImm24Mask)); | 1339 emit(cond | B27 | B25 | (imm24 & kImm24Mask)); |
| (...skipping 2492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3831 { | 3832 { |
| 3832 // Block recursive calls to CheckConstPool. | 3833 // Block recursive calls to CheckConstPool. |
| 3833 BlockConstPoolScope block_const_pool(this); | 3834 BlockConstPoolScope block_const_pool(this); |
| 3834 RecordComment("[ Constant Pool"); | 3835 RecordComment("[ Constant Pool"); |
| 3835 RecordConstPool(size); | 3836 RecordConstPool(size); |
| 3836 | 3837 |
| 3837 Label size_check; | 3838 Label size_check; |
| 3838 bind(&size_check); | 3839 bind(&size_check); |
| 3839 | 3840 |
| 3840 // Emit jump over constant pool if necessary. | 3841 // Emit jump over constant pool if necessary. |
| 3841 if (require_jump) b(size - kPcLoadDelta); | 3842 Label after_pool; |
| 3843 if (require_jump) { |
| 3844 b(&after_pool); |
| 3845 } |
| 3842 | 3846 |
| 3843 // Put down constant pool marker "Undefined instruction". | 3847 // Put down constant pool marker "Undefined instruction". |
| 3844 // The data size helps disassembly know what to print. | 3848 // The data size helps disassembly know what to print. |
| 3845 emit(kConstantPoolMarker | | 3849 emit(kConstantPoolMarker | |
| 3846 EncodeConstantPoolLength(size_after_marker / kPointerSize)); | 3850 EncodeConstantPoolLength(size_after_marker / kPointerSize)); |
| 3847 | 3851 |
| 3848 if (require_64_bit_align) { | 3852 if (require_64_bit_align) { |
| 3849 emit(kConstantPoolMarker); | 3853 emit(kConstantPoolMarker); |
| 3850 } | 3854 } |
| 3851 | 3855 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3915 } | 3919 } |
| 3916 | 3920 |
| 3917 num_pending_32_bit_constants_ = 0; | 3921 num_pending_32_bit_constants_ = 0; |
| 3918 num_pending_64_bit_constants_ = 0; | 3922 num_pending_64_bit_constants_ = 0; |
| 3919 first_const_pool_32_use_ = -1; | 3923 first_const_pool_32_use_ = -1; |
| 3920 first_const_pool_64_use_ = -1; | 3924 first_const_pool_64_use_ = -1; |
| 3921 | 3925 |
| 3922 RecordComment("]"); | 3926 RecordComment("]"); |
| 3923 | 3927 |
| 3924 DCHECK_EQ(size, SizeOfCodeGeneratedSince(&size_check)); | 3928 DCHECK_EQ(size, SizeOfCodeGeneratedSince(&size_check)); |
| 3929 |
| 3930 if (after_pool.is_linked()) { |
| 3931 bind(&after_pool); |
| 3932 } |
| 3925 } | 3933 } |
| 3926 | 3934 |
| 3927 // Since a constant pool was just emitted, move the check offset forward by | 3935 // Since a constant pool was just emitted, move the check offset forward by |
| 3928 // the standard interval. | 3936 // the standard interval. |
| 3929 next_buffer_check_ = pc_offset() + kCheckPoolInterval; | 3937 next_buffer_check_ = pc_offset() + kCheckPoolInterval; |
| 3930 } | 3938 } |
| 3931 | 3939 |
| 3932 | 3940 |
| 3933 void Assembler::PatchConstantPoolAccessInstruction( | 3941 void Assembler::PatchConstantPoolAccessInstruction( |
| 3934 int pc_offset, int offset, ConstantPoolEntry::Access access, | 3942 int pc_offset, int offset, ConstantPoolEntry::Access access, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3981 DCHECK(is_uint12(offset)); | 3989 DCHECK(is_uint12(offset)); |
| 3982 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); | 3990 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); |
| 3983 } | 3991 } |
| 3984 } | 3992 } |
| 3985 | 3993 |
| 3986 | 3994 |
| 3987 } // namespace internal | 3995 } // namespace internal |
| 3988 } // namespace v8 | 3996 } // namespace v8 |
| 3989 | 3997 |
| 3990 #endif // V8_TARGET_ARCH_ARM | 3998 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |