| 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 1753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1764 TAG_OBJECT); | 1764 TAG_OBJECT); |
| 1765 | 1765 |
| 1766 InitializeNewString(result, | 1766 InitializeNewString(result, |
| 1767 length, | 1767 length, |
| 1768 Heap::kConsAsciiStringMapRootIndex, | 1768 Heap::kConsAsciiStringMapRootIndex, |
| 1769 scratch1, | 1769 scratch1, |
| 1770 scratch2); | 1770 scratch2); |
| 1771 } | 1771 } |
| 1772 | 1772 |
| 1773 | 1773 |
| 1774 void MacroAssembler::AllocateTwoByteSlicedString(Register result, |
| 1775 Register length, |
| 1776 Register scratch1, |
| 1777 Register scratch2, |
| 1778 Label* gc_required) { |
| 1779 AllocateInNewSpace(SlicedString::kSize, |
| 1780 result, |
| 1781 scratch1, |
| 1782 scratch2, |
| 1783 gc_required, |
| 1784 TAG_OBJECT); |
| 1785 |
| 1786 InitializeNewString(result, |
| 1787 length, |
| 1788 Heap::kSlicedStringMapRootIndex, |
| 1789 scratch1, |
| 1790 scratch2); |
| 1791 } |
| 1792 |
| 1793 |
| 1794 void MacroAssembler::AllocateAsciiSlicedString(Register result, |
| 1795 Register length, |
| 1796 Register scratch1, |
| 1797 Register scratch2, |
| 1798 Label* gc_required) { |
| 1799 AllocateInNewSpace(SlicedString::kSize, |
| 1800 result, |
| 1801 scratch1, |
| 1802 scratch2, |
| 1803 gc_required, |
| 1804 TAG_OBJECT); |
| 1805 |
| 1806 InitializeNewString(result, |
| 1807 length, |
| 1808 Heap::kSlicedAsciiStringMapRootIndex, |
| 1809 scratch1, |
| 1810 scratch2); |
| 1811 } |
| 1812 |
| 1813 |
| 1774 void MacroAssembler::CompareObjectType(Register object, | 1814 void MacroAssembler::CompareObjectType(Register object, |
| 1775 Register map, | 1815 Register map, |
| 1776 Register type_reg, | 1816 Register type_reg, |
| 1777 InstanceType type) { | 1817 InstanceType type) { |
| 1778 ldr(map, FieldMemOperand(object, HeapObject::kMapOffset)); | 1818 ldr(map, FieldMemOperand(object, HeapObject::kMapOffset)); |
| 1779 CompareInstanceType(map, type_reg, type); | 1819 CompareInstanceType(map, type_reg, type); |
| 1780 } | 1820 } |
| 1781 | 1821 |
| 1782 | 1822 |
| 1783 void MacroAssembler::CompareInstanceType(Register map, | 1823 void MacroAssembler::CompareInstanceType(Register map, |
| (...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3245 // Detect some, but not all, common pointer-free objects. This is used by the | 3285 // Detect some, but not all, common pointer-free objects. This is used by the |
| 3246 // incremental write barrier which doesn't care about oddballs (they are always | 3286 // incremental write barrier which doesn't care about oddballs (they are always |
| 3247 // marked black immediately so this code is not hit). | 3287 // marked black immediately so this code is not hit). |
| 3248 void MacroAssembler::JumpIfDataObject(Register value, | 3288 void MacroAssembler::JumpIfDataObject(Register value, |
| 3249 Register scratch, | 3289 Register scratch, |
| 3250 Label* not_data_object) { | 3290 Label* not_data_object) { |
| 3251 Label is_data_object; | 3291 Label is_data_object; |
| 3252 ldr(scratch, FieldMemOperand(value, HeapObject::kMapOffset)); | 3292 ldr(scratch, FieldMemOperand(value, HeapObject::kMapOffset)); |
| 3253 CompareRoot(scratch, Heap::kHeapNumberMapRootIndex); | 3293 CompareRoot(scratch, Heap::kHeapNumberMapRootIndex); |
| 3254 b(eq, &is_data_object); | 3294 b(eq, &is_data_object); |
| 3255 ASSERT(kConsStringTag == 1 && kIsConsStringMask == 1); | 3295 ASSERT(kIsIndirectStringTag == 1 && kIsIndirectStringMask == 1); |
| 3256 ASSERT(kNotStringTag == 0x80 && kIsNotStringMask == 0x80); | 3296 ASSERT(kNotStringTag == 0x80 && kIsNotStringMask == 0x80); |
| 3257 // If it's a string and it's not a cons string then it's an object containing | 3297 // If it's a string and it's not a cons string then it's an object containing |
| 3258 // no GC pointers. | 3298 // no GC pointers. |
| 3259 ldrb(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); | 3299 ldrb(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); |
| 3260 tst(scratch, Operand(kIsConsStringMask | kIsNotStringMask)); | 3300 tst(scratch, Operand(kIsIndirectStringMask | kIsNotStringMask)); |
| 3261 b(ne, not_data_object); | 3301 b(ne, not_data_object); |
| 3262 bind(&is_data_object); | 3302 bind(&is_data_object); |
| 3263 } | 3303 } |
| 3264 | 3304 |
| 3265 | 3305 |
| 3266 void MacroAssembler::GetMarkBits(Register addr_reg, | 3306 void MacroAssembler::GetMarkBits(Register addr_reg, |
| 3267 Register bitmap_reg, | 3307 Register bitmap_reg, |
| 3268 Register mask_reg) { | 3308 Register mask_reg) { |
| 3269 ASSERT(!AreAliased(addr_reg, bitmap_reg, mask_reg, no_reg)); | 3309 ASSERT(!AreAliased(addr_reg, bitmap_reg, mask_reg, no_reg)); |
| 3270 and_(bitmap_reg, addr_reg, Operand(~Page::kPageAlignmentMask)); | 3310 and_(bitmap_reg, addr_reg, Operand(~Page::kPageAlignmentMask)); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3316 Register length = load_scratch; // Holds length of object after testing type. | 3356 Register length = load_scratch; // Holds length of object after testing type. |
| 3317 Label is_data_object; | 3357 Label is_data_object; |
| 3318 | 3358 |
| 3319 // Check for heap-number | 3359 // Check for heap-number |
| 3320 ldr(map, FieldMemOperand(value, HeapObject::kMapOffset)); | 3360 ldr(map, FieldMemOperand(value, HeapObject::kMapOffset)); |
| 3321 CompareRoot(map, Heap::kHeapNumberMapRootIndex); | 3361 CompareRoot(map, Heap::kHeapNumberMapRootIndex); |
| 3322 mov(length, Operand(HeapNumber::kSize), LeaveCC, eq); | 3362 mov(length, Operand(HeapNumber::kSize), LeaveCC, eq); |
| 3323 b(eq, &is_data_object); | 3363 b(eq, &is_data_object); |
| 3324 | 3364 |
| 3325 // Check for strings. | 3365 // Check for strings. |
| 3326 ASSERT(kConsStringTag == 1 && kIsConsStringMask == 1); | 3366 ASSERT(kIsIndirectStringTag == 1 && kIsIndirectStringMask == 1); |
| 3327 ASSERT(kNotStringTag == 0x80 && kIsNotStringMask == 0x80); | 3367 ASSERT(kNotStringTag == 0x80 && kIsNotStringMask == 0x80); |
| 3328 // If it's a string and it's not a cons string then it's an object containing | 3368 // If it's a string and it's not a cons string then it's an object containing |
| 3329 // no GC pointers. | 3369 // no GC pointers. |
| 3330 Register instance_type = load_scratch; | 3370 Register instance_type = load_scratch; |
| 3331 ldrb(instance_type, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 3371 ldrb(instance_type, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 3332 tst(instance_type, Operand(kIsConsStringMask | kIsNotStringMask)); | 3372 tst(instance_type, Operand(kIsIndirectStringMask | kIsNotStringMask)); |
| 3333 b(ne, value_is_white_and_not_data); | 3373 b(ne, value_is_white_and_not_data); |
| 3334 // It's a non-cons string. | 3374 // It's a non-indirect (non-cons and non-slice) string. |
| 3335 // If it's external, the length is just ExternalString::kSize. | 3375 // If it's external, the length is just ExternalString::kSize. |
| 3336 // Otherwise it's String::kHeaderSize + string->length() * (1 or 2). | 3376 // Otherwise it's String::kHeaderSize + string->length() * (1 or 2). |
| 3337 // External strings are the only ones with the kExternalStringTag bit | 3377 // External strings are the only ones with the kExternalStringTag bit |
| 3338 // set. | 3378 // set. |
| 3339 ASSERT_EQ(0, kSeqStringTag & kExternalStringTag); | 3379 ASSERT_EQ(0, kSeqStringTag & kExternalStringTag); |
| 3340 ASSERT_EQ(0, kConsStringTag & kExternalStringTag); | 3380 ASSERT_EQ(0, kConsStringTag & kExternalStringTag); |
| 3341 tst(instance_type, Operand(kExternalStringTag)); | 3381 tst(instance_type, Operand(kExternalStringTag)); |
| 3342 mov(length, Operand(ExternalString::kSize), LeaveCC, ne); | 3382 mov(length, Operand(ExternalString::kSize), LeaveCC, ne); |
| 3343 b(ne, &is_data_object); | 3383 b(ne, &is_data_object); |
| 3344 | 3384 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3465 void CodePatcher::EmitCondition(Condition cond) { | 3505 void CodePatcher::EmitCondition(Condition cond) { |
| 3466 Instr instr = Assembler::instr_at(masm_.pc_); | 3506 Instr instr = Assembler::instr_at(masm_.pc_); |
| 3467 instr = (instr & ~kCondMask) | cond; | 3507 instr = (instr & ~kCondMask) | cond; |
| 3468 masm_.emit(instr); | 3508 masm_.emit(instr); |
| 3469 } | 3509 } |
| 3470 | 3510 |
| 3471 | 3511 |
| 3472 } } // namespace v8::internal | 3512 } } // namespace v8::internal |
| 3473 | 3513 |
| 3474 #endif // V8_TARGET_ARCH_ARM | 3514 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |