OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |