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

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: Comment response Created 7 years, 5 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
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 &non_double_value, 791 &non_double_value,
792 DONT_DO_SMI_CHECK); 792 DONT_DO_SMI_CHECK);
793 793
794 // Value is a double. Transition FAST_SMI_ELEMENTS -> FAST_DOUBLE_ELEMENTS 794 // Value is a double. Transition FAST_SMI_ELEMENTS -> FAST_DOUBLE_ELEMENTS
795 // and complete the store. 795 // and complete the store.
796 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, 796 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS,
797 FAST_DOUBLE_ELEMENTS, 797 FAST_DOUBLE_ELEMENTS,
798 ebx, 798 ebx,
799 edi, 799 edi,
800 slow); 800 slow);
801 AllocationSiteMode mode = AllocationSiteInfo::GetMode(FAST_SMI_ELEMENTS, 801 AllocationSiteMode mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS,
802 FAST_DOUBLE_ELEMENTS); 802 FAST_DOUBLE_ELEMENTS);
803 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, slow); 803 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, slow);
804 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); 804 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset));
805 __ jmp(&fast_double_without_map_check); 805 __ jmp(&fast_double_without_map_check);
806 806
807 __ bind(&non_double_value); 807 __ bind(&non_double_value);
808 // Value is not a double, FAST_SMI_ELEMENTS -> FAST_ELEMENTS 808 // Value is not a double, FAST_SMI_ELEMENTS -> FAST_ELEMENTS
809 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, 809 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS,
810 FAST_ELEMENTS, 810 FAST_ELEMENTS,
811 ebx, 811 ebx,
812 edi, 812 edi,
813 slow); 813 slow);
814 mode = AllocationSiteInfo::GetMode(FAST_SMI_ELEMENTS, FAST_ELEMENTS); 814 mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS, FAST_ELEMENTS);
815 ElementsTransitionGenerator::GenerateMapChangeElementsTransition(masm, mode, 815 ElementsTransitionGenerator::GenerateMapChangeElementsTransition(masm, mode,
816 slow); 816 slow);
817 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); 817 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset));
818 __ jmp(&finish_object_store); 818 __ jmp(&finish_object_store);
819 819
820 __ bind(&transition_double_elements); 820 __ bind(&transition_double_elements);
821 // Elements are FAST_DOUBLE_ELEMENTS, but value is an Object that's not a 821 // Elements are FAST_DOUBLE_ELEMENTS, but value is an Object that's not a
822 // HeapNumber. Make sure that the receiver is a Array with FAST_ELEMENTS and 822 // HeapNumber. Make sure that the receiver is a Array with FAST_ELEMENTS and
823 // transition array from FAST_DOUBLE_ELEMENTS to FAST_ELEMENTS 823 // transition array from FAST_DOUBLE_ELEMENTS to FAST_ELEMENTS
824 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); 824 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset));
825 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS, 825 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS,
826 FAST_ELEMENTS, 826 FAST_ELEMENTS,
827 ebx, 827 ebx,
828 edi, 828 edi,
829 slow); 829 slow);
830 mode = AllocationSiteInfo::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS); 830 mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS);
831 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, slow); 831 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, slow);
832 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); 832 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset));
833 __ jmp(&finish_object_store); 833 __ jmp(&finish_object_store);
834 } 834 }
835 835
836 836
837 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, 837 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
838 StrictModeFlag strict_mode) { 838 StrictModeFlag strict_mode) {
839 // ----------- S t a t e ------------- 839 // ----------- S t a t e -------------
840 // -- eax : value 840 // -- eax : value
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
1591 1591
1592 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { 1592 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) {
1593 // ----------- S t a t e ------------- 1593 // ----------- S t a t e -------------
1594 // -- ebx : target map 1594 // -- ebx : target map
1595 // -- edx : receiver 1595 // -- edx : receiver
1596 // -- esp[0] : return address 1596 // -- esp[0] : return address
1597 // ----------------------------------- 1597 // -----------------------------------
1598 // Must return the modified receiver in eax. 1598 // Must return the modified receiver in eax.
1599 if (!FLAG_trace_elements_transitions) { 1599 if (!FLAG_trace_elements_transitions) {
1600 Label fail; 1600 Label fail;
1601 AllocationSiteMode mode = AllocationSiteInfo::GetMode(FAST_SMI_ELEMENTS, 1601 AllocationSiteMode mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS,
1602 FAST_DOUBLE_ELEMENTS); 1602 FAST_DOUBLE_ELEMENTS);
1603 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail); 1603 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail);
1604 __ mov(eax, edx); 1604 __ mov(eax, edx);
1605 __ Ret(); 1605 __ Ret();
1606 __ bind(&fail); 1606 __ bind(&fail);
1607 } 1607 }
1608 1608
1609 __ pop(ebx); 1609 __ pop(ebx);
1610 __ push(edx); 1610 __ push(edx);
1611 __ push(ebx); // return address 1611 __ push(ebx); // return address
1612 // Leaving the code managed by the register allocator and return to the 1612 // Leaving the code managed by the register allocator and return to the
1613 // convention of using esi as context register. 1613 // convention of using esi as context register.
1614 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 1614 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
1615 __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); 1615 __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1);
1616 } 1616 }
1617 1617
1618 1618
1619 void KeyedStoreIC::GenerateTransitionElementsDoubleToObject( 1619 void KeyedStoreIC::GenerateTransitionElementsDoubleToObject(
1620 MacroAssembler* masm) { 1620 MacroAssembler* masm) {
1621 // ----------- S t a t e ------------- 1621 // ----------- S t a t e -------------
1622 // -- ebx : target map 1622 // -- ebx : target map
1623 // -- edx : receiver 1623 // -- edx : receiver
1624 // -- esp[0] : return address 1624 // -- esp[0] : return address
1625 // ----------------------------------- 1625 // -----------------------------------
1626 // Must return the modified receiver in eax. 1626 // Must return the modified receiver in eax.
1627 if (!FLAG_trace_elements_transitions) { 1627 if (!FLAG_trace_elements_transitions) {
1628 Label fail; 1628 Label fail;
1629 AllocationSiteMode mode = AllocationSiteInfo::GetMode(FAST_DOUBLE_ELEMENTS, 1629 AllocationSiteMode mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS,
1630 FAST_ELEMENTS); 1630 FAST_ELEMENTS);
1631 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail); 1631 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail);
1632 __ mov(eax, edx); 1632 __ mov(eax, edx);
1633 __ Ret(); 1633 __ Ret();
1634 __ bind(&fail); 1634 __ bind(&fail);
1635 } 1635 }
1636 1636
1637 __ pop(ebx); 1637 __ pop(ebx);
1638 __ push(edx); 1638 __ push(edx);
1639 __ push(ebx); // return address 1639 __ push(ebx); // return address
1640 // Leaving the code managed by the register allocator and return to the 1640 // Leaving the code managed by the register allocator and return to the
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) 1711 Condition cc = (check == ENABLE_INLINED_SMI_CHECK)
1712 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) 1712 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero)
1713 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); 1713 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry);
1714 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1714 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1715 } 1715 }
1716 1716
1717 1717
1718 } } // namespace v8::internal 1718 } } // namespace v8::internal
1719 1719
1720 #endif // V8_TARGET_ARCH_IA32 1720 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698