OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 | 1659 |
1660 | 1660 |
1661 LInstruction* LChunkBuilder::DoClassOfTest(HClassOfTest* instr) { | 1661 LInstruction* LChunkBuilder::DoClassOfTest(HClassOfTest* instr) { |
1662 ASSERT(instr->value()->representation().IsTagged()); | 1662 ASSERT(instr->value()->representation().IsTagged()); |
1663 LOperand* value = UseTempRegister(instr->value()); | 1663 LOperand* value = UseTempRegister(instr->value()); |
1664 | 1664 |
1665 return DefineSameAsFirst(new LClassOfTest(value, TempRegister())); | 1665 return DefineSameAsFirst(new LClassOfTest(value, TempRegister())); |
1666 } | 1666 } |
1667 | 1667 |
1668 | 1668 |
1669 LInstruction* LChunkBuilder::DoArrayLength(HArrayLength* instr) { | 1669 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) { |
1670 LOperand* array = NULL; | 1670 LOperand* array = UseRegisterAtStart(instr->value()); |
1671 LOperand* temporary = NULL; | 1671 return DefineAsRegister(new LJSArrayLength(array)); |
1672 | |
1673 if (instr->value()->IsLoadElements()) { | |
1674 array = UseRegisterAtStart(instr->value()); | |
1675 } else { | |
1676 array = UseRegister(instr->value()); | |
1677 temporary = TempRegister(); | |
1678 } | |
1679 | |
1680 LInstruction* result = new LArrayLength(array, temporary); | |
1681 return AssignEnvironment(DefineAsRegister(result)); | |
1682 } | 1672 } |
1683 | 1673 |
1684 | 1674 |
| 1675 LInstruction* LChunkBuilder::DoFixedArrayLength(HFixedArrayLength* instr) { |
| 1676 LOperand* array = UseRegisterAtStart(instr->value()); |
| 1677 return DefineAsRegister(new LFixedArrayLength(array)); |
| 1678 } |
| 1679 |
| 1680 |
1685 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) { | 1681 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) { |
1686 LOperand* object = UseRegister(instr->value()); | 1682 LOperand* object = UseRegister(instr->value()); |
1687 LInstruction* result = new LValueOf(object, TempRegister()); | 1683 LInstruction* result = new LValueOf(object, TempRegister()); |
1688 return AssignEnvironment(DefineSameAsFirst(result)); | 1684 return AssignEnvironment(DefineSameAsFirst(result)); |
1689 } | 1685 } |
1690 | 1686 |
1691 | 1687 |
1692 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { | 1688 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { |
1693 return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()), | 1689 return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()), |
1694 Use(instr->length()))); | 1690 Use(instr->length()))); |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2121 void LPointerMap::PrintTo(StringStream* stream) const { | 2117 void LPointerMap::PrintTo(StringStream* stream) const { |
2122 stream->Add("{"); | 2118 stream->Add("{"); |
2123 for (int i = 0; i < pointer_operands_.length(); ++i) { | 2119 for (int i = 0; i < pointer_operands_.length(); ++i) { |
2124 if (i != 0) stream->Add(";"); | 2120 if (i != 0) stream->Add(";"); |
2125 pointer_operands_[i]->PrintTo(stream); | 2121 pointer_operands_[i]->PrintTo(stream); |
2126 } | 2122 } |
2127 stream->Add("} @%d", position()); | 2123 stream->Add("} @%d", position()); |
2128 } | 2124 } |
2129 | 2125 |
2130 } } // namespace v8::internal | 2126 } } // namespace v8::internal |
OLD | NEW |