Lines Matching refs:instr

451 void LChunk::AddInstruction(LInstruction* instr, HBasicBlock* block) {
454 if (instr->IsControl()) {
457 instructions_.Add(instr);
460 instructions_.Add(instr);
463 if (instr->HasPointerMap()) {
464 pointer_maps_.Add(instr->pointer_map());
465 instr->pointer_map()->set_lithium_position(index);
648 HInstruction* instr = HInstruction::cast(value);
649 VisitInstruction(instr);
657 LInstruction* LChunkBuilder::Define(LTemplateInstruction<1, I, T>* instr,
660 instr->set_result(result);
661 return instr;
666 LInstruction* LChunkBuilder::Define(LTemplateInstruction<1, I, T>* instr) {
667 return Define(instr, new LUnallocated(LUnallocated::NONE));
673 LTemplateInstruction<1, I, T>* instr) {
674 return Define(instr, new LUnallocated(LUnallocated::MUST_HAVE_REGISTER));
680 LTemplateInstruction<1, I, T>* instr, int index) {
681 return Define(instr, new LUnallocated(LUnallocated::FIXED_SLOT, index));
687 LTemplateInstruction<1, I, T>* instr) {
688 return Define(instr, new LUnallocated(LUnallocated::SAME_AS_FIRST_INPUT));
694 LTemplateInstruction<1, I, T>* instr, Register reg) {
695 return Define(instr, ToUnallocated(reg));
701 LTemplateInstruction<1, I, T>* instr, DoubleRegister reg) {
702 return Define(instr, ToUnallocated(reg));
706 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) {
708 instr->set_environment(CreateEnvironment(hydrogen_env));
709 return instr;
714 LInstruction* instr, int ast_id) {
717 instruction_pending_deoptimization_environment_ = instr;
719 return instr;
729 LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr,
733 instr->VerifyCall();
735 instr->MarkAsCall();
736 instr = AssignPointerMap(instr);
741 instr = SetInstructionPendingDeoptimizationEnvironment(
742 instr, sim->ast_id());
751 if (needs_environment && !instr->HasEnvironment()) {
752 instr = AssignEnvironment(instr);
755 return instr;
759 LInstruction* LChunkBuilder::MarkAsSaveDoubles(LInstruction* instr) {
760 instr->MarkAsSaveDoubles();
761 return instr;
765 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) {
766 ASSERT(!instr->HasPointerMap());
767 instr->set_pointer_map(new LPointerMap(position_));
768 return instr;
793 LInstruction* LChunkBuilder::DoBlockEntry(HBlockEntry* instr) {
794 return new LLabel(instr->block());
798 LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) {
804 HBitwiseBinaryOperation* instr) {
805 if (instr->representation().IsInteger32()) {
806 ASSERT(instr->left()->representation().IsInteger32());
807 ASSERT(instr->right()->representation().IsInteger32());
809 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
810 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
813 ASSERT(instr->representation().IsTagged());
814 ASSERT(instr->left()->representation().IsTagged());
815 ASSERT(instr->right()->representation().IsTagged());
817 LOperand* left = UseFixed(instr->left(), r1);
818 LOperand* right = UseFixed(instr->right(), r0);
820 return MarkAsCall(DefineFixed(result, r0), instr);
826 HBitwiseBinaryOperation* instr) {
827 if (instr->representation().IsTagged()) {
828 ASSERT(instr->left()->representation().IsTagged());
829 ASSERT(instr->right()->representation().IsTagged());
831 LOperand* left = UseFixed(instr->left(), r1);
832 LOperand* right = UseFixed(instr->right(), r0);
834 return MarkAsCall(DefineFixed(result, r0), instr);
837 ASSERT(instr->representation().IsInteger32());
838 ASSERT(instr->OperandAt(0)->representation().IsInteger32());
839 ASSERT(instr->OperandAt(1)->representation().IsInteger32());
840 LOperand* left = UseRegisterAtStart(instr->OperandAt(0));
842 HValue* right_value = instr->OperandAt(1);
858 for (int i = 0; i < instr->uses()->length(); i++) {
859 if (!instr->uses()->at(i)->CheckFlag(HValue::kTruncatingToInt32)) {
875 HArithmeticBinaryOperation* instr) {
876 ASSERT(instr->representation().IsDouble());
877 ASSERT(instr->left()->representation().IsDouble());
878 ASSERT(instr->right()->representation().IsDouble());
880 LOperand* left = UseRegisterAtStart(instr->left());
881 LOperand* right = UseRegisterAtStart(instr->right());
888 HArithmeticBinaryOperation* instr) {
894 HValue* left = instr->left();
895 HValue* right = instr->right();
901 return MarkAsCall(DefineFixed(result, r0), instr);
972 LInstruction* instr = current->CompileToLithium(this);
974 if (instr != NULL) {
975 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
976 instr = AssignPointerMap(instr);
978 if (FLAG_stress_environments && !instr->HasEnvironment()) {
979 instr = AssignEnvironment(instr);
981 if (current->IsTest() && !instr->IsGoto()) {
982 ASSERT(instr->IsControl());
984 instr->set_hydrogen_value(test->value());
988 instr->SetBranchTargets(first->block_id(), second->block_id());
990 instr->set_hydrogen_value(current);
993 chunk_->AddInstruction(instr, current_block_);
1030 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
1031 LInstruction* result = new LGoto(instr->FirstSuccessor()->block_id(),
1032 instr->include_stack_check());
1033 if (instr->include_stack_check()) result = AssignPointerMap(result);
1038 LInstruction* LChunkBuilder::DoTest(HTest* instr) {
1039 HValue* v = instr->value();
1071 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());
1149 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) {
1151 new LInstanceOf(UseFixed(instr->left(), r0),
1152 UseFixed(instr->right(), r1));
1153 return MarkAsCall(DefineFixed(result, r0), instr);
1158 HInstanceOfKnownGlobal* instr) {
1160 new LInstanceOfKnownGlobal(UseFixed(instr->value(), r0), FixedTemp(r4));
1161 return MarkAsCall(DefineFixed(result, r0), instr);
1165 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) {
1166 LOperand* function = UseFixed(instr->function(), r1);
1167 LOperand* receiver = UseFixed(instr->receiver(), r0);
1168 LOperand* length = UseFixed(instr->length(), r2);
1169 LOperand* elements = UseFixed(instr->elements(), r3);
1174 return MarkAsCall(DefineFixed(result, r0), instr, CAN_DEOPTIMIZE_EAGERLY);
1178 LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) {
1180 LOperand* argument = Use(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) {
1197 LOperand* context = UseRegisterAtStart(instr->value());
1202 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) {
1203 LOperand* global_object = UseRegisterAtStart(instr->value());
1209 HCallConstantFunction* instr) {
1210 argument_count_ -= instr->argument_count();
1211 return MarkAsCall(DefineFixed(new LCallConstantFunction, r0), instr);
1215 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
1216 BuiltinFunctionId op = instr->op();
1218 LOperand* input = UseFixedDouble(instr->value(), d2);
1220 return MarkAsCall(DefineFixedDouble(result, d2), instr);
1222 LOperand* input = UseRegisterAtStart(instr->value());
1244 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) {
1245 ASSERT(instr->key()->representation().IsTagged());
1246 argument_count_ -= instr->argument_count();
1247 LOperand* key = UseFixed(instr->key(), r2);
1248 return MarkAsCall(DefineFixed(new LCallKeyed(key), r0), instr);
1252 LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) {
1253 argument_count_ -= instr->argument_count();
1254 return MarkAsCall(DefineFixed(new LCallNamed, r0), instr);
1258 LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) {
1259 argument_count_ -= instr->argument_count();
1260 return MarkAsCall(DefineFixed(new LCallGlobal, r0), instr);
1264 LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) {
1265 argument_count_ -= instr->argument_count();
1266 return MarkAsCall(DefineFixed(new LCallKnownGlobal, r0), instr);
1270 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) {
1271 LOperand* constructor = UseFixed(instr->constructor(), r1);
1272 argument_count_ -= instr->argument_count();
1274 return MarkAsCall(DefineFixed(result, r0), instr);
1278 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) {
1279 argument_count_ -= instr->argument_count();
1280 return MarkAsCall(DefineFixed(new LCallFunction, r0), instr);
1284 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) {
1285 argument_count_ -= instr->argument_count();
1286 return MarkAsCall(DefineFixed(new LCallRuntime, r0), 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 return DefineSameAsFirst(new LBitNotI(UseRegisterAtStart(instr->value())));
1317 LInstruction* LChunkBuilder::DoBitOr(HBitOr* instr) {
1318 return DoBit(Token::BIT_OR, instr);
1322 LInstruction* LChunkBuilder::DoBitXor(HBitXor* instr) {
1323 return DoBit(Token::BIT_XOR, instr);
1327 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
1328 if (instr->representation().IsDouble()) {
1329 return DoArithmeticD(Token::DIV, instr);
1330 } else if (instr->representation().IsInteger32()) {
1336 LOperand* dividend = UseFixed(instr->left(), r0);
1337 LOperand* divisor = UseFixed(instr->right(), r1);
1341 return DoArithmeticT(Token::DIV, instr);
1346 LInstruction* LChunkBuilder::DoMod(HMod* instr) {
1347 if (instr->representation().IsInteger32()) {
1348 ASSERT(instr->left()->representation().IsInteger32());
1349 ASSERT(instr->right()->representation().IsInteger32());
1352 if (instr->HasPowerOf2Divisor()) {
1353 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero));
1354 LOperand* value = UseRegisterAtStart(instr->left());
1355 mod = new LModI(value, UseOrConstant(instr->right()));
1357 LOperand* dividend = UseRegister(instr->left());
1358 LOperand* divisor = UseRegisterAtStart(instr->right());
1367 } else if (instr->representation().IsTagged()) {
1368 return DoArithmeticT(Token::MOD, instr);
1370 ASSERT(instr->representation().IsDouble());
1374 LOperand* left = UseFixedDouble(instr->left(), d1);
1375 LOperand* right = UseFixedDouble(instr->right(), d2);
1377 return MarkAsCall(DefineFixedDouble(result, d1), instr);
1382 LInstruction* LChunkBuilder::DoMul(HMul* instr) {
1383 if (instr->representation().IsInteger32()) {
1384 ASSERT(instr->left()->representation().IsInteger32());
1385 ASSERT(instr->right()->representation().IsInteger32());
1386 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
1387 LOperand* right = UseOrConstant(instr->MostConstantOperand());
1389 if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
1394 } else if (instr->representation().IsDouble()) {
1395 return DoArithmeticD(Token::MUL, instr);
1397 return DoArithmeticT(Token::MUL, instr);
1402 LInstruction* LChunkBuilder::DoSub(HSub* instr) {
1403 if (instr->representation().IsInteger32()) {
1404 ASSERT(instr->left()->representation().IsInteger32());
1405 ASSERT(instr->right()->representation().IsInteger32());
1406 LOperand* left = UseRegisterAtStart(instr->left());
1407 LOperand* right = UseOrConstantAtStart(instr->right());
1410 if (instr->CheckFlag(HValue::kCanOverflow)) {
1414 } else if (instr->representation().IsDouble()) {
1415 return DoArithmeticD(Token::SUB, instr);
1417 return DoArithmeticT(Token::SUB, instr);
1422 LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
1423 if (instr->representation().IsInteger32()) {
1424 ASSERT(instr->left()->representation().IsInteger32());
1425 ASSERT(instr->right()->representation().IsInteger32());
1426 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
1427 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
1430 if (instr->CheckFlag(HValue::kCanOverflow)) {
1434 } else if (instr->representation().IsDouble()) {
1435 return DoArithmeticD(Token::ADD, instr);
1437 ASSERT(instr->representation().IsTagged());
1438 return DoArithmeticT(Token::ADD, instr);
1443 LInstruction* LChunkBuilder::DoPower(HPower* instr) {
1444 ASSERT(instr->representation().IsDouble());
1447 Representation exponent_type = instr->right()->representation();
1448 ASSERT(instr->left()->representation().IsDouble());
1449 LOperand* left = UseFixedDouble(instr->left(), d1);
1451 UseFixedDouble(instr->right(), d2) :
1452 UseFixed(instr->right(), r0);
1455 instr,
1460 LInstruction* LChunkBuilder::DoCompare(HCompare* instr) {
1461 Token::Value op = instr->token();
1462 Representation r = instr->GetInputRepresentation();
1464 ASSERT(instr->left()->representation().IsInteger32());
1465 ASSERT(instr->right()->representation().IsInteger32());
1466 LOperand* left = UseRegisterAtStart(instr->left());
1467 LOperand* right = UseRegisterAtStart(instr->right());
1470 ASSERT(instr->left()->representation().IsDouble());
1471 ASSERT(instr->right()->representation().IsDouble());
1472 LOperand* left = UseRegisterAtStart(instr->left());
1473 LOperand* right = UseRegisterAtStart(instr->right());
1476 ASSERT(instr->left()->representation().IsTagged());
1477 ASSERT(instr->right()->representation().IsTagged());
1479 LOperand* left = UseFixed(instr->left(), reversed ? r0 : r1);
1480 LOperand* right = UseFixed(instr->right(), reversed ? r1 : r0);
1482 return MarkAsCall(DefineFixed(result, r0), instr);
1488 HCompareJSObjectEq* instr) {
1489 LOperand* left = UseRegisterAtStart(instr->left());
1490 LOperand* right = UseRegisterAtStart(instr->right());
1496 LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) {
1497 ASSERT(instr->value()->representation().IsTagged());
1498 LOperand* value = UseRegisterAtStart(instr->value());
1504 LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) {
1505 ASSERT(instr->value()->representation().IsTagged());
1506 LOperand* value = UseRegisterAtStart(instr->value());
1512 LInstruction* LChunkBuilder::DoIsSmi(HIsSmi* instr) {
1513 ASSERT(instr->value()->representation().IsTagged());
1514 LOperand* value = UseAtStart(instr->value());
1520 LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) {
1521 ASSERT(instr->value()->representation().IsTagged());
1522 LOperand* value = UseRegisterAtStart(instr->value());
1529 HGetCachedArrayIndex* instr) {
1530 ASSERT(instr->value()->representation().IsTagged());
1531 LOperand* value = UseRegisterAtStart(instr->value());
1538 HHasCachedArrayIndex* instr) {
1539 ASSERT(instr->value()->representation().IsTagged());
1540 LOperand* value = UseRegister(instr->value());
1546 LInstruction* LChunkBuilder::DoClassOfTest(HClassOfTest* instr) {
1547 ASSERT(instr->value()->representation().IsTagged());
1548 LOperand* value = UseTempRegister(instr->value());
1553 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) {
1554 LOperand* array = UseRegisterAtStart(instr->value());
1560 HExternalArrayLength* instr) {
1561 LOperand* array = UseRegisterAtStart(instr->value());
1566 LInstruction* LChunkBuilder::DoFixedArrayLength(HFixedArrayLength* instr) {
1567 LOperand* array = UseRegisterAtStart(instr->value());
1572 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) {
1573 LOperand* object = UseRegister(instr->value());
1579 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
1580 return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()),
1581 UseRegister(instr->length())));
1585 LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
1592 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
1593 LOperand* value = UseFixed(instr->value(), r0);
1594 return MarkAsCall(new LThrow(value), instr);
1598 LInstruction* LChunkBuilder::DoChange(HChange* instr) {
1599 Representation from = instr->from();
1600 Representation to = instr->to();
1603 LOperand* value = UseRegister(instr->value());
1608 LOperand* value = UseRegister(instr->value());
1609 bool needs_check = !instr->value()->type().IsSmi();
1615 LOperand* temp2 = instr->CanTruncateToInt32() ? TempRegister()
1617 LOperand* temp3 = instr->CanTruncateToInt32() ? FixedTemp(d3)
1626 LOperand* value = UseRegister(instr->value());
1638 LOperand* value = UseRegister(instr->value());
1642 instr->CanTruncateToInt32() ? TempRegister() : NULL);
1647 HValue* val = instr->value();
1657 LOperand* value = Use(instr->value());
1666 LInstruction* LChunkBuilder::DoCheckNonSmi(HCheckNonSmi* instr) {
1667 LOperand* value = UseRegisterAtStart(instr->value());
1672 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) {
1673 LOperand* value = UseRegisterAtStart(instr->value());
1679 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) {
1687 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) {
1688 LOperand* value = UseRegisterAtStart(instr->value());
1693 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) {
1694 LOperand* value = UseRegisterAtStart(instr->value());
1699 LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) {
1700 LOperand* value = UseRegisterAtStart(instr->value());
1706 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) {
1707 return new LReturn(UseFixed(instr->value(), r0));
1711 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
1712 Representation r = instr->representation();
1726 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) {
1728 return instr->check_hole_value()
1734 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) {
1735 LOperand* global_object = UseFixed(instr->global_object(), r0);
1737 return MarkAsCall(DefineFixed(result, r0), instr);
1741 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) {
1742 if (instr->check_hole_value()) {
1744 LOperand* value = UseRegister(instr->value());
1747 LOperand* value = UseRegisterAtStart(instr->value());
1753 LInstruction* LChunkBuilder::DoStoreGlobalGeneric(HStoreGlobalGeneric* instr) {
1754 LOperand* global_object = UseFixed(instr->global_object(), r1);
1755 LOperand* value = UseFixed(instr->value(), r0);
1758 return MarkAsCall(result, instr);
1762 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) {
1763 LOperand* context = UseRegisterAtStart(instr->value());
1768 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) {
1771 if (instr->NeedsWriteBarrier()) {
1772 context = UseTempRegister(instr->context());
1773 value = UseTempRegister(instr->value());
1775 context = UseRegister(instr->context());
1776 value = UseRegister(instr->value());
1782 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
1784 new LLoadNamedField(UseRegisterAtStart(instr->object())));
1789 HLoadNamedFieldPolymorphic* instr) {
1790 ASSERT(instr->representation().IsTagged());
1791 if (instr->need_generic()) {
1792 LOperand* obj = UseFixed(instr->object(), r0);
1794 return MarkAsCall(DefineFixed(result, r0), instr);
1796 LOperand* obj = UseRegisterAtStart(instr->object());
1803 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
1804 LOperand* object = UseFixed(instr->object(), r0);
1806 return MarkAsCall(result, instr);
1811 HLoadFunctionPrototype* instr) {
1813 new LLoadFunctionPrototype(UseRegister(instr->function()))));
1817 LInstruction* LChunkBuilder::DoLoadElements(HLoadElements* instr) {
1818 LOperand* input = UseRegisterAtStart(instr->value());
1824 HLoadExternalArrayPointer* instr) {
1825 LOperand* input = UseRegisterAtStart(instr->value());
1831 HLoadKeyedFastElement* instr) {
1832 ASSERT(instr->representation().IsTagged());
1833 ASSERT(instr->key()->representation().IsInteger32());
1834 LOperand* obj = UseRegisterAtStart(instr->object());
1835 LOperand* key = UseRegisterAtStart(instr->key());
1842 HLoadKeyedSpecializedArrayElement* instr) {
1843 ExternalArrayType array_type = instr->array_type();
1844 Representation representation(instr->representation());
1847 ASSERT(instr->key()->representation().IsInteger32());
1848 LOperand* external_pointer = UseRegister(instr->external_pointer());
1849 LOperand* key = UseRegister(instr->key());
1860 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
1861 LOperand* object = UseFixed(instr->object(), r1);
1862 LOperand* key = UseFixed(instr->key(), r0);
1866 return MarkAsCall(result, instr);
1871 HStoreKeyedFastElement* instr) {
1872 bool needs_write_barrier = instr->NeedsWriteBarrier();
1873 ASSERT(instr->value()->representation().IsTagged());
1874 ASSERT(instr->object()->representation().IsTagged());
1875 ASSERT(instr->key()->representation().IsInteger32());
1877 LOperand* obj = UseTempRegister(instr->object());
1879 ? UseTempRegister(instr->value())
1880 : UseRegisterAtStart(instr->value());
1882 ? UseTempRegister(instr->key())
1883 : UseRegisterOrConstantAtStart(instr->key());
1890 HStoreKeyedSpecializedArrayElement* instr) {
1891 Representation representation(instr->value()->representation());
1892 ExternalArrayType array_type = instr->array_type();
1895 ASSERT(instr->external_pointer()->representation().IsExternal());
1896 ASSERT(instr->key()->representation().IsInteger32());
1898 LOperand* external_pointer = UseRegister(instr->external_pointer());
1902 ? UseTempRegister(instr->value())
1903 : UseRegister(instr->value());
1904 LOperand* key = UseRegister(instr->key());
1912 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) {
1913 LOperand* obj = UseFixed(instr->object(), r2);
1914 LOperand* key = UseFixed(instr->key(), r1);
1915 LOperand* val = UseFixed(instr->value(), r0);
1917 ASSERT(instr->object()->representation().IsTagged());
1918 ASSERT(instr->key()->representation().IsTagged());
1919 ASSERT(instr->value()->representation().IsTagged());
1921 return MarkAsCall(new LStoreKeyedGeneric(obj, key, val), instr);
1925 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
1926 bool needs_write_barrier = instr->NeedsWriteBarrier();
1929 ? UseTempRegister(instr->object())
1930 : UseRegisterAtStart(instr->object());
1933 ? UseTempRegister(instr->value())
1934 : UseRegister(instr->value());
1940 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
1941 LOperand* obj = UseFixed(instr->object(), r1);
1942 LOperand* val = UseFixed(instr->value(), r0);
1945 return MarkAsCall(result, instr);
1949 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) {
1950 LOperand* string = UseRegister(instr->string());
1951 LOperand* index = UseRegisterOrConstant(instr->index());
1957 LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) {
1958 LOperand* char_code = UseRegister(instr->value());
1964 LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) {
1965 LOperand* string = UseRegisterAtStart(instr->value());
1970 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) {
1971 return MarkAsCall(DefineFixed(new LArrayLiteral, r0), instr);
1975 LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) {
1976 return MarkAsCall(DefineFixed(new LObjectLiteral, r0), instr);
1980 LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) {
1981 return MarkAsCall(DefineFixed(new LRegExpLiteral, r0), instr);
1985 LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) {
1986 return MarkAsCall(DefineFixed(new LFunctionLiteral, r0), instr);
1990 LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) {
1991 LOperand* object = UseFixed(instr->object(), r0);
1992 LOperand* key = UseFixed(instr->key(), r1);
1994 return MarkAsCall(DefineFixed(result, r0), instr);
1998 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) {
2000 current_block_->last_environment()->set_ast_id(instr->ast_id());
2005 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
2006 int spill_index = chunk()->GetParameterStackSlot(instr->index());
2011 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
2021 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) {
2022 argument_count_ -= instr->argument_count();
2023 return MarkAsCall(DefineFixed(new LCallStub, r0), instr);
2027 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) {
2036 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) {
2037 LOperand* arguments = UseRegister(instr->arguments());
2038 LOperand* length = UseTempRegister(instr->length());
2039 LOperand* index = UseRegister(instr->index());
2045 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) {
2046 LOperand* object = UseFixed(instr->value(), r0);
2048 return MarkAsCall(DefineFixed(result, r0), instr);
2052 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) {
2053 LTypeof* result = new LTypeof(UseFixed(instr->value(), r0));
2054 return MarkAsCall(DefineFixed(result, r0), instr);
2058 LInstruction* LChunkBuilder::DoTypeofIs(HTypeofIs* instr) {
2059 return DefineSameAsFirst(new LTypeofIs(UseRegister(instr->value())));
2063 LInstruction* LChunkBuilder::DoIsConstructCall(HIsConstructCall* instr) {
2068 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) {
2072 env->set_ast_id(instr->ast_id());
2074 env->Drop(instr->pop_count());
2075 for (int i = 0; i < instr->values()->length(); ++i) {
2076 HValue* value = instr->values()->at(i);
2077 if (instr->HasAssignedIndexAt(i)) {
2078 env->Bind(instr->GetAssignedIndexAt(i), value);
2086 if (pending_deoptimization_ast_id_ == instr->ast_id()) {
2099 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) {
2100 return MarkAsCall(new LStackCheck, instr);
2104 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
2107 HEnvironment* inner = outer->CopyForInlining(instr->closure(),
2108 instr->function(),
2112 chunk_->AddInlinedClosure(instr->closure());
2117 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {