| OLD | NEW |
| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 *hydrogen()->class_name(), | 254 *hydrogen()->class_name(), |
| 255 true_block_id(), | 255 true_block_id(), |
| 256 false_block_id()); | 256 false_block_id()); |
| 257 } | 257 } |
| 258 | 258 |
| 259 | 259 |
| 260 void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) { | 260 void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) { |
| 261 stream->Add("if typeof "); | 261 stream->Add("if typeof "); |
| 262 value()->PrintTo(stream); | 262 value()->PrintTo(stream); |
| 263 stream->Add(" == \"%s\" then B%d else B%d", | 263 stream->Add(" == \"%s\" then B%d else B%d", |
| 264 *hydrogen()->type_literal()->ToCString(), | 264 hydrogen()->type_literal()->ToCString().get(), |
| 265 true_block_id(), false_block_id()); | 265 true_block_id(), false_block_id()); |
| 266 } | 266 } |
| 267 | 267 |
| 268 | 268 |
| 269 void LStoreCodeEntry::PrintDataTo(StringStream* stream) { | 269 void LStoreCodeEntry::PrintDataTo(StringStream* stream) { |
| 270 stream->Add(" = "); | 270 stream->Add(" = "); |
| 271 function()->PrintTo(stream); | 271 function()->PrintTo(stream); |
| 272 stream->Add(".code_entry = "); | 272 stream->Add(".code_entry = "); |
| 273 code_object()->PrintTo(stream); | 273 code_object()->PrintTo(stream); |
| 274 } | 274 } |
| 275 | 275 |
| 276 | 276 |
| 277 void LInnerAllocatedObject::PrintDataTo(StringStream* stream) { | 277 void LInnerAllocatedObject::PrintDataTo(StringStream* stream) { |
| 278 stream->Add(" = "); | 278 stream->Add(" = "); |
| 279 base_object()->PrintTo(stream); | 279 base_object()->PrintTo(stream); |
| 280 stream->Add(" + %d", offset()); | 280 stream->Add(" + "); |
| 281 offset()->PrintTo(stream); |
| 281 } | 282 } |
| 282 | 283 |
| 283 | 284 |
| 284 void LCallConstantFunction::PrintDataTo(StringStream* stream) { | 285 void LCallConstantFunction::PrintDataTo(StringStream* stream) { |
| 285 stream->Add("#%d / ", arity()); | 286 stream->Add("#%d / ", arity()); |
| 286 } | 287 } |
| 287 | 288 |
| 288 | 289 |
| 289 void LLoadContextSlot::PrintDataTo(StringStream* stream) { | 290 void LLoadContextSlot::PrintDataTo(StringStream* stream) { |
| 290 context()->PrintTo(stream); | 291 context()->PrintTo(stream); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 306 } | 307 } |
| 307 | 308 |
| 308 | 309 |
| 309 void LCallKeyed::PrintDataTo(StringStream* stream) { | 310 void LCallKeyed::PrintDataTo(StringStream* stream) { |
| 310 stream->Add("[a2] #%d / ", arity()); | 311 stream->Add("[a2] #%d / ", arity()); |
| 311 } | 312 } |
| 312 | 313 |
| 313 | 314 |
| 314 void LCallNamed::PrintDataTo(StringStream* stream) { | 315 void LCallNamed::PrintDataTo(StringStream* stream) { |
| 315 SmartArrayPointer<char> name_string = name()->ToCString(); | 316 SmartArrayPointer<char> name_string = name()->ToCString(); |
| 316 stream->Add("%s #%d / ", *name_string, arity()); | 317 stream->Add("%s #%d / ", name_string.get(), arity()); |
| 317 } | 318 } |
| 318 | 319 |
| 319 | 320 |
| 320 void LCallGlobal::PrintDataTo(StringStream* stream) { | 321 void LCallGlobal::PrintDataTo(StringStream* stream) { |
| 321 SmartArrayPointer<char> name_string = name()->ToCString(); | 322 SmartArrayPointer<char> name_string = name()->ToCString(); |
| 322 stream->Add("%s #%d / ", *name_string, arity()); | 323 stream->Add("%s #%d / ", name_string.get(), arity()); |
| 323 } | 324 } |
| 324 | 325 |
| 325 | 326 |
| 326 void LCallKnownGlobal::PrintDataTo(StringStream* stream) { | 327 void LCallKnownGlobal::PrintDataTo(StringStream* stream) { |
| 327 stream->Add("#%d / ", arity()); | 328 stream->Add("#%d / ", arity()); |
| 328 } | 329 } |
| 329 | 330 |
| 330 | 331 |
| 331 void LCallNew::PrintDataTo(StringStream* stream) { | 332 void LCallNew::PrintDataTo(StringStream* stream) { |
| 332 stream->Add("= "); | 333 stream->Add("= "); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 357 object()->PrintTo(stream); | 358 object()->PrintTo(stream); |
| 358 hydrogen()->access().PrintTo(stream); | 359 hydrogen()->access().PrintTo(stream); |
| 359 stream->Add(" <- "); | 360 stream->Add(" <- "); |
| 360 value()->PrintTo(stream); | 361 value()->PrintTo(stream); |
| 361 } | 362 } |
| 362 | 363 |
| 363 | 364 |
| 364 void LStoreNamedGeneric::PrintDataTo(StringStream* stream) { | 365 void LStoreNamedGeneric::PrintDataTo(StringStream* stream) { |
| 365 object()->PrintTo(stream); | 366 object()->PrintTo(stream); |
| 366 stream->Add("."); | 367 stream->Add("."); |
| 367 stream->Add(*String::cast(*name())->ToCString()); | 368 stream->Add(String::cast(*name())->ToCString().get()); |
| 368 stream->Add(" <- "); | 369 stream->Add(" <- "); |
| 369 value()->PrintTo(stream); | 370 value()->PrintTo(stream); |
| 370 } | 371 } |
| 371 | 372 |
| 372 | 373 |
| 373 void LLoadKeyed::PrintDataTo(StringStream* stream) { | 374 void LLoadKeyed::PrintDataTo(StringStream* stream) { |
| 374 elements()->PrintTo(stream); | 375 elements()->PrintTo(stream); |
| 375 stream->Add("["); | 376 stream->Add("["); |
| 376 key()->PrintTo(stream); | 377 key()->PrintTo(stream); |
| 377 if (hydrogen()->IsDehoisted()) { | 378 if (hydrogen()->IsDehoisted()) { |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1080 UseFixed(instr->left(), a0), | 1081 UseFixed(instr->left(), a0), |
| 1081 FixedTemp(t0)); | 1082 FixedTemp(t0)); |
| 1082 return MarkAsCall(DefineFixed(result, v0), instr); | 1083 return MarkAsCall(DefineFixed(result, v0), instr); |
| 1083 } | 1084 } |
| 1084 | 1085 |
| 1085 | 1086 |
| 1086 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { | 1087 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { |
| 1087 LOperand* receiver = UseRegisterAtStart(instr->receiver()); | 1088 LOperand* receiver = UseRegisterAtStart(instr->receiver()); |
| 1088 LOperand* function = UseRegisterAtStart(instr->function()); | 1089 LOperand* function = UseRegisterAtStart(instr->function()); |
| 1089 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); | 1090 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); |
| 1090 return AssignEnvironment(DefineSameAsFirst(result)); | 1091 return AssignEnvironment(DefineAsRegister(result)); |
| 1091 } | 1092 } |
| 1092 | 1093 |
| 1093 | 1094 |
| 1094 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) { | 1095 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) { |
| 1095 LOperand* function = UseFixed(instr->function(), a1); | 1096 LOperand* function = UseFixed(instr->function(), a1); |
| 1096 LOperand* receiver = UseFixed(instr->receiver(), a0); | 1097 LOperand* receiver = UseFixed(instr->receiver(), a0); |
| 1097 LOperand* length = UseFixed(instr->length(), a2); | 1098 LOperand* length = UseFixed(instr->length(), a2); |
| 1098 LOperand* elements = UseFixed(instr->elements(), a3); | 1099 LOperand* elements = UseFixed(instr->elements(), a3); |
| 1099 LApplyArguments* result = new(zone()) LApplyArguments(function, | 1100 LApplyArguments* result = new(zone()) LApplyArguments(function, |
| 1100 receiver, | 1101 receiver, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1112 | 1113 |
| 1113 LInstruction* LChunkBuilder::DoStoreCodeEntry( | 1114 LInstruction* LChunkBuilder::DoStoreCodeEntry( |
| 1114 HStoreCodeEntry* store_code_entry) { | 1115 HStoreCodeEntry* store_code_entry) { |
| 1115 LOperand* function = UseRegister(store_code_entry->function()); | 1116 LOperand* function = UseRegister(store_code_entry->function()); |
| 1116 LOperand* code_object = UseTempRegister(store_code_entry->code_object()); | 1117 LOperand* code_object = UseTempRegister(store_code_entry->code_object()); |
| 1117 return new(zone()) LStoreCodeEntry(function, code_object); | 1118 return new(zone()) LStoreCodeEntry(function, code_object); |
| 1118 } | 1119 } |
| 1119 | 1120 |
| 1120 | 1121 |
| 1121 LInstruction* LChunkBuilder::DoInnerAllocatedObject( | 1122 LInstruction* LChunkBuilder::DoInnerAllocatedObject( |
| 1122 HInnerAllocatedObject* inner_object) { | 1123 HInnerAllocatedObject* instr) { |
| 1123 LOperand* base_object = UseRegisterAtStart(inner_object->base_object()); | 1124 LOperand* base_object = UseRegisterAtStart(instr->base_object()); |
| 1124 LInnerAllocatedObject* result = | 1125 LOperand* offset = UseRegisterOrConstantAtStart(instr->offset()); |
| 1125 new(zone()) LInnerAllocatedObject(base_object); | 1126 return DefineAsRegister( |
| 1126 return DefineAsRegister(result); | 1127 new(zone()) LInnerAllocatedObject(base_object, offset)); |
| 1127 } | 1128 } |
| 1128 | 1129 |
| 1129 | 1130 |
| 1130 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) { | 1131 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) { |
| 1131 return instr->HasNoUses() | 1132 return instr->HasNoUses() |
| 1132 ? NULL | 1133 ? NULL |
| 1133 : DefineAsRegister(new(zone()) LThisFunction); | 1134 : DefineAsRegister(new(zone()) LThisFunction); |
| 1134 } | 1135 } |
| 1135 | 1136 |
| 1136 | 1137 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1182 return MarkAsCall(DefineFixed(result, v0), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1183 return MarkAsCall(DefineFixed(result, v0), instr, CANNOT_DEOPTIMIZE_EAGERLY); |
| 1183 } | 1184 } |
| 1184 | 1185 |
| 1185 | 1186 |
| 1186 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1187 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
| 1187 switch (instr->op()) { | 1188 switch (instr->op()) { |
| 1188 case kMathFloor: return DoMathFloor(instr); | 1189 case kMathFloor: return DoMathFloor(instr); |
| 1189 case kMathRound: return DoMathRound(instr); | 1190 case kMathRound: return DoMathRound(instr); |
| 1190 case kMathAbs: return DoMathAbs(instr); | 1191 case kMathAbs: return DoMathAbs(instr); |
| 1191 case kMathLog: return DoMathLog(instr); | 1192 case kMathLog: return DoMathLog(instr); |
| 1192 case kMathSin: return DoMathSin(instr); | |
| 1193 case kMathCos: return DoMathCos(instr); | |
| 1194 case kMathTan: return DoMathTan(instr); | |
| 1195 case kMathExp: return DoMathExp(instr); | 1193 case kMathExp: return DoMathExp(instr); |
| 1196 case kMathSqrt: return DoMathSqrt(instr); | 1194 case kMathSqrt: return DoMathSqrt(instr); |
| 1197 case kMathPowHalf: return DoMathPowHalf(instr); | 1195 case kMathPowHalf: return DoMathPowHalf(instr); |
| 1198 default: | 1196 default: |
| 1199 UNREACHABLE(); | 1197 UNREACHABLE(); |
| 1200 return NULL; | 1198 return NULL; |
| 1201 } | 1199 } |
| 1202 } | 1200 } |
| 1203 | 1201 |
| 1204 | 1202 |
| 1205 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { | 1203 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { |
| 1206 LOperand* input = UseFixedDouble(instr->value(), f4); | 1204 LOperand* input = UseFixedDouble(instr->value(), f4); |
| 1207 LMathLog* result = new(zone()) LMathLog(input); | 1205 LMathLog* result = new(zone()) LMathLog(input); |
| 1208 return MarkAsCall(DefineFixedDouble(result, f4), instr); | 1206 return MarkAsCall(DefineFixedDouble(result, f4), instr); |
| 1209 } | 1207 } |
| 1210 | 1208 |
| 1211 | 1209 |
| 1212 LInstruction* LChunkBuilder::DoMathSin(HUnaryMathOperation* instr) { | |
| 1213 LOperand* input = UseFixedDouble(instr->value(), f4); | |
| 1214 LMathSin* result = new(zone()) LMathSin(input); | |
| 1215 return MarkAsCall(DefineFixedDouble(result, f4), instr); | |
| 1216 } | |
| 1217 | |
| 1218 | |
| 1219 LInstruction* LChunkBuilder::DoMathCos(HUnaryMathOperation* instr) { | |
| 1220 LOperand* input = UseFixedDouble(instr->value(), f4); | |
| 1221 LMathCos* result = new(zone()) LMathCos(input); | |
| 1222 return MarkAsCall(DefineFixedDouble(result, f4), instr); | |
| 1223 } | |
| 1224 | |
| 1225 | |
| 1226 LInstruction* LChunkBuilder::DoMathTan(HUnaryMathOperation* instr) { | |
| 1227 LOperand* input = UseFixedDouble(instr->value(), f4); | |
| 1228 LMathTan* result = new(zone()) LMathTan(input); | |
| 1229 return MarkAsCall(DefineFixedDouble(result, f4), instr); | |
| 1230 } | |
| 1231 | |
| 1232 | |
| 1233 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { | 1210 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { |
| 1234 ASSERT(instr->representation().IsDouble()); | 1211 ASSERT(instr->representation().IsDouble()); |
| 1235 ASSERT(instr->value()->representation().IsDouble()); | 1212 ASSERT(instr->value()->representation().IsDouble()); |
| 1236 LOperand* input = UseRegister(instr->value()); | 1213 LOperand* input = UseRegister(instr->value()); |
| 1237 LOperand* temp1 = TempRegister(); | 1214 LOperand* temp1 = TempRegister(); |
| 1238 LOperand* temp2 = TempRegister(); | 1215 LOperand* temp2 = TempRegister(); |
| 1239 LOperand* double_temp = FixedTemp(f6); // Chosen by fair dice roll. | 1216 LOperand* double_temp = FixedTemp(f6); // Chosen by fair dice roll. |
| 1240 LMathExp* result = new(zone()) LMathExp(input, double_temp, temp1, temp2); | 1217 LMathExp* result = new(zone()) LMathExp(input, double_temp, temp1, temp2); |
| 1241 return DefineAsRegister(result); | 1218 return DefineAsRegister(result); |
| 1242 } | 1219 } |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1447 | 1424 |
| 1448 LInstruction* LChunkBuilder::DoMod(HMod* instr) { | 1425 LInstruction* LChunkBuilder::DoMod(HMod* instr) { |
| 1449 HValue* left = instr->left(); | 1426 HValue* left = instr->left(); |
| 1450 HValue* right = instr->right(); | 1427 HValue* right = instr->right(); |
| 1451 if (instr->representation().IsSmiOrInteger32()) { | 1428 if (instr->representation().IsSmiOrInteger32()) { |
| 1452 ASSERT(instr->left()->representation().Equals(instr->representation())); | 1429 ASSERT(instr->left()->representation().Equals(instr->representation())); |
| 1453 ASSERT(instr->right()->representation().Equals(instr->representation())); | 1430 ASSERT(instr->right()->representation().Equals(instr->representation())); |
| 1454 if (instr->HasPowerOf2Divisor()) { | 1431 if (instr->HasPowerOf2Divisor()) { |
| 1455 ASSERT(!right->CanBeZero()); | 1432 ASSERT(!right->CanBeZero()); |
| 1456 LModI* mod = new(zone()) LModI(UseRegisterAtStart(left), | 1433 LModI* mod = new(zone()) LModI(UseRegisterAtStart(left), |
| 1457 UseOrConstant(right)); | 1434 UseConstant(right)); |
| 1458 LInstruction* result = DefineAsRegister(mod); | 1435 LInstruction* result = DefineAsRegister(mod); |
| 1459 return (left->CanBeNegative() && | 1436 return (left->CanBeNegative() && |
| 1460 instr->CheckFlag(HValue::kBailoutOnMinusZero)) | 1437 instr->CheckFlag(HValue::kBailoutOnMinusZero)) |
| 1461 ? AssignEnvironment(result) | 1438 ? AssignEnvironment(result) |
| 1462 : result; | 1439 : result; |
| 1463 } else { | 1440 } else { |
| 1464 LModI* mod = new(zone()) LModI(UseRegister(left), | 1441 LModI* mod = new(zone()) LModI(UseRegister(left), |
| 1465 UseRegister(right), | 1442 UseRegister(right), |
| 1466 TempRegister(), | 1443 TempRegister(), |
| 1467 FixedTemp(f20), | 1444 FixedTemp(f20), |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1580 ASSERT(instr->left()->representation().Equals(instr->representation())); | 1557 ASSERT(instr->left()->representation().Equals(instr->representation())); |
| 1581 ASSERT(instr->right()->representation().Equals(instr->representation())); | 1558 ASSERT(instr->right()->representation().Equals(instr->representation())); |
| 1582 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); | 1559 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); |
| 1583 LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); | 1560 LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); |
| 1584 LAddI* add = new(zone()) LAddI(left, right); | 1561 LAddI* add = new(zone()) LAddI(left, right); |
| 1585 LInstruction* result = DefineAsRegister(add); | 1562 LInstruction* result = DefineAsRegister(add); |
| 1586 if (instr->CheckFlag(HValue::kCanOverflow)) { | 1563 if (instr->CheckFlag(HValue::kCanOverflow)) { |
| 1587 result = AssignEnvironment(result); | 1564 result = AssignEnvironment(result); |
| 1588 } | 1565 } |
| 1589 return result; | 1566 return result; |
| 1567 } else if (instr->representation().IsExternal()) { |
| 1568 ASSERT(instr->left()->representation().IsExternal()); |
| 1569 ASSERT(instr->right()->representation().IsInteger32()); |
| 1570 ASSERT(!instr->CheckFlag(HValue::kCanOverflow)); |
| 1571 LOperand* left = UseRegisterAtStart(instr->left()); |
| 1572 LOperand* right = UseOrConstantAtStart(instr->right()); |
| 1573 LAddI* add = new(zone()) LAddI(left, right); |
| 1574 LInstruction* result = DefineAsRegister(add); |
| 1575 return result; |
| 1590 } else if (instr->representation().IsDouble()) { | 1576 } else if (instr->representation().IsDouble()) { |
| 1591 if (kArchVariant == kMips32r2) { | 1577 if (kArchVariant == kMips32r2) { |
| 1592 if (instr->left()->IsMul()) | 1578 if (instr->left()->IsMul()) |
| 1593 return DoMultiplyAdd(HMul::cast(instr->left()), instr->right()); | 1579 return DoMultiplyAdd(HMul::cast(instr->left()), instr->right()); |
| 1594 | 1580 |
| 1595 if (instr->right()->IsMul()) { | 1581 if (instr->right()->IsMul()) { |
| 1596 ASSERT(!instr->left()->IsMul()); | 1582 ASSERT(!instr->left()->IsMul()); |
| 1597 return DoMultiplyAdd(HMul::cast(instr->right()), instr->left()); | 1583 return DoMultiplyAdd(HMul::cast(instr->right()), instr->left()); |
| 1598 } | 1584 } |
| 1599 } | 1585 } |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1924 LDoubleToI* res = new(zone()) LDoubleToI(value); | 1910 LDoubleToI* res = new(zone()) LDoubleToI(value); |
| 1925 return AssignEnvironment(DefineAsRegister(res)); | 1911 return AssignEnvironment(DefineAsRegister(res)); |
| 1926 } | 1912 } |
| 1927 } else if (from.IsInteger32()) { | 1913 } else if (from.IsInteger32()) { |
| 1928 info()->MarkAsDeferredCalling(); | 1914 info()->MarkAsDeferredCalling(); |
| 1929 if (to.IsTagged()) { | 1915 if (to.IsTagged()) { |
| 1930 HValue* val = instr->value(); | 1916 HValue* val = instr->value(); |
| 1931 LOperand* value = UseRegisterAtStart(val); | 1917 LOperand* value = UseRegisterAtStart(val); |
| 1932 if (val->CheckFlag(HInstruction::kUint32)) { | 1918 if (val->CheckFlag(HInstruction::kUint32)) { |
| 1933 LNumberTagU* result = new(zone()) LNumberTagU(value); | 1919 LNumberTagU* result = new(zone()) LNumberTagU(value); |
| 1934 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); | 1920 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); |
| 1935 } else if (val->HasRange() && val->range()->IsInSmiRange()) { | 1921 } else if (val->HasRange() && val->range()->IsInSmiRange()) { |
| 1936 return DefineAsRegister(new(zone()) LSmiTag(value)); | 1922 return DefineAsRegister(new(zone()) LSmiTag(value)); |
| 1937 } else { | 1923 } else { |
| 1938 LNumberTagI* result = new(zone()) LNumberTagI(value); | 1924 LNumberTagI* result = new(zone()) LNumberTagI(value); |
| 1939 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); | 1925 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); |
| 1940 } | 1926 } |
| 1941 } else if (to.IsSmi()) { | 1927 } else if (to.IsSmi()) { |
| 1942 HValue* val = instr->value(); | 1928 HValue* val = instr->value(); |
| 1943 LOperand* value = UseRegister(val); | 1929 LOperand* value = UseRegister(val); |
| 1944 LInstruction* result = val->CheckFlag(HInstruction::kUint32) | 1930 LInstruction* result = val->CheckFlag(HInstruction::kUint32) |
| 1945 ? DefineSameAsFirst(new(zone()) LUint32ToSmi(value)) | 1931 ? DefineAsRegister(new(zone()) LUint32ToSmi(value)) |
| 1946 : DefineSameAsFirst(new(zone()) LInteger32ToSmi(value)); | 1932 : DefineAsRegister(new(zone()) LInteger32ToSmi(value)); |
| 1947 if (val->HasRange() && val->range()->IsInSmiRange()) { | 1933 if (val->HasRange() && val->range()->IsInSmiRange()) { |
| 1948 return result; | 1934 return result; |
| 1949 } | 1935 } |
| 1950 return AssignEnvironment(result); | 1936 return AssignEnvironment(result); |
| 1951 } else { | 1937 } else { |
| 1952 ASSERT(to.IsDouble()); | 1938 ASSERT(to.IsDouble()); |
| 1953 if (instr->value()->CheckFlag(HInstruction::kUint32)) { | 1939 if (instr->value()->CheckFlag(HInstruction::kUint32)) { |
| 1954 return DefineAsRegister( | 1940 return DefineAsRegister( |
| 1955 new(zone()) LUint32ToDouble(UseRegister(instr->value()))); | 1941 new(zone()) LUint32ToDouble(UseRegister(instr->value()))); |
| 1956 } else { | 1942 } else { |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2588 | 2574 |
| 2589 | 2575 |
| 2590 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2576 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2591 LOperand* object = UseRegister(instr->object()); | 2577 LOperand* object = UseRegister(instr->object()); |
| 2592 LOperand* index = UseRegister(instr->index()); | 2578 LOperand* index = UseRegister(instr->index()); |
| 2593 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2579 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
| 2594 } | 2580 } |
| 2595 | 2581 |
| 2596 | 2582 |
| 2597 } } // namespace v8::internal | 2583 } } // namespace v8::internal |
| OLD | NEW |