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 1887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1898 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( | 1898 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( |
1899 HStoreKeyedSpecializedArrayElement* instr) { | 1899 HStoreKeyedSpecializedArrayElement* instr) { |
1900 Representation representation(instr->value()->representation()); | 1900 Representation representation(instr->value()->representation()); |
1901 ExternalArrayType array_type = instr->array_type(); | 1901 ExternalArrayType array_type = instr->array_type(); |
1902 ASSERT((representation.IsInteger32() && array_type != kExternalFloatArray) || | 1902 ASSERT((representation.IsInteger32() && array_type != kExternalFloatArray) || |
1903 (representation.IsDouble() && array_type == kExternalFloatArray)); | 1903 (representation.IsDouble() && array_type == kExternalFloatArray)); |
1904 ASSERT(instr->external_pointer()->representation().IsExternal()); | 1904 ASSERT(instr->external_pointer()->representation().IsExternal()); |
1905 ASSERT(instr->key()->representation().IsInteger32()); | 1905 ASSERT(instr->key()->representation().IsInteger32()); |
1906 | 1906 |
1907 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 1907 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
1908 LOperand* val = UseRegister(instr->value()); | |
1909 LOperand* key = UseRegister(instr->key()); | 1908 LOperand* key = UseRegister(instr->key()); |
1910 LOperand* temp = NULL; | 1909 LOperand* temp = NULL; |
1911 | 1910 |
1912 if (array_type == kExternalPixelArray) { | 1911 if (array_type == kExternalPixelArray) { |
1913 // The generated code for pixel array stores requires that the clamped value | 1912 // The generated code for pixel array stores requires that the clamped value |
1914 // is in a byte register. eax is an arbitrary choice to satisfy this | 1913 // is in a byte register. eax is an arbitrary choice to satisfy this |
1915 // requirement. | 1914 // requirement. |
1916 temp = FixedTemp(eax); | 1915 temp = FixedTemp(eax); |
1917 } | 1916 } |
1918 | 1917 |
| 1918 LOperand* val = NULL; |
| 1919 if (array_type == kExternalByteArray || |
| 1920 array_type == kExternalUnsignedByteArray) { |
| 1921 // We need a byte register in this case for the value. |
| 1922 val = UseFixed(instr->value(), eax); |
| 1923 } else { |
| 1924 val = UseRegister(instr->value()); |
| 1925 } |
| 1926 |
1919 return new LStoreKeyedSpecializedArrayElement(external_pointer, | 1927 return new LStoreKeyedSpecializedArrayElement(external_pointer, |
1920 key, | 1928 key, |
1921 val, | 1929 val, |
1922 temp); | 1930 temp); |
1923 } | 1931 } |
1924 | 1932 |
1925 | 1933 |
1926 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { | 1934 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { |
1927 LOperand* context = UseFixed(instr->context(), esi); | 1935 LOperand* context = UseFixed(instr->context(), esi); |
1928 LOperand* object = UseFixed(instr->object(), edx); | 1936 LOperand* object = UseFixed(instr->object(), edx); |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2141 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2149 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
2142 HEnvironment* outer = current_block_->last_environment()->outer(); | 2150 HEnvironment* outer = current_block_->last_environment()->outer(); |
2143 current_block_->UpdateEnvironment(outer); | 2151 current_block_->UpdateEnvironment(outer); |
2144 return NULL; | 2152 return NULL; |
2145 } | 2153 } |
2146 | 2154 |
2147 | 2155 |
2148 } } // namespace v8::internal | 2156 } } // namespace v8::internal |
2149 | 2157 |
2150 #endif // V8_TARGET_ARCH_IA32 | 2158 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |