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

Side by Side Diff: src/x64/ic-x64.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/x64/code-stubs-x64.cc ('k') | src/x64/lithium-codegen-x64.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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 __ CompareRoot(r9, Heap::kHeapNumberMapRootIndex); 666 __ CompareRoot(r9, Heap::kHeapNumberMapRootIndex);
667 __ j(not_equal, &non_double_value); 667 __ j(not_equal, &non_double_value);
668 668
669 // Value is a double. Transition FAST_SMI_ELEMENTS -> 669 // Value is a double. Transition FAST_SMI_ELEMENTS ->
670 // FAST_DOUBLE_ELEMENTS and complete the store. 670 // FAST_DOUBLE_ELEMENTS and complete the store.
671 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, 671 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS,
672 FAST_DOUBLE_ELEMENTS, 672 FAST_DOUBLE_ELEMENTS,
673 rbx, 673 rbx,
674 rdi, 674 rdi,
675 slow); 675 slow);
676 AllocationSiteMode mode = AllocationSiteInfo::GetMode(FAST_SMI_ELEMENTS, 676 AllocationSiteMode mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS,
677 FAST_DOUBLE_ELEMENTS); 677 FAST_DOUBLE_ELEMENTS);
678 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, slow); 678 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, slow);
679 __ movq(rbx, FieldOperand(rdx, JSObject::kElementsOffset)); 679 __ movq(rbx, FieldOperand(rdx, JSObject::kElementsOffset));
680 __ jmp(&fast_double_without_map_check); 680 __ jmp(&fast_double_without_map_check);
681 681
682 __ bind(&non_double_value); 682 __ bind(&non_double_value);
683 // Value is not a double, FAST_SMI_ELEMENTS -> FAST_ELEMENTS 683 // Value is not a double, FAST_SMI_ELEMENTS -> FAST_ELEMENTS
684 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, 684 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS,
685 FAST_ELEMENTS, 685 FAST_ELEMENTS,
686 rbx, 686 rbx,
687 rdi, 687 rdi,
688 slow); 688 slow);
689 mode = AllocationSiteInfo::GetMode(FAST_SMI_ELEMENTS, FAST_ELEMENTS); 689 mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS, FAST_ELEMENTS);
690 ElementsTransitionGenerator::GenerateMapChangeElementsTransition(masm, mode, 690 ElementsTransitionGenerator::GenerateMapChangeElementsTransition(masm, mode,
691 slow); 691 slow);
692 __ movq(rbx, FieldOperand(rdx, JSObject::kElementsOffset)); 692 __ movq(rbx, FieldOperand(rdx, JSObject::kElementsOffset));
693 __ jmp(&finish_object_store); 693 __ jmp(&finish_object_store);
694 694
695 __ bind(&transition_double_elements); 695 __ bind(&transition_double_elements);
696 // Elements are FAST_DOUBLE_ELEMENTS, but value is an Object that's not a 696 // Elements are FAST_DOUBLE_ELEMENTS, but value is an Object that's not a
697 // HeapNumber. Make sure that the receiver is a Array with FAST_ELEMENTS and 697 // HeapNumber. Make sure that the receiver is a Array with FAST_ELEMENTS and
698 // transition array from FAST_DOUBLE_ELEMENTS to FAST_ELEMENTS 698 // transition array from FAST_DOUBLE_ELEMENTS to FAST_ELEMENTS
699 __ movq(rbx, FieldOperand(rdx, HeapObject::kMapOffset)); 699 __ movq(rbx, FieldOperand(rdx, HeapObject::kMapOffset));
700 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS, 700 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS,
701 FAST_ELEMENTS, 701 FAST_ELEMENTS,
702 rbx, 702 rbx,
703 rdi, 703 rdi,
704 slow); 704 slow);
705 mode = AllocationSiteInfo::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS); 705 mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS);
706 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, slow); 706 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, slow);
707 __ movq(rbx, FieldOperand(rdx, JSObject::kElementsOffset)); 707 __ movq(rbx, FieldOperand(rdx, JSObject::kElementsOffset));
708 __ jmp(&finish_object_store); 708 __ jmp(&finish_object_store);
709 } 709 }
710 710
711 711
712 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, 712 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
713 StrictModeFlag strict_mode) { 713 StrictModeFlag strict_mode) {
714 // ----------- S t a t e ------------- 714 // ----------- S t a t e -------------
715 // -- rax : value 715 // -- rax : value
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
1611 1611
1612 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { 1612 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) {
1613 // ----------- S t a t e ------------- 1613 // ----------- S t a t e -------------
1614 // -- rbx : target map 1614 // -- rbx : target map
1615 // -- rdx : receiver 1615 // -- rdx : receiver
1616 // -- rsp[0] : return address 1616 // -- rsp[0] : return address
1617 // ----------------------------------- 1617 // -----------------------------------
1618 // Must return the modified receiver in eax. 1618 // Must return the modified receiver in eax.
1619 if (!FLAG_trace_elements_transitions) { 1619 if (!FLAG_trace_elements_transitions) {
1620 Label fail; 1620 Label fail;
1621 AllocationSiteMode mode = AllocationSiteInfo::GetMode(FAST_SMI_ELEMENTS, 1621 AllocationSiteMode mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS,
1622 FAST_DOUBLE_ELEMENTS); 1622 FAST_DOUBLE_ELEMENTS);
1623 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail); 1623 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail);
1624 __ movq(rax, rdx); 1624 __ movq(rax, rdx);
1625 __ Ret(); 1625 __ Ret();
1626 __ bind(&fail); 1626 __ bind(&fail);
1627 } 1627 }
1628 1628
1629 __ pop(rbx); 1629 __ pop(rbx);
1630 __ push(rdx); 1630 __ push(rdx);
1631 __ push(rbx); // return address 1631 __ push(rbx); // return address
1632 __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); 1632 __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1);
1633 } 1633 }
1634 1634
1635 1635
1636 void KeyedStoreIC::GenerateTransitionElementsDoubleToObject( 1636 void KeyedStoreIC::GenerateTransitionElementsDoubleToObject(
1637 MacroAssembler* masm) { 1637 MacroAssembler* masm) {
1638 // ----------- S t a t e ------------- 1638 // ----------- S t a t e -------------
1639 // -- rbx : target map 1639 // -- rbx : target map
1640 // -- rdx : receiver 1640 // -- rdx : receiver
1641 // -- rsp[0] : return address 1641 // -- rsp[0] : return address
1642 // ----------------------------------- 1642 // -----------------------------------
1643 // Must return the modified receiver in eax. 1643 // Must return the modified receiver in eax.
1644 if (!FLAG_trace_elements_transitions) { 1644 if (!FLAG_trace_elements_transitions) {
1645 Label fail; 1645 Label fail;
1646 AllocationSiteMode mode = AllocationSiteInfo::GetMode(FAST_DOUBLE_ELEMENTS, 1646 AllocationSiteMode mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS,
1647 FAST_ELEMENTS); 1647 FAST_ELEMENTS);
1648 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail); 1648 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail);
1649 __ movq(rax, rdx); 1649 __ movq(rax, rdx);
1650 __ Ret(); 1650 __ Ret();
1651 __ bind(&fail); 1651 __ bind(&fail);
1652 } 1652 }
1653 1653
1654 __ pop(rbx); 1654 __ pop(rbx);
1655 __ push(rdx); 1655 __ push(rdx);
1656 __ push(rbx); // return address 1656 __ push(rbx); // return address
1657 __ TailCallRuntime(Runtime::kTransitionElementsDoubleToObject, 1, 1); 1657 __ TailCallRuntime(Runtime::kTransitionElementsDoubleToObject, 1, 1);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1725 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) 1725 Condition cc = (check == ENABLE_INLINED_SMI_CHECK)
1726 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) 1726 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero)
1727 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); 1727 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry);
1728 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1728 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1729 } 1729 }
1730 1730
1731 1731
1732 } } // namespace v8::internal 1732 } } // namespace v8::internal
1733 1733
1734 #endif // V8_TARGET_ARCH_X64 1734 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698