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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 Condition cond) { | 323 Condition cond) { |
324 if (!src2.is_reg() && | 324 if (!src2.is_reg() && |
325 !src2.must_use_constant_pool() && | 325 !src2.must_use_constant_pool() && |
326 src2.immediate() == 0) { | 326 src2.immediate() == 0) { |
327 mov(dst, Operand(0, RelocInfo::NONE), LeaveCC, cond); | 327 mov(dst, Operand(0, RelocInfo::NONE), LeaveCC, cond); |
328 | 328 |
329 } else if (!src2.is_single_instruction() && | 329 } else if (!src2.is_single_instruction() && |
330 !src2.must_use_constant_pool() && | 330 !src2.must_use_constant_pool() && |
331 CpuFeatures::IsSupported(ARMv7) && | 331 CpuFeatures::IsSupported(ARMv7) && |
332 IsPowerOf2(src2.immediate() + 1)) { | 332 IsPowerOf2(src2.immediate() + 1)) { |
333 ubfx(dst, src1, 0, WhichPowerOf2(src2.immediate() + 1), cond); | 333 ubfx(dst, src1, 0, |
| 334 WhichPowerOf2(static_cast<uint32_t>(src2.immediate()) + 1), cond); |
334 | 335 |
335 } else { | 336 } else { |
336 and_(dst, src1, src2, LeaveCC, cond); | 337 and_(dst, src1, src2, LeaveCC, cond); |
337 } | 338 } |
338 } | 339 } |
339 | 340 |
340 | 341 |
341 void MacroAssembler::Ubfx(Register dst, Register src1, int lsb, int width, | 342 void MacroAssembler::Ubfx(Register dst, Register src1, int lsb, int width, |
342 Condition cond) { | 343 Condition cond) { |
343 ASSERT(lsb < 32); | 344 ASSERT(lsb < 32); |
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1670 | 1671 |
1671 | 1672 |
1672 void MacroAssembler::CompareRoot(Register obj, | 1673 void MacroAssembler::CompareRoot(Register obj, |
1673 Heap::RootListIndex index) { | 1674 Heap::RootListIndex index) { |
1674 ASSERT(!obj.is(ip)); | 1675 ASSERT(!obj.is(ip)); |
1675 LoadRoot(ip, index); | 1676 LoadRoot(ip, index); |
1676 cmp(obj, ip); | 1677 cmp(obj, ip); |
1677 } | 1678 } |
1678 | 1679 |
1679 | 1680 |
| 1681 void MacroAssembler::CheckFastElements(Register map, |
| 1682 Register scratch, |
| 1683 Label* fail) { |
| 1684 STATIC_ASSERT(JSObject::FAST_ELEMENTS == 0); |
| 1685 ldrb(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 1686 cmp(scratch, Operand(Map::kMaximumBitField2FastElementValue)); |
| 1687 b(hi, fail); |
| 1688 } |
| 1689 |
| 1690 |
1680 void MacroAssembler::CheckMap(Register obj, | 1691 void MacroAssembler::CheckMap(Register obj, |
1681 Register scratch, | 1692 Register scratch, |
1682 Handle<Map> map, | 1693 Handle<Map> map, |
1683 Label* fail, | 1694 Label* fail, |
1684 SmiCheckType smi_check_type) { | 1695 SmiCheckType smi_check_type) { |
1685 if (smi_check_type == DO_SMI_CHECK) { | 1696 if (smi_check_type == DO_SMI_CHECK) { |
1686 JumpIfSmi(obj, fail); | 1697 JumpIfSmi(obj, fail); |
1687 } | 1698 } |
1688 ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset)); | 1699 ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset)); |
1689 mov(ip, Operand(map)); | 1700 mov(ip, Operand(map)); |
(...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3157 void CodePatcher::EmitCondition(Condition cond) { | 3168 void CodePatcher::EmitCondition(Condition cond) { |
3158 Instr instr = Assembler::instr_at(masm_.pc_); | 3169 Instr instr = Assembler::instr_at(masm_.pc_); |
3159 instr = (instr & ~kCondMask) | cond; | 3170 instr = (instr & ~kCondMask) | cond; |
3160 masm_.emit(instr); | 3171 masm_.emit(instr); |
3161 } | 3172 } |
3162 | 3173 |
3163 | 3174 |
3164 } } // namespace v8::internal | 3175 } } // namespace v8::internal |
3165 | 3176 |
3166 #endif // V8_TARGET_ARCH_ARM | 3177 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |