Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: src/ia32/lithium-ia32.cc

Issue 18331004: Refactoring and cleanup of control instructions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase to ToT Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1698 ASSERT(instr->left()->representation().IsSmiOrTagged()); 1698 ASSERT(instr->left()->representation().IsSmiOrTagged());
1699 ASSERT(instr->right()->representation().IsSmiOrTagged()); 1699 ASSERT(instr->right()->representation().IsSmiOrTagged());
1700 LOperand* context = UseFixed(instr->context(), esi); 1700 LOperand* context = UseFixed(instr->context(), esi);
1701 LOperand* left = UseFixed(instr->left(), edx); 1701 LOperand* left = UseFixed(instr->left(), edx);
1702 LOperand* right = UseFixed(instr->right(), eax); 1702 LOperand* right = UseFixed(instr->right(), eax);
1703 LCmpT* result = new(zone()) LCmpT(context, left, right); 1703 LCmpT* result = new(zone()) LCmpT(context, left, right);
1704 return MarkAsCall(DefineFixed(result, eax), instr); 1704 return MarkAsCall(DefineFixed(result, eax), instr);
1705 } 1705 }
1706 1706
1707 1707
1708 LInstruction* LChunkBuilder::DoCompareIDAndBranch( 1708 LInstruction* LChunkBuilder::DoCompareNumericAndBranch(
1709 HCompareIDAndBranch* instr) { 1709 HCompareNumericAndBranch* instr) {
1710 Representation r = instr->representation(); 1710 Representation r = instr->representation();
1711 if (r.IsSmiOrInteger32()) { 1711 if (r.IsSmiOrInteger32()) {
1712 ASSERT(instr->left()->representation().IsSmiOrInteger32()); 1712 ASSERT(instr->left()->representation().IsSmiOrInteger32());
1713 ASSERT(instr->left()->representation().Equals( 1713 ASSERT(instr->left()->representation().Equals(
1714 instr->right()->representation())); 1714 instr->right()->representation()));
1715 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); 1715 LOperand* left = UseRegisterOrConstantAtStart(instr->left());
1716 LOperand* right = UseOrConstantAtStart(instr->right()); 1716 LOperand* right = UseOrConstantAtStart(instr->right());
1717 return new(zone()) LCmpIDAndBranch(left, right); 1717 return new(zone()) LCompareNumericAndBranch(left, right);
1718 } else { 1718 } else {
1719 ASSERT(r.IsDouble()); 1719 ASSERT(r.IsDouble());
1720 ASSERT(instr->left()->representation().IsDouble()); 1720 ASSERT(instr->left()->representation().IsDouble());
1721 ASSERT(instr->right()->representation().IsDouble()); 1721 ASSERT(instr->right()->representation().IsDouble());
1722 LOperand* left; 1722 LOperand* left;
1723 LOperand* right; 1723 LOperand* right;
1724 if (instr->left()->IsConstant() && instr->right()->IsConstant()) { 1724 if (instr->left()->IsConstant() && instr->right()->IsConstant()) {
1725 left = UseRegisterOrConstantAtStart(instr->left()); 1725 left = UseRegisterOrConstantAtStart(instr->left());
1726 right = UseRegisterOrConstantAtStart(instr->right()); 1726 right = UseRegisterOrConstantAtStart(instr->right());
1727 } else { 1727 } else {
1728 left = UseRegisterAtStart(instr->left()); 1728 left = UseRegisterAtStart(instr->left());
1729 right = UseRegisterAtStart(instr->right()); 1729 right = UseRegisterAtStart(instr->right());
1730 } 1730 }
1731 return new(zone()) LCmpIDAndBranch(left, right); 1731 return new(zone()) LCompareNumericAndBranch(left, right);
1732 } 1732 }
1733 } 1733 }
1734 1734
1735 1735
1736 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( 1736 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch(
1737 HCompareObjectEqAndBranch* instr) { 1737 HCompareObjectEqAndBranch* instr) {
1738 LOperand* left = UseRegisterAtStart(instr->left()); 1738 LOperand* left = UseRegisterAtStart(instr->left());
1739 LOperand* right = UseOrConstantAtStart(instr->right()); 1739 LOperand* right = UseOrConstantAtStart(instr->right());
1740 return new(zone()) LCmpObjectEqAndBranch(left, right); 1740 return new(zone()) LCmpObjectEqAndBranch(left, right);
1741 } 1741 }
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
2804 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2804 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2805 LOperand* object = UseRegister(instr->object()); 2805 LOperand* object = UseRegister(instr->object());
2806 LOperand* index = UseTempRegister(instr->index()); 2806 LOperand* index = UseTempRegister(instr->index());
2807 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2807 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2808 } 2808 }
2809 2809
2810 2810
2811 } } // namespace v8::internal 2811 } } // namespace v8::internal
2812 2812
2813 #endif // V8_TARGET_ARCH_IA32 2813 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698