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