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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) { | 185 LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) { |
186 return new(zone()) LDebugBreak(); | 186 return new(zone()) LDebugBreak(); |
187 } | 187 } |
188 | 188 |
189 void LCmpIDAndBranch::PrintDataTo(StringStream* stream) { | 189 |
| 190 void LCompareNumericAndBranch::PrintDataTo(StringStream* stream) { |
190 stream->Add("if "); | 191 stream->Add("if "); |
191 left()->PrintTo(stream); | 192 left()->PrintTo(stream); |
192 stream->Add(" %s ", Token::String(op())); | 193 stream->Add(" %s ", Token::String(op())); |
193 right()->PrintTo(stream); | 194 right()->PrintTo(stream); |
194 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); | 195 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); |
195 } | 196 } |
196 | 197 |
197 | 198 |
198 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { | 199 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { |
199 stream->Add("if is_object("); | 200 stream->Add("if is_object("); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 constructor()->PrintTo(stream); | 324 constructor()->PrintTo(stream); |
324 stream->Add(" #%d / ", arity()); | 325 stream->Add(" #%d / ", arity()); |
325 } | 326 } |
326 | 327 |
327 | 328 |
328 void LCallNewArray::PrintDataTo(StringStream* stream) { | 329 void LCallNewArray::PrintDataTo(StringStream* stream) { |
329 stream->Add("= "); | 330 stream->Add("= "); |
330 constructor()->PrintTo(stream); | 331 constructor()->PrintTo(stream); |
331 stream->Add(" #%d / ", arity()); | 332 stream->Add(" #%d / ", arity()); |
332 ASSERT(hydrogen()->property_cell()->value()->IsSmi()); | 333 ASSERT(hydrogen()->property_cell()->value()->IsSmi()); |
333 ElementsKind kind = static_cast<ElementsKind>( | 334 ElementsKind kind = hydrogen()->elements_kind(); |
334 Smi::cast(hydrogen()->property_cell()->value())->value()); | |
335 stream->Add(" (%s) ", ElementsKindToString(kind)); | 335 stream->Add(" (%s) ", ElementsKindToString(kind)); |
336 } | 336 } |
337 | 337 |
338 | 338 |
339 void LAccessArgumentsAt::PrintDataTo(StringStream* stream) { | 339 void LAccessArgumentsAt::PrintDataTo(StringStream* stream) { |
340 arguments()->PrintTo(stream); | 340 arguments()->PrintTo(stream); |
341 stream->Add(" length "); | 341 stream->Add(" length "); |
342 length()->PrintTo(stream); | 342 length()->PrintTo(stream); |
343 stream->Add(" index "); | 343 stream->Add(" index "); |
344 index()->PrintTo(stream); | 344 index()->PrintTo(stream); |
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1599 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { | 1599 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { |
1600 ASSERT(instr->left()->representation().IsTagged()); | 1600 ASSERT(instr->left()->representation().IsTagged()); |
1601 ASSERT(instr->right()->representation().IsTagged()); | 1601 ASSERT(instr->right()->representation().IsTagged()); |
1602 LOperand* left = UseFixed(instr->left(), a1); | 1602 LOperand* left = UseFixed(instr->left(), a1); |
1603 LOperand* right = UseFixed(instr->right(), a0); | 1603 LOperand* right = UseFixed(instr->right(), a0); |
1604 LCmpT* result = new(zone()) LCmpT(left, right); | 1604 LCmpT* result = new(zone()) LCmpT(left, right); |
1605 return MarkAsCall(DefineFixed(result, v0), instr); | 1605 return MarkAsCall(DefineFixed(result, v0), instr); |
1606 } | 1606 } |
1607 | 1607 |
1608 | 1608 |
1609 LInstruction* LChunkBuilder::DoCompareIDAndBranch( | 1609 LInstruction* LChunkBuilder::DoCompareNumericAndBranch( |
1610 HCompareIDAndBranch* instr) { | 1610 HCompareNumericAndBranch* instr) { |
1611 Representation r = instr->representation(); | 1611 Representation r = instr->representation(); |
1612 if (r.IsSmiOrInteger32()) { | 1612 if (r.IsSmiOrInteger32()) { |
1613 ASSERT(instr->left()->representation().IsSmiOrInteger32()); | 1613 ASSERT(instr->left()->representation().IsSmiOrInteger32()); |
1614 ASSERT(instr->left()->representation().Equals( | 1614 ASSERT(instr->left()->representation().Equals( |
1615 instr->right()->representation())); | 1615 instr->right()->representation())); |
1616 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); | 1616 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); |
1617 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); | 1617 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); |
1618 return new(zone()) LCmpIDAndBranch(left, right); | 1618 return new(zone()) LCompareNumericAndBranch(left, right); |
1619 } else { | 1619 } else { |
1620 ASSERT(r.IsDouble()); | 1620 ASSERT(r.IsDouble()); |
1621 ASSERT(instr->left()->representation().IsDouble()); | 1621 ASSERT(instr->left()->representation().IsDouble()); |
1622 ASSERT(instr->right()->representation().IsDouble()); | 1622 ASSERT(instr->right()->representation().IsDouble()); |
1623 LOperand* left = UseRegisterAtStart(instr->left()); | 1623 LOperand* left = UseRegisterAtStart(instr->left()); |
1624 LOperand* right = UseRegisterAtStart(instr->right()); | 1624 LOperand* right = UseRegisterAtStart(instr->right()); |
1625 return new(zone()) LCmpIDAndBranch(left, right); | 1625 return new(zone()) LCompareNumericAndBranch(left, right); |
1626 } | 1626 } |
1627 } | 1627 } |
1628 | 1628 |
1629 | 1629 |
1630 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( | 1630 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( |
1631 HCompareObjectEqAndBranch* instr) { | 1631 HCompareObjectEqAndBranch* instr) { |
1632 LOperand* left = UseRegisterAtStart(instr->left()); | 1632 LOperand* left = UseRegisterAtStart(instr->left()); |
1633 LOperand* right = UseRegisterAtStart(instr->right()); | 1633 LOperand* right = UseRegisterAtStart(instr->right()); |
1634 return new(zone()) LCmpObjectEqAndBranch(left, right); | 1634 return new(zone()) LCmpObjectEqAndBranch(left, right); |
1635 } | 1635 } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1710 | 1710 |
1711 | 1711 |
1712 LInstruction* LChunkBuilder::DoClassOfTestAndBranch( | 1712 LInstruction* LChunkBuilder::DoClassOfTestAndBranch( |
1713 HClassOfTestAndBranch* instr) { | 1713 HClassOfTestAndBranch* instr) { |
1714 ASSERT(instr->value()->representation().IsTagged()); | 1714 ASSERT(instr->value()->representation().IsTagged()); |
1715 return new(zone()) LClassOfTestAndBranch(UseRegister(instr->value()), | 1715 return new(zone()) LClassOfTestAndBranch(UseRegister(instr->value()), |
1716 TempRegister()); | 1716 TempRegister()); |
1717 } | 1717 } |
1718 | 1718 |
1719 | 1719 |
1720 LInstruction* LChunkBuilder::DoFixedArrayBaseLength( | |
1721 HFixedArrayBaseLength* instr) { | |
1722 LOperand* array = UseRegisterAtStart(instr->value()); | |
1723 return DefineAsRegister(new(zone()) LFixedArrayBaseLength(array)); | |
1724 } | |
1725 | |
1726 | |
1727 LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { | 1720 LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { |
1728 LOperand* map = UseRegisterAtStart(instr->value()); | 1721 LOperand* map = UseRegisterAtStart(instr->value()); |
1729 return DefineAsRegister(new(zone()) LMapEnumLength(map)); | 1722 return DefineAsRegister(new(zone()) LMapEnumLength(map)); |
1730 } | 1723 } |
1731 | 1724 |
1732 | 1725 |
1733 LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) { | 1726 LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) { |
1734 LOperand* object = UseRegisterAtStart(instr->value()); | 1727 LOperand* object = UseRegisterAtStart(instr->value()); |
1735 return DefineAsRegister(new(zone()) LElementsKind(object)); | 1728 return DefineAsRegister(new(zone()) LElementsKind(object)); |
1736 } | 1729 } |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1919 return NULL; | 1912 return NULL; |
1920 } | 1913 } |
1921 | 1914 |
1922 | 1915 |
1923 LInstruction* LChunkBuilder::DoCheckHeapObject(HCheckHeapObject* instr) { | 1916 LInstruction* LChunkBuilder::DoCheckHeapObject(HCheckHeapObject* instr) { |
1924 LOperand* value = UseRegisterAtStart(instr->value()); | 1917 LOperand* value = UseRegisterAtStart(instr->value()); |
1925 return AssignEnvironment(new(zone()) LCheckNonSmi(value)); | 1918 return AssignEnvironment(new(zone()) LCheckNonSmi(value)); |
1926 } | 1919 } |
1927 | 1920 |
1928 | 1921 |
| 1922 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { |
| 1923 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1924 return AssignEnvironment(new(zone()) LCheckSmi(value)); |
| 1925 } |
| 1926 |
| 1927 |
| 1928 LInstruction* LChunkBuilder::DoIsNumberAndBranch(HIsNumberAndBranch* instr) { |
| 1929 return new(zone()) |
| 1930 LIsNumberAndBranch(UseRegisterOrConstantAtStart(instr->value())); |
| 1931 } |
| 1932 |
| 1933 |
1929 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { | 1934 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { |
1930 LOperand* value = UseRegisterAtStart(instr->value()); | 1935 LOperand* value = UseRegisterAtStart(instr->value()); |
1931 LInstruction* result = new(zone()) LCheckInstanceType(value); | 1936 LInstruction* result = new(zone()) LCheckInstanceType(value); |
1932 return AssignEnvironment(result); | 1937 return AssignEnvironment(result); |
1933 } | 1938 } |
1934 | 1939 |
1935 | 1940 |
1936 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { | 1941 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { |
1937 LUnallocated* temp1 = TempRegister(); | 1942 LUnallocated* temp1 = TempRegister(); |
1938 LOperand* temp2 = TempRegister(); | 1943 LOperand* temp2 = TempRegister(); |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2558 | 2563 |
2559 | 2564 |
2560 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2565 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2561 LOperand* object = UseRegister(instr->object()); | 2566 LOperand* object = UseRegister(instr->object()); |
2562 LOperand* index = UseRegister(instr->index()); | 2567 LOperand* index = UseRegister(instr->index()); |
2563 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2568 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2564 } | 2569 } |
2565 | 2570 |
2566 | 2571 |
2567 } } // namespace v8::internal | 2572 } } // namespace v8::internal |
OLD | NEW |