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

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

Issue 6323002: Add custom typed ICs for pixel array loads. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 11 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
« src/arm/ic-arm.cc ('K') | « src/ic.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 760
761 // Perform tail call to the entry. 761 // Perform tail call to the entry.
762 __ TailCallExternalReference(ExternalReference( 762 __ TailCallExternalReference(ExternalReference(
763 IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1); 763 IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1);
764 764
765 __ bind(&slow); 765 __ bind(&slow);
766 GenerateMiss(masm); 766 GenerateMiss(masm);
767 } 767 }
768 768
769 769
770 void KeyedLoadIC::GeneratePixelArray(MacroAssembler* masm) {
771 // ----------- S t a t e -------------
772 // -- rax : key
773 // -- rdx : receiver
774 // -- rsp[0] : return address
775 // -----------------------------------
776 Label slow;
777
778 // Verify that it's safe to access the receiver's elements.
779 GenerateKeyedLoadReceiverCheck(
780 masm, rdx, rcx, Map::kHasNamedInterceptor, &slow);
781
782 // Verify that the receiver has pixel array elements.
783 __ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset));
784 __ CompareRoot(FieldOperand(rcx, HeapObject::kMapOffset),
785 Heap::kPixelArrayMapRootIndex);
786 __ j(not_equal, &slow);
787
788 // Check that the key is a smi and in range.
789 __ JumpIfNotSmi(rax, &slow);
790 __ SmiToInteger32(rbx, rax);
791 __ cmpl(rbx, FieldOperand(rcx, PixelArray::kLengthOffset));
792 __ j(above_equal, &slow);
793
794 // Load and tag the element as a smi.
795 __ movq(rax, FieldOperand(rcx, PixelArray::kExternalPointerOffset));
796 __ movzxbq(rax, Operand(rax, rbx, times_1, 0));
797 __ Integer32ToSmi(rax, rax);
798 __ ret(0);
799
800 __ bind(&slow);
801 GenerateMiss(masm);
802 }
803
804
770 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { 805 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
771 // ----------- S t a t e ------------- 806 // ----------- S t a t e -------------
772 // -- rax : value 807 // -- rax : value
773 // -- rcx : key 808 // -- rcx : key
774 // -- rdx : receiver 809 // -- rdx : receiver
775 // -- rsp[0] : return address 810 // -- rsp[0] : return address
776 // ----------------------------------- 811 // -----------------------------------
777 Label slow, slow_with_tagged_index, fast, array, extra, check_pixel_array; 812 Label slow, slow_with_tagged_index, fast, array, extra, check_pixel_array;
778 813
779 // Check that the object isn't a smi. 814 // Check that the object isn't a smi.
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 } 1737 }
1703 1738
1704 void PatchInlinedSmiCode(Address address) { 1739 void PatchInlinedSmiCode(Address address) {
1705 UNIMPLEMENTED(); 1740 UNIMPLEMENTED();
1706 } 1741 }
1707 1742
1708 1743
1709 } } // namespace v8::internal 1744 } } // namespace v8::internal
1710 1745
1711 #endif // V8_TARGET_ARCH_X64 1746 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/arm/ic-arm.cc ('K') | « src/ic.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698