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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 | 422 |
423 void LStoreKeyedFastElement::PrintDataTo(StringStream* stream) { | 423 void LStoreKeyedFastElement::PrintDataTo(StringStream* stream) { |
424 object()->PrintTo(stream); | 424 object()->PrintTo(stream); |
425 stream->Add("["); | 425 stream->Add("["); |
426 key()->PrintTo(stream); | 426 key()->PrintTo(stream); |
427 stream->Add("] <- "); | 427 stream->Add("] <- "); |
428 value()->PrintTo(stream); | 428 value()->PrintTo(stream); |
429 } | 429 } |
430 | 430 |
431 | 431 |
| 432 void LStoreKeyedFastDoubleElement::PrintDataTo(StringStream* stream) { |
| 433 elements()->PrintTo(stream); |
| 434 stream->Add("["); |
| 435 key()->PrintTo(stream); |
| 436 stream->Add("] <- "); |
| 437 value()->PrintTo(stream); |
| 438 } |
| 439 |
| 440 |
432 void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { | 441 void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { |
433 object()->PrintTo(stream); | 442 object()->PrintTo(stream); |
434 stream->Add("["); | 443 stream->Add("["); |
435 key()->PrintTo(stream); | 444 key()->PrintTo(stream); |
436 stream->Add("] <- "); | 445 stream->Add("] <- "); |
437 value()->PrintTo(stream); | 446 value()->PrintTo(stream); |
438 } | 447 } |
439 | 448 |
440 | 449 |
441 void LChunk::AddInstruction(LInstruction* instr, HBasicBlock* block) { | 450 void LChunk::AddInstruction(LInstruction* instr, HBasicBlock* block) { |
(...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1871 HLoadKeyedFastElement* instr) { | 1880 HLoadKeyedFastElement* instr) { |
1872 ASSERT(instr->representation().IsTagged()); | 1881 ASSERT(instr->representation().IsTagged()); |
1873 ASSERT(instr->key()->representation().IsInteger32()); | 1882 ASSERT(instr->key()->representation().IsInteger32()); |
1874 LOperand* obj = UseRegisterAtStart(instr->object()); | 1883 LOperand* obj = UseRegisterAtStart(instr->object()); |
1875 LOperand* key = UseRegisterAtStart(instr->key()); | 1884 LOperand* key = UseRegisterAtStart(instr->key()); |
1876 LLoadKeyedFastElement* result = new LLoadKeyedFastElement(obj, key); | 1885 LLoadKeyedFastElement* result = new LLoadKeyedFastElement(obj, key); |
1877 return AssignEnvironment(DefineSameAsFirst(result)); | 1886 return AssignEnvironment(DefineSameAsFirst(result)); |
1878 } | 1887 } |
1879 | 1888 |
1880 | 1889 |
| 1890 LInstruction* LChunkBuilder::DoLoadKeyedFastDoubleElement( |
| 1891 HLoadKeyedFastDoubleElement* instr) { |
| 1892 ASSERT(instr->representation().IsDouble()); |
| 1893 ASSERT(instr->key()->representation().IsInteger32()); |
| 1894 LOperand* elements = UseRegisterAtStart(instr->elements()); |
| 1895 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
| 1896 LLoadKeyedFastDoubleElement* result = |
| 1897 new LLoadKeyedFastDoubleElement(elements, key); |
| 1898 return AssignEnvironment(DefineAsRegister(result)); |
| 1899 } |
| 1900 |
| 1901 |
1881 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( | 1902 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( |
1882 HLoadKeyedSpecializedArrayElement* instr) { | 1903 HLoadKeyedSpecializedArrayElement* instr) { |
1883 JSObject::ElementsKind elements_kind = instr->elements_kind(); | 1904 JSObject::ElementsKind elements_kind = instr->elements_kind(); |
1884 Representation representation(instr->representation()); | 1905 Representation representation(instr->representation()); |
1885 ASSERT( | 1906 ASSERT( |
1886 (representation.IsInteger32() && | 1907 (representation.IsInteger32() && |
1887 (elements_kind != JSObject::EXTERNAL_FLOAT_ELEMENTS) && | 1908 (elements_kind != JSObject::EXTERNAL_FLOAT_ELEMENTS) && |
1888 (elements_kind != JSObject::EXTERNAL_DOUBLE_ELEMENTS)) || | 1909 (elements_kind != JSObject::EXTERNAL_DOUBLE_ELEMENTS)) || |
1889 (representation.IsDouble() && | 1910 (representation.IsDouble() && |
1890 ((elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) || | 1911 ((elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) || |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1926 ? UseTempRegister(instr->value()) | 1947 ? UseTempRegister(instr->value()) |
1927 : UseRegisterAtStart(instr->value()); | 1948 : UseRegisterAtStart(instr->value()); |
1928 LOperand* key = needs_write_barrier | 1949 LOperand* key = needs_write_barrier |
1929 ? UseTempRegister(instr->key()) | 1950 ? UseTempRegister(instr->key()) |
1930 : UseRegisterOrConstantAtStart(instr->key()); | 1951 : UseRegisterOrConstantAtStart(instr->key()); |
1931 | 1952 |
1932 return AssignEnvironment(new LStoreKeyedFastElement(obj, key, val)); | 1953 return AssignEnvironment(new LStoreKeyedFastElement(obj, key, val)); |
1933 } | 1954 } |
1934 | 1955 |
1935 | 1956 |
| 1957 LInstruction* LChunkBuilder::DoStoreKeyedFastDoubleElement( |
| 1958 HStoreKeyedFastDoubleElement* instr) { |
| 1959 ASSERT(instr->value()->representation().IsDouble()); |
| 1960 ASSERT(instr->elements()->representation().IsTagged()); |
| 1961 ASSERT(instr->key()->representation().IsInteger32()); |
| 1962 |
| 1963 LOperand* elements = UseRegisterAtStart(instr->elements()); |
| 1964 LOperand* val = UseTempRegister(instr->value()); |
| 1965 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
| 1966 |
| 1967 return new LStoreKeyedFastDoubleElement(elements, key, val); |
| 1968 } |
| 1969 |
| 1970 |
1936 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( | 1971 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( |
1937 HStoreKeyedSpecializedArrayElement* instr) { | 1972 HStoreKeyedSpecializedArrayElement* instr) { |
1938 Representation representation(instr->value()->representation()); | 1973 Representation representation(instr->value()->representation()); |
1939 JSObject::ElementsKind elements_kind = instr->elements_kind(); | 1974 JSObject::ElementsKind elements_kind = instr->elements_kind(); |
1940 ASSERT( | 1975 ASSERT( |
1941 (representation.IsInteger32() && | 1976 (representation.IsInteger32() && |
1942 (elements_kind != JSObject::EXTERNAL_FLOAT_ELEMENTS) && | 1977 (elements_kind != JSObject::EXTERNAL_FLOAT_ELEMENTS) && |
1943 (elements_kind != JSObject::EXTERNAL_DOUBLE_ELEMENTS)) || | 1978 (elements_kind != JSObject::EXTERNAL_DOUBLE_ELEMENTS)) || |
1944 (representation.IsDouble() && | 1979 (representation.IsDouble() && |
1945 ((elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) || | 1980 ((elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) || |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2221 LOperand* key = UseOrConstantAtStart(instr->key()); | 2256 LOperand* key = UseOrConstantAtStart(instr->key()); |
2222 LOperand* object = UseOrConstantAtStart(instr->object()); | 2257 LOperand* object = UseOrConstantAtStart(instr->object()); |
2223 LIn* result = new LIn(context, key, object); | 2258 LIn* result = new LIn(context, key, object); |
2224 return MarkAsCall(DefineFixed(result, eax), instr); | 2259 return MarkAsCall(DefineFixed(result, eax), instr); |
2225 } | 2260 } |
2226 | 2261 |
2227 | 2262 |
2228 } } // namespace v8::internal | 2263 } } // namespace v8::internal |
2229 | 2264 |
2230 #endif // V8_TARGET_ARCH_IA32 | 2265 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |