| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 } | 1125 } |
| 1126 } else if (from.IsDouble()) { | 1126 } else if (from.IsDouble()) { |
| 1127 if (to.IsTagged()) { | 1127 if (to.IsTagged()) { |
| 1128 info()->MarkAsDeferredCalling(); | 1128 info()->MarkAsDeferredCalling(); |
| 1129 LOperand* value = UseRegister(instr->value()); | 1129 LOperand* value = UseRegister(instr->value()); |
| 1130 LOperand* temp1 = TempRegister(); | 1130 LOperand* temp1 = TempRegister(); |
| 1131 LOperand* temp2 = TempRegister(); | 1131 LOperand* temp2 = TempRegister(); |
| 1132 | 1132 |
| 1133 LNumberTagD* result = new(zone()) LNumberTagD(value, temp1, temp2); | 1133 LNumberTagD* result = new(zone()) LNumberTagD(value, temp1, temp2); |
| 1134 return AssignPointerMap(DefineAsRegister(result)); | 1134 return AssignPointerMap(DefineAsRegister(result)); |
| 1135 } else if (to.IsSmi()) { | 1135 } else { |
| 1136 // TODO(all): Split LDoubleToSmi into two instructions. | 1136 ASSERT(to.IsSmi() || to.IsInteger32()); |
| 1137 LOperand* value = UseRegister(instr->value()); | 1137 LOperand* value = UseRegister(instr->value()); |
| 1138 LOperand* temp1 = instr->CanTruncateToInt32() ? TempRegister() : NULL; | 1138 |
| 1139 LOperand* temp2 = instr->CanTruncateToInt32() ? TempRegister() : NULL; | 1139 if (instr->CanTruncateToInt32()) { |
| 1140 LDoubleToSmi* result = new(zone()) LDoubleToSmi(value, temp1, temp2); | 1140 LOperand* temp1 = TempRegister(); |
| 1141 return AssignEnvironment(DefineAsRegister(result)); | 1141 LOperand* temp2 = TempRegister(); |
| 1142 } else { | 1142 LTruncateDoubleToIntOrSmi* result = |
| 1143 // TODO(all): Split LDoubleToI into two instructions, truncating and not. | 1143 new(zone()) LTruncateDoubleToIntOrSmi(value, temp1, temp2); |
| 1144 ASSERT(to.IsInteger32()); | 1144 return DefineAsRegister(result); |
| 1145 LOperand* value = UseRegister(instr->value()); | 1145 } else { |
| 1146 LOperand* temp1 = instr->CanTruncateToInt32() ? TempRegister() : NULL; | 1146 LDoubleToIntOrSmi* result = new(zone()) LDoubleToIntOrSmi(value); |
| 1147 LOperand* temp2 = instr->CanTruncateToInt32() ? TempRegister() : NULL; | 1147 return AssignEnvironment(DefineAsRegister(result)); |
| 1148 LDoubleToI* result = new(zone()) LDoubleToI(value, temp1, temp2); | 1148 } |
| 1149 return AssignEnvironment(DefineAsRegister(result)); | |
| 1150 } | 1149 } |
| 1151 } else if (from.IsInteger32()) { | 1150 } else if (from.IsInteger32()) { |
| 1152 info()->MarkAsDeferredCalling(); | 1151 info()->MarkAsDeferredCalling(); |
| 1153 if (to.IsTagged()) { | 1152 if (to.IsTagged()) { |
| 1154 HValue* val = instr->value(); | 1153 HValue* val = instr->value(); |
| 1155 | 1154 |
| 1156 if (val->CheckFlag(HInstruction::kUint32)) { | 1155 if (val->CheckFlag(HInstruction::kUint32)) { |
| 1157 LOperand* value = UseRegister(val); | 1156 LOperand* value = UseRegister(val); |
| 1158 LNumberTagU* result = new(zone()) LNumberTagU(value, | 1157 LNumberTagU* result = new(zone()) LNumberTagU(value, |
| 1159 TempRegister(), | 1158 TempRegister(), |
| (...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2505 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { | 2504 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { |
| 2506 LOperand* receiver = UseRegister(instr->receiver()); | 2505 LOperand* receiver = UseRegister(instr->receiver()); |
| 2507 LOperand* function = UseRegisterAtStart(instr->function()); | 2506 LOperand* function = UseRegisterAtStart(instr->function()); |
| 2508 LOperand* temp = TempRegister(); | 2507 LOperand* temp = TempRegister(); |
| 2509 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function, temp); | 2508 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function, temp); |
| 2510 return AssignEnvironment(DefineAsRegister(result)); | 2509 return AssignEnvironment(DefineAsRegister(result)); |
| 2511 } | 2510 } |
| 2512 | 2511 |
| 2513 | 2512 |
| 2514 } } // namespace v8::internal | 2513 } } // namespace v8::internal |
| OLD | NEW |