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

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

Issue 6902112: Avoid using a register for constant external array indices. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: add arch-independent ExternalArrayTypeToShiftSize() function Created 9 years, 7 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 | « no previous file | src/arm/lithium-codegen-arm.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after
1854 HLoadKeyedSpecializedArrayElement* instr) { 1854 HLoadKeyedSpecializedArrayElement* instr) {
1855 ExternalArrayType array_type = instr->array_type(); 1855 ExternalArrayType array_type = instr->array_type();
1856 Representation representation(instr->representation()); 1856 Representation representation(instr->representation());
1857 ASSERT( 1857 ASSERT(
1858 (representation.IsInteger32() && (array_type != kExternalFloatArray && 1858 (representation.IsInteger32() && (array_type != kExternalFloatArray &&
1859 array_type != kExternalDoubleArray)) || 1859 array_type != kExternalDoubleArray)) ||
1860 (representation.IsDouble() && (array_type == kExternalFloatArray || 1860 (representation.IsDouble() && (array_type == kExternalFloatArray ||
1861 array_type == kExternalDoubleArray))); 1861 array_type == kExternalDoubleArray)));
1862 ASSERT(instr->key()->representation().IsInteger32()); 1862 ASSERT(instr->key()->representation().IsInteger32());
1863 LOperand* external_pointer = UseRegister(instr->external_pointer()); 1863 LOperand* external_pointer = UseRegister(instr->external_pointer());
1864 LOperand* key = UseRegister(instr->key()); 1864 LOperand* key = UseRegisterOrConstant(instr->key());
1865 LLoadKeyedSpecializedArrayElement* result = 1865 LLoadKeyedSpecializedArrayElement* result =
1866 new LLoadKeyedSpecializedArrayElement(external_pointer, key); 1866 new LLoadKeyedSpecializedArrayElement(external_pointer, key);
1867 LInstruction* load_instr = DefineAsRegister(result); 1867 LInstruction* load_instr = DefineAsRegister(result);
1868 // An unsigned int array load might overflow and cause a deopt, make sure it 1868 // An unsigned int array load might overflow and cause a deopt, make sure it
1869 // has an environment. 1869 // has an environment.
1870 return (array_type == kExternalUnsignedIntArray) ? 1870 return (array_type == kExternalUnsignedIntArray) ?
1871 AssignEnvironment(load_instr) : load_instr; 1871 AssignEnvironment(load_instr) : load_instr;
1872 } 1872 }
1873 1873
1874 1874
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1912 array_type == kExternalDoubleArray))); 1912 array_type == kExternalDoubleArray)));
1913 ASSERT(instr->external_pointer()->representation().IsExternal()); 1913 ASSERT(instr->external_pointer()->representation().IsExternal());
1914 ASSERT(instr->key()->representation().IsInteger32()); 1914 ASSERT(instr->key()->representation().IsInteger32());
1915 1915
1916 LOperand* external_pointer = UseRegister(instr->external_pointer()); 1916 LOperand* external_pointer = UseRegister(instr->external_pointer());
1917 bool val_is_temp_register = array_type == kExternalPixelArray || 1917 bool val_is_temp_register = array_type == kExternalPixelArray ||
1918 array_type == kExternalFloatArray; 1918 array_type == kExternalFloatArray;
1919 LOperand* val = val_is_temp_register 1919 LOperand* val = val_is_temp_register
1920 ? UseTempRegister(instr->value()) 1920 ? UseTempRegister(instr->value())
1921 : UseRegister(instr->value()); 1921 : UseRegister(instr->value());
1922 LOperand* key = UseRegister(instr->key()); 1922 LOperand* key = UseRegisterOrConstant(instr->key());
1923 1923
1924 return new LStoreKeyedSpecializedArrayElement(external_pointer, 1924 return new LStoreKeyedSpecializedArrayElement(external_pointer,
1925 key, 1925 key,
1926 val); 1926 val);
1927 } 1927 }
1928 1928
1929 1929
1930 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { 1930 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) {
1931 LOperand* obj = UseFixed(instr->object(), r2); 1931 LOperand* obj = UseFixed(instr->object(), r2);
1932 LOperand* key = UseFixed(instr->key(), r1); 1932 LOperand* key = UseFixed(instr->key(), r1);
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2144 2144
2145 LInstruction* LChunkBuilder::DoIn(HIn* instr) { 2145 LInstruction* LChunkBuilder::DoIn(HIn* instr) {
2146 LOperand* key = UseRegisterAtStart(instr->key()); 2146 LOperand* key = UseRegisterAtStart(instr->key());
2147 LOperand* object = UseRegisterAtStart(instr->object()); 2147 LOperand* object = UseRegisterAtStart(instr->object());
2148 LIn* result = new LIn(key, object); 2148 LIn* result = new LIn(key, object);
2149 return MarkAsCall(DefineFixed(result, r0), instr); 2149 return MarkAsCall(DefineFixed(result, r0), instr);
2150 } 2150 }
2151 2151
2152 2152
2153 } } // namespace v8::internal 2153 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698