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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 stream->Add("B%d", block_id()); | 194 stream->Add("B%d", block_id()); |
195 } | 195 } |
196 | 196 |
197 | 197 |
198 void LBranch::PrintDataTo(StringStream* stream) { | 198 void LBranch::PrintDataTo(StringStream* stream) { |
199 stream->Add("B%d | B%d on ", true_block_id(), false_block_id()); | 199 stream->Add("B%d | B%d on ", true_block_id(), false_block_id()); |
200 value()->PrintTo(stream); | 200 value()->PrintTo(stream); |
201 } | 201 } |
202 | 202 |
203 | 203 |
204 void LCmpIDAndBranch::PrintDataTo(StringStream* stream) { | 204 void LCompareNumericAndBranch::PrintDataTo(StringStream* stream) { |
205 stream->Add("if "); | 205 stream->Add("if "); |
206 left()->PrintTo(stream); | 206 left()->PrintTo(stream); |
207 stream->Add(" %s ", Token::String(op())); | 207 stream->Add(" %s ", Token::String(op())); |
208 right()->PrintTo(stream); | 208 right()->PrintTo(stream); |
209 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); | 209 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); |
210 } | 210 } |
211 | 211 |
212 | 212 |
213 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { | 213 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { |
214 stream->Add("if is_object("); | 214 stream->Add("if is_object("); |
(...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1688 ASSERT(instr->left()->representation().IsSmiOrTagged()); | 1688 ASSERT(instr->left()->representation().IsSmiOrTagged()); |
1689 ASSERT(instr->right()->representation().IsSmiOrTagged()); | 1689 ASSERT(instr->right()->representation().IsSmiOrTagged()); |
1690 LOperand* context = UseFixed(instr->context(), esi); | 1690 LOperand* context = UseFixed(instr->context(), esi); |
1691 LOperand* left = UseFixed(instr->left(), edx); | 1691 LOperand* left = UseFixed(instr->left(), edx); |
1692 LOperand* right = UseFixed(instr->right(), eax); | 1692 LOperand* right = UseFixed(instr->right(), eax); |
1693 LCmpT* result = new(zone()) LCmpT(context, left, right); | 1693 LCmpT* result = new(zone()) LCmpT(context, left, right); |
1694 return MarkAsCall(DefineFixed(result, eax), instr); | 1694 return MarkAsCall(DefineFixed(result, eax), instr); |
1695 } | 1695 } |
1696 | 1696 |
1697 | 1697 |
1698 LInstruction* LChunkBuilder::DoCompareIDAndBranch( | 1698 LInstruction* LChunkBuilder::DoCompareNumericAndBranch( |
1699 HCompareIDAndBranch* instr) { | 1699 HCompareNumericAndBranch* instr) { |
1700 Representation r = instr->representation(); | 1700 Representation r = instr->representation(); |
1701 if (r.IsSmiOrInteger32()) { | 1701 if (r.IsSmiOrInteger32()) { |
1702 ASSERT(instr->left()->representation().IsSmiOrInteger32()); | 1702 ASSERT(instr->left()->representation().IsSmiOrInteger32()); |
1703 ASSERT(instr->left()->representation().Equals( | 1703 ASSERT(instr->left()->representation().Equals( |
1704 instr->right()->representation())); | 1704 instr->right()->representation())); |
1705 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); | 1705 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); |
1706 LOperand* right = UseOrConstantAtStart(instr->right()); | 1706 LOperand* right = UseOrConstantAtStart(instr->right()); |
1707 return new(zone()) LCmpIDAndBranch(left, right); | 1707 return new(zone()) LCompareNumericAndBranch(left, right); |
1708 } else { | 1708 } else { |
1709 ASSERT(r.IsDouble()); | 1709 ASSERT(r.IsDouble()); |
1710 ASSERT(instr->left()->representation().IsDouble()); | 1710 ASSERT(instr->left()->representation().IsDouble()); |
1711 ASSERT(instr->right()->representation().IsDouble()); | 1711 ASSERT(instr->right()->representation().IsDouble()); |
1712 LOperand* left; | 1712 LOperand* left; |
1713 LOperand* right; | 1713 LOperand* right; |
1714 if (instr->left()->IsConstant() && instr->right()->IsConstant()) { | 1714 if (instr->left()->IsConstant() && instr->right()->IsConstant()) { |
1715 left = UseRegisterOrConstantAtStart(instr->left()); | 1715 left = UseRegisterOrConstantAtStart(instr->left()); |
1716 right = UseRegisterOrConstantAtStart(instr->right()); | 1716 right = UseRegisterOrConstantAtStart(instr->right()); |
1717 } else { | 1717 } else { |
1718 left = UseRegisterAtStart(instr->left()); | 1718 left = UseRegisterAtStart(instr->left()); |
1719 right = UseRegisterAtStart(instr->right()); | 1719 right = UseRegisterAtStart(instr->right()); |
1720 } | 1720 } |
1721 return new(zone()) LCmpIDAndBranch(left, right); | 1721 return new(zone()) LCompareNumericAndBranch(left, right); |
1722 } | 1722 } |
1723 } | 1723 } |
1724 | 1724 |
1725 | 1725 |
1726 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( | 1726 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( |
1727 HCompareObjectEqAndBranch* instr) { | 1727 HCompareObjectEqAndBranch* instr) { |
1728 LOperand* left = UseRegisterAtStart(instr->left()); | 1728 LOperand* left = UseRegisterAtStart(instr->left()); |
1729 LOperand* right = UseOrConstantAtStart(instr->right()); | 1729 LOperand* right = UseOrConstantAtStart(instr->right()); |
1730 return new(zone()) LCmpObjectEqAndBranch(left, right); | 1730 return new(zone()) LCmpObjectEqAndBranch(left, right); |
1731 } | 1731 } |
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2789 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2789 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2790 LOperand* object = UseRegister(instr->object()); | 2790 LOperand* object = UseRegister(instr->object()); |
2791 LOperand* index = UseTempRegister(instr->index()); | 2791 LOperand* index = UseTempRegister(instr->index()); |
2792 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2792 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2793 } | 2793 } |
2794 | 2794 |
2795 | 2795 |
2796 } } // namespace v8::internal | 2796 } } // namespace v8::internal |
2797 | 2797 |
2798 #endif // V8_TARGET_ARCH_IA32 | 2798 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |