| 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 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1040 ? instr->FirstSuccessor() | 1040 ? instr->FirstSuccessor() |
| 1041 : instr->SecondSuccessor(); | 1041 : instr->SecondSuccessor(); |
| 1042 return new LGoto(successor->block_id()); | 1042 return new LGoto(successor->block_id()); |
| 1043 } | 1043 } |
| 1044 ToBooleanStub::Types expected = instr->expected_input_types(); | 1044 ToBooleanStub::Types expected = instr->expected_input_types(); |
| 1045 // We need a temporary register when we have to access the map *or* we have | 1045 // We need a temporary register when we have to access the map *or* we have |
| 1046 // no type info yet, in which case we handle all cases (including the ones | 1046 // no type info yet, in which case we handle all cases (including the ones |
| 1047 // involving maps). | 1047 // involving maps). |
| 1048 bool needs_temp = expected.NeedsMap() || expected.IsEmpty(); | 1048 bool needs_temp = expected.NeedsMap() || expected.IsEmpty(); |
| 1049 LOperand* temp = needs_temp ? TempRegister() : NULL; | 1049 LOperand* temp = needs_temp ? TempRegister() : NULL; |
| 1050 LInstruction* branch = new LBranch(UseRegister(v), temp); | 1050 return AssignEnvironment(new LBranch(UseRegister(v), temp)); |
| 1051 // When we handle all cases, we never deopt, so we don't need to assign the | |
| 1052 // environment then. | |
| 1053 return expected.IsAll() ? branch : AssignEnvironment(branch); | |
| 1054 } | 1051 } |
| 1055 | 1052 |
| 1056 | 1053 |
| 1057 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { | 1054 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { |
| 1058 ASSERT(instr->value()->representation().IsTagged()); | 1055 ASSERT(instr->value()->representation().IsTagged()); |
| 1059 LOperand* value = UseRegisterAtStart(instr->value()); | 1056 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1060 return new LCmpMapAndBranch(value); | 1057 return new LCmpMapAndBranch(value); |
| 1061 } | 1058 } |
| 1062 | 1059 |
| 1063 | 1060 |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1534 TempRegister()); | 1531 TempRegister()); |
| 1535 } | 1532 } |
| 1536 | 1533 |
| 1537 | 1534 |
| 1538 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) { | 1535 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) { |
| 1539 LOperand* array = UseRegisterAtStart(instr->value()); | 1536 LOperand* array = UseRegisterAtStart(instr->value()); |
| 1540 return DefineAsRegister(new LJSArrayLength(array)); | 1537 return DefineAsRegister(new LJSArrayLength(array)); |
| 1541 } | 1538 } |
| 1542 | 1539 |
| 1543 | 1540 |
| 1544 LInstruction* LChunkBuilder::DoFixedArrayLength(HFixedArrayLength* instr) { | 1541 LInstruction* LChunkBuilder::DoFixedArrayBaseLength( |
| 1542 HFixedArrayBaseLength* instr) { |
| 1545 LOperand* array = UseRegisterAtStart(instr->value()); | 1543 LOperand* array = UseRegisterAtStart(instr->value()); |
| 1546 return DefineAsRegister(new LFixedArrayLength(array)); | 1544 return DefineAsRegister(new LFixedArrayBaseLength(array)); |
| 1547 } | |
| 1548 | |
| 1549 | |
| 1550 LInstruction* LChunkBuilder::DoExternalArrayLength( | |
| 1551 HExternalArrayLength* instr) { | |
| 1552 LOperand* array = UseRegisterAtStart(instr->value()); | |
| 1553 return DefineAsRegister(new LExternalArrayLength(array)); | |
| 1554 } | 1545 } |
| 1555 | 1546 |
| 1556 | 1547 |
| 1557 LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) { | 1548 LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) { |
| 1558 LOperand* object = UseRegisterAtStart(instr->value()); | 1549 LOperand* object = UseRegisterAtStart(instr->value()); |
| 1559 return DefineAsRegister(new LElementsKind(object)); | 1550 return DefineAsRegister(new LElementsKind(object)); |
| 1560 } | 1551 } |
| 1561 | 1552 |
| 1562 | 1553 |
| 1563 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) { | 1554 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) { |
| 1564 LOperand* object = UseRegister(instr->value()); | 1555 LOperand* object = UseRegister(instr->value()); |
| 1565 LValueOf* result = new LValueOf(object, TempRegister()); | 1556 LValueOf* result = new LValueOf(object, TempRegister()); |
| 1566 return AssignEnvironment(DefineSameAsFirst(result)); | 1557 return AssignEnvironment(DefineSameAsFirst(result)); |
| 1567 } | 1558 } |
| 1568 | 1559 |
| 1569 | 1560 |
| 1570 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { | 1561 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { |
| 1571 return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()), | 1562 return AssignEnvironment(new LBoundsCheck( |
| 1572 UseAtStart(instr->length()))); | 1563 UseRegisterOrConstantAtStart(instr->index()), |
| 1564 UseAtStart(instr->length()))); |
| 1573 } | 1565 } |
| 1574 | 1566 |
| 1575 | 1567 |
| 1576 LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) { | 1568 LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) { |
| 1577 // The control instruction marking the end of a block that completed | 1569 // The control instruction marking the end of a block that completed |
| 1578 // abruptly (e.g., threw an exception). There is nothing specific to do. | 1570 // abruptly (e.g., threw an exception). There is nothing specific to do. |
| 1579 return NULL; | 1571 return NULL; |
| 1580 } | 1572 } |
| 1581 | 1573 |
| 1582 | 1574 |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1883 LOperand* input = UseRegisterAtStart(instr->value()); | 1875 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1884 return DefineAsRegister(new LLoadExternalArrayPointer(input)); | 1876 return DefineAsRegister(new LLoadExternalArrayPointer(input)); |
| 1885 } | 1877 } |
| 1886 | 1878 |
| 1887 | 1879 |
| 1888 LInstruction* LChunkBuilder::DoLoadKeyedFastElement( | 1880 LInstruction* LChunkBuilder::DoLoadKeyedFastElement( |
| 1889 HLoadKeyedFastElement* instr) { | 1881 HLoadKeyedFastElement* instr) { |
| 1890 ASSERT(instr->representation().IsTagged()); | 1882 ASSERT(instr->representation().IsTagged()); |
| 1891 ASSERT(instr->key()->representation().IsInteger32()); | 1883 ASSERT(instr->key()->representation().IsInteger32()); |
| 1892 LOperand* obj = UseRegisterAtStart(instr->object()); | 1884 LOperand* obj = UseRegisterAtStart(instr->object()); |
| 1893 LOperand* key = UseRegisterAtStart(instr->key()); | 1885 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
| 1894 LLoadKeyedFastElement* result = new LLoadKeyedFastElement(obj, key); | 1886 LLoadKeyedFastElement* result = new LLoadKeyedFastElement(obj, key); |
| 1895 return AssignEnvironment(DefineSameAsFirst(result)); | 1887 return AssignEnvironment(DefineAsRegister(result)); |
| 1896 } | 1888 } |
| 1897 | 1889 |
| 1898 | 1890 |
| 1899 LInstruction* LChunkBuilder::DoLoadKeyedFastDoubleElement( | 1891 LInstruction* LChunkBuilder::DoLoadKeyedFastDoubleElement( |
| 1900 HLoadKeyedFastDoubleElement* instr) { | 1892 HLoadKeyedFastDoubleElement* instr) { |
| 1901 ASSERT(instr->representation().IsDouble()); | 1893 ASSERT(instr->representation().IsDouble()); |
| 1902 ASSERT(instr->key()->representation().IsInteger32()); | 1894 ASSERT(instr->key()->representation().IsInteger32()); |
| 1903 LOperand* elements = UseRegisterAtStart(instr->elements()); | 1895 LOperand* elements = UseRegisterAtStart(instr->elements()); |
| 1904 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 1896 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
| 1905 LLoadKeyedFastDoubleElement* result = | 1897 LLoadKeyedFastDoubleElement* result = |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2270 LOperand* key = UseOrConstantAtStart(instr->key()); | 2262 LOperand* key = UseOrConstantAtStart(instr->key()); |
| 2271 LOperand* object = UseOrConstantAtStart(instr->object()); | 2263 LOperand* object = UseOrConstantAtStart(instr->object()); |
| 2272 LIn* result = new LIn(context, key, object); | 2264 LIn* result = new LIn(context, key, object); |
| 2273 return MarkAsCall(DefineFixed(result, eax), instr); | 2265 return MarkAsCall(DefineFixed(result, eax), instr); |
| 2274 } | 2266 } |
| 2275 | 2267 |
| 2276 | 2268 |
| 2277 } } // namespace v8::internal | 2269 } } // namespace v8::internal |
| 2278 | 2270 |
| 2279 #endif // V8_TARGET_ARCH_IA32 | 2271 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |