Lines Matching refs:instr

471 void LChunk::AddInstruction(LInstruction* instr, HBasicBlock* block) {
474 if (instr->IsControl()) {
477 instructions_.Add(instr);
480 instructions_.Add(instr);
483 if (instr->HasPointerMap()) {
484 pointer_maps_.Add(instr->pointer_map());
485 instr->pointer_map()->set_lithium_position(index);
664 HInstruction* instr = HInstruction::cast(value);
665 VisitInstruction(instr);
673 LInstruction* LChunkBuilder::Define(LTemplateInstruction<1, I, T>* instr,
676 instr->set_result(result);
677 return instr;
683 LTemplateInstruction<1, I, T>* instr) {
684 return Define(instr,
691 LTemplateInstruction<1, I, T>* instr,
693 return Define(instr,
700 LTemplateInstruction<1, I, T>* instr) {
701 return Define(instr,
707 LInstruction* LChunkBuilder::DefineFixed(LTemplateInstruction<1, I, T>* instr,
709 return Define(instr, ToUnallocated(reg));
715 LTemplateInstruction<1, I, T>* instr,
717 return Define(instr, ToUnallocated(reg));
721 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) {
724 instr->set_environment(CreateEnvironment(hydrogen_env,
726 return instr;
731 LInstruction* instr, int ast_id) {
734 instruction_pending_deoptimization_environment_ = instr;
736 return instr;
746 LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr,
750 instr->VerifyCall();
752 instr->MarkAsCall();
753 instr = AssignPointerMap(instr);
758 instr = SetInstructionPendingDeoptimizationEnvironment(
759 instr, sim->ast_id());
769 if (needs_environment && !instr->HasEnvironment()) {
770 instr = AssignEnvironment(instr);
773 return instr;
777 LInstruction* LChunkBuilder::MarkAsSaveDoubles(LInstruction* instr) {
778 instr->MarkAsSaveDoubles();
779 return instr;
783 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) {
784 ASSERT(!instr->HasPointerMap());
785 instr->set_pointer_map(new(zone()) LPointerMap(position_));
786 return instr;
813 LInstruction* LChunkBuilder::DoBlockEntry(HBlockEntry* instr) {
814 return new(zone()) LLabel(instr->block());
818 LInstruction* LChunkBuilder::DoSoftDeoptimize(HSoftDeoptimize* instr) {
823 LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) {
829 HBitwiseBinaryOperation* instr) {
830 if (instr->representation().IsTagged()) {
831 ASSERT(instr->left()->representation().IsTagged());
832 ASSERT(instr->right()->representation().IsTagged());
834 LOperand* left = UseFixed(instr->left(), rdx);
835 LOperand* right = UseFixed(instr->right(), rax);
837 return MarkAsCall(DefineFixed(result, rax), instr);
840 ASSERT(instr->representation().IsInteger32());
841 ASSERT(instr->left()->representation().IsInteger32());
842 ASSERT(instr->right()->representation().IsInteger32());
843 LOperand* left = UseRegisterAtStart(instr->left());
845 HValue* right_value = instr->right();
861 for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
876 HArithmeticBinaryOperation* instr) {
877 ASSERT(instr->representation().IsDouble());
878 ASSERT(instr->left()->representation().IsDouble());
879 ASSERT(instr->right()->representation().IsDouble());
881 LOperand* left = UseRegisterAtStart(instr->left());
882 LOperand* right = UseRegisterAtStart(instr->right());
889 HArithmeticBinaryOperation* instr) {
895 HValue* left = instr->left();
896 HValue* right = instr->right();
903 return MarkAsCall(DefineFixed(result, rax), instr);
974 LInstruction* instr = current->CompileToLithium(this);
976 if (instr != NULL) {
977 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
978 instr = AssignPointerMap(instr);
980 if (FLAG_stress_environments && !instr->HasEnvironment()) {
981 instr = AssignEnvironment(instr);
983 instr->set_hydrogen_value(current);
984 chunk_->AddInstruction(instr, current_block_);
1033 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
1034 return new(zone()) LGoto(instr->FirstSuccessor()->block_id());
1038 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
1039 HValue* value = instr->value();
1044 ? instr->FirstSuccessor()
1045 : instr->SecondSuccessor();
1061 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
1062 ASSERT(instr->value()->representation().IsTagged());
1063 LOperand* value = UseRegisterAtStart(instr->value());
1078 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) {
1079 LOperand* left = UseFixed(instr->left(), rax);
1080 LOperand* right = UseFixed(instr->right(), rdx);
1082 return MarkAsCall(DefineFixed(result, rax), instr);
1087 HInstanceOfKnownGlobal* instr) {
1089 new(zone()) LInstanceOfKnownGlobal(UseFixed(instr->left(), rax),
1091 return MarkAsCall(DefineFixed(result, rax), instr);
1095 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) {
1096 LOperand* receiver = UseRegister(instr->receiver());
1097 LOperand* function = UseRegisterAtStart(instr->function());
1103 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) {
1104 LOperand* function = UseFixed(instr->function(), rdi);
1105 LOperand* receiver = UseFixed(instr->receiver(), rax);
1106 LOperand* length = UseFixed(instr->length(), rbx);
1107 LOperand* elements = UseFixed(instr->elements(), rcx);
1112 return MarkAsCall(DefineFixed(result, rax), instr, CAN_DEOPTIMIZE_EAGERLY);
1116 LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) {
1118 LOperand* argument = UseOrConstant(instr->argument());
1123 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) {
1124 return instr->HasNoUses()
1130 LInstruction* LChunkBuilder::DoContext(HContext* instr) {
1131 return instr->HasNoUses() ? NULL : DefineAsRegister(new(zone()) LContext);
1135 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) {
1136 LOperand* context = UseRegisterAtStart(instr->value());
1141 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) {
1142 return MarkAsCall(new(zone()) LDeclareGlobals, instr);
1146 LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) {
1151 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) {
1152 LOperand* global_object = UseRegisterAtStart(instr->value());
1158 HCallConstantFunction* instr) {
1159 argument_count_ -= instr->argument_count();
1160 return MarkAsCall(DefineFixed(new(zone()) LCallConstantFunction, rax), instr);
1164 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) {
1165 LOperand* function = UseFixed(instr->function(), rdi);
1166 argument_count_ -= instr->argument_count();
1168 return MarkAsCall(DefineFixed(result, rax), instr, CANNOT_DEOPTIMIZE_EAGERLY);
1172 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
1173 BuiltinFunctionId op = instr->op();
1175 LOperand* input = UseFixedDouble(instr->value(), xmm1);
1177 return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
1179 LOperand* input = UseRegisterAtStart(instr->value());
1200 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) {
1201 ASSERT(instr->key()->representation().IsTagged());
1202 LOperand* key = UseFixed(instr->key(), rcx);
1203 argument_count_ -= instr->argument_count();
1205 return MarkAsCall(DefineFixed(result, rax), instr);
1209 LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) {
1210 argument_count_ -= instr->argument_count();
1211 return MarkAsCall(DefineFixed(new(zone()) LCallNamed, rax), instr);
1215 LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) {
1216 argument_count_ -= instr->argument_count();
1217 return MarkAsCall(DefineFixed(new(zone()) LCallGlobal, rax), instr);
1221 LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) {
1222 argument_count_ -= instr->argument_count();
1223 return MarkAsCall(DefineFixed(new(zone()) LCallKnownGlobal, rax), instr);
1227 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) {
1228 LOperand* constructor = UseFixed(instr->constructor(), rdi);
1229 argument_count_ -= instr->argument_count();
1231 return MarkAsCall(DefineFixed(result, rax), instr);
1235 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) {
1236 LOperand* function = UseFixed(instr->function(), rdi);
1237 argument_count_ -= instr->argument_count();
1239 return MarkAsCall(DefineFixed(result, rax), instr);
1243 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) {
1244 argument_count_ -= instr->argument_count();
1245 return MarkAsCall(DefineFixed(new(zone()) LCallRuntime, rax), instr);
1249 LInstruction* LChunkBuilder::DoShr(HShr* instr) {
1250 return DoShift(Token::SHR, instr);
1254 LInstruction* LChunkBuilder::DoSar(HSar* instr) {
1255 return DoShift(Token::SAR, instr);
1259 LInstruction* LChunkBuilder::DoShl(HShl* instr) {
1260 return DoShift(Token::SHL, instr);
1264 LInstruction* LChunkBuilder::DoBitwise(HBitwise* instr) {
1265 if (instr->representation().IsInteger32()) {
1266 ASSERT(instr->left()->representation().IsInteger32());
1267 ASSERT(instr->right()->representation().IsInteger32());
1269 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
1270 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
1273 ASSERT(instr->representation().IsTagged());
1274 ASSERT(instr->left()->representation().IsTagged());
1275 ASSERT(instr->right()->representation().IsTagged());
1277 LOperand* left = UseFixed(instr->left(), rdx);
1278 LOperand* right = UseFixed(instr->right(), rax);
1279 LArithmeticT* result = new(zone()) LArithmeticT(instr->op(), left, right);
1280 return MarkAsCall(DefineFixed(result, rax), instr);
1285 LInstruction* LChunkBuilder::DoBitNot(HBitNot* instr) {
1286 ASSERT(instr->value()->representation().IsInteger32());
1287 ASSERT(instr->representation().IsInteger32());
1288 LOperand* input = UseRegisterAtStart(instr->value());
1294 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
1295 if (instr->representation().IsDouble()) {
1296 return DoArithmeticD(Token::DIV, instr);
1297 } else if (instr->representation().IsInteger32()) {
1301 LOperand* dividend = UseFixed(instr->left(), rax);
1302 LOperand* divisor = UseRegister(instr->right());
1306 ASSERT(instr->representation().IsTagged());
1307 return DoArithmeticT(Token::DIV, instr);
1312 LInstruction* LChunkBuilder::DoMod(HMod* instr) {
1313 if (instr->representation().IsInteger32()) {
1314 ASSERT(instr->left()->representation().IsInteger32());
1315 ASSERT(instr->right()->representation().IsInteger32());
1318 if (instr->HasPowerOf2Divisor()) {
1319 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero));
1320 LOperand* value = UseRegisterAtStart(instr->left());
1322 new(zone()) LModI(value, UseOrConstant(instr->right()), NULL);
1328 LOperand* value = UseFixed(instr->left(), rax);
1329 LOperand* divisor = UseRegister(instr->right());
1334 return (instr->CheckFlag(HValue::kBailoutOnMinusZero) ||
1335 instr->CheckFlag(HValue::kCanBeDivByZero))
1338 } else if (instr->representation().IsTagged()) {
1339 return DoArithmeticT(Token::MOD, instr);
1341 ASSERT(instr->representation().IsDouble());
1345 LOperand* left = UseFixedDouble(instr->left(), xmm2);
1346 LOperand* right = UseFixedDouble(instr->right(), xmm1);
1348 return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
1353 LInstruction* LChunkBuilder::DoMul(HMul* instr) {
1354 if (instr->representation().IsInteger32()) {
1355 ASSERT(instr->left()->representation().IsInteger32());
1356 ASSERT(instr->right()->representation().IsInteger32());
1357 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
1358 LOperand* right = UseOrConstant(instr->MostConstantOperand());
1360 if (instr->CheckFlag(HValue::kCanOverflow) ||
1361 instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
1365 } else if (instr->representation().IsDouble()) {
1366 return DoArithmeticD(Token::MUL, instr);
1368 ASSERT(instr->representation().IsTagged());
1369 return DoArithmeticT(Token::MUL, instr);
1374 LInstruction* LChunkBuilder::DoSub(HSub* instr) {
1375 if (instr->representation().IsInteger32()) {
1376 ASSERT(instr->left()->representation().IsInteger32());
1377 ASSERT(instr->right()->representation().IsInteger32());
1378 LOperand* left = UseRegisterAtStart(instr->left());
1379 LOperand* right = UseOrConstantAtStart(instr->right());
1382 if (instr->CheckFlag(HValue::kCanOverflow)) {
1386 } else if (instr->representation().IsDouble()) {
1387 return DoArithmeticD(Token::SUB, instr);
1389 ASSERT(instr->representation().IsTagged());
1390 return DoArithmeticT(Token::SUB, instr);
1395 LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
1396 if (instr->representation().IsInteger32()) {
1397 ASSERT(instr->left()->representation().IsInteger32());
1398 ASSERT(instr->right()->representation().IsInteger32());
1399 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
1400 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
1403 if (instr->CheckFlag(HValue::kCanOverflow)) {
1407 } else if (instr->representation().IsDouble()) {
1408 return DoArithmeticD(Token::ADD, instr);
1410 ASSERT(instr->representation().IsTagged());
1411 return DoArithmeticT(Token::ADD, instr);
1417 LInstruction* LChunkBuilder::DoPower(HPower* instr) {
1418 ASSERT(instr->representation().IsDouble());
1421 Representation exponent_type = instr->right()->representation();
1422 ASSERT(instr->left()->representation().IsDouble());
1423 LOperand* left = UseFixedDouble(instr->left(), xmm2);
1425 UseFixedDouble(instr->right(), xmm1) :
1427 UseFixed(instr->right(), rdx);
1429 UseFixed(instr->right(), rdi);
1432 return MarkAsCall(DefineFixedDouble(result, xmm3), instr,
1437 LInstruction* LChunkBuilder::DoRandom(HRandom* instr) {
1438 ASSERT(instr->representation().IsDouble());
1439 ASSERT(instr->global_object()->representation().IsTagged());
1441 LOperand* global_object = UseFixed(instr->global_object(), rcx);
1443 LOperand* global_object = UseFixed(instr->global_object(), rdi);
1446 return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
1450 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
1451 ASSERT(instr->left()->representation().IsTagged());
1452 ASSERT(instr->right()->representation().IsTagged());
1453 LOperand* left = UseFixed(instr->left(), rdx);
1454 LOperand* right = UseFixed(instr->right(), rax);
1456 return MarkAsCall(DefineFixed(result, rax), instr);
1461 HCompareIDAndBranch* instr) {
1462 Representation r = instr->GetInputRepresentation();
1464 ASSERT(instr->left()->representation().IsInteger32());
1465 ASSERT(instr->right()->representation().IsInteger32());
1466 LOperand* left = UseRegisterOrConstantAtStart(instr->left());
1467 LOperand* right = UseOrConstantAtStart(instr->right());
1471 ASSERT(instr->left()->representation().IsDouble());
1472 ASSERT(instr->right()->representation().IsDouble());
1475 if (instr->left()->IsConstant() && instr->right()->IsConstant()) {
1476 left = UseRegisterOrConstantAtStart(instr->left());
1477 right = UseRegisterOrConstantAtStart(instr->right());
1479 left = UseRegisterAtStart(instr->left());
1480 right = UseRegisterAtStart(instr->right());
1488 HCompareObjectEqAndBranch* instr) {
1489 LOperand* left = UseRegisterAtStart(instr->left());
1490 LOperand* right = UseRegisterAtStart(instr->right());
1496 HCompareConstantEqAndBranch* instr) {
1497 LOperand* value = UseRegisterAtStart(instr->value());
1502 LInstruction* LChunkBuilder::DoIsNilAndBranch(HIsNilAndBranch* instr) {
1503 ASSERT(instr->value()->representation().IsTagged());
1504 LOperand* temp = instr->kind() == kStrictEquality ? NULL : TempRegister();
1505 return new(zone()) LIsNilAndBranch(UseRegisterAtStart(instr->value()), temp);
1509 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) {
1510 ASSERT(instr->value()->representation().IsTagged());
1511 return new(zone()) LIsObjectAndBranch(UseRegisterAtStart(instr->value()));
1515 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) {
1516 ASSERT(instr->value()->representation().IsTagged());
1517 LOperand* value = UseRegisterAtStart(instr->value());
1523 LInstruction* LChunkBuilder::DoIsSmiAndBranch(HIsSmiAndBranch* instr) {
1524 ASSERT(instr->value()->representation().IsTagged());
1525 return new(zone()) LIsSmiAndBranch(Use(instr->value()));
1530 HIsUndetectableAndBranch* instr) {
1531 ASSERT(instr->value()->representation().IsTagged());
1532 LOperand* value = UseRegisterAtStart(instr->value());
1539 HStringCompareAndBranch* instr) {
1541 ASSERT(instr->left()->representation().IsTagged());
1542 ASSERT(instr->right()->representation().IsTagged());
1543 LOperand* left = UseFixed(instr->left(), rdx);
1544 LOperand* right = UseFixed(instr->right(), rax);
1548 return MarkAsCall(result, instr);
1553 HHasInstanceTypeAndBranch* instr) {
1554 ASSERT(instr->value()->representation().IsTagged());
1555 LOperand* value = UseRegisterAtStart(instr->value());
1561 HGetCachedArrayIndex* instr) {
1562 ASSERT(instr->value()->representation().IsTagged());
1563 LOperand* value = UseRegisterAtStart(instr->value());
1570 HHasCachedArrayIndexAndBranch* instr) {
1571 ASSERT(instr->value()->representation().IsTagged());
1572 LOperand* value = UseRegisterAtStart(instr->value());
1578 HClassOfTestAndBranch* instr) {
1579 LOperand* value = UseRegister(instr->value());
1586 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) {
1587 LOperand* array = UseRegisterAtStart(instr->value());
1593 HFixedArrayBaseLength* instr) {
1594 LOperand* array = UseRegisterAtStart(instr->value());
1599 LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) {
1600 LOperand* object = UseRegisterAtStart(instr->value());
1605 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) {
1606 LOperand* object = UseRegister(instr->value());
1612 LInstruction* LChunkBuilder::DoDateField(HDateField* instr) {
1613 LOperand* object = UseFixed(instr->value(), rax);
1614 LDateField* result = new LDateField(object, instr->index());
1615 return MarkAsCall(DefineFixed(result, rax), instr);
1619 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
1620 LOperand* value = UseRegisterOrConstantAtStart(instr->index());
1621 LOperand* length = Use(instr->length());
1626 LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
1633 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
1634 LOperand* value = UseFixed(instr->value(), rax);
1635 return MarkAsCall(new(zone()) LThrow(value), instr);
1639 LInstruction* LChunkBuilder::DoUseConst(HUseConst* instr) {
1652 LInstruction* LChunkBuilder::DoChange(HChange* instr) {
1653 Representation from = instr->from();
1654 Representation to = instr->to();
1657 LOperand* value = UseRegister(instr->value());
1662 LOperand* value = UseRegister(instr->value());
1663 bool needs_check = !instr->value()->type().IsSmi();
1665 bool truncating = instr->CanTruncateToInt32();
1675 LOperand* value = UseRegister(instr->value());
1684 LOperand* value = UseRegister(instr->value());
1689 HValue* val = instr->value();
1699 LOperand* value = Use(instr->value());
1708 LInstruction* LChunkBuilder::DoCheckNonSmi(HCheckNonSmi* instr) {
1709 LOperand* value = UseRegisterAtStart(instr->value());
1714 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) {
1715 LOperand* value = UseRegisterAtStart(instr->value());
1721 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) {
1728 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) {
1729 LOperand* value = UseRegisterAtStart(instr->value());
1734 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) {
1735 LOperand* value = UseRegisterAtStart(instr->value());
1740 LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) {
1741 LOperand* value = UseRegisterAtStart(instr->value());
1747 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) {
1748 HValue* value = instr->value();
1768 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) {
1769 return new(zone()) LReturn(UseFixed(instr->value(), rax));
1773 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
1774 Representation r = instr->representation();
1789 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) {
1791 return instr->RequiresHoleCheck()
1797 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) {
1798 LOperand* global_object = UseFixed(instr->global_object(), rax);
1800 return MarkAsCall(DefineFixed(result, rax), instr);
1804 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) {
1805 LOperand* value = UseRegister(instr->value());
1808 return instr->RequiresHoleCheck()
1814 LInstruction* LChunkBuilder::DoStoreGlobalGeneric(HStoreGlobalGeneric* instr) {
1815 LOperand* global_object = UseFixed(instr->global_object(), rdx);
1816 LOperand* value = UseFixed(instr->value(), rax);
1819 return MarkAsCall(result, instr);
1823 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) {
1824 LOperand* context = UseRegisterAtStart(instr->value());
1827 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result;
1831 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) {
1835 if (instr->NeedsWriteBarrier()) {
1836 context = UseTempRegister(instr->context());
1837 value = UseTempRegister(instr->value());
1840 context = UseRegister(instr->context());
1841 value = UseRegister(instr->value());
1845 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result;
1849 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
1850 ASSERT(instr->representation().IsTagged());
1851 LOperand* obj = UseRegisterAtStart(instr->object());
1857 HLoadNamedFieldPolymorphic* instr) {
1858 ASSERT(instr->representation().IsTagged());
1859 if (instr->need_generic()) {
1860 LOperand* obj = UseFixed(instr->object(), rax);
1863 return MarkAsCall(DefineFixed(result, rax), instr);
1865 LOperand* obj = UseRegisterAtStart(instr->object());
1873 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
1874 LOperand* object = UseFixed(instr->object(), rax);
1876 return MarkAsCall(DefineFixed(result, rax), instr);
1881 HLoadFunctionPrototype* instr) {
1883 new(zone()) LLoadFunctionPrototype(UseRegister(instr->function()))));
1887 LInstruction* LChunkBuilder::DoLoadElements(HLoadElements* instr) {
1888 LOperand* input = UseRegisterAtStart(instr->value());
1894 HLoadExternalArrayPointer* instr) {
1895 LOperand* input = UseRegisterAtStart(instr->value());
1901 HLoadKeyedFastElement* instr) {
1902 ASSERT(instr->representation().IsTagged());
1903 ASSERT(instr->key()->representation().IsInteger32());
1904 LOperand* obj = UseRegisterAtStart(instr->object());
1905 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
1907 if (instr->RequiresHoleCheck()) AssignEnvironment(result);
1913 HLoadKeyedFastDoubleElement* instr) {
1914 ASSERT(instr->representation().IsDouble());
1915 ASSERT(instr->key()->representation().IsInteger32());
1916 LOperand* elements = UseRegisterAtStart(instr->elements());
1917 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
1925 HLoadKeyedSpecializedArrayElement* instr) {
1926 ElementsKind elements_kind = instr->elements_kind();
1928 (instr->representation().IsInteger32() &&
1931 (instr->representation().IsDouble() &&
1934 ASSERT(instr->key()->representation().IsInteger32());
1935 LOperand* external_pointer = UseRegister(instr->external_pointer());
1936 LOperand* key = UseRegisterOrConstant(instr->key());
1947 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
1948 LOperand* object = UseFixed(instr->object(), rdx);
1949 LOperand* key = UseFixed(instr->key(), rax);
1952 return MarkAsCall(DefineFixed(result, rax), instr);
1957 HStoreKeyedFastElement* instr) {
1958 bool needs_write_barrier = instr->NeedsWriteBarrier();
1959 ASSERT(instr->value()->representation().IsTagged());
1960 ASSERT(instr->object()->representation().IsTagged());
1961 ASSERT(instr->key()->representation().IsInteger32());
1963 LOperand* obj = UseTempRegister(instr->object());
1965 ? UseTempRegister(instr->value())
1966 : UseRegisterAtStart(instr->value());
1968 ? UseTempRegister(instr->key())
1969 : UseRegisterOrConstantAtStart(instr->key());
1975 HStoreKeyedFastDoubleElement* instr) {
1976 ASSERT(instr->value()->representation().IsDouble());
1977 ASSERT(instr->elements()->representation().IsTagged());
1978 ASSERT(instr->key()->representation().IsInteger32());
1980 LOperand* elements = UseRegisterAtStart(instr->elements());
1981 LOperand* val = UseTempRegister(instr->value());
1982 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
1989 HStoreKeyedSpecializedArrayElement* instr) {
1990 ElementsKind elements_kind = instr->elements_kind();
1992 (instr->value()->representation().IsInteger32() &&
1995 (instr->value()->representation().IsDouble() &&
1998 ASSERT(instr->external_pointer()->representation().IsExternal());
1999 ASSERT(instr->key()->representation().IsInteger32());
2001 LOperand* external_pointer = UseRegister(instr->external_pointer());
2006 ? UseTempRegister(instr->value())
2007 : UseRegister(instr->value());
2008 LOperand* key = UseRegisterOrConstant(instr->key());
2016 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) {
2017 LOperand* object = UseFixed(instr->object(), rdx);
2018 LOperand* key = UseFixed(instr->key(), rcx);
2019 LOperand* value = UseFixed(instr->value(), rax);
2021 ASSERT(instr->object()->representation().IsTagged());
2022 ASSERT(instr->key()->representation().IsTagged());
2023 ASSERT(instr->value()->representation().IsTagged());
2027 return MarkAsCall(result, instr);
2032 HTransitionElementsKind* instr) {
2033 if (instr->original_map()->elements_kind() == FAST_SMI_ONLY_ELEMENTS &&
2034 instr->transitioned_map()->elements_kind() == FAST_ELEMENTS) {
2035 LOperand* object = UseRegister(instr->object());
2042 LOperand* object = UseFixed(instr->object(), rax);
2049 return MarkAsCall(DefineFixed(result, rax), instr);
2054 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
2055 bool needs_write_barrier = instr->NeedsWriteBarrier();
2058 ? UseTempRegister(instr->object())
2059 : UseRegisterAtStart(instr->object());
2062 ? UseTempRegister(instr->value())
2063 : UseRegister(instr->value());
2067 LOperand* temp = (!instr->is_in_object() || needs_write_barrier)
2074 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
2075 LOperand* object = UseFixed(instr->object(), rdx);
2076 LOperand* value = UseFixed(instr->value(), rax);
2079 return MarkAsCall(result, instr);
2083 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) {
2084 LOperand* left = UseOrConstantAtStart(instr->left());
2085 LOperand* right = UseOrConstantAtStart(instr->right());
2087 instr);
2091 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) {
2092 LOperand* string = UseTempRegister(instr->string());
2093 LOperand* index = UseTempRegister(instr->index());
2099 LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) {
2100 LOperand* char_code = UseRegister(instr->value());
2106 LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) {
2107 LOperand* string = UseRegisterAtStart(instr->value());
2112 LInstruction* LChunkBuilder::DoAllocateObject(HAllocateObject* instr) {
2118 LInstruction* LChunkBuilder::DoFastLiteral(HFastLiteral* instr) {
2119 return MarkAsCall(DefineFixed(new(zone()) LFastLiteral, rax), instr);
2123 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) {
2124 return MarkAsCall(DefineFixed(new(zone()) LArrayLiteral, rax), instr);
2128 LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) {
2129 return MarkAsCall(DefineFixed(new(zone()) LObjectLiteral, rax), instr);
2133 LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) {
2134 return MarkAsCall(DefineFixed(new(zone()) LRegExpLiteral, rax), instr);
2138 LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) {
2139 return MarkAsCall(DefineFixed(new(zone()) LFunctionLiteral, rax), instr);
2143 LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) {
2144 LOperand* object = UseAtStart(instr->object());
2145 LOperand* key = UseOrConstantAtStart(instr->key());
2147 return MarkAsCall(DefineFixed(result, rax), instr);
2151 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) {
2153 current_block_->last_environment()->set_ast_id(instr->ast_id());
2158 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
2159 int spill_index = chunk()->GetParameterStackSlot(instr->index());
2164 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
2174 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) {
2175 argument_count_ -= instr->argument_count();
2176 return MarkAsCall(DefineFixed(new(zone()) LCallStub, rax), instr);
2180 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) {
2189 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) {
2190 LOperand* arguments = UseRegister(instr->arguments());
2191 LOperand* length = UseTempRegister(instr->length());
2192 LOperand* index = Use(instr->index());
2199 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) {
2200 LOperand* object = UseFixed(instr->value(), rax);
2202 return MarkAsCall(DefineFixed(result, rax), instr);
2206 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) {
2207 LTypeof* result = new(zone()) LTypeof(UseAtStart(instr->value()));
2208 return MarkAsCall(DefineFixed(result, rax), instr);
2212 LInstruction* LChunkBuilder::DoTypeofIsAndBranch(HTypeofIsAndBranch* instr) {
2213 return new(zone()) LTypeofIsAndBranch(UseTempRegister(instr->value()));
2218 HIsConstructCallAndBranch* instr) {
2223 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) {
2227 env->set_ast_id(instr->ast_id());
2229 env->Drop(instr->pop_count());
2230 for (int i = 0; i < instr->values()->length(); ++i) {
2231 HValue* value = instr->values()->at(i);
2232 if (instr->HasAssignedIndexAt(i)) {
2233 env->Bind(instr->GetAssignedIndexAt(i), value);
2241 if (pending_deoptimization_ast_id_ == instr->ast_id()) {
2254 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) {
2255 if (instr->is_function_entry()) {
2256 return MarkAsCall(new(zone()) LStackCheck, instr);
2258 ASSERT(instr->is_backwards_branch());
2264 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
2267 HEnvironment* inner = outer->CopyForInlining(instr->closure(),
2268 instr->arguments_count(),
2269 instr->function(),
2271 instr->call_kind(),
2272 instr->is_construct());
2273 if (instr->arguments() != NULL) {
2274 inner->Bind(instr->arguments(), graph()->GetArgumentsObject());
2277 chunk_->AddInlinedClosure(instr->closure());
2282 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
2290 LInstruction* LChunkBuilder::DoIn(HIn* instr) {
2291 LOperand* key = UseOrConstantAtStart(instr->key());
2292 LOperand* object = UseOrConstantAtStart(instr->object());
2294 return MarkAsCall(DefineFixed(result, rax), instr);
2298 LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) {
2299 LOperand* object = UseFixed(instr->enumerable(), rax);
2301 return MarkAsCall(DefineFixed(result, rax), instr, CAN_DEOPTIMIZE_EAGERLY);
2305 LInstruction* LChunkBuilder::DoForInCacheArray(HForInCacheArray* instr) {
2306 LOperand* map = UseRegister(instr->map());
2312 LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) {
2313 LOperand* value = UseRegisterAtStart(instr->value());
2314 LOperand* map = UseRegisterAtStart(instr->map());
2319 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2320 LOperand* object = UseRegister(instr->object());
2321 LOperand* index = UseTempRegister(instr->index());