OLD | NEW |
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 Loading... |
1592 if (from.IsTagged()) { | 1592 if (from.IsTagged()) { |
1593 if (to.IsDouble()) { | 1593 if (to.IsDouble()) { |
1594 LOperand* value = UseRegister(instr->value()); | 1594 LOperand* value = UseRegister(instr->value()); |
1595 LNumberUntagD* res = new LNumberUntagD(value); | 1595 LNumberUntagD* res = new LNumberUntagD(value); |
1596 return AssignEnvironment(DefineAsRegister(res)); | 1596 return AssignEnvironment(DefineAsRegister(res)); |
1597 } else { | 1597 } else { |
1598 ASSERT(to.IsInteger32()); | 1598 ASSERT(to.IsInteger32()); |
1599 LOperand* value = UseRegister(instr->value()); | 1599 LOperand* value = UseRegister(instr->value()); |
1600 bool needs_check = !instr->value()->type().IsSmi(); | 1600 bool needs_check = !instr->value()->type().IsSmi(); |
1601 LInstruction* res = NULL; | 1601 LInstruction* res = NULL; |
1602 if (needs_check) { | 1602 if (!needs_check) { |
1603 res = DefineSameAsFirst(new LTaggedToI(value, FixedTemp(d1))); | 1603 res = DefineSameAsFirst(new LSmiUntag(value, needs_check)); |
1604 } else { | 1604 } else { |
1605 res = DefineSameAsFirst(new LSmiUntag(value, needs_check)); | 1605 LOperand* temp1 = TempRegister(); |
1606 } | 1606 LOperand* temp2 = instr->CanTruncateToInt32() ? TempRegister() |
1607 if (needs_check) { | 1607 : NULL; |
| 1608 LOperand* temp3 = instr->CanTruncateToInt32() ? FixedTemp(d3) |
| 1609 : NULL; |
| 1610 res = DefineSameAsFirst(new LTaggedToI(value, temp1, temp2, temp3)); |
1608 res = AssignEnvironment(res); | 1611 res = AssignEnvironment(res); |
1609 } | 1612 } |
1610 return res; | 1613 return res; |
1611 } | 1614 } |
1612 } else if (from.IsDouble()) { | 1615 } else if (from.IsDouble()) { |
1613 if (to.IsTagged()) { | 1616 if (to.IsTagged()) { |
1614 LOperand* value = UseRegister(instr->value()); | 1617 LOperand* value = UseRegister(instr->value()); |
1615 LOperand* temp1 = TempRegister(); | 1618 LOperand* temp1 = TempRegister(); |
1616 LOperand* temp2 = TempRegister(); | 1619 LOperand* temp2 = TempRegister(); |
1617 | 1620 |
1618 // Make sure that the temp and result_temp registers are | 1621 // Make sure that the temp and result_temp registers are |
1619 // different. | 1622 // different. |
1620 LUnallocated* result_temp = TempRegister(); | 1623 LUnallocated* result_temp = TempRegister(); |
1621 LNumberTagD* result = new LNumberTagD(value, temp1, temp2); | 1624 LNumberTagD* result = new LNumberTagD(value, temp1, temp2); |
1622 Define(result, result_temp); | 1625 Define(result, result_temp); |
1623 return AssignPointerMap(result); | 1626 return AssignPointerMap(result); |
1624 } else { | 1627 } else { |
1625 ASSERT(to.IsInteger32()); | 1628 ASSERT(to.IsInteger32()); |
1626 LOperand* value = UseRegister(instr->value()); | 1629 LOperand* value = UseRegister(instr->value()); |
1627 LDoubleToI* res = new LDoubleToI(value, TempRegister()); | 1630 LDoubleToI* res = |
| 1631 new LDoubleToI(value, |
| 1632 TempRegister(), |
| 1633 instr->CanTruncateToInt32() ? TempRegister() : NULL); |
1628 return AssignEnvironment(DefineAsRegister(res)); | 1634 return AssignEnvironment(DefineAsRegister(res)); |
1629 } | 1635 } |
1630 } else if (from.IsInteger32()) { | 1636 } else if (from.IsInteger32()) { |
1631 if (to.IsTagged()) { | 1637 if (to.IsTagged()) { |
1632 HValue* val = instr->value(); | 1638 HValue* val = instr->value(); |
1633 LOperand* value = UseRegister(val); | 1639 LOperand* value = UseRegister(val); |
1634 if (val->HasRange() && val->range()->IsInSmiRange()) { | 1640 if (val->HasRange() && val->range()->IsInSmiRange()) { |
1635 return DefineSameAsFirst(new LSmiTag(value)); | 1641 return DefineSameAsFirst(new LSmiTag(value)); |
1636 } else { | 1642 } else { |
1637 LNumberTagI* result = new LNumberTagI(value); | 1643 LNumberTagI* result = new LNumberTagI(value); |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2038 | 2044 |
2039 | 2045 |
2040 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2046 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
2041 HEnvironment* outer = current_block_->last_environment()->outer(); | 2047 HEnvironment* outer = current_block_->last_environment()->outer(); |
2042 current_block_->UpdateEnvironment(outer); | 2048 current_block_->UpdateEnvironment(outer); |
2043 return NULL; | 2049 return NULL; |
2044 } | 2050 } |
2045 | 2051 |
2046 | 2052 |
2047 } } // namespace v8::internal | 2053 } } // namespace v8::internal |
OLD | NEW |