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

Side by Side Diff: src/x64/lithium-x64.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/x64/lithium-x64.h ('k') | test/mjsunit/regress/regress-2537.js » ('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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 stream->Add("B%d", block_id()); 178 stream->Add("B%d", block_id());
179 } 179 }
180 180
181 181
182 void LBranch::PrintDataTo(StringStream* stream) { 182 void LBranch::PrintDataTo(StringStream* stream) {
183 stream->Add("B%d | B%d on ", true_block_id(), false_block_id()); 183 stream->Add("B%d | B%d on ", true_block_id(), false_block_id());
184 value()->PrintTo(stream); 184 value()->PrintTo(stream);
185 } 185 }
186 186
187 187
188 void LCmpIDAndBranch::PrintDataTo(StringStream* stream) { 188 void LCompareNumericAndBranch::PrintDataTo(StringStream* stream) {
189 stream->Add("if "); 189 stream->Add("if ");
190 left()->PrintTo(stream); 190 left()->PrintTo(stream);
191 stream->Add(" %s ", Token::String(op())); 191 stream->Add(" %s ", Token::String(op()));
192 right()->PrintTo(stream); 192 right()->PrintTo(stream);
193 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); 193 stream->Add(" then B%d else B%d", true_block_id(), false_block_id());
194 } 194 }
195 195
196 196
197 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { 197 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) {
198 stream->Add("if is_object("); 198 stream->Add("if is_object(");
(...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { 1592 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
1593 ASSERT(instr->left()->representation().IsTagged()); 1593 ASSERT(instr->left()->representation().IsTagged());
1594 ASSERT(instr->right()->representation().IsTagged()); 1594 ASSERT(instr->right()->representation().IsTagged());
1595 LOperand* left = UseFixed(instr->left(), rdx); 1595 LOperand* left = UseFixed(instr->left(), rdx);
1596 LOperand* right = UseFixed(instr->right(), rax); 1596 LOperand* right = UseFixed(instr->right(), rax);
1597 LCmpT* result = new(zone()) LCmpT(left, right); 1597 LCmpT* result = new(zone()) LCmpT(left, right);
1598 return MarkAsCall(DefineFixed(result, rax), instr); 1598 return MarkAsCall(DefineFixed(result, rax), instr);
1599 } 1599 }
1600 1600
1601 1601
1602 LInstruction* LChunkBuilder::DoCompareIDAndBranch( 1602 LInstruction* LChunkBuilder::DoCompareNumericAndBranch(
1603 HCompareIDAndBranch* instr) { 1603 HCompareNumericAndBranch* instr) {
1604 Representation r = instr->representation(); 1604 Representation r = instr->representation();
1605 if (r.IsSmiOrInteger32()) { 1605 if (r.IsSmiOrInteger32()) {
1606 ASSERT(instr->left()->representation().IsSmiOrInteger32()); 1606 ASSERT(instr->left()->representation().IsSmiOrInteger32());
1607 ASSERT(instr->left()->representation().Equals( 1607 ASSERT(instr->left()->representation().Equals(
1608 instr->right()->representation())); 1608 instr->right()->representation()));
1609 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); 1609 LOperand* left = UseRegisterOrConstantAtStart(instr->left());
1610 LOperand* right = UseOrConstantAtStart(instr->right()); 1610 LOperand* right = UseOrConstantAtStart(instr->right());
1611 return new(zone()) LCmpIDAndBranch(left, right); 1611 return new(zone()) LCompareNumericAndBranch(left, right);
1612 } else { 1612 } else {
1613 ASSERT(r.IsDouble()); 1613 ASSERT(r.IsDouble());
1614 ASSERT(instr->left()->representation().IsDouble()); 1614 ASSERT(instr->left()->representation().IsDouble());
1615 ASSERT(instr->right()->representation().IsDouble()); 1615 ASSERT(instr->right()->representation().IsDouble());
1616 LOperand* left; 1616 LOperand* left;
1617 LOperand* right; 1617 LOperand* right;
1618 if (instr->left()->IsConstant() && instr->right()->IsConstant()) { 1618 if (instr->left()->IsConstant() && instr->right()->IsConstant()) {
1619 left = UseRegisterOrConstantAtStart(instr->left()); 1619 left = UseRegisterOrConstantAtStart(instr->left());
1620 right = UseRegisterOrConstantAtStart(instr->right()); 1620 right = UseRegisterOrConstantAtStart(instr->right());
1621 } else { 1621 } else {
1622 left = UseRegisterAtStart(instr->left()); 1622 left = UseRegisterAtStart(instr->left());
1623 right = UseRegisterAtStart(instr->right()); 1623 right = UseRegisterAtStart(instr->right());
1624 } 1624 }
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 = UseRegisterOrConstantAtStart(instr->right()); 1633 LOperand* right = UseRegisterOrConstantAtStart(instr->right());
1634 return new(zone()) LCmpObjectEqAndBranch(left, right); 1634 return new(zone()) LCmpObjectEqAndBranch(left, right);
1635 } 1635 }
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
2580 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2580 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2581 LOperand* object = UseRegister(instr->object()); 2581 LOperand* object = UseRegister(instr->object());
2582 LOperand* index = UseTempRegister(instr->index()); 2582 LOperand* index = UseTempRegister(instr->index());
2583 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2583 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2584 } 2584 }
2585 2585
2586 2586
2587 } } // namespace v8::internal 2587 } } // namespace v8::internal
2588 2588
2589 #endif // V8_TARGET_ARCH_X64 2589 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | test/mjsunit/regress/regress-2537.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698