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

Side by Side Diff: src/ia32/ic-ia32.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
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 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 // Perform tail call to the entry. 753 // Perform tail call to the entry.
754 ExternalReference ref = ExternalReference( 754 ExternalReference ref = ExternalReference(
755 IC_Utility(kKeyedLoadPropertyWithInterceptor)); 755 IC_Utility(kKeyedLoadPropertyWithInterceptor));
756 __ TailCallExternalReference(ref, 2, 1); 756 __ TailCallExternalReference(ref, 2, 1);
757 757
758 __ bind(&slow); 758 __ bind(&slow);
759 GenerateMiss(masm); 759 GenerateMiss(masm);
760 } 760 }
761 761
762 762
763 void KeyedLoadIC::GeneratePixelArray(MacroAssembler* masm) {
764 // ----------- S t a t e -------------
765 // -- eax : key
766 // -- edx : receiver
767 // -- esp[0] : return address
768 // -----------------------------------
769 Label slow;
770
771 // Check that the receiver isn't a smi.
772 __ test(edx, Immediate(kSmiTagMask));
773 __ j(zero, &slow, not_taken);
774
775 // Check that the key is an array index, that is Uint32.
Mads Ager (chromium) 2011/01/25 14:49:17 This code looks more complicated than on ARM and I
danno 2011/01/25 20:56:29 Done.
776 __ test(eax, Immediate(kSmiTagMask | kSmiSignMask));
777 __ j(not_zero, &slow, not_taken);
778
779 // Get the map of the receiver.
780 __ mov(ecx, FieldOperand(edx, HeapObject::kMapOffset));
781
782 // Check whether the elements is a pixel array.
783 // edx: receiver
784 // eax: key
785 __ mov(ebx, eax);
786 __ SmiUntag(ebx);
787 __ mov(ecx, FieldOperand(edx, JSObject::kElementsOffset));
Mads Ager (chromium) 2011/01/25 14:49:17 Need a JSObject check.
danno 2011/01/25 20:56:29 Done.
788 __ CheckMap(ecx, Factory::pixel_array_map(), &slow, true);
789 __ cmp(ebx, FieldOperand(ecx, PixelArray::kLengthOffset));
790 __ j(above_equal, &slow);
791 __ mov(eax, FieldOperand(ecx, PixelArray::kExternalPointerOffset));
792 __ movzx_b(eax, Operand(eax, ebx, times_1, 0));
793 __ SmiTag(eax);
794 __ ret(0);
795
796 __ bind(&slow);
797 GenerateMiss(masm);
798 }
799
800
763 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { 801 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
764 // ----------- S t a t e ------------- 802 // ----------- S t a t e -------------
765 // -- eax : value 803 // -- eax : value
766 // -- ecx : key 804 // -- ecx : key
767 // -- edx : receiver 805 // -- edx : receiver
768 // -- esp[0] : return address 806 // -- esp[0] : return address
769 // ----------------------------------- 807 // -----------------------------------
770 Label slow, fast, array, extra, check_pixel_array; 808 Label slow, fast, array, extra, check_pixel_array;
771 809
772 // Check that the object isn't a smi. 810 // Check that the object isn't a smi.
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1771 Condition cc = *jmp_address == Assembler::kJncShortOpcode 1809 Condition cc = *jmp_address == Assembler::kJncShortOpcode
1772 ? not_zero 1810 ? not_zero
1773 : zero; 1811 : zero;
1774 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1812 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1775 } 1813 }
1776 1814
1777 1815
1778 } } // namespace v8::internal 1816 } } // namespace v8::internal
1779 1817
1780 #endif // V8_TARGET_ARCH_IA32 1818 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698