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

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

Issue 647013: Make setting length on arrays faster. (Closed)
Patch Set: Porting to ARM and x64 Created 10 years, 10 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
« no previous file with comments | « no previous file | src/builtins.h » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 // ----------------------------------- 851 // -----------------------------------
852 852
853 __ push(r1); 853 __ push(r1);
854 __ stm(db_w, sp, r2.bit() | r0.bit()); 854 __ stm(db_w, sp, r2.bit() | r0.bit());
855 855
856 // Perform tail call to the entry. 856 // Perform tail call to the entry.
857 __ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_Miss)), 3, 1); 857 __ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_Miss)), 3, 1);
858 } 858 }
859 859
860 860
861 void StoreIC::GenerateArrayLength(MacroAssembler* masm) {
862 // ----------- S t a t e -------------
863 // -- r0 : value
864 // -- r1 : receiver
865 // -- r2 : name
866 // -- lr : return address
867 // -----------------------------------
868 //
869 // This accepts as a receiver anything JSObject::SetElementsLength accepts
870 // (currently anything except for external and pixel arrays which means
871 // anything with elements of FixedArray type.), but currently is restricted
872 // to JSArray.
873 // Value must be a number, but only smis are accepted as the most common case.
874
875 Label miss;
876
877 Register receiver = r1;
878 Register value = r0;
879 Register scratch = r3;
880
881 // Check that the receiver isn't a smi.
882 __ BranchOnSmi(receiver, &miss);
883
884 // Check that the object is a JS array.
885 __ CompareObjectType(receiver, scratch, scratch, JS_ARRAY_TYPE);
886 __ b(ne, &miss);
887
888 // Check that elements are FixedArray.
889 __ ldr(scratch, FieldMemOperand(receiver, JSArray::kElementsOffset));
890 __ CompareObjectType(scratch, scratch, scratch, FIXED_ARRAY_TYPE);
891 __ b(ne, &miss);
892
893 // Check that value is a smi.
894 __ BranchOnNotSmi(value, &miss);
895
896 // Prepare tail call to StoreIC_ArrayLength.
897 __ push(receiver);
898 __ push(value);
899
900 __ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_ArrayLength)), 2, 1);
901
902 __ bind(&miss);
903
904 GenerateMiss(masm);
905 }
906
907
861 #undef __ 908 #undef __
862 909
863 910
864 } } // namespace v8::internal 911 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698