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

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 5961016: Optimize array-length and fast element 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
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/hydrogen.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 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 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 Abort("DoConstantD unimplemented."); 891 Abort("DoConstantD unimplemented.");
892 } 892 }
893 893
894 894
895 void LCodeGen::DoConstantT(LConstantT* instr) { 895 void LCodeGen::DoConstantT(LConstantT* instr) {
896 ASSERT(instr->result()->IsRegister()); 896 ASSERT(instr->result()->IsRegister());
897 __ mov(ToRegister(instr->result()), Operand(instr->value())); 897 __ mov(ToRegister(instr->result()), Operand(instr->value()));
898 } 898 }
899 899
900 900
901 void LCodeGen::DoArrayLength(LArrayLength* instr) { 901 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) {
902 Register result = ToRegister(instr->result()); 902 Register result = ToRegister(instr->result());
903 903 Register array = ToRegister(instr->input());
904 if (instr->hydrogen()->value()->IsLoadElements()) { 904 __ ldr(result, FieldMemOperand(array, JSArray::kLengthOffset));
905 // We load the length directly from the elements array. 905 Abort("DoJSArrayLength untested.");
906 Register elements = ToRegister(instr->input());
907 __ ldr(result, FieldMemOperand(elements, FixedArray::kLengthOffset));
908 } else {
909 // Check that the receiver really is an array.
910 Register array = ToRegister(instr->input());
911 Register temporary = ToRegister(instr->temporary());
912 __ CompareObjectType(array, temporary, temporary, JS_ARRAY_TYPE);
913 DeoptimizeIf(ne, instr->environment());
914
915 // Load length directly from the array.
916 __ ldr(result, FieldMemOperand(array, JSArray::kLengthOffset));
917 }
918 Abort("DoArrayLength untested.");
919 } 906 }
920 907
921 908
909 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) {
910 Register result = ToRegister(instr->result());
911 Register array = ToRegister(instr->input());
912 __ ldr(result, FieldMemOperand(array, FixedArray::kLengthOffset));
913 Abort("DoFixedArrayLength untested.");
914 }
915
916
922 void LCodeGen::DoValueOf(LValueOf* instr) { 917 void LCodeGen::DoValueOf(LValueOf* instr) {
923 Abort("DoValueOf unimplemented."); 918 Abort("DoValueOf unimplemented.");
924 } 919 }
925 920
926 921
927 void LCodeGen::DoBitNotI(LBitNotI* instr) { 922 void LCodeGen::DoBitNotI(LBitNotI* instr) {
928 LOperand* input = instr->input(); 923 LOperand* input = instr->input();
929 ASSERT(input->Equals(instr->result())); 924 ASSERT(input->Equals(instr->result()));
930 __ mvn(ToRegister(input), Operand(ToRegister(input))); 925 __ mvn(ToRegister(input), Operand(ToRegister(input)));
931 Abort("DoBitNotI untested."); 926 Abort("DoBitNotI untested.");
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after
2209 2204
2210 2205
2211 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { 2206 void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
2212 Abort("DoOsrEntry unimplemented."); 2207 Abort("DoOsrEntry unimplemented.");
2213 } 2208 }
2214 2209
2215 2210
2216 #undef __ 2211 #undef __
2217 2212
2218 } } // namespace v8::internal 2213 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698