Lines Matching refs:instr
444 void LChunk::AddInstruction(LInstruction* instr, HBasicBlock* block) {
447 if (instr->IsControl()) {
450 instructions_.Add(instr);
453 instructions_.Add(instr);
456 if (instr->HasPointerMap()) {
457 pointer_maps_.Add(instr->pointer_map());
458 instr->pointer_map()->set_lithium_position(index);
641 HInstruction* instr = HInstruction::cast(value);
642 VisitInstruction(instr);
650 LInstruction* LChunkBuilder::Define(LTemplateInstruction<1, I, T>* instr,
653 instr->set_result(result);
654 return instr;
659 LInstruction* LChunkBuilder::Define(LTemplateInstruction<1, I, T>* instr) {
660 return Define(instr, new LUnallocated(LUnallocated::NONE));
666 LTemplateInstruction<1, I, T>* instr) {
667 return Define(instr, new LUnallocated(LUnallocated::MUST_HAVE_REGISTER));
673 LTemplateInstruction<1, I, T>* instr,
675 return Define(instr, new LUnallocated(LUnallocated::FIXED_SLOT, index));
681 LTemplateInstruction<1, I, T>* instr) {
682 return Define(instr, new LUnallocated(LUnallocated::SAME_AS_FIRST_INPUT));
687 LInstruction* LChunkBuilder::DefineFixed(LTemplateInstruction<1, I, T>* instr,
689 return Define(instr, ToUnallocated(reg));
695 LTemplateInstruction<1, I, T>* instr,
697 return Define(instr, ToUnallocated(reg));
701 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) {
703 instr->set_environment(CreateEnvironment(hydrogen_env));
704 return instr;
709 LInstruction* instr, int ast_id) {
712 instruction_pending_deoptimization_environment_ = instr;
714 return instr;
724 LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr,
728 instr->VerifyCall();
730 instr->MarkAsCall();
731 instr = AssignPointerMap(instr);
736 instr = SetInstructionPendingDeoptimizationEnvironment(
737 instr, sim->ast_id());
746 if (needs_environment && !instr->HasEnvironment()) {
747 instr = AssignEnvironment(instr);
750 return instr;
754 LInstruction* LChunkBuilder::MarkAsSaveDoubles(LInstruction* instr) {
755 instr->MarkAsSaveDoubles();
756 return instr;
760 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) {
761 ASSERT(!instr->HasPointerMap());
762 instr->set_pointer_map(new LPointerMap(position_));
763 return instr;
788 LInstruction* LChunkBuilder::DoBlockEntry(HBlockEntry* instr) {
789 return new LLabel(instr->block());
793 LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) {
799 HBitwiseBinaryOperation* instr) {
800 if (instr->representation().IsInteger32()) {
801 ASSERT(instr->left()->representation().IsInteger32());
802 ASSERT(instr->right()->representation().IsInteger32());
804 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
805 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
808 ASSERT(instr->representation().IsTagged());
809 ASSERT(instr->left()->representation().IsTagged());
810 ASSERT(instr->right()->representation().IsTagged());
812 LOperand* left = UseFixed(instr->left(), rdx);
813 LOperand* right = UseFixed(instr->right(), rax);
815 return MarkAsCall(DefineFixed(result, rax), instr);
821 HBitwiseBinaryOperation* instr) {
822 if (instr->representation().IsTagged()) {
823 ASSERT(instr->left()->representation().IsTagged());
824 ASSERT(instr->right()->representation().IsTagged());
826 LOperand* left = UseFixed(instr->left(), rdx);
827 LOperand* right = UseFixed(instr->right(), rax);
829 return MarkAsCall(DefineFixed(result, rax), instr);
832 ASSERT(instr->representation().IsInteger32());
833 ASSERT(instr->OperandAt(0)->representation().IsInteger32());
834 ASSERT(instr->OperandAt(1)->representation().IsInteger32());
835 LOperand* left = UseRegisterAtStart(instr->OperandAt(0));
837 HValue* right_value = instr->OperandAt(1);
853 for (int i = 0; i < instr->uses()->length(); i++) {
854 if (!instr->uses()->at(i)->CheckFlag(HValue::kTruncatingToInt32)) {
870 HArithmeticBinaryOperation* instr) {
871 ASSERT(instr->representation().IsDouble());
872 ASSERT(instr->left()->representation().IsDouble());
873 ASSERT(instr->right()->representation().IsDouble());
875 LOperand* left = UseRegisterAtStart(instr->left());
876 LOperand* right = UseRegisterAtStart(instr->right());
883 HArithmeticBinaryOperation* instr) {
889 HValue* left = instr->left();
890 HValue* right = instr->right();
896 return MarkAsCall(DefineFixed(result, rax), instr);
967 LInstruction* instr = current->CompileToLithium(this);
969 if (instr != NULL) {
970 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
971 instr = AssignPointerMap(instr);
973 if (FLAG_stress_environments && !instr->HasEnvironment()) {
974 instr = AssignEnvironment(instr);
976 if (current->IsTest() && !instr->IsGoto()) {
977 ASSERT(instr->IsControl());
979 instr->set_hydrogen_value(test->value());
983 instr->SetBranchTargets(first->block_id(), second->block_id());
985 instr->set_hydrogen_value(current);
988 chunk_->AddInstruction(instr, current_block_);
1025 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
1026 LGoto* result = new LGoto(instr->FirstSuccessor()->block_id(),
1027 instr->include_stack_check());
1028 return (instr->include_stack_check())
1034 LInstruction* LChunkBuilder::DoTest(HTest* instr) {
1035 HValue* v = instr->value();
1069 return MarkAsCall(result, instr);
1109 return MarkAsCall(result, instr);
1118 return new LGoto(instr->FirstSuccessor()->block_id());
1120 return new LGoto(instr->SecondSuccessor()->block_id());
1131 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
1132 ASSERT(instr->value()->representation().IsTagged());
1133 LOperand* value = UseRegisterAtStart(instr->value());
1148 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) {
1149 LOperand* left = UseFixed(instr->left(), rax);
1150 LOperand* right = UseFixed(instr->right(), rdx);
1152 return MarkAsCall(DefineFixed(result, rax), instr);
1157 HInstanceOfKnownGlobal* instr) {
1159 new LInstanceOfKnownGlobal(UseFixed(instr->value(), rax),
1161 return MarkAsCall(DefineFixed(result, rax), instr);
1165 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) {
1166 LOperand* function = UseFixed(instr->function(), rdi);
1167 LOperand* receiver = UseFixed(instr->receiver(), rax);
1168 LOperand* length = UseFixed(instr->length(), rbx);
1169 LOperand* elements = UseFixed(instr->elements(), rcx);
1174 return MarkAsCall(DefineFixed(result, rax), instr, CAN_DEOPTIMIZE_EAGERLY);
1178 LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) {
1180 LOperand* argument = UseOrConstant(instr->argument());
1185 LInstruction* LChunkBuilder::DoContext(HContext* instr) {
1190 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) {
1191 LOperand* context = UseRegisterAtStart(instr->value());
1196 LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) {
1201 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) {
1202 LOperand* global_object = UseRegisterAtStart(instr->value());
1208 HCallConstantFunction* instr) {
1209 argument_count_ -= instr->argument_count();
1210 return MarkAsCall(DefineFixed(new LCallConstantFunction, rax), instr);
1214 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
1215 BuiltinFunctionId op = instr->op();
1217 LOperand* input = UseFixedDouble(instr->value(), xmm1);
1219 return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
1221 LOperand* input = UseRegisterAtStart(instr->value());
1242 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) {
1243 ASSERT(instr->key()->representation().IsTagged());
1244 LOperand* key = UseFixed(instr->key(), rcx);
1245 argument_count_ -= instr->argument_count();
1247 return MarkAsCall(DefineFixed(result, rax), instr);
1251 LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) {
1252 argument_count_ -= instr->argument_count();
1253 return MarkAsCall(DefineFixed(new LCallNamed, rax), instr);
1257 LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) {
1258 argument_count_ -= instr->argument_count();
1259 return MarkAsCall(DefineFixed(new LCallGlobal, rax), instr);
1263 LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) {
1264 argument_count_ -= instr->argument_count();
1265 return MarkAsCall(DefineFixed(new LCallKnownGlobal, rax), instr);
1269 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) {
1270 LOperand* constructor = UseFixed(instr->constructor(), rdi);
1271 argument_count_ -= instr->argument_count();
1273 return MarkAsCall(DefineFixed(result, rax), instr);
1277 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) {
1278 argument_count_ -= instr->argument_count();
1280 return MarkAsCall(DefineFixed(result, rax), instr);
1284 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) {
1285 argument_count_ -= instr->argument_count();
1286 return MarkAsCall(DefineFixed(new LCallRuntime, rax), instr);
1290 LInstruction* LChunkBuilder::DoShr(HShr* instr) {
1291 return DoShift(Token::SHR, instr);
1295 LInstruction* LChunkBuilder::DoSar(HSar* instr) {
1296 return DoShift(Token::SAR, instr);
1300 LInstruction* LChunkBuilder::DoShl(HShl* instr) {
1301 return DoShift(Token::SHL, instr);
1305 LInstruction* LChunkBuilder::DoBitAnd(HBitAnd* instr) {
1306 return DoBit(Token::BIT_AND, instr);
1310 LInstruction* LChunkBuilder::DoBitNot(HBitNot* instr) {
1311 ASSERT(instr->value()->representation().IsInteger32());
1312 ASSERT(instr->representation().IsInteger32());
1313 LOperand* input = UseRegisterAtStart(instr->value());
1319 LInstruction* LChunkBuilder::DoBitOr(HBitOr* instr) {
1320 return DoBit(Token::BIT_OR, instr);
1324 LInstruction* LChunkBuilder::DoBitXor(HBitXor* instr) {
1325 return DoBit(Token::BIT_XOR, instr);
1329 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
1330 if (instr->representation().IsDouble()) {
1331 return DoArithmeticD(Token::DIV, instr);
1332 } else if (instr->representation().IsInteger32()) {
1336 LOperand* dividend = UseFixed(instr->left(), rax);
1337 LOperand* divisor = UseRegister(instr->right());
1341 ASSERT(instr->representation().IsTagged());
1342 return DoArithmeticT(Token::DIV, instr);
1347 LInstruction* LChunkBuilder::DoMod(HMod* instr) {
1348 if (instr->representation().IsInteger32()) {
1349 ASSERT(instr->left()->representation().IsInteger32());
1350 ASSERT(instr->right()->representation().IsInteger32());
1353 if (instr->HasPowerOf2Divisor()) {
1354 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero));
1355 LOperand* value = UseRegisterAtStart(instr->left());
1356 LModI* mod = new LModI(value, UseOrConstant(instr->right()), NULL);
1362 LOperand* value = UseFixed(instr->left(), rax);
1363 LOperand* divisor = UseRegister(instr->right());
1368 return (instr->CheckFlag(HValue::kBailoutOnMinusZero) ||
1369 instr->CheckFlag(HValue::kCanBeDivByZero))
1372 } else if (instr->representation().IsTagged()) {
1373 return DoArithmeticT(Token::MOD, instr);
1375 ASSERT(instr->representation().IsDouble());
1379 LOperand* left = UseFixedDouble(instr->left(), xmm2);
1380 LOperand* right = UseFixedDouble(instr->right(), xmm1);
1382 return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
1387 LInstruction* LChunkBuilder::DoMul(HMul* instr) {
1388 if (instr->representation().IsInteger32()) {
1389 ASSERT(instr->left()->representation().IsInteger32());
1390 ASSERT(instr->right()->representation().IsInteger32());
1391 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
1392 LOperand* right = UseOrConstant(instr->MostConstantOperand());
1395 } else if (instr->representation().IsDouble()) {
1396 return DoArithmeticD(Token::MUL, instr);
1398 ASSERT(instr->representation().IsTagged());
1399 return DoArithmeticT(Token::MUL, instr);
1404 LInstruction* LChunkBuilder::DoSub(HSub* instr) {
1405 if (instr->representation().IsInteger32()) {
1406 ASSERT(instr->left()->representation().IsInteger32());
1407 ASSERT(instr->right()->representation().IsInteger32());
1408 LOperand* left = UseRegisterAtStart(instr->left());
1409 LOperand* right = UseOrConstantAtStart(instr->right());
1412 if (instr->CheckFlag(HValue::kCanOverflow)) {
1416 } else if (instr->representation().IsDouble()) {
1417 return DoArithmeticD(Token::SUB, instr);
1419 ASSERT(instr->representation().IsTagged());
1420 return DoArithmeticT(Token::SUB, instr);
1425 LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
1426 if (instr->representation().IsInteger32()) {
1427 ASSERT(instr->left()->representation().IsInteger32());
1428 ASSERT(instr->right()->representation().IsInteger32());
1429 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
1430 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
1433 if (instr->CheckFlag(HValue::kCanOverflow)) {
1437 } else if (instr->representation().IsDouble()) {
1438 return DoArithmeticD(Token::ADD, instr);
1440 ASSERT(instr->representation().IsTagged());
1441 return DoArithmeticT(Token::ADD, instr);
1447 LInstruction* LChunkBuilder::DoPower(HPower* instr) {
1448 ASSERT(instr->representation().IsDouble());
1451 Representation exponent_type = instr->right()->representation();
1452 ASSERT(instr->left()->representation().IsDouble());
1453 LOperand* left = UseFixedDouble(instr->left(), xmm2);
1455 UseFixedDouble(instr->right(), xmm1) :
1457 UseFixed(instr->right(), rdx);
1459 UseFixed(instr->right(), rdi);
1462 return MarkAsCall(DefineFixedDouble(result, xmm1), instr,
1467 LInstruction* LChunkBuilder::DoCompare(HCompare* instr) {
1468 Token::Value op = instr->token();
1469 Representation r = instr->GetInputRepresentation();
1471 ASSERT(instr->left()->representation().IsInteger32());
1472 ASSERT(instr->right()->representation().IsInteger32());
1473 LOperand* left = UseRegisterAtStart(instr->left());
1474 LOperand* right = UseOrConstantAtStart(instr->right());
1477 ASSERT(instr->left()->representation().IsDouble());
1478 ASSERT(instr->right()->representation().IsDouble());
1479 LOperand* left = UseRegisterAtStart(instr->left());
1480 LOperand* right = UseRegisterAtStart(instr->right());
1483 ASSERT(instr->left()->representation().IsTagged());
1484 ASSERT(instr->right()->representation().IsTagged());
1486 LOperand* left = UseFixed(instr->left(), reversed ? rax : rdx);
1487 LOperand* right = UseFixed(instr->right(), reversed ? rdx : rax);
1489 return MarkAsCall(DefineFixed(result, rax), instr);
1495 HCompareJSObjectEq* instr) {
1496 LOperand* left = UseRegisterAtStart(instr->left());
1497 LOperand* right = UseRegisterAtStart(instr->right());
1503 LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) {
1504 ASSERT(instr->value()->representation().IsTagged());
1505 LOperand* value = UseRegisterAtStart(instr->value());
1511 LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) {
1512 ASSERT(instr->value()->representation().IsTagged());
1513 LOperand* value = UseRegister(instr->value());
1519 LInstruction* LChunkBuilder::DoIsSmi(HIsSmi* instr) {
1520 ASSERT(instr->value()->representation().IsTagged());
1521 LOperand* value = UseAtStart(instr->value());
1527 LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) {
1528 ASSERT(instr->value()->representation().IsTagged());
1529 LOperand* value = UseRegisterAtStart(instr->value());
1536 HGetCachedArrayIndex* instr) {
1537 ASSERT(instr->value()->representation().IsTagged());
1538 LOperand* value = UseRegisterAtStart(instr->value());
1545 HHasCachedArrayIndex* instr) {
1546 ASSERT(instr
1547 LOperand* value = UseRegister(instr->value());
1552 LInstruction* LChunkBuilder::DoClassOfTest(HClassOfTest* instr) {
1558 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) {
1559 LOperand* array = UseRegisterAtStart(instr->value());
1564 LInstruction* LChunkBuilder::DoFixedArrayLength(HFixedArrayLength* instr) {
1565 LOperand* array = UseRegisterAtStart(instr->value());
1571 HExternalArrayLength* instr) {
1572 LOperand* array = UseRegisterAtStart(instr->value());
1577 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) {
1578 LOperand* object = UseRegister(instr->value());
1584 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
1585 return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()),
1586 Use(instr->length())));
1590 LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
1597 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
1598 LOperand* value = UseFixed(instr->value(), rax);
1599 return MarkAsCall(new LThrow(value), instr);
1603 LInstruction* LChunkBuilder::DoChange(HChange* instr) {
1604 Representation from = instr->from();
1605 Representation to = instr->to();
1608 LOperand* value = UseRegister(instr->value());
1613 LOperand* value = UseRegister(instr->value());
1614 bool needs_check = !instr->value()->type().IsSmi();
1616 LOperand* xmm_temp = instr->CanTruncateToInt32() ? NULL
1626 LOperand* value = UseRegister(instr->value());
1635 LOperand* value = UseRegister(instr->value());
1640 HValue* val = instr->value();
1650 return DefineAsRegister(new LInteger32ToDouble(Use(instr->value())));
1658 LInstruction* LChunkBuilder::DoCheckNonSmi(HCheckNonSmi* instr) {
1659 LOperand* value = UseRegisterAtStart(instr->value());
1664 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) {
1665 LOperand* value = UseRegisterAtStart(instr->value());
1671 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) {
1678 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) {
1679 LOperand* value = UseRegisterAtStart(instr->value());
1684 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) {
1685 LOperand* value = UseRegisterAtStart(instr->value());
1690 LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) {
1691 LOperand* value = UseRegisterAtStart(instr->value());
1697 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) {
1698 return new LReturn(UseFixed(instr->value(), rax));
1702 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
1703 Representation r = instr->representation();
1718 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) {
1720 return instr->check_hole_value()
1726 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) {
1727 LOperand* global_object = UseFixed(instr->global_object(), rax);
1729 return MarkAsCall(DefineFixed(result, rax), instr);
1733 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) {
1735 new LStoreGlobalCell(UseRegister(instr->value()), TempRegister());
1736 return instr->check_hole_value() ? AssignEnvironment(result) : result;
1740 LInstruction* LChunkBuilder::DoStoreGlobalGeneric(HStoreGlobalGeneric* instr) {
1741 LOperand* global_object = UseFixed(instr->global_object(), rdx);
1742 LOperand* value = UseFixed(instr->value(), rax);
1744 return MarkAsCall(result, instr);
1748 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) {
1749 LOperand* context = UseRegisterAtStart(instr->value());
1754 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) {
1758 if (instr->NeedsWriteBarrier()) {
1759 context = UseTempRegister(instr->context());
1760 value = UseTempRegister(instr->value());
1763 context = UseRegister(instr->context());
1764 value = UseRegister(instr->value());
1771 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
1772 ASSERT(instr->representation().IsTagged());
1773 LOperand* obj = UseRegisterAtStart(instr->object());
1779 HLoadNamedFieldPolymorphic* instr) {
1780 ASSERT(instr->representation().IsTagged());
1781 if (instr->need_generic()) {
1782 LOperand* obj = UseFixed(instr->object(), rax);
1784 return MarkAsCall(DefineFixed(result, rax), instr);
1786 LOperand* obj = UseRegisterAtStart(instr->object());
1793 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
1794 LOperand* object = UseFixed(instr->object(), rax);
1796 return MarkAsCall(DefineFixed(result, rax), instr);
1801 HLoadFunctionPrototype* instr) {
1803 new LLoadFunctionPrototype(UseRegister(instr->function()))));
1807 LInstruction* LChunkBuilder::DoLoadElements(HLoadElements* instr) {
1808 LOperand* input = UseRegisterAtStart(instr->value());
1814 HLoadExternalArrayPointer* instr) {
1815 LOperand* input = UseRegisterAtStart(instr->value());
1821 HLoadKeyedFastElement* instr) {
1822 ASSERT(instr->representation().IsTagged());
1823 ASSERT(instr->key()->representation().IsInteger32());
1824 LOperand* obj = UseRegisterAtStart(instr->object());
1825 LOperand* key = UseRegisterAtStart(instr->key());
1832 HLoadKeyedSpecializedArrayElement* instr) {
1833 ExternalArrayType array_type = instr->array_type();
1834 Representation representation(instr->representation());
1837 ASSERT(instr->key()->representation().IsInteger32());
1838 LOperand* external_pointer = UseRegister(instr->external_pointer());
1839 LOperand* key = UseRegister(instr->key());
1850 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
1851 LOperand* object = UseFixed(instr->object(), rdx);
1852 LOperand* key = UseFixed(instr->key(), rax);
1855 return MarkAsCall(DefineFixed(result, rax), instr);
1860 HStoreKeyedFastElement* instr) {
1861 bool needs_write_barrier = instr->NeedsWriteBarrier();
1862 ASSERT(instr->value()->representation().IsTagged());
1863 ASSERT(instr->object()->representation().IsTagged());
1864 ASSERT(instr->key()->representation().IsInteger32());
1866 LOperand* obj = UseTempRegister(instr->object());
1868 ? UseTempRegister(instr->value())
1869 : UseRegisterAtStart(instr->value());
1871 ? UseTempRegister(instr->key())
1872 : UseRegisterOrConstantAtStart(instr->key());
1879 HStoreKeyedSpecializedArrayElement* instr) {
1880 Representation representation(instr->value()->representation());
1881 ExternalArrayType array_type = instr->array_type();
1884 ASSERT(instr->external_pointer()->representation().IsExternal());
1885 ASSERT(instr->key()->representation().IsInteger32());
1887 LOperand* external_pointer = UseRegister(instr->external_pointer());
1891 ? UseTempRegister(instr->value())
1892 : UseRegister(instr->value());
1893 LOperand* key = UseRegister(instr->key());
1901 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) {
1902 LOperand* object = UseFixed(instr->object(), rdx);
1903 LOperand* key = UseFixed(instr->key(), rcx);
1904 LOperand* value = UseFixed(instr->value(), rax);
1906 ASSERT(instr->object()->representation().IsTagged());
1907 ASSERT(instr->key()->representation().IsTagged());
1908 ASSERT(instr->value()->representation().IsTagged());
1911 return MarkAsCall(result, instr);
1915 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
1916 bool needs_write_barrier = instr->NeedsWriteBarrier();
1919 ? UseTempRegister(instr->object())
1920 : UseRegisterAtStart(instr->object());
1923 ? UseTempRegister(instr->value())
1924 : UseRegister(instr->value());
1928 LOperand* temp = (!instr->is_in_object() || needs_write_barrier)
1935 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
1936 LOperand* object = UseFixed(instr->object(), rdx);
1937 LOperand* value = UseFixed(instr->value(), rax);
1940 return MarkAsCall(result, instr);
1944 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) {
1945 LOperand* string = UseRegister(instr->string());
1946 LOperand* index = UseRegisterOrConstant(instr->index());
1952 LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) {
1953 LOperand* char_code = UseRegister(instr->value());
1959 LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) {
1960 LOperand* string = UseRegisterAtStart(instr->value());
1965 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) {
1966 return MarkAsCall(DefineFixed(new LArrayLiteral, rax), instr);
1970 LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) {
1971 return MarkAsCall(DefineFixed(new LObjectLiteral, rax), instr);
1975 LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) {
1976 return MarkAsCall(DefineFixed(new LRegExpLiteral, rax), instr);
1980 LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) {
1981 return MarkAsCall(DefineFixed(new LFunctionLiteral, rax), instr);
1985 LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) {
1987 new LDeleteProperty(Use(instr->object()), UseOrConstant(instr->key()));
1988 return MarkAsCall(DefineFixed(result, rax), instr);
1992 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) {
1994 current_block_->last_environment()->set_ast_id(instr->ast_id());
1999 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
2000 int spill_index = chunk()->GetParameterStackSlot(instr->index());
2005 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
2015 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) {
2016 argument_count_ -= instr->argument_count();
2017 return MarkAsCall(DefineFixed(new LCallStub, rax), instr);
2021 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) {
2030 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) {
2031 LOperand* arguments = UseRegister(instr->arguments());
2032 LOperand* length = UseTempRegister(instr->length());
2033 LOperand* index = Use(instr->index());
2039 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) {
2040 LOperand* object = UseFixed(instr->value(), rax);
2042 return MarkAsCall(DefineFixed(result, rax), instr);
2046 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) {
2047 LTypeof* result = new LTypeof(UseAtStart(instr->value()));
2048 return MarkAsCall(DefineFixed(result, rax), instr);
2052 LInstruction* LChunkBuilder::DoTypeofIs(HTypeofIs* instr) {
2053 return DefineSameAsFirst(new LTypeofIs(UseRegister(instr->value())));
2057 LInstruction* LChunkBuilder::DoIsConstructCall(HIsConstructCall* instr) {
2062 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) {
2066 env->set_ast_id(instr->ast_id());
2068 env->Drop(instr->pop_count());
2069 for (int i = 0; i < instr->values()->length(); ++i) {
2070 HValue* value = instr->values()->at(i);
2071 if (instr->HasAssignedIndexAt(i)) {
2072 env->Bind(instr->GetAssignedIndexAt(i), value);
2080 if (pending_deoptimization_ast_id_ == instr->ast_id()) {
2093 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) {
2094 return MarkAsCall(new LStackCheck, instr);
2098 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
2101 HEnvironment* inner = outer->CopyForInlining(instr->closure(),
2102 instr->function(),
2106 chunk_->AddInlinedClosure(instr->closure());
2111 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {