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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 void ElementsTransitionGenerator::GenerateDoubleToObject( | 555 void ElementsTransitionGenerator::GenerateDoubleToObject( |
556 MacroAssembler* masm, AllocationSiteMode mode, Label* fail) { | 556 MacroAssembler* masm, AllocationSiteMode mode, Label* fail) { |
557 // ----------- S t a t e ------------- | 557 // ----------- S t a t e ------------- |
558 // -- r0 : value | 558 // -- r0 : value |
559 // -- r1 : key | 559 // -- r1 : key |
560 // -- r2 : receiver | 560 // -- r2 : receiver |
561 // -- lr : return address | 561 // -- lr : return address |
562 // -- r3 : target map, scratch for subsequent call | 562 // -- r3 : target map, scratch for subsequent call |
563 // -- r4 : scratch (elements) | 563 // -- r4 : scratch (elements) |
564 // ----------------------------------- | 564 // ----------------------------------- |
565 Label entry, loop, convert_hole, gc_required, gc_cleanup, only_change_map; | 565 Label entry, loop, convert_hole, gc_required, only_change_map; |
566 | 566 |
567 if (mode == TRACK_ALLOCATION_SITE) { | 567 if (mode == TRACK_ALLOCATION_SITE) { |
568 __ JumpIfJSArrayHasAllocationMemento(r2, r4, fail); | 568 __ JumpIfJSArrayHasAllocationMemento(r2, r4, fail); |
569 } | 569 } |
570 | 570 |
571 // Check for empty arrays, which only require a map transition and no changes | 571 // Check for empty arrays, which only require a map transition and no changes |
572 // to the backing store. | 572 // to the backing store. |
573 __ ldr(r4, FieldMemOperand(r2, JSObject::kElementsOffset)); | 573 __ ldr(r4, FieldMemOperand(r2, JSObject::kElementsOffset)); |
574 __ CompareRoot(r4, Heap::kEmptyFixedArrayRootIndex); | 574 __ CompareRoot(r4, Heap::kEmptyFixedArrayRootIndex); |
575 __ b(eq, &only_change_map); | 575 __ b(eq, &only_change_map); |
(...skipping 21 matching lines...) Expand all Loading... |
597 __ add(r5, r3, Operand(r5, LSL, 1)); | 597 __ add(r5, r3, Operand(r5, LSL, 1)); |
598 __ LoadRoot(r9, Heap::kHeapNumberMapRootIndex); | 598 __ LoadRoot(r9, Heap::kHeapNumberMapRootIndex); |
599 // Using offsetted addresses in r4 to fully take advantage of post-indexing. | 599 // Using offsetted addresses in r4 to fully take advantage of post-indexing. |
600 // r3: begin of destination FixedArray element fields, not tagged | 600 // r3: begin of destination FixedArray element fields, not tagged |
601 // r4: begin of source FixedDoubleArray element fields, not tagged, +4 | 601 // r4: begin of source FixedDoubleArray element fields, not tagged, +4 |
602 // r5: end of destination FixedArray, not tagged | 602 // r5: end of destination FixedArray, not tagged |
603 // r6: destination FixedArray | 603 // r6: destination FixedArray |
604 // r9: heap number map | 604 // r9: heap number map |
605 __ b(&entry); | 605 __ b(&entry); |
606 | 606 |
607 __ bind(&gc_cleanup); | |
608 #ifdef VERIFY_HEAP | |
609 // Make sure new space is iterable if we are verifying the heap. | |
610 __ mov(r0, Operand(masm->isolate()->factory()->one_pointer_filler_map())); | |
611 __ str(r0, MemOperand(r3, 4, PostIndex)); | |
612 __ cmp(r3, r5); | |
613 __ b(lt, &gc_cleanup); | |
614 #endif | |
615 | |
616 // Call into runtime if GC is required. | 607 // Call into runtime if GC is required. |
617 __ bind(&gc_required); | 608 __ bind(&gc_required); |
618 __ Pop(r3, r2, r1, r0); | 609 __ Pop(r3, r2, r1, r0); |
619 __ pop(lr); | 610 __ pop(lr); |
620 __ b(fail); | 611 __ b(fail); |
621 | 612 |
622 __ bind(&loop); | 613 __ bind(&loop); |
623 __ ldr(r1, MemOperand(r4, 8, PostIndex)); | 614 __ ldr(r1, MemOperand(r4, 8, PostIndex)); |
624 // r1: current element's upper 32 bit | 615 // r1: current element's upper 32 bit |
625 // r4: address of next element's upper 32 bit | 616 // r4: address of next element's upper 32 bit |
626 __ cmp(r1, Operand(kHoleNanUpper32)); | 617 __ cmp(r1, Operand(kHoleNanUpper32)); |
627 __ b(eq, &convert_hole); | 618 __ b(eq, &convert_hole); |
628 | 619 |
629 // Non-hole double, copy value into a heap number. | 620 // Non-hole double, copy value into a heap number. |
630 __ AllocateHeapNumber(r2, r0, lr, r9, &gc_cleanup); | 621 __ AllocateHeapNumber(r2, r0, lr, r9, &gc_required); |
631 // r2: new heap number | 622 // r2: new heap number |
632 __ ldr(r0, MemOperand(r4, 12, NegOffset)); | 623 __ ldr(r0, MemOperand(r4, 12, NegOffset)); |
633 __ Strd(r0, r1, FieldMemOperand(r2, HeapNumber::kValueOffset)); | 624 __ Strd(r0, r1, FieldMemOperand(r2, HeapNumber::kValueOffset)); |
634 __ mov(r0, r3); | 625 __ mov(r0, r3); |
635 __ str(r2, MemOperand(r3, 4, PostIndex)); | 626 __ str(r2, MemOperand(r3, 4, PostIndex)); |
636 __ RecordWrite(r6, | 627 __ RecordWrite(r6, |
637 r0, | 628 r0, |
638 r2, | 629 r2, |
639 kLRHasBeenSaved, | 630 kLRHasBeenSaved, |
640 kDontSaveFPRegs, | 631 kDontSaveFPRegs, |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 patcher.masm()->add(r0, pc, Operand(-8)); | 911 patcher.masm()->add(r0, pc, Operand(-8)); |
921 patcher.masm()->ldr(pc, MemOperand(pc, -4)); | 912 patcher.masm()->ldr(pc, MemOperand(pc, -4)); |
922 patcher.masm()->emit_code_stub_address(stub); | 913 patcher.masm()->emit_code_stub_address(stub); |
923 } | 914 } |
924 } | 915 } |
925 | 916 |
926 | 917 |
927 } } // namespace v8::internal | 918 } } // namespace v8::internal |
928 | 919 |
929 #endif // V8_TARGET_ARCH_ARM | 920 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |