Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Side by Side Diff: src/ia32/ic-ia32.cc

Issue 15094018: Create AllocationSite objects, pointed to by AllocationSiteInfo. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Some cleanup Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 &non_double_value, 790 &non_double_value,
791 DONT_DO_SMI_CHECK); 791 DONT_DO_SMI_CHECK);
792 792
793 // Value is a double. Transition FAST_SMI_ELEMENTS -> FAST_DOUBLE_ELEMENTS 793 // Value is a double. Transition FAST_SMI_ELEMENTS -> FAST_DOUBLE_ELEMENTS
794 // and complete the store. 794 // and complete the store.
795 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, 795 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS,
796 FAST_DOUBLE_ELEMENTS, 796 FAST_DOUBLE_ELEMENTS,
797 ebx, 797 ebx,
798 edi, 798 edi,
799 slow); 799 slow);
800 AllocationSiteMode mode = AllocationSiteInfo::GetMode(FAST_SMI_ELEMENTS, 800 AllocationSiteMode mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS,
801 FAST_DOUBLE_ELEMENTS); 801 FAST_DOUBLE_ELEMENTS);
802 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, slow); 802 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, slow);
803 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); 803 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset));
804 __ jmp(&fast_double_without_map_check); 804 __ jmp(&fast_double_without_map_check);
805 805
806 __ bind(&non_double_value); 806 __ bind(&non_double_value);
807 // Value is not a double, FAST_SMI_ELEMENTS -> FAST_ELEMENTS 807 // Value is not a double, FAST_SMI_ELEMENTS -> FAST_ELEMENTS
808 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, 808 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS,
809 FAST_ELEMENTS, 809 FAST_ELEMENTS,
810 ebx, 810 ebx,
811 edi, 811 edi,
812 slow); 812 slow);
813 mode = AllocationSiteInfo::GetMode(FAST_SMI_ELEMENTS, FAST_ELEMENTS); 813 mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS, FAST_ELEMENTS);
814 ElementsTransitionGenerator::GenerateMapChangeElementsTransition(masm, mode, 814 ElementsTransitionGenerator::GenerateMapChangeElementsTransition(masm, mode,
815 slow); 815 slow);
816 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); 816 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset));
817 __ jmp(&finish_object_store); 817 __ jmp(&finish_object_store);
818 818
819 __ bind(&transition_double_elements); 819 __ bind(&transition_double_elements);
820 // Elements are FAST_DOUBLE_ELEMENTS, but value is an Object that's not a 820 // Elements are FAST_DOUBLE_ELEMENTS, but value is an Object that's not a
821 // HeapNumber. Make sure that the receiver is a Array with FAST_ELEMENTS and 821 // HeapNumber. Make sure that the receiver is a Array with FAST_ELEMENTS and
822 // transition array from FAST_DOUBLE_ELEMENTS to FAST_ELEMENTS 822 // transition array from FAST_DOUBLE_ELEMENTS to FAST_ELEMENTS
823 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); 823 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset));
824 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS, 824 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS,
825 FAST_ELEMENTS, 825 FAST_ELEMENTS,
826 ebx, 826 ebx,
827 edi, 827 edi,
828 slow); 828 slow);
829 mode = AllocationSiteInfo::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS); 829 mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS);
830 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, slow); 830 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, slow);
831 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); 831 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset));
832 __ jmp(&finish_object_store); 832 __ jmp(&finish_object_store);
833 } 833 }
834 834
835 835
836 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, 836 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
837 StrictModeFlag strict_mode) { 837 StrictModeFlag strict_mode) {
838 // ----------- S t a t e ------------- 838 // ----------- S t a t e -------------
839 // -- eax : value 839 // -- eax : value
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 1590
1591 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { 1591 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) {
1592 // ----------- S t a t e ------------- 1592 // ----------- S t a t e -------------
1593 // -- ebx : target map 1593 // -- ebx : target map
1594 // -- edx : receiver 1594 // -- edx : receiver
1595 // -- esp[0] : return address 1595 // -- esp[0] : return address
1596 // ----------------------------------- 1596 // -----------------------------------
1597 // Must return the modified receiver in eax. 1597 // Must return the modified receiver in eax.
1598 if (!FLAG_trace_elements_transitions) { 1598 if (!FLAG_trace_elements_transitions) {
1599 Label fail; 1599 Label fail;
1600 AllocationSiteMode mode = AllocationSiteInfo::GetMode(FAST_SMI_ELEMENTS, 1600 AllocationSiteMode mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS,
1601 FAST_DOUBLE_ELEMENTS); 1601 FAST_DOUBLE_ELEMENTS);
1602 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail); 1602 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail);
1603 __ mov(eax, edx); 1603 __ mov(eax, edx);
1604 __ Ret(); 1604 __ Ret();
1605 __ bind(&fail); 1605 __ bind(&fail);
1606 } 1606 }
1607 1607
1608 __ pop(ebx); 1608 __ pop(ebx);
1609 __ push(edx); 1609 __ push(edx);
1610 __ push(ebx); // return address 1610 __ push(ebx); // return address
1611 // Leaving the code managed by the register allocator and return to the 1611 // Leaving the code managed by the register allocator and return to the
1612 // convention of using esi as context register. 1612 // convention of using esi as context register.
1613 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 1613 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
1614 __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); 1614 __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1);
1615 } 1615 }
1616 1616
1617 1617
1618 void KeyedStoreIC::GenerateTransitionElementsDoubleToObject( 1618 void KeyedStoreIC::GenerateTransitionElementsDoubleToObject(
1619 MacroAssembler* masm) { 1619 MacroAssembler* masm) {
1620 // ----------- S t a t e ------------- 1620 // ----------- S t a t e -------------
1621 // -- ebx : target map 1621 // -- ebx : target map
1622 // -- edx : receiver 1622 // -- edx : receiver
1623 // -- esp[0] : return address 1623 // -- esp[0] : return address
1624 // ----------------------------------- 1624 // -----------------------------------
1625 // Must return the modified receiver in eax. 1625 // Must return the modified receiver in eax.
1626 if (!FLAG_trace_elements_transitions) { 1626 if (!FLAG_trace_elements_transitions) {
1627 Label fail; 1627 Label fail;
1628 AllocationSiteMode mode = AllocationSiteInfo::GetMode(FAST_DOUBLE_ELEMENTS, 1628 AllocationSiteMode mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS,
1629 FAST_ELEMENTS); 1629 FAST_ELEMENTS);
1630 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail); 1630 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail);
1631 __ mov(eax, edx); 1631 __ mov(eax, edx);
1632 __ Ret(); 1632 __ Ret();
1633 __ bind(&fail); 1633 __ bind(&fail);
1634 } 1634 }
1635 1635
1636 __ pop(ebx); 1636 __ pop(ebx);
1637 __ push(edx); 1637 __ push(edx);
1638 __ push(ebx); // return address 1638 __ push(ebx); // return address
1639 // Leaving the code managed by the register allocator and return to the 1639 // Leaving the code managed by the register allocator and return to the
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) 1710 Condition cc = (check == ENABLE_INLINED_SMI_CHECK)
1711 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) 1711 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero)
1712 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); 1712 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry);
1713 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1713 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1714 } 1714 }
1715 1715
1716 1716
1717 } } // namespace v8::internal 1717 } } // namespace v8::internal
1718 1718
1719 #endif // V8_TARGET_ARCH_IA32 1719 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698