Home | History | Annotate | Download | only in ia32

Lines Matching refs:instr

443 void LChunk::AddInstruction(LInstruction* instr, HBasicBlock* block) {
446 if (instr->IsControl()) {
449 instructions_.Add(instr);
452 instructions_.Add(instr);
455 if (instr->HasPointerMap()) {
456 pointer_maps_.Add(instr->pointer_map());
457 instr->pointer_map()->set_lithium_position(index);
640 HInstruction* instr = HInstruction::cast(value);
641 VisitInstruction(instr);
649 LInstruction* LChunkBuilder::Define(LTemplateInstruction<1, I, T>* instr,
652 instr->set_result(result);
653 return instr;
658 LInstruction* LChunkBuilder::Define(LTemplateInstruction<1, I, T>* instr) {
659 return Define(instr, new LUnallocated(LUnallocated::NONE));
665 LTemplateInstruction<1, I, T>* instr) {
666 return Define(instr, new LUnallocated(LUnallocated::MUST_HAVE_REGISTER));
672 LTemplateInstruction<1, I, T>* instr,
674 return Define(instr, new LUnallocated(LUnallocated::FIXED_SLOT, index));
680 LTemplateInstruction<1, I, T>* instr) {
681 return Define(instr, new LUnallocated(LUnallocated::SAME_AS_FIRST_INPUT));
686 LInstruction* LChunkBuilder::DefineFixed(LTemplateInstruction<1, I, T>* instr,
688 return Define(instr, ToUnallocated(reg));
694 LTemplateInstruction<1, I, T>* instr,
696 return Define(instr, ToUnallocated(reg));
700 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) {
702 instr->set_environment(CreateEnvironment(hydrogen_env));
703 return instr;
708 LInstruction* instr, int ast_id) {
711 instruction_pending_deoptimization_environment_ = instr;
713 return instr;
723 LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr,
727 instr->VerifyCall();
729 instr->MarkAsCall();
730 instr = AssignPointerMap(instr);
735 instr = SetInstructionPendingDeoptimizationEnvironment(
736 instr, sim->ast_id());
745 if (needs_environment && !instr->HasEnvironment()) {
746 instr = AssignEnvironment(instr);
749 return instr;
753 LInstruction* LChunkBuilder::MarkAsSaveDoubles(LInstruction* instr) {
754 instr->MarkAsSaveDoubles();
755 return instr;
759 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) {
760 ASSERT(!instr->HasPointerMap());
761 instr->set_pointer_map(new LPointerMap(position_));
762 return instr;
787 LInstruction* LChunkBuilder::DoBlockEntry(HBlockEntry* instr) {
788 return new LLabel(instr->block());
792 LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) {
798 HBitwiseBinaryOperation* instr) {
799 if (instr->representation().IsInteger32()) {
800 ASSERT(instr->left()->representation().IsInteger32());
801 ASSERT(instr->right()->representation().IsInteger32());
803 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
804 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
807 ASSERT(instr->representation().IsTagged());
808 ASSERT(instr->left()->representation().IsTagged());
809 ASSERT(instr->right()->representation().IsTagged());
811 LOperand* left = UseFixed(instr->left(), edx);
812 LOperand* right = UseFixed(instr->right(), eax);
814 return MarkAsCall(DefineFixed(result, eax), instr);
820 HBitwiseBinaryOperation* instr) {
821 if (instr->representation().IsTagged()) {
822 ASSERT(instr->left()->representation().IsTagged());
823 ASSERT(instr->right()->representation().IsTagged());
825 LOperand* left = UseFixed(instr->left(), edx);
826 LOperand* right = UseFixed(instr->right(), eax);
828 return MarkAsCall(DefineFixed(result, eax), instr);
831 ASSERT(instr->representation().IsInteger32());
832 ASSERT(instr->OperandAt(0)->representation().IsInteger32());
833 ASSERT(instr->OperandAt(1)->representation().IsInteger32());
834 LOperand* left = UseRegisterAtStart(instr->OperandAt(0));
836 HValue* right_value = instr->OperandAt(1);
852 for (int i = 0; i < instr->uses()->length(); i++) {
853 if (!instr->uses()->at(i)->CheckFlag(HValue::kTruncatingToInt32)) {
869 HArithmeticBinaryOperation* instr) {
870 ASSERT(instr->representation().IsDouble());
871 ASSERT(instr->left()->representation().IsDouble());
872 ASSERT(instr->right()->representation().IsDouble());
874 LOperand* left = UseRegisterAtStart(instr->left());
875 LOperand* right = UseRegisterAtStart(instr->right());
882 HArithmeticBinaryOperation* instr) {
888 HValue* left = instr->left();
889 HValue* right = instr->right();
895 return MarkAsCall(DefineFixed(result, eax), instr);
965 LInstruction* instr = current->CompileToLithium(this);
967 if (instr != NULL) {
968 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
969 instr = AssignPointerMap(instr);
971 if (FLAG_stress_environments && !instr->HasEnvironment()) {
972 instr = AssignEnvironment(instr);
974 if (current->IsTest() && !instr->IsGoto()) {
975 ASSERT(instr->IsControl());
977 instr->set_hydrogen_value(test->value());
981 instr->SetBranchTargets(first->block_id(), second->block_id());
983 instr->set_hydrogen_value(current);
986 chunk_->AddInstruction(instr, current_block_);
1023 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
1024 LGoto* result = new LGoto(instr->FirstSuccessor()->block_id(),
1025 instr->include_stack_check());
1026 return (instr->include_stack_check())
1032 LInstruction* LChunkBuilder::DoTest(HTest* instr) {
1033 HValue* v = instr->value();
1068 return MarkAsCall(result, instr);
1115 return MarkAsCall(result, instr);
1124 return new LGoto(instr->FirstSuccessor()->block_id());
1126 return new LGoto(instr->SecondSuccessor()->block_id());
1137 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
1138 ASSERT(instr->value()->representation().IsTagged());
1139 LOperand* value = UseRegisterAtStart(instr->value());
1154 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) {
1155 LOperand* left = UseFixed(instr->left(), InstanceofStub::left());
1156 LOperand* right = UseFixed(instr->right(), InstanceofStub::right());
1157 LOperand* context = UseFixed(instr->context(), esi);
1159 return MarkAsCall(DefineFixed(result, eax), instr);
1164 HInstanceOfKnownGlobal* instr) {
1167 UseFixed(instr->value(), InstanceofStub::left()),
1169 return MarkAsCall(DefineFixed(result, eax), instr);
1173 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) {
1174 LOperand* function = UseFixed(instr->function(), edi);
1175 LOperand* receiver = UseFixed(instr->receiver(), eax);
1176 LOperand* length = UseFixed(instr->length(), ebx);
1177 LOperand* elements = UseFixed(instr->elements(), ecx);
1184 return MarkAsCall(DefineFixed(result, eax), instr, CAN_DEOPTIMIZE_EAGERLY);
1188 LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) {
1190 LOperand* argument = UseAny(instr->argument());
1195 LInstruction* LChunkBuilder::DoContext(HContext* instr) {
1200 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) {
1201 LOperand* context = UseRegisterAtStart(instr->value());
1206 LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) {
1207 LOperand* context = UseRegisterAtStart(instr->value());
1212 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) {
1213 LOperand* global_object = UseRegisterAtStart(instr->value());
1219 HCallConstantFunction* instr) {
1220 argument_count_ -= instr->argument_count();
1221 return MarkAsCall(DefineFixed(new LCallConstantFunction, eax), instr);
1225 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
1226 BuiltinFunctionId op = instr->op();
1228 ASSERT(instr->representation().IsDouble());
1229 ASSERT(instr->value()->representation().IsDouble());
1230 LOperand* input = UseRegisterAtStart(instr->value());
1234 LOperand* input = UseFixedDouble(instr->value(), xmm1);
1236 return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
1238 LOperand* input = UseRegisterAtStart(instr->value());
1259 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) {
1260 ASSERT(instr->key()->representation().IsTagged());
1261 LOperand* context = UseFixed(instr->context(), esi);
1262 LOperand* key = UseFixed(instr->key(), ecx);
1263 argument_count_ -= instr->argument_count();
1265 return MarkAsCall(DefineFixed(result, eax), instr);
1269 LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) {
1270 LOperand* context = UseFixed(instr->context(), esi);
1271 argument_count_ -= instr->argument_count();
1273 return MarkAsCall(DefineFixed(result, eax), instr);
1277 LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) {
1278 LOperand* context = UseFixed(instr->context(), esi);
1279 argument_count_ -= instr->argument_count();
1281 return MarkAsCall(DefineFixed(result, eax), instr);
1285 LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) {
1286 argument_count_ -= instr->argument_count();
1287 return MarkAsCall(DefineFixed(new LCallKnownGlobal, eax), instr);
1291 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) {
1292 LOperand* context = UseFixed(instr->context(), esi);
1293 LOperand* constructor = UseFixed(instr->constructor(), edi);
1294 argument_count_ -= instr->argument_count();
1296 return MarkAsCall(DefineFixed(result, eax), instr);
1300 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) {
1301 LOperand* context = UseFixed(instr->context(), esi);
1302 argument_count_ -= instr->argument_count();
1304 return MarkAsCall(DefineFixed(result, eax), instr);
1308 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) {
1309 argument_count_ -= instr->argument_count();
1310 return MarkAsCall(DefineFixed(new LCallRuntime, eax), instr);
1314 LInstruction* LChunkBuilder::DoShr(HShr* instr) {
1315 return DoShift(Token::SHR, instr);
1319 LInstruction* LChunkBuilder::DoSar(HSar* instr) {
1320 return DoShift(Token::SAR, instr);
1324 LInstruction* LChunkBuilder::DoShl(HShl* instr) {
1325 return DoShift(Token::SHL, instr);
1329 LInstruction* LChunkBuilder::DoBitAnd(HBitAnd* instr) {
1330 return DoBit(Token::BIT_AND, instr);
1334 LInstruction* LChunkBuilder::DoBitNot(HBitNot* instr) {
1335 ASSERT(instr->value()->representation().IsInteger32());
1336 ASSERT(instr->representation().IsInteger32());
1337 LOperand* input = UseRegisterAtStart(instr->value());
1343 LInstruction* LChunkBuilder::DoBitOr(HBitOr* instr) {
1344 return DoBit(Token::BIT_OR, instr);
1348 LInstruction* LChunkBuilder::DoBitXor(HBitXor* instr) {
1349 return DoBit(Token::BIT_XOR, instr);
1353 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
1354 if (instr->representation().IsDouble()) {
1355 return DoArithmeticD(Token::DIV, instr);
1356 } else if (instr->representation().IsInteger32()) {
1360 LOperand* dividend = UseFixed(instr->left(), eax);
1361 LOperand* divisor = UseRegister(instr->right());
1365 ASSERT(instr->representation().IsTagged());
1366 return DoArithmeticT(Token::DIV, instr);
1371 LInstruction* LChunkBuilder::DoMod(HMod* instr) {
1372 if (instr->representation().IsInteger32()) {
1373 ASSERT(instr->left()->representation().IsInteger32());
1374 ASSERT(instr->right()->representation().IsInteger32());
1377 if (instr->HasPowerOf2Divisor()) {
1378 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero));
1379 LOperand* value = UseRegisterAtStart(instr->left());
1380 LModI* mod = new LModI(value, UseOrConstant(instr->right()), NULL);
1386 LOperand* value = UseFixed(instr->left(), eax);
1387 LOperand* divisor = UseRegister(instr->right());
1392 return (instr->CheckFlag(HValue::kBailoutOnMinusZero) ||
1393 instr->CheckFlag(HValue::kCanBeDivByZero))
1396 } else if (instr->representation().IsTagged()) {
1397 return DoArithmeticT(Token::MOD, instr);
1399 ASSERT(instr->representation().IsDouble());
1403 LOperand* left = UseFixedDouble(instr->left(), xmm2);
1404 LOperand* right = UseFixedDouble(instr->right(), xmm1);
1406 return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
1411 LInstruction* LChunkBuilder::DoMul(HMul* instr) {
1412 if (instr->representation().IsInteger32()) {
1413 ASSERT(instr->left()->representation().IsInteger32());
1414 ASSERT(instr->right()->representation().IsInteger32());
1415 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
1416 LOperand* right = UseOrConstant(instr->MostConstantOperand());
1418 if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
1423 } else if (instr->representation().IsDouble()) {
1424 return DoArithmeticD(Token::MUL, instr);
1426 ASSERT(instr->representation().IsTagged());
1427 return DoArithmeticT(Token::MUL, instr);
1432 LInstruction* LChunkBuilder::DoSub(HSub* instr) {
1433 if (instr->representation().IsInteger32()) {
1434 ASSERT(instr->left()->representation().IsInteger32());
1435 ASSERT(instr->right()->representation().IsInteger32());
1436 LOperand* left = UseRegisterAtStart(instr->left());
1437 LOperand* right = UseOrConstantAtStart(instr->right());
1440 if (instr->CheckFlag(HValue::kCanOverflow)) {
1444 } else if (instr->representation().IsDouble()) {
1445 return DoArithmeticD(Token::SUB, instr);
1447 ASSERT(instr->representation().IsTagged());
1448 return DoArithmeticT(Token::SUB, instr);
1453 LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
1454 if (instr->representation().IsInteger32()) {
1455 ASSERT(instr->left()->representation().IsInteger32());
1456 ASSERT(instr->right()->representation().IsInteger32());
1457 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
1458 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
1461 if (instr->CheckFlag(HValue::kCanOverflow)) {
1465 } else if (instr->representation().IsDouble()) {
1466 return DoArithmeticD(Token::ADD, instr);
1468 ASSERT(instr->representation().IsTagged());
1469 return DoArithmeticT(Token::ADD, instr);
1474 LInstruction* LChunkBuilder::DoPower(HPower* instr) {
1475 ASSERT(instr->representation().IsDouble());
1478 Representation exponent_type = instr->right()->representation();
1479 ASSERT(instr->left()->representation().IsDouble());
1480 LOperand* left = UseFixedDouble(instr->left(), xmm1);
1482 UseFixedDouble(instr->right(), xmm2) :
1483 UseFixed(instr->right(), eax);
1485 return MarkAsCall(DefineFixedDouble(result, xmm3), instr,
1490 LInstruction* LChunkBuilder::DoCompare(HCompare* instr) {
1491 Token::Value op = instr->token();
1492 Representation r = instr->GetInputRepresentation();
1494 ASSERT(instr->left()->representation().IsInteger32());
1495 ASSERT(instr->right()->representation().IsInteger32());
1496 LOperand* left = UseRegisterAtStart(instr->left());
1497 LOperand* right = UseOrConstantAtStart(instr->right());
1500 ASSERT(instr->left()->representation().IsDouble());
1501 ASSERT(instr->right()->representation().IsDouble());
1502 LOperand* left = UseRegisterAtStart(instr->left());
1503 LOperand* right = UseRegisterAtStart(instr->right());
1506 ASSERT(instr->left()->representation().IsTagged());
1507 ASSERT(instr->right()->representation().IsTagged());
1509 LOperand* left = UseFixed(instr->left(), reversed ? eax : edx);
1510 LOperand* right = UseFixed(instr->right(), reversed ? edx : eax);
1512 return MarkAsCall(DefineFixed(result, eax), instr);
1518 HCompareJSObjectEq* instr) {
1519 LOperand* left = UseRegisterAtStart(instr->left());
1520 LOperand* right = UseRegisterAtStart(instr->right());
1526 LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) {
1527 ASSERT(instr->value()->representation().IsTagged());
1528 LOperand* value = UseRegisterAtStart(instr->value());
1534 LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) {
1535 ASSERT(instr->value()->representation().IsTagged());
1536 LOperand* value = UseRegister(instr->value());
1542 LInstruction* LChunkBuilder::DoIsSmi(HIsSmi* instr) {
1543 ASSERT(instr->value()->representation().IsTagged());
1544 LOperand* value = UseAtStart(instr->value());
1550 LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) {
1551 ASSERT(instr->value()->representation().IsTagged());
1552 LOperand* value = UseRegisterAtStart(instr->value());
1559 HGetCachedArrayIndex* instr) {
1560 ASSERT(instr->value()->representation().IsTagged());
1561 LOperand* value = UseRegisterAtStart(instr->value());
1568 HHasCachedArrayIndex* instr) {
1569 ASSERT(instr->value()->representation().IsTagged());
1570 LOperand* value = UseRegister(instr->value());
1576 LInstruction* LChunkBuilder::DoClassOfTest(HClassOfTest* instr) {
1577 ASSERT(instr->value()->representation().IsTagged());
1578 LOperand* value = UseTempRegister(instr->value());
1584 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) {
1585 LOperand* array = UseRegisterAtStart(instr->value());
1590 LInstruction* LChunkBuilder::DoFixedArrayLength(HFixedArrayLength* instr) {
1591 LOperand* array = UseRegisterAtStart(instr->value());
1597 HExternalArrayLength* instr) {
1598 LOperand* array = UseRegisterAtStart(instr->value());
1603 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) {
1604 LOperand* object = UseRegister(instr->value());
1610 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
1611 return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()),
1612 Use(instr->length())));
1616 LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
1623 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
1624 LOperand* value = UseFixed(instr->value(), eax);
1625 return MarkAsCall(new LThrow(value), instr);
1629 LInstruction* LChunkBuilder::DoChange(HChange* instr) {
1630 Representation from = instr->from();
1631 Representation to = instr->to();
1634 LOperand* value = UseRegister(instr->value());
1639 LOperand* value = UseRegister(instr->value());
1640 bool needs_check = !instr->value()->type().IsSmi();
1643 (instr->CanTruncateToInt32() && CpuFeatures::IsSupported(SSE3))
1654 LOperand* value = UseRegister(instr->value());
1663 bool needs_temp = instr->CanTruncateToInt32() &&
1666 UseTempRegister(instr->value()) : UseRegister(instr->value());
1672 HValue* val = instr->value();
1682 return DefineAsRegister(new LInteger32ToDouble(Use(instr->value())));
1690 LInstruction* LChunkBuilder::DoCheckNonSmi(HCheckNonSmi* instr) {
1691 LOperand* value = UseRegisterAtStart(instr->value());
1696 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) {
1697 LOperand* value = UseRegisterAtStart(instr->value());
1704 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) {
1711 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) {
1712 LOperand* value = UseRegisterAtStart(instr->value());
1717 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) {
1718 LOperand* value = UseRegisterAtStart(instr->value());
1723 LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) {
1724 LOperand* value = UseRegisterAtStart(instr->value());
1730 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) {
1731 return new LReturn(UseFixed(instr->value(), eax));
1735 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
1736 Representation r = instr->representation();
1740 double value = instr->DoubleValue();
1754 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) {
1756 return instr->check_hole_value()
1762 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) {
1763 LOperand* context = UseFixed(instr->context(), esi);
1764 LOperand* global_object = UseFixed(instr->global_object(), eax);
1766 return MarkAsCall(DefineFixed(result, eax), instr);
1770 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) {
1772 new LStoreGlobalCell(UseRegisterAtStart(instr->value()));
1773 return instr->check_hole_value() ? AssignEnvironment(result) : result;
1777 LInstruction* LChunkBuilder::DoStoreGlobalGeneric(HStoreGlobalGeneric* instr) {
1778 LOperand* context = UseFixed(instr->context(), esi);
1779 LOperand* global_object = UseFixed(instr->global_object(), edx);
1780 LOperand* value = UseFixed(instr->value(), eax);
1783 return MarkAsCall(result, instr);
1787 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) {
1788 LOperand* context = UseRegisterAtStart(instr->value());
1793 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) {
1797 if (instr->NeedsWriteBarrier()) {
1798 context = UseTempRegister(instr->context());
1799 value = UseTempRegister(instr->value());
1802 context = UseRegister(instr->context());
1803 value = UseRegister(instr->value());
1810 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
1811 ASSERT(instr->representation().IsTagged());
1812 LOperand* obj = UseRegisterAtStart(instr->object());
1818 HLoadNamedFieldPolymorphic* instr) {
1819 ASSERT(instr->representation().IsTagged());
1820 if (instr->need_generic()) {
1821 LOperand* obj = UseFixed(instr->object(), eax);
1823 return MarkAsCall(DefineFixed(result, eax), instr);
1825 LOperand* obj = UseRegisterAtStart(instr->object());
1832 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
1833 LOperand* context = UseFixed(instr->context(), esi);
1834 LOperand* object = UseFixed(instr->object(), eax);
1836 return MarkAsCall(DefineFixed(result, eax), instr);
1841 HLoadFunctionPrototype* instr) {
1843 new LLoadFunctionPrototype(UseRegister(instr->function()),
1848 LInstruction* LChunkBuilder::DoLoadElements(HLoadElements* instr) {
1849 LOperand* input = UseRegisterAtStart(instr->value());
1855 HLoadExternalArrayPointer* instr) {
1856 LOperand* input = UseRegisterAtStart(instr->value());
1862 HLoadKeyedFastElement* instr) {
1863 ASSERT(instr->representation().IsTagged());
1864 ASSERT(instr->key()->representation().IsInteger32());
1865 LOperand* obj = UseRegisterAtStart(instr->object());
1866 LOperand* key = UseRegisterAtStart(instr->key());
1873 HLoadKeyedSpecializedArrayElement* instr) {
1874 ExternalArrayType array_type = instr->array_type();
1875 Representation representation(instr->representation());
1878 ASSERT(instr->key()->representation().IsInteger32());
1879 LOperand* external_pointer = UseRegister(instr->external_pointer());
1880 LOperand* key = UseRegister(instr->key());
1893 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
1894 LOperand* context = UseFixed(instr->context(), esi);
1895 LOperand* object = UseFixed(instr->object(), edx);
1896 LOperand* key = UseFixed(instr->key(), eax);
1899 return MarkAsCall(DefineFixed(result, eax), instr);
1904 HStoreKeyedFastElement* instr) {
1905 bool needs_write_barrier = instr->NeedsWriteBarrier();
1906 ASSERT(instr->value()->representation().IsTagged());
1907 ASSERT(instr->object()->representation().IsTagged());
1908 ASSERT(instr->key()->representation().IsInteger32());
1910 LOperand* obj = UseTempRegister(instr->object());
1912 ? UseTempRegister(instr->value())
1913 : UseRegisterAtStart(instr->value());
1915 ? UseTempRegister(instr->key())
1916 : UseRegisterOrConstantAtStart(instr->key());
1923 HStoreKeyedSpecializedArrayElement* instr) {
1924 Representation representation(instr->value()->representation());
1925 ExternalArrayType array_type = instr->array_type();
1928 ASSERT(instr->external_pointer()->representation().IsExternal());
1929 ASSERT(instr->key()->representation().IsInteger32());
1931 LOperand* external_pointer = UseRegister(instr->external_pointer());
1932 LOperand* key = UseRegister(instr->key());
1946 val = UseFixed(instr->value(), eax);
1948 val = UseRegister(instr->value());
1958 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) {
1959 LOperand* context = UseFixed(instr->context(), esi);
1960 LOperand* object = UseFixed(instr->object(), edx);
1961 LOperand* key = UseFixed(instr->key(), ecx);
1962 LOperand* value = UseFixed(instr->value(), eax);
1964 ASSERT(instr->object()->representation().IsTagged());
1965 ASSERT(instr->key()->representation().IsTagged());
1966 ASSERT(instr->value()->representation().IsTagged());
1970 return MarkAsCall(result, instr);
1974 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
1975 bool needs_write_barrier = instr->NeedsWriteBarrier();
1978 ? UseTempRegister(instr->object())
1979 : UseRegisterAtStart(instr->object());
1982 ? UseTempRegister(instr->value())
1983 : UseRegister(instr->value());
1987 LOperand* temp = (!instr->is_in_object() || needs_write_barrier)
1995 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
1996 LOperand* context = UseFixed(instr->context(), esi);
1997 LOperand* object = UseFixed(instr->object(), edx);
1998 LOperand* value = UseFixed(instr->value(), eax);
2001 return MarkAsCall(result, instr);
2005 instr) {
2006 LOperand* string = UseRegister(instr->string());
2007 LOperand* index = UseRegisterOrConstant(instr->index());
2013 LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) {
2014 LOperand* char_code = UseRegister(instr->value());
2020 LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) {
2021 LOperand* string = UseRegisterAtStart(instr->value());
2026 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) {
2027 return MarkAsCall(DefineFixed(new LArrayLiteral, eax), instr);
2031 LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) {
2032 LOperand* context = UseFixed(instr->context(), esi);
2033 return MarkAsCall(DefineFixed(new LObjectLiteral(context), eax), instr);
2037 LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) {
2038 return MarkAsCall(DefineFixed(new LRegExpLiteral, eax), instr);
2042 LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) {
2043 return MarkAsCall(DefineFixed(new LFunctionLiteral, eax), instr);
2047 LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) {
2049 new LDeleteProperty(Use(instr->object()), UseOrConstant(instr->key()));
2050 return MarkAsCall(DefineFixed(result, eax), instr);
2054 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) {
2056 current_block_->last_environment()->set_ast_id(instr->ast_id());
2061 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
2062 int spill_index = chunk()->GetParameterStackSlot(instr->index());
2067 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
2077 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) {
2078 LOperand* context = UseFixed(instr->context(), esi);
2079 argument_count_ -= instr->argument_count();
2081 return MarkAsCall(DefineFixed(result, eax), instr);
2085 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) {
2094 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) {
2095 LOperand* arguments = UseRegister(instr->arguments());
2096 LOperand* length = UseTempRegister(instr->length());
2097 LOperand* index = Use(instr->index());
2103 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) {
2104 LOperand* object = UseFixed(instr->value(), eax);
2106 return MarkAsCall(DefineFixed(result, eax), instr);
2110 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) {
2111 LTypeof* result = new LTypeof(UseAtStart(instr->value()));
2112 return MarkAsCall(DefineFixed(result, eax), instr);
2116 LInstruction* LChunkBuilder::DoTypeofIs(HTypeofIs* instr) {
2117 return DefineSameAsFirst(new LTypeofIs(UseRegister(instr->value())));
2121 LInstruction* LChunkBuilder::DoIsConstructCall(HIsConstructCall* instr) {
2126 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) {
2130 env->set_ast_id(instr->ast_id());
2132 env->Drop(instr->pop_count());
2133 for (int i = 0; i < instr->values()->length(); ++i) {
2134 HValue* value = instr->values()->at(i);
2135 if (instr->HasAssignedIndexAt(i)) {
2136 env->Bind(instr->GetAssignedIndexAt(i), value);
2145 ASSERT(pending_deoptimization_ast_id_ == instr->ast_id());
2158 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) {
2159 return MarkAsCall(new LStackCheck, instr);
2163 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
2166 HEnvironment* inner = outer->CopyForInlining(instr->closure(),
2167 instr->function(),
2171 chunk_->AddInlinedClosure(instr->closure());
2176 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {