OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 stream->Add("B%d", block_id()); | 175 stream->Add("B%d", block_id()); |
176 } | 176 } |
177 | 177 |
178 | 178 |
179 void LBranch::PrintDataTo(StringStream* stream) { | 179 void LBranch::PrintDataTo(StringStream* stream) { |
180 stream->Add("B%d | B%d on ", true_block_id(), false_block_id()); | 180 stream->Add("B%d | B%d on ", true_block_id(), false_block_id()); |
181 value()->PrintTo(stream); | 181 value()->PrintTo(stream); |
182 } | 182 } |
183 | 183 |
184 | 184 |
185 void LCmpIDAndBranch::PrintDataTo(StringStream* stream) { | 185 void LCompareNumericAndBranch::PrintDataTo(StringStream* stream) { |
186 stream->Add("if "); | 186 stream->Add("if "); |
187 left()->PrintTo(stream); | 187 left()->PrintTo(stream); |
188 stream->Add(" %s ", Token::String(op())); | 188 stream->Add(" %s ", Token::String(op())); |
189 right()->PrintTo(stream); | 189 right()->PrintTo(stream); |
190 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); | 190 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); |
191 } | 191 } |
192 | 192 |
193 | 193 |
194 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { | 194 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { |
195 stream->Add("if is_object("); | 195 stream->Add("if is_object("); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 constructor()->PrintTo(stream); | 319 constructor()->PrintTo(stream); |
320 stream->Add(" #%d / ", arity()); | 320 stream->Add(" #%d / ", arity()); |
321 } | 321 } |
322 | 322 |
323 | 323 |
324 void LCallNewArray::PrintDataTo(StringStream* stream) { | 324 void LCallNewArray::PrintDataTo(StringStream* stream) { |
325 stream->Add("= "); | 325 stream->Add("= "); |
326 constructor()->PrintTo(stream); | 326 constructor()->PrintTo(stream); |
327 stream->Add(" #%d / ", arity()); | 327 stream->Add(" #%d / ", arity()); |
328 ASSERT(hydrogen()->property_cell()->value()->IsSmi()); | 328 ASSERT(hydrogen()->property_cell()->value()->IsSmi()); |
329 ElementsKind kind = static_cast<ElementsKind>( | 329 ElementsKind kind = hydrogen()->elements_kind(); |
330 Smi::cast(hydrogen()->property_cell()->value())->value()); | |
331 stream->Add(" (%s) ", ElementsKindToString(kind)); | 330 stream->Add(" (%s) ", ElementsKindToString(kind)); |
332 } | 331 } |
333 | 332 |
334 | 333 |
335 void LAccessArgumentsAt::PrintDataTo(StringStream* stream) { | 334 void LAccessArgumentsAt::PrintDataTo(StringStream* stream) { |
336 arguments()->PrintTo(stream); | 335 arguments()->PrintTo(stream); |
337 stream->Add(" length "); | 336 stream->Add(" length "); |
338 length()->PrintTo(stream); | 337 length()->PrintTo(stream); |
339 stream->Add(" index "); | 338 stream->Add(" index "); |
340 index()->PrintTo(stream); | 339 index()->PrintTo(stream); |
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1679 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { | 1678 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { |
1680 ASSERT(instr->left()->representation().IsTagged()); | 1679 ASSERT(instr->left()->representation().IsTagged()); |
1681 ASSERT(instr->right()->representation().IsTagged()); | 1680 ASSERT(instr->right()->representation().IsTagged()); |
1682 LOperand* left = UseFixed(instr->left(), r1); | 1681 LOperand* left = UseFixed(instr->left(), r1); |
1683 LOperand* right = UseFixed(instr->right(), r0); | 1682 LOperand* right = UseFixed(instr->right(), r0); |
1684 LCmpT* result = new(zone()) LCmpT(left, right); | 1683 LCmpT* result = new(zone()) LCmpT(left, right); |
1685 return MarkAsCall(DefineFixed(result, r0), instr); | 1684 return MarkAsCall(DefineFixed(result, r0), instr); |
1686 } | 1685 } |
1687 | 1686 |
1688 | 1687 |
1689 LInstruction* LChunkBuilder::DoCompareIDAndBranch( | 1688 LInstruction* LChunkBuilder::DoCompareNumericAndBranch( |
1690 HCompareIDAndBranch* instr) { | 1689 HCompareNumericAndBranch* instr) { |
1691 Representation r = instr->representation(); | 1690 Representation r = instr->representation(); |
1692 if (r.IsSmiOrInteger32()) { | 1691 if (r.IsSmiOrInteger32()) { |
1693 ASSERT(instr->left()->representation().IsSmiOrInteger32()); | 1692 ASSERT(instr->left()->representation().IsSmiOrInteger32()); |
1694 ASSERT(instr->left()->representation().Equals( | 1693 ASSERT(instr->left()->representation().Equals( |
1695 instr->right()->representation())); | 1694 instr->right()->representation())); |
1696 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); | 1695 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); |
1697 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); | 1696 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); |
1698 return new(zone()) LCmpIDAndBranch(left, right); | 1697 return new(zone()) LCompareNumericAndBranch(left, right); |
1699 } else { | 1698 } else { |
1700 ASSERT(r.IsDouble()); | 1699 ASSERT(r.IsDouble()); |
1701 ASSERT(instr->left()->representation().IsDouble()); | 1700 ASSERT(instr->left()->representation().IsDouble()); |
1702 ASSERT(instr->right()->representation().IsDouble()); | 1701 ASSERT(instr->right()->representation().IsDouble()); |
1703 LOperand* left = UseRegisterAtStart(instr->left()); | 1702 LOperand* left = UseRegisterAtStart(instr->left()); |
1704 LOperand* right = UseRegisterAtStart(instr->right()); | 1703 LOperand* right = UseRegisterAtStart(instr->right()); |
1705 return new(zone()) LCmpIDAndBranch(left, right); | 1704 return new(zone()) LCompareNumericAndBranch(left, right); |
1706 } | 1705 } |
1707 } | 1706 } |
1708 | 1707 |
1709 | 1708 |
1710 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( | 1709 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( |
1711 HCompareObjectEqAndBranch* instr) { | 1710 HCompareObjectEqAndBranch* instr) { |
1712 LOperand* left = UseRegisterAtStart(instr->left()); | 1711 LOperand* left = UseRegisterAtStart(instr->left()); |
1713 LOperand* right = UseRegisterAtStart(instr->right()); | 1712 LOperand* right = UseRegisterAtStart(instr->right()); |
1714 return new(zone()) LCmpObjectEqAndBranch(left, right); | 1713 return new(zone()) LCmpObjectEqAndBranch(left, right); |
1715 } | 1714 } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1790 | 1789 |
1791 | 1790 |
1792 LInstruction* LChunkBuilder::DoClassOfTestAndBranch( | 1791 LInstruction* LChunkBuilder::DoClassOfTestAndBranch( |
1793 HClassOfTestAndBranch* instr) { | 1792 HClassOfTestAndBranch* instr) { |
1794 ASSERT(instr->value()->representation().IsTagged()); | 1793 ASSERT(instr->value()->representation().IsTagged()); |
1795 LOperand* value = UseRegister(instr->value()); | 1794 LOperand* value = UseRegister(instr->value()); |
1796 return new(zone()) LClassOfTestAndBranch(value, TempRegister()); | 1795 return new(zone()) LClassOfTestAndBranch(value, TempRegister()); |
1797 } | 1796 } |
1798 | 1797 |
1799 | 1798 |
1800 LInstruction* LChunkBuilder::DoFixedArrayBaseLength( | |
1801 HFixedArrayBaseLength* instr) { | |
1802 LOperand* array = UseRegisterAtStart(instr->value()); | |
1803 return DefineAsRegister(new(zone()) LFixedArrayBaseLength(array)); | |
1804 } | |
1805 | |
1806 | |
1807 LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { | 1799 LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { |
1808 LOperand* map = UseRegisterAtStart(instr->value()); | 1800 LOperand* map = UseRegisterAtStart(instr->value()); |
1809 return DefineAsRegister(new(zone()) LMapEnumLength(map)); | 1801 return DefineAsRegister(new(zone()) LMapEnumLength(map)); |
1810 } | 1802 } |
1811 | 1803 |
1812 | 1804 |
1813 LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) { | 1805 LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) { |
1814 LOperand* object = UseRegisterAtStart(instr->value()); | 1806 LOperand* object = UseRegisterAtStart(instr->value()); |
1815 return DefineAsRegister(new(zone()) LElementsKind(object)); | 1807 return DefineAsRegister(new(zone()) LElementsKind(object)); |
1816 } | 1808 } |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1999 return NULL; | 1991 return NULL; |
2000 } | 1992 } |
2001 | 1993 |
2002 | 1994 |
2003 LInstruction* LChunkBuilder::DoCheckHeapObject(HCheckHeapObject* instr) { | 1995 LInstruction* LChunkBuilder::DoCheckHeapObject(HCheckHeapObject* instr) { |
2004 LOperand* value = UseRegisterAtStart(instr->value()); | 1996 LOperand* value = UseRegisterAtStart(instr->value()); |
2005 return AssignEnvironment(new(zone()) LCheckNonSmi(value)); | 1997 return AssignEnvironment(new(zone()) LCheckNonSmi(value)); |
2006 } | 1998 } |
2007 | 1999 |
2008 | 2000 |
| 2001 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { |
| 2002 LOperand* value = UseRegisterAtStart(instr->value()); |
| 2003 return AssignEnvironment(new(zone()) LCheckSmi(value)); |
| 2004 } |
| 2005 |
| 2006 |
| 2007 LInstruction* LChunkBuilder::DoIsNumberAndBranch(HIsNumberAndBranch* instr) { |
| 2008 return new(zone()) |
| 2009 LIsNumberAndBranch(UseRegisterOrConstantAtStart(instr->value())); |
| 2010 } |
| 2011 |
| 2012 |
2009 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { | 2013 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { |
2010 LOperand* value = UseRegisterAtStart(instr->value()); | 2014 LOperand* value = UseRegisterAtStart(instr->value()); |
2011 LInstruction* result = new(zone()) LCheckInstanceType(value); | 2015 LInstruction* result = new(zone()) LCheckInstanceType(value); |
2012 return AssignEnvironment(result); | 2016 return AssignEnvironment(result); |
2013 } | 2017 } |
2014 | 2018 |
2015 | 2019 |
2016 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { | 2020 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { |
2017 LUnallocated* temp1 = TempRegister(); | 2021 LUnallocated* temp1 = TempRegister(); |
2018 LOperand* temp2 = TempRegister(); | 2022 LOperand* temp2 = TempRegister(); |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2636 | 2640 |
2637 | 2641 |
2638 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2642 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2639 LOperand* object = UseRegister(instr->object()); | 2643 LOperand* object = UseRegister(instr->object()); |
2640 LOperand* index = UseRegister(instr->index()); | 2644 LOperand* index = UseRegister(instr->index()); |
2641 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2645 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2642 } | 2646 } |
2643 | 2647 |
2644 | 2648 |
2645 } } // namespace v8::internal | 2649 } } // namespace v8::internal |
OLD | NEW |