OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 } | 171 } |
172 | 172 |
173 | 173 |
174 void MacroAssembler::Drop(int count, Condition cond) { | 174 void MacroAssembler::Drop(int count, Condition cond) { |
175 if (count > 0) { | 175 if (count > 0) { |
176 add(sp, sp, Operand(count * kPointerSize), LeaveCC, cond); | 176 add(sp, sp, Operand(count * kPointerSize), LeaveCC, cond); |
177 } | 177 } |
178 } | 178 } |
179 | 179 |
180 | 180 |
| 181 void MacroAssembler::Ret(int drop, Condition cond) { |
| 182 Drop(drop, cond); |
| 183 Ret(cond); |
| 184 } |
| 185 |
| 186 |
181 void MacroAssembler::Swap(Register reg1, | 187 void MacroAssembler::Swap(Register reg1, |
182 Register reg2, | 188 Register reg2, |
183 Register scratch, | 189 Register scratch, |
184 Condition cond) { | 190 Condition cond) { |
185 if (scratch.is(no_reg)) { | 191 if (scratch.is(no_reg)) { |
186 eor(reg1, reg1, Operand(reg2), LeaveCC, cond); | 192 eor(reg1, reg1, Operand(reg2), LeaveCC, cond); |
187 eor(reg2, reg2, Operand(reg1), LeaveCC, cond); | 193 eor(reg2, reg2, Operand(reg1), LeaveCC, cond); |
188 eor(reg1, reg1, Operand(reg2), LeaveCC, cond); | 194 eor(reg1, reg1, Operand(reg2), LeaveCC, cond); |
189 } else { | 195 } else { |
190 mov(scratch, reg1, LeaveCC, cond); | 196 mov(scratch, reg1, LeaveCC, cond); |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 // code field in the function to allow recompilation to take effect | 820 // code field in the function to allow recompilation to take effect |
815 // without changing any of the call sites. | 821 // without changing any of the call sites. |
816 ldr(r3, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); | 822 ldr(r3, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); |
817 InvokeCode(r3, expected, actual, flag); | 823 InvokeCode(r3, expected, actual, flag); |
818 } else { | 824 } else { |
819 InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET, flag); | 825 InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET, flag); |
820 } | 826 } |
821 } | 827 } |
822 | 828 |
823 | 829 |
| 830 void MacroAssembler::IsObjectJSObjectType(Register heap_object, |
| 831 Register map, |
| 832 Register scratch, |
| 833 Label* fail) { |
| 834 ldr(map, FieldMemOperand(heap_object, HeapObject::kMapOffset)); |
| 835 IsInstanceJSObjectType(map, scratch, fail); |
| 836 } |
| 837 |
| 838 |
| 839 void MacroAssembler::IsInstanceJSObjectType(Register map, |
| 840 Register scratch, |
| 841 Label* fail) { |
| 842 ldrb(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 843 cmp(scratch, Operand(FIRST_JS_OBJECT_TYPE)); |
| 844 b(lt, fail); |
| 845 cmp(scratch, Operand(LAST_JS_OBJECT_TYPE)); |
| 846 b(gt, fail); |
| 847 } |
| 848 |
| 849 |
| 850 void MacroAssembler::IsObjectJSStringType(Register object, |
| 851 Register scratch, |
| 852 Label* fail) { |
| 853 ASSERT(kNotStringTag != 0); |
| 854 |
| 855 ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); |
| 856 ldrb(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); |
| 857 tst(scratch, Operand(kIsNotStringMask)); |
| 858 b(nz, fail); |
| 859 } |
| 860 |
| 861 |
824 #ifdef ENABLE_DEBUGGER_SUPPORT | 862 #ifdef ENABLE_DEBUGGER_SUPPORT |
825 void MacroAssembler::DebugBreak() { | 863 void MacroAssembler::DebugBreak() { |
826 ASSERT(allow_stub_calls()); | 864 ASSERT(allow_stub_calls()); |
827 mov(r0, Operand(0, RelocInfo::NONE)); | 865 mov(r0, Operand(0, RelocInfo::NONE)); |
828 mov(r1, Operand(ExternalReference(Runtime::kDebugBreak))); | 866 mov(r1, Operand(ExternalReference(Runtime::kDebugBreak))); |
829 CEntryStub ces(1); | 867 CEntryStub ces(1); |
830 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); | 868 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); |
831 } | 869 } |
832 #endif | 870 #endif |
833 | 871 |
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2107 | 2145 |
2108 void CodePatcher::Emit(Address addr) { | 2146 void CodePatcher::Emit(Address addr) { |
2109 masm()->emit(reinterpret_cast<Instr>(addr)); | 2147 masm()->emit(reinterpret_cast<Instr>(addr)); |
2110 } | 2148 } |
2111 #endif // ENABLE_DEBUGGER_SUPPORT | 2149 #endif // ENABLE_DEBUGGER_SUPPORT |
2112 | 2150 |
2113 | 2151 |
2114 } } // namespace v8::internal | 2152 } } // namespace v8::internal |
2115 | 2153 |
2116 #endif // V8_TARGET_ARCH_ARM | 2154 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |