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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 usat(dst, satpos, src, cond); | 311 usat(dst, satpos, src, cond); |
312 } | 312 } |
313 } | 313 } |
314 | 314 |
315 | 315 |
316 void MacroAssembler::SmiJumpTable(Register index, Vector<Label*> targets) { | 316 void MacroAssembler::SmiJumpTable(Register index, Vector<Label*> targets) { |
317 // Empty the const pool. | 317 // Empty the const pool. |
318 CheckConstPool(true, true); | 318 CheckConstPool(true, true); |
319 add(pc, pc, Operand(index, | 319 add(pc, pc, Operand(index, |
320 LSL, | 320 LSL, |
321 assembler::arm::Instr::kInstrSizeLog2 - kSmiTagSize)); | 321 Instruction::kInstrSizeLog2 - kSmiTagSize)); |
322 BlockConstPoolBefore(pc_offset() + (targets.length() + 1) * kInstrSize); | 322 BlockConstPoolBefore(pc_offset() + (targets.length() + 1) * kInstrSize); |
323 nop(); // Jump table alignment. | 323 nop(); // Jump table alignment. |
324 for (int i = 0; i < targets.length(); i++) { | 324 for (int i = 0; i < targets.length(); i++) { |
325 b(targets[i]); | 325 b(targets[i]); |
326 } | 326 } |
327 } | 327 } |
328 | 328 |
329 | 329 |
330 void MacroAssembler::LoadRoot(Register destination, | 330 void MacroAssembler::LoadRoot(Register destination, |
331 Heap::RootListIndex index, | 331 Heap::RootListIndex index, |
(...skipping 30 matching lines...) Expand all Loading... |
362 // Mark region dirty. | 362 // Mark region dirty. |
363 ldr(scratch, MemOperand(object, Page::kDirtyFlagOffset)); | 363 ldr(scratch, MemOperand(object, Page::kDirtyFlagOffset)); |
364 mov(ip, Operand(1)); | 364 mov(ip, Operand(1)); |
365 orr(scratch, scratch, Operand(ip, LSL, address)); | 365 orr(scratch, scratch, Operand(ip, LSL, address)); |
366 str(scratch, MemOperand(object, Page::kDirtyFlagOffset)); | 366 str(scratch, MemOperand(object, Page::kDirtyFlagOffset)); |
367 } | 367 } |
368 | 368 |
369 | 369 |
370 void MacroAssembler::InNewSpace(Register object, | 370 void MacroAssembler::InNewSpace(Register object, |
371 Register scratch, | 371 Register scratch, |
372 Condition cc, | 372 Condition cond, |
373 Label* branch) { | 373 Label* branch) { |
374 ASSERT(cc == eq || cc == ne); | 374 ASSERT(cond == eq || cond == ne); |
375 and_(scratch, object, Operand(ExternalReference::new_space_mask())); | 375 and_(scratch, object, Operand(ExternalReference::new_space_mask())); |
376 cmp(scratch, Operand(ExternalReference::new_space_start())); | 376 cmp(scratch, Operand(ExternalReference::new_space_start())); |
377 b(cc, branch); | 377 b(cond, branch); |
378 } | 378 } |
379 | 379 |
380 | 380 |
381 // Will clobber 4 registers: object, offset, scratch, ip. The | 381 // Will clobber 4 registers: object, offset, scratch, ip. The |
382 // register 'object' contains a heap object pointer. The heap object | 382 // register 'object' contains a heap object pointer. The heap object |
383 // tag is shifted away. | 383 // tag is shifted away. |
384 void MacroAssembler::RecordWrite(Register object, | 384 void MacroAssembler::RecordWrite(Register object, |
385 Operand offset, | 385 Operand offset, |
386 Register scratch0, | 386 Register scratch0, |
387 Register scratch1) { | 387 Register scratch1) { |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 | 926 |
927 | 927 |
928 void MacroAssembler::IsObjectJSStringType(Register object, | 928 void MacroAssembler::IsObjectJSStringType(Register object, |
929 Register scratch, | 929 Register scratch, |
930 Label* fail) { | 930 Label* fail) { |
931 ASSERT(kNotStringTag != 0); | 931 ASSERT(kNotStringTag != 0); |
932 | 932 |
933 ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); | 933 ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); |
934 ldrb(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); | 934 ldrb(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); |
935 tst(scratch, Operand(kIsNotStringMask)); | 935 tst(scratch, Operand(kIsNotStringMask)); |
936 b(nz, fail); | 936 b(ne, fail); |
937 } | 937 } |
938 | 938 |
939 | 939 |
940 #ifdef ENABLE_DEBUGGER_SUPPORT | 940 #ifdef ENABLE_DEBUGGER_SUPPORT |
941 void MacroAssembler::DebugBreak() { | 941 void MacroAssembler::DebugBreak() { |
942 ASSERT(allow_stub_calls()); | 942 ASSERT(allow_stub_calls()); |
943 mov(r0, Operand(0, RelocInfo::NONE)); | 943 mov(r0, Operand(0, RelocInfo::NONE)); |
944 mov(r1, Operand(ExternalReference(Runtime::kDebugBreak))); | 944 mov(r1, Operand(ExternalReference(Runtime::kDebugBreak))); |
945 CEntryStub ces(1); | 945 CEntryStub ces(1); |
946 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); | 946 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1806 ASSERT(value > 0); | 1806 ASSERT(value > 0); |
1807 if (FLAG_native_code_counters && counter->Enabled()) { | 1807 if (FLAG_native_code_counters && counter->Enabled()) { |
1808 mov(scratch2, Operand(ExternalReference(counter))); | 1808 mov(scratch2, Operand(ExternalReference(counter))); |
1809 ldr(scratch1, MemOperand(scratch2)); | 1809 ldr(scratch1, MemOperand(scratch2)); |
1810 sub(scratch1, scratch1, Operand(value)); | 1810 sub(scratch1, scratch1, Operand(value)); |
1811 str(scratch1, MemOperand(scratch2)); | 1811 str(scratch1, MemOperand(scratch2)); |
1812 } | 1812 } |
1813 } | 1813 } |
1814 | 1814 |
1815 | 1815 |
1816 void MacroAssembler::Assert(Condition cc, const char* msg) { | 1816 void MacroAssembler::Assert(Condition cond, const char* msg) { |
1817 if (FLAG_debug_code) | 1817 if (FLAG_debug_code) |
1818 Check(cc, msg); | 1818 Check(cond, msg); |
1819 } | 1819 } |
1820 | 1820 |
1821 | 1821 |
1822 void MacroAssembler::AssertRegisterIsRoot(Register reg, | 1822 void MacroAssembler::AssertRegisterIsRoot(Register reg, |
1823 Heap::RootListIndex index) { | 1823 Heap::RootListIndex index) { |
1824 if (FLAG_debug_code) { | 1824 if (FLAG_debug_code) { |
1825 LoadRoot(ip, index); | 1825 LoadRoot(ip, index); |
1826 cmp(reg, ip); | 1826 cmp(reg, ip); |
1827 Check(eq, "Register did not match expected root"); | 1827 Check(eq, "Register did not match expected root"); |
1828 } | 1828 } |
(...skipping 12 matching lines...) Expand all Loading... |
1841 LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex); | 1841 LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex); |
1842 cmp(elements, ip); | 1842 cmp(elements, ip); |
1843 b(eq, &ok); | 1843 b(eq, &ok); |
1844 Abort("JSObject with fast elements map has slow elements"); | 1844 Abort("JSObject with fast elements map has slow elements"); |
1845 bind(&ok); | 1845 bind(&ok); |
1846 pop(elements); | 1846 pop(elements); |
1847 } | 1847 } |
1848 } | 1848 } |
1849 | 1849 |
1850 | 1850 |
1851 void MacroAssembler::Check(Condition cc, const char* msg) { | 1851 void MacroAssembler::Check(Condition cond, const char* msg) { |
1852 Label L; | 1852 Label L; |
1853 b(cc, &L); | 1853 b(cond, &L); |
1854 Abort(msg); | 1854 Abort(msg); |
1855 // will not return here | 1855 // will not return here |
1856 bind(&L); | 1856 bind(&L); |
1857 } | 1857 } |
1858 | 1858 |
1859 | 1859 |
1860 void MacroAssembler::Abort(const char* msg) { | 1860 void MacroAssembler::Abort(const char* msg) { |
1861 Label abort_start; | 1861 Label abort_start; |
1862 bind(&abort_start); | 1862 bind(&abort_start); |
1863 // We want to pass the msg string like a smi to avoid GC | 1863 // We want to pass the msg string like a smi to avoid GC |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2252 | 2252 |
2253 void CodePatcher::Emit(Address addr) { | 2253 void CodePatcher::Emit(Address addr) { |
2254 masm()->emit(reinterpret_cast<Instr>(addr)); | 2254 masm()->emit(reinterpret_cast<Instr>(addr)); |
2255 } | 2255 } |
2256 #endif // ENABLE_DEBUGGER_SUPPORT | 2256 #endif // ENABLE_DEBUGGER_SUPPORT |
2257 | 2257 |
2258 | 2258 |
2259 } } // namespace v8::internal | 2259 } } // namespace v8::internal |
2260 | 2260 |
2261 #endif // V8_TARGET_ARCH_ARM | 2261 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |