| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 generating_stub_(false), | 45 generating_stub_(false), |
| 46 allow_stub_calls_(true), | 46 allow_stub_calls_(true), |
| 47 has_frame_(false) { | 47 has_frame_(false) { |
| 48 if (isolate() != NULL) { | 48 if (isolate() != NULL) { |
| 49 code_object_ = Handle<Object>(isolate()->heap()->undefined_value(), | 49 code_object_ = Handle<Object>(isolate()->heap()->undefined_value(), |
| 50 isolate()); | 50 isolate()); |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 | 53 |
| 54 | 54 |
| 55 void MacroAssembler::AddMemOperand(Register dst, |
| 56 Register src1, |
| 57 const MemOperand& src2, |
| 58 SBit s) { |
| 59 ldr(ip, src2); |
| 60 add(dst, src1, Operand(ip), s); |
| 61 } |
| 62 |
| 63 |
| 64 void MacroAssembler::SubMemOperand(Register dst, |
| 65 Register src1, |
| 66 const MemOperand& src2, |
| 67 SBit s) { |
| 68 ldr(ip, src2); |
| 69 sub(dst, src1, Operand(ip), s); |
| 70 } |
| 71 |
| 72 |
| 73 void MacroAssembler::RsbMemOperand(Register dst, |
| 74 Register src1, |
| 75 const MemOperand& src2, |
| 76 SBit s) { |
| 77 ldr(ip, src2); |
| 78 rsb(dst, src1, Operand(ip), s); |
| 79 } |
| 80 |
| 81 |
| 82 void MacroAssembler::AndMemOperand(Register dst, |
| 83 Register src1, |
| 84 const MemOperand& src2, |
| 85 SBit s) { |
| 86 ldr(ip, src2); |
| 87 and_(dst, src1, Operand(ip), s); |
| 88 } |
| 89 |
| 90 |
| 91 void MacroAssembler::OrrMemOperand(Register dst, |
| 92 Register src1, |
| 93 const MemOperand& src2, |
| 94 SBit s) { |
| 95 ldr(ip, src2); |
| 96 orr(dst, src1, Operand(ip), s); |
| 97 } |
| 98 |
| 99 |
| 100 void MacroAssembler::EorMemOperand(Register dst, |
| 101 Register src1, |
| 102 const MemOperand& src2, |
| 103 SBit s) { |
| 104 ldr(ip, src2); |
| 105 eor(dst, src1, Operand(ip), s); |
| 106 } |
| 107 |
| 108 |
| 55 void MacroAssembler::Jump(Register target, Condition cond) { | 109 void MacroAssembler::Jump(Register target, Condition cond) { |
| 56 bx(target, cond); | 110 bx(target, cond); |
| 57 } | 111 } |
| 58 | 112 |
| 59 | 113 |
| 60 void MacroAssembler::Jump(intptr_t target, RelocInfo::Mode rmode, | 114 void MacroAssembler::Jump(intptr_t target, RelocInfo::Mode rmode, |
| 61 Condition cond) { | 115 Condition cond) { |
| 62 mov(ip, Operand(target, rmode)); | 116 mov(ip, Operand(target, rmode)); |
| 63 bx(ip, cond); | 117 bx(ip, cond); |
| 64 } | 118 } |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 // If needed, restore wanted bits of FPSCR. | 780 // If needed, restore wanted bits of FPSCR. |
| 727 Label fpscr_done; | 781 Label fpscr_done; |
| 728 vmrs(scratch); | 782 vmrs(scratch); |
| 729 tst(scratch, Operand(kVFPDefaultNaNModeControlBit)); | 783 tst(scratch, Operand(kVFPDefaultNaNModeControlBit)); |
| 730 b(ne, &fpscr_done); | 784 b(ne, &fpscr_done); |
| 731 orr(scratch, scratch, Operand(kVFPDefaultNaNModeControlBit)); | 785 orr(scratch, scratch, Operand(kVFPDefaultNaNModeControlBit)); |
| 732 vmsr(scratch); | 786 vmsr(scratch); |
| 733 bind(&fpscr_done); | 787 bind(&fpscr_done); |
| 734 } | 788 } |
| 735 | 789 |
| 736 void MacroAssembler::VFPCanonicalizeNaN(const DwVfpRegister value, | 790 void MacroAssembler::VFPCanonicalizeNaN(const DwVfpRegister result, |
| 791 const DwVfpRegister value, |
| 737 const Condition cond) { | 792 const Condition cond) { |
| 738 vsub(value, value, kDoubleRegZero, cond); | 793 vsub(result, value, kDoubleRegZero, cond); |
| 739 } | 794 } |
| 740 | 795 |
| 741 | 796 |
| 742 void MacroAssembler::VFPCompareAndSetFlags(const DwVfpRegister src1, | 797 void MacroAssembler::VFPCompareAndSetFlags(const DwVfpRegister src1, |
| 743 const DwVfpRegister src2, | 798 const DwVfpRegister src2, |
| 744 const Condition cond) { | 799 const Condition cond) { |
| 745 // Compare and move FPSCR flags to the normal condition flags. | 800 // Compare and move FPSCR flags to the normal condition flags. |
| 746 VFPCompareAndLoadFlags(src1, src2, pc, cond); | 801 VFPCompareAndLoadFlags(src1, src2, pc, cond); |
| 747 } | 802 } |
| 748 | 803 |
| (...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2050 Heap::kSlicedAsciiStringMapRootIndex, | 2105 Heap::kSlicedAsciiStringMapRootIndex, |
| 2051 scratch1, | 2106 scratch1, |
| 2052 scratch2); | 2107 scratch2); |
| 2053 } | 2108 } |
| 2054 | 2109 |
| 2055 | 2110 |
| 2056 void MacroAssembler::CompareObjectType(Register object, | 2111 void MacroAssembler::CompareObjectType(Register object, |
| 2057 Register map, | 2112 Register map, |
| 2058 Register type_reg, | 2113 Register type_reg, |
| 2059 InstanceType type) { | 2114 InstanceType type) { |
| 2115 const Register temp = type_reg.is(no_reg) ? ip : type_reg; |
| 2116 |
| 2060 ldr(map, FieldMemOperand(object, HeapObject::kMapOffset)); | 2117 ldr(map, FieldMemOperand(object, HeapObject::kMapOffset)); |
| 2061 CompareInstanceType(map, type_reg, type); | 2118 CompareInstanceType(map, temp, type); |
| 2062 } | 2119 } |
| 2063 | 2120 |
| 2064 | 2121 |
| 2122 void MacroAssembler::CheckObjectTypeRange(Register object, |
| 2123 Register map, |
| 2124 InstanceType min_type, |
| 2125 InstanceType max_type, |
| 2126 Label* false_label) { |
| 2127 STATIC_ASSERT(Map::kInstanceTypeOffset < 4096); |
| 2128 STATIC_ASSERT(LAST_TYPE < 256); |
| 2129 ldr(map, FieldMemOperand(object, HeapObject::kMapOffset)); |
| 2130 ldrb(ip, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 2131 sub(ip, ip, Operand(min_type)); |
| 2132 cmp(ip, Operand(max_type - min_type)); |
| 2133 b(hi, false_label); |
| 2134 } |
| 2135 |
| 2136 |
| 2065 void MacroAssembler::CompareInstanceType(Register map, | 2137 void MacroAssembler::CompareInstanceType(Register map, |
| 2066 Register type_reg, | 2138 Register type_reg, |
| 2067 InstanceType type) { | 2139 InstanceType type) { |
| 2068 ldrb(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 2140 ldrb(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 2069 cmp(type_reg, Operand(type)); | 2141 cmp(type_reg, Operand(type)); |
| 2070 } | 2142 } |
| 2071 | 2143 |
| 2072 | 2144 |
| 2073 void MacroAssembler::CompareRoot(Register obj, | 2145 void MacroAssembler::CompareRoot(Register obj, |
| 2074 Heap::RootListIndex index) { | 2146 Heap::RootListIndex index) { |
| (...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3888 void CodePatcher::EmitCondition(Condition cond) { | 3960 void CodePatcher::EmitCondition(Condition cond) { |
| 3889 Instr instr = Assembler::instr_at(masm_.pc_); | 3961 Instr instr = Assembler::instr_at(masm_.pc_); |
| 3890 instr = (instr & ~kCondMask) | cond; | 3962 instr = (instr & ~kCondMask) | cond; |
| 3891 masm_.emit(instr); | 3963 masm_.emit(instr); |
| 3892 } | 3964 } |
| 3893 | 3965 |
| 3894 | 3966 |
| 3895 } } // namespace v8::internal | 3967 } } // namespace v8::internal |
| 3896 | 3968 |
| 3897 #endif // V8_TARGET_ARCH_ARM | 3969 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |