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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 #undef __ | 644 #undef __ |
645 | 645 |
646 // ------------------------------------------------------------------------- | 646 // ------------------------------------------------------------------------- |
647 // Code generators | 647 // Code generators |
648 | 648 |
649 #define __ ACCESS_MASM(masm) | 649 #define __ ACCESS_MASM(masm) |
650 | 650 |
651 | 651 |
652 void ElementsTransitionGenerator::GenerateMapChangeElementsTransition( | 652 void ElementsTransitionGenerator::GenerateMapChangeElementsTransition( |
653 MacroAssembler* masm, AllocationSiteMode mode, | 653 MacroAssembler* masm, AllocationSiteMode mode, |
654 Label* allocation_site_info_found) { | 654 Label* allocation_memento_found) { |
655 // ----------- S t a t e ------------- | 655 // ----------- S t a t e ------------- |
656 // -- eax : value | 656 // -- eax : value |
657 // -- ebx : target map | 657 // -- ebx : target map |
658 // -- ecx : key | 658 // -- ecx : key |
659 // -- edx : receiver | 659 // -- edx : receiver |
660 // -- esp[0] : return address | 660 // -- esp[0] : return address |
661 // ----------------------------------- | 661 // ----------------------------------- |
662 if (mode == TRACK_ALLOCATION_SITE) { | 662 if (mode == TRACK_ALLOCATION_SITE) { |
663 ASSERT(allocation_site_info_found != NULL); | 663 ASSERT(allocation_memento_found != NULL); |
664 __ TestJSArrayForAllocationSiteInfo(edx, edi); | 664 __ TestJSArrayForAllocationMemento(edx, edi); |
665 __ j(equal, allocation_site_info_found); | 665 __ j(equal, allocation_memento_found); |
666 } | 666 } |
667 | 667 |
668 // Set transitioned map. | 668 // Set transitioned map. |
669 __ mov(FieldOperand(edx, HeapObject::kMapOffset), ebx); | 669 __ mov(FieldOperand(edx, HeapObject::kMapOffset), ebx); |
670 __ RecordWriteField(edx, | 670 __ RecordWriteField(edx, |
671 HeapObject::kMapOffset, | 671 HeapObject::kMapOffset, |
672 ebx, | 672 ebx, |
673 edi, | 673 edi, |
674 kDontSaveFPRegs, | 674 kDontSaveFPRegs, |
675 EMIT_REMEMBERED_SET, | 675 EMIT_REMEMBERED_SET, |
676 OMIT_SMI_CHECK); | 676 OMIT_SMI_CHECK); |
677 } | 677 } |
678 | 678 |
679 | 679 |
680 void ElementsTransitionGenerator::GenerateSmiToDouble( | 680 void ElementsTransitionGenerator::GenerateSmiToDouble( |
681 MacroAssembler* masm, AllocationSiteMode mode, Label* fail) { | 681 MacroAssembler* masm, AllocationSiteMode mode, Label* fail) { |
682 // ----------- S t a t e ------------- | 682 // ----------- S t a t e ------------- |
683 // -- eax : value | 683 // -- eax : value |
684 // -- ebx : target map | 684 // -- ebx : target map |
685 // -- ecx : key | 685 // -- ecx : key |
686 // -- edx : receiver | 686 // -- edx : receiver |
687 // -- esp[0] : return address | 687 // -- esp[0] : return address |
688 // ----------------------------------- | 688 // ----------------------------------- |
689 Label loop, entry, convert_hole, gc_required, only_change_map; | 689 Label loop, entry, convert_hole, gc_required, only_change_map; |
690 | 690 |
691 if (mode == TRACK_ALLOCATION_SITE) { | 691 if (mode == TRACK_ALLOCATION_SITE) { |
692 __ TestJSArrayForAllocationSiteInfo(edx, edi); | 692 __ TestJSArrayForAllocationMemento(edx, edi); |
693 __ j(equal, fail); | 693 __ j(equal, fail); |
694 } | 694 } |
695 | 695 |
696 // Check for empty arrays, which only require a map transition and no changes | 696 // Check for empty arrays, which only require a map transition and no changes |
697 // to the backing store. | 697 // to the backing store. |
698 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); | 698 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); |
699 __ cmp(edi, Immediate(masm->isolate()->factory()->empty_fixed_array())); | 699 __ cmp(edi, Immediate(masm->isolate()->factory()->empty_fixed_array())); |
700 __ j(equal, &only_change_map); | 700 __ j(equal, &only_change_map); |
701 | 701 |
702 __ push(eax); | 702 __ push(eax); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 // ----------- S t a t e ------------- | 821 // ----------- S t a t e ------------- |
822 // -- eax : value | 822 // -- eax : value |
823 // -- ebx : target map | 823 // -- ebx : target map |
824 // -- ecx : key | 824 // -- ecx : key |
825 // -- edx : receiver | 825 // -- edx : receiver |
826 // -- esp[0] : return address | 826 // -- esp[0] : return address |
827 // ----------------------------------- | 827 // ----------------------------------- |
828 Label loop, entry, convert_hole, gc_required, only_change_map, success; | 828 Label loop, entry, convert_hole, gc_required, only_change_map, success; |
829 | 829 |
830 if (mode == TRACK_ALLOCATION_SITE) { | 830 if (mode == TRACK_ALLOCATION_SITE) { |
831 __ TestJSArrayForAllocationSiteInfo(edx, edi); | 831 __ TestJSArrayForAllocationMemento(edx, edi); |
832 __ j(equal, fail); | 832 __ j(equal, fail); |
833 } | 833 } |
834 | 834 |
835 // Check for empty arrays, which only require a map transition and no changes | 835 // Check for empty arrays, which only require a map transition and no changes |
836 // to the backing store. | 836 // to the backing store. |
837 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); | 837 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); |
838 __ cmp(edi, Immediate(masm->isolate()->factory()->empty_fixed_array())); | 838 __ cmp(edi, Immediate(masm->isolate()->factory()->empty_fixed_array())); |
839 __ j(equal, &only_change_map); | 839 __ j(equal, &only_change_map); |
840 | 840 |
841 __ push(eax); | 841 __ push(eax); |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 Code* stub = GetCodeAgeStub(age, parity); | 1172 Code* stub = GetCodeAgeStub(age, parity); |
1173 CodePatcher patcher(sequence, young_length); | 1173 CodePatcher patcher(sequence, young_length); |
1174 patcher.masm()->call(stub->instruction_start(), RelocInfo::NONE32); | 1174 patcher.masm()->call(stub->instruction_start(), RelocInfo::NONE32); |
1175 } | 1175 } |
1176 } | 1176 } |
1177 | 1177 |
1178 | 1178 |
1179 } } // namespace v8::internal | 1179 } } // namespace v8::internal |
1180 | 1180 |
1181 #endif // V8_TARGET_ARCH_IA32 | 1181 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |