| 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 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1881 LOperand* key = UseRegisterAtStart(instr->key()); | 1881 LOperand* key = UseRegisterAtStart(instr->key()); |
| 1882 LLoadKeyedFastElement* result = new LLoadKeyedFastElement(obj, key); | 1882 LLoadKeyedFastElement* result = new LLoadKeyedFastElement(obj, key); |
| 1883 return AssignEnvironment(DefineSameAsFirst(result)); | 1883 return AssignEnvironment(DefineSameAsFirst(result)); |
| 1884 } | 1884 } |
| 1885 | 1885 |
| 1886 | 1886 |
| 1887 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( | 1887 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( |
| 1888 HLoadKeyedSpecializedArrayElement* instr) { | 1888 HLoadKeyedSpecializedArrayElement* instr) { |
| 1889 ExternalArrayType array_type = instr->array_type(); | 1889 ExternalArrayType array_type = instr->array_type(); |
| 1890 Representation representation(instr->representation()); | 1890 Representation representation(instr->representation()); |
| 1891 ASSERT((representation.IsInteger32() && array_type != kExternalFloatArray) || | 1891 ASSERT( |
| 1892 (representation.IsDouble() && array_type == kExternalFloatArray)); | 1892 (representation.IsInteger32() && (array_type != kExternalFloatArray && |
| 1893 array_type != kExternalDoubleArray)) || |
| 1894 (representation.IsDouble() && (array_type == kExternalFloatArray || |
| 1895 array_type == kExternalDoubleArray))); |
| 1893 ASSERT(instr->key()->representation().IsInteger32()); | 1896 ASSERT(instr->key()->representation().IsInteger32()); |
| 1894 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 1897 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
| 1895 LOperand* key = UseRegister(instr->key()); | 1898 LOperand* key = UseRegister(instr->key()); |
| 1896 LLoadKeyedSpecializedArrayElement* result = | 1899 LLoadKeyedSpecializedArrayElement* result = |
| 1897 new LLoadKeyedSpecializedArrayElement(external_pointer, | 1900 new LLoadKeyedSpecializedArrayElement(external_pointer, |
| 1898 key); | 1901 key); |
| 1899 LInstruction* load_instr = DefineAsRegister(result); | 1902 LInstruction* load_instr = DefineAsRegister(result); |
| 1900 // An unsigned int array load might overflow and cause a deopt, make sure it | 1903 // An unsigned int array load might overflow and cause a deopt, make sure it |
| 1901 // has an environment. | 1904 // has an environment. |
| 1902 return (array_type == kExternalUnsignedIntArray) | 1905 return (array_type == kExternalUnsignedIntArray) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1931 : UseRegisterOrConstantAtStart(instr->key()); | 1934 : UseRegisterOrConstantAtStart(instr->key()); |
| 1932 | 1935 |
| 1933 return AssignEnvironment(new LStoreKeyedFastElement(obj, key, val)); | 1936 return AssignEnvironment(new LStoreKeyedFastElement(obj, key, val)); |
| 1934 } | 1937 } |
| 1935 | 1938 |
| 1936 | 1939 |
| 1937 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( | 1940 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( |
| 1938 HStoreKeyedSpecializedArrayElement* instr) { | 1941 HStoreKeyedSpecializedArrayElement* instr) { |
| 1939 Representation representation(instr->value()->representation()); | 1942 Representation representation(instr->value()->representation()); |
| 1940 ExternalArrayType array_type = instr->array_type(); | 1943 ExternalArrayType array_type = instr->array_type(); |
| 1941 ASSERT((representation.IsInteger32() && array_type != kExternalFloatArray) || | 1944 ASSERT( |
| 1942 (representation.IsDouble() && array_type == kExternalFloatArray)); | 1945 (representation.IsInteger32() && (array_type != kExternalFloatArray && |
| 1946 array_type != kExternalDoubleArray)) || |
| 1947 (representation.IsDouble() && (array_type == kExternalFloatArray || |
| 1948 array_type == kExternalDoubleArray))); |
| 1943 ASSERT(instr->external_pointer()->representation().IsExternal()); | 1949 ASSERT(instr->external_pointer()->representation().IsExternal()); |
| 1944 ASSERT(instr->key()->representation().IsInteger32()); | 1950 ASSERT(instr->key()->representation().IsInteger32()); |
| 1945 | 1951 |
| 1946 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 1952 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
| 1947 LOperand* key = UseRegister(instr->key()); | 1953 LOperand* key = UseRegister(instr->key()); |
| 1948 LOperand* temp = NULL; | 1954 LOperand* temp = NULL; |
| 1949 | 1955 |
| 1950 if (array_type == kExternalPixelArray) { | 1956 if (array_type == kExternalPixelArray) { |
| 1951 // The generated code for pixel array stores requires that the clamped value | 1957 // The generated code for pixel array stores requires that the clamped value |
| 1952 // is in a byte register. eax is an arbitrary choice to satisfy this | 1958 // is in a byte register. eax is an arbitrary choice to satisfy this |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2195 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2201 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
| 2196 HEnvironment* outer = current_block_->last_environment()->outer(); | 2202 HEnvironment* outer = current_block_->last_environment()->outer(); |
| 2197 current_block_->UpdateEnvironment(outer); | 2203 current_block_->UpdateEnvironment(outer); |
| 2198 return NULL; | 2204 return NULL; |
| 2199 } | 2205 } |
| 2200 | 2206 |
| 2201 | 2207 |
| 2202 } } // namespace v8::internal | 2208 } } // namespace v8::internal |
| 2203 | 2209 |
| 2204 #endif // V8_TARGET_ARCH_IA32 | 2210 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |