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

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

Issue 6625084: ARM: Improved double to integer truncation.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 9 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 if (to.IsDouble()) { 1592 if (to.IsDouble()) {
1593 LOperand* value = UseRegister(instr->value()); 1593 LOperand* value = UseRegister(instr->value());
1594 LNumberUntagD* res = new LNumberUntagD(value); 1594 LNumberUntagD* res = new LNumberUntagD(value);
1595 return AssignEnvironment(DefineAsRegister(res)); 1595 return AssignEnvironment(DefineAsRegister(res));
1596 } else { 1596 } else {
1597 ASSERT(to.IsInteger32()); 1597 ASSERT(to.IsInteger32());
1598 LOperand* value = UseRegister(instr->value()); 1598 LOperand* value = UseRegister(instr->value());
1599 bool needs_check = !instr->value()->type().IsSmi(); 1599 bool needs_check = !instr->value()->type().IsSmi();
1600 LInstruction* res = NULL; 1600 LInstruction* res = NULL;
1601 if (needs_check) { 1601 if (needs_check) {
1602 res = DefineSameAsFirst(new LTaggedToI(value, FixedTemp(d1))); 1602 res = DefineSameAsFirst(new LTaggedToI(value,
1603 TempRegister(),
1604 FixedTemp(d1),
1605 FixedTemp(d2)));
1603 } else { 1606 } else {
1604 res = DefineSameAsFirst(new LSmiUntag(value, needs_check)); 1607 res = DefineSameAsFirst(new LSmiUntag(value, needs_check));
1605 } 1608 }
1606 if (needs_check) { 1609 if (needs_check) {
1607 res = AssignEnvironment(res); 1610 res = AssignEnvironment(res);
1608 } 1611 }
1609 return res; 1612 return res;
1610 } 1613 }
1611 } else if (from.IsDouble()) { 1614 } else if (from.IsDouble()) {
1612 if (to.IsTagged()) { 1615 if (to.IsTagged()) {
1613 LOperand* value = UseRegister(instr->value()); 1616 LOperand* value = UseRegister(instr->value());
1614 LOperand* temp1 = TempRegister(); 1617 LOperand* temp1 = TempRegister();
1615 LOperand* temp2 = TempRegister(); 1618 LOperand* temp2 = TempRegister();
1616 1619
1617 // Make sure that the temp and result_temp registers are 1620 // Make sure that the temp and result_temp registers are
1618 // different. 1621 // different.
1619 LUnallocated* result_temp = TempRegister(); 1622 LUnallocated* result_temp = TempRegister();
1620 LNumberTagD* result = new LNumberTagD(value, temp1, temp2); 1623 LNumberTagD* result = new LNumberTagD(value, temp1, temp2);
1621 Define(result, result_temp); 1624 Define(result, result_temp);
1622 return AssignPointerMap(result); 1625 return AssignPointerMap(result);
1623 } else { 1626 } else {
1624 ASSERT(to.IsInteger32()); 1627 ASSERT(to.IsInteger32());
1625 LOperand* value = UseRegister(instr->value()); 1628 LOperand* value = UseRegister(instr->value());
1626 LDoubleToI* res = new LDoubleToI(value, TempRegister()); 1629 LDoubleToI* res = new LDoubleToI(value, TempRegister(), FixedTemp(d1));
1627 return AssignEnvironment(DefineAsRegister(res)); 1630 return AssignEnvironment(DefineAsRegister(res));
1628 } 1631 }
1629 } else if (from.IsInteger32()) { 1632 } else if (from.IsInteger32()) {
1630 if (to.IsTagged()) { 1633 if (to.IsTagged()) {
1631 HValue* val = instr->value(); 1634 HValue* val = instr->value();
1632 LOperand* value = UseRegister(val); 1635 LOperand* value = UseRegister(val);
1633 if (val->HasRange() && val->range()->IsInSmiRange()) { 1636 if (val->HasRange() && val->range()->IsInSmiRange()) {
1634 return DefineSameAsFirst(new LSmiTag(value)); 1637 return DefineSameAsFirst(new LSmiTag(value));
1635 } else { 1638 } else {
1636 LNumberTagI* result = new LNumberTagI(value); 1639 LNumberTagI* result = new LNumberTagI(value);
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
2030 2033
2031 2034
2032 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 2035 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
2033 HEnvironment* outer = current_block_->last_environment()->outer(); 2036 HEnvironment* outer = current_block_->last_environment()->outer();
2034 current_block_->UpdateEnvironment(outer); 2037 current_block_->UpdateEnvironment(outer);
2035 return NULL; 2038 return NULL;
2036 } 2039 }
2037 2040
2038 2041
2039 } } // namespace v8::internal 2042 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698