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

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: More tweaks 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
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 1392 matching lines...) Expand 10 before | Expand all | Expand 10 after
1591 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { 1591 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
1592 ASSERT(instr->left()->representation().IsTagged()); 1592 ASSERT(instr->left()->representation().IsTagged());
1593 ASSERT(instr->right()->representation().IsTagged()); 1593 ASSERT(instr->right()->representation().IsTagged());
1594 LOperand* left = UseFixed(instr->left(), rdx); 1594 LOperand* left = UseFixed(instr->left(), rdx);
1595 LOperand* right = UseFixed(instr->right(), rax); 1595 LOperand* right = UseFixed(instr->right(), rax);
1596 LCmpT* result = new(zone()) LCmpT(left, right); 1596 LCmpT* result = new(zone()) LCmpT(left, right);
1597 return MarkAsCall(DefineFixed(result, rax), instr); 1597 return MarkAsCall(DefineFixed(result, rax), instr);
1598 } 1598 }
1599 1599
1600 1600
1601 LInstruction* LChunkBuilder::DoCompareIDAndBranch( 1601 LInstruction* LChunkBuilder::DoCompareNumericAndBranch(
1602 HCompareIDAndBranch* instr) { 1602 HCompareNumericAndBranch* instr) {
1603 Representation r = instr->representation(); 1603 Representation r = instr->representation();
1604 if (r.IsSmiOrInteger32()) { 1604 if (r.IsSmiOrInteger32()) {
1605 ASSERT(instr->left()->representation().IsSmiOrInteger32()); 1605 ASSERT(instr->left()->representation().IsSmiOrInteger32());
1606 ASSERT(instr->left()->representation().Equals( 1606 ASSERT(instr->left()->representation().Equals(
1607 instr->right()->representation())); 1607 instr->right()->representation()));
1608 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); 1608 LOperand* left = UseRegisterOrConstantAtStart(instr->left());
1609 LOperand* right = UseOrConstantAtStart(instr->right()); 1609 LOperand* right = UseOrConstantAtStart(instr->right());
1610 return new(zone()) LCmpIDAndBranch(left, right); 1610 return new(zone()) LCompareNumericAndBranch(left, right);
1611 } else { 1611 } else {
1612 ASSERT(r.IsDouble()); 1612 ASSERT(r.IsDouble());
1613 ASSERT(instr->left()->representation().IsDouble()); 1613 ASSERT(instr->left()->representation().IsDouble());
1614 ASSERT(instr->right()->representation().IsDouble()); 1614 ASSERT(instr->right()->representation().IsDouble());
1615 LOperand* left; 1615 LOperand* left;
1616 LOperand* right; 1616 LOperand* right;
1617 if (instr->left()->IsConstant() && instr->right()->IsConstant()) { 1617 if (instr->left()->IsConstant() && instr->right()->IsConstant()) {
1618 left = UseRegisterOrConstantAtStart(instr->left()); 1618 left = UseRegisterOrConstantAtStart(instr->left());
1619 right = UseRegisterOrConstantAtStart(instr->right()); 1619 right = UseRegisterOrConstantAtStart(instr->right());
1620 } else { 1620 } else {
1621 left = UseRegisterAtStart(instr->left()); 1621 left = UseRegisterAtStart(instr->left());
1622 right = UseRegisterAtStart(instr->right()); 1622 right = UseRegisterAtStart(instr->right());
1623 } 1623 }
1624 return new(zone()) LCmpIDAndBranch(left, right); 1624 return new(zone()) LCompareNumericAndBranch(left, right);
1625 } 1625 }
1626 } 1626 }
1627 1627
1628 1628
1629 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( 1629 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch(
1630 HCompareObjectEqAndBranch* instr) { 1630 HCompareObjectEqAndBranch* instr) {
1631 LOperand* left = UseRegisterAtStart(instr->left()); 1631 LOperand* left = UseRegisterAtStart(instr->left());
1632 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); 1632 LOperand* right = UseRegisterOrConstantAtStart(instr->right());
1633 return new(zone()) LCmpObjectEqAndBranch(left, right); 1633 return new(zone()) LCmpObjectEqAndBranch(left, right);
1634 } 1634 }
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
2574 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2574 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2575 LOperand* object = UseRegister(instr->object()); 2575 LOperand* object = UseRegister(instr->object());
2576 LOperand* index = UseTempRegister(instr->index()); 2576 LOperand* index = UseTempRegister(instr->index());
2577 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2577 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2578 } 2578 }
2579 2579
2580 2580
2581 } } // namespace v8::internal 2581 } } // namespace v8::internal
2582 2582
2583 #endif // V8_TARGET_ARCH_X64 2583 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698