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

Side by Side Diff: src/x64/lithium-x64.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 | « src/x64/lithium-codegen-x64.cc ('k') | test/cctest/test-api.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 1833 matching lines...) Expand 10 before | Expand all | Expand 10 after
1844 HLoadKeyedSpecializedArrayElement* instr) { 1844 HLoadKeyedSpecializedArrayElement* instr) {
1845 ExternalArrayType array_type = instr->array_type(); 1845 ExternalArrayType array_type = instr->array_type();
1846 Representation representation(instr->representation()); 1846 Representation representation(instr->representation());
1847 ASSERT( 1847 ASSERT(
1848 (representation.IsInteger32() && (array_type != kExternalFloatArray && 1848 (representation.IsInteger32() && (array_type != kExternalFloatArray &&
1849 array_type != kExternalDoubleArray)) || 1849 array_type != kExternalDoubleArray)) ||
1850 (representation.IsDouble() && (array_type == kExternalFloatArray || 1850 (representation.IsDouble() && (array_type == kExternalFloatArray ||
1851 array_type == kExternalDoubleArray))); 1851 array_type == kExternalDoubleArray)));
1852 ASSERT(instr->key()->representation().IsInteger32()); 1852 ASSERT(instr->key()->representation().IsInteger32());
1853 LOperand* external_pointer = UseRegister(instr->external_pointer()); 1853 LOperand* external_pointer = UseRegister(instr->external_pointer());
1854 LOperand* key = UseRegister(instr->key()); 1854 LOperand* key = UseRegisterOrConstant(instr->key());
1855 LLoadKeyedSpecializedArrayElement* result = 1855 LLoadKeyedSpecializedArrayElement* result =
1856 new LLoadKeyedSpecializedArrayElement(external_pointer, key); 1856 new LLoadKeyedSpecializedArrayElement(external_pointer, key);
1857 LInstruction* load_instr = DefineAsRegister(result); 1857 LInstruction* load_instr = DefineAsRegister(result);
1858 // An unsigned int array load might overflow and cause a deopt, make sure it 1858 // An unsigned int array load might overflow and cause a deopt, make sure it
1859 // has an environment. 1859 // has an environment.
1860 return (array_type == kExternalUnsignedIntArray) ? 1860 return (array_type == kExternalUnsignedIntArray) ?
1861 AssignEnvironment(load_instr) : load_instr; 1861 AssignEnvironment(load_instr) : load_instr;
1862 } 1862 }
1863 1863
1864 1864
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1901 array_type == kExternalDoubleArray))); 1901 array_type == kExternalDoubleArray)));
1902 ASSERT(instr->external_pointer()->representation().IsExternal()); 1902 ASSERT(instr->external_pointer()->representation().IsExternal());
1903 ASSERT(instr->key()->representation().IsInteger32()); 1903 ASSERT(instr->key()->representation().IsInteger32());
1904 1904
1905 LOperand* external_pointer = UseRegister(instr->external_pointer()); 1905 LOperand* external_pointer = UseRegister(instr->external_pointer());
1906 bool val_is_temp_register = array_type == kExternalPixelArray || 1906 bool val_is_temp_register = array_type == kExternalPixelArray ||
1907 array_type == kExternalFloatArray; 1907 array_type == kExternalFloatArray;
1908 LOperand* val = val_is_temp_register 1908 LOperand* val = val_is_temp_register
1909 ? UseTempRegister(instr->value()) 1909 ? UseTempRegister(instr->value())
1910 : UseRegister(instr->value()); 1910 : UseRegister(instr->value());
1911 LOperand* key = UseRegister(instr->key()); 1911 LOperand* key = UseRegisterOrConstant(instr->key());
1912 1912
1913 return new LStoreKeyedSpecializedArrayElement(external_pointer, 1913 return new LStoreKeyedSpecializedArrayElement(external_pointer,
1914 key, 1914 key,
1915 val); 1915 val);
1916 } 1916 }
1917 1917
1918 1918
1919 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { 1919 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) {
1920 LOperand* object = UseFixed(instr->object(), rdx); 1920 LOperand* object = UseFixed(instr->object(), rdx);
1921 LOperand* key = UseFixed(instr->key(), rcx); 1921 LOperand* key = UseFixed(instr->key(), rcx);
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
2141 LOperand* key = UseOrConstantAtStart(instr->key()); 2141 LOperand* key = UseOrConstantAtStart(instr->key());
2142 LOperand* object = UseOrConstantAtStart(instr->object()); 2142 LOperand* object = UseOrConstantAtStart(instr->object());
2143 LIn* result = new LIn(key, object); 2143 LIn* result = new LIn(key, object);
2144 return MarkAsCall(DefineFixed(result, rax), instr); 2144 return MarkAsCall(DefineFixed(result, rax), instr);
2145 } 2145 }
2146 2146
2147 2147
2148 } } // namespace v8::internal 2148 } } // namespace v8::internal
2149 2149
2150 #endif // V8_TARGET_ARCH_X64 2150 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698