Home | History | Annotate | Download | only in ia32

Lines Matching refs:instr

215     LInstruction* instr = instructions_->at(current_instruction_);
216 if (instr->IsLabel()) {
217 LLabel* label = LLabel::cast(instr);
222 Comment(";;; @%d: %s.", current_instruction_, instr->Mnemonic());
223 instr->CompileToNative(this);
413 LInstruction* instr,
416 ASSERT(instr != NULL);
417 LPointerMap* pointers = instr->pointer_map();
425 RegisterLazyDeoptimization(instr, safepoint_mode);
438 LInstruction* instr,
440 CallCodeGeneric(code, mode, instr, context_mode, RECORD_SIMPLE_SAFEPOINT);
446 LInstruction* instr,
448 ASSERT(instr != NULL);
449 ASSERT(instr->HasPointerMap());
450 LPointerMap* pointers = instr->pointer_map();
458 RegisterLazyDeoptimization(instr, RECORD_SIMPLE_SAFEPOINT);
464 LInstruction* instr) {
468 instr->pointer_map(), argc, Safepoint::kNoDeoptimizationIndex);
472 void LCodeGen::RegisterLazyDeoptimization(LInstruction* instr,
478 if (instr->HasDeoptimizationEnvironment()) {
479 deoptimization_environment = instr->deoptimization_environment();
481 deoptimization_environment = instr->environment();
486 RecordSafepoint(instr->pointer_map(),
491 instr->pointer_map(),
718 void LCodeGen::DoParameter(LParameter* instr) {
723 void LCodeGen::DoCallStub(LCallStub* instr) {
724 ASSERT(ToRegister(instr->context()).is(esi));
725 ASSERT(ToRegister(instr->result()).is(eax));
726 switch (instr->hydrogen()->major_key()) {
729 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, CONTEXT_ADJUSTED);
734 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, CONTEXT_ADJUSTED);
739 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, CONTEXT_ADJUSTED);
744 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, CONTEXT_ADJUSTED);
749 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, CONTEXT_ADJUSTED);
754 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, CONTEXT_ADJUSTED);
758 TranscendentalCacheStub stub(instr->transcendental_type(),
760 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, CONTEXT_ADJUSTED);
769 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) {
774 void LCodeGen::DoModI(LModI* instr) {
775 if (instr->hydrogen()->HasPowerOf2Divisor()) {
776 Register dividend = ToRegister(instr->InputAt(0));
779 HConstant::cast(instr->hydrogen()->right())->Integer32Value();
789 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
791 DeoptimizeIf(no_condition, instr->environment());
799 LOperand* right = instr->InputAt(1);
800 ASSERT(ToRegister(instr->InputAt(0)).is(eax));
801 ASSERT(ToRegister(instr->result()).is(edx));
808 if (instr->hydrogen()->CheckFlag(HValue::kCanBeDivByZero)) {
810 DeoptimizeIf(zero, instr->environment());
817 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
828 DeoptimizeIf(no_condition, instr->environment());
839 void LCodeGen::DoDivI(LDivI* instr) {
840 LOperand* right = instr->InputAt(1);
841 ASSERT(ToRegister(instr->result()).is(eax));
842 ASSERT(ToRegister(instr->InputAt(0)).is(eax));
843 ASSERT(!ToRegister(instr->InputAt(1)).is(eax));
844 ASSERT(!ToRegister(instr->InputAt(1)).is(edx));
850 if (instr->hydrogen()->CheckFlag(HValue::kCanBeDivByZero)) {
852 DeoptimizeIf(zero, instr->environment());
856 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
861 DeoptimizeIf(sign, instr->environment());
866 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
871 DeoptimizeIf(zero, instr->environment());
881 DeoptimizeIf(not_zero, instr->environment());
885 void LCodeGen::DoMulI(LMulI* instr) {
886 Register left = ToRegister(instr->InputAt(0));
887 LOperand* right = instr->InputAt(1);
889 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
890 __ mov(ToRegister(instr->TempAt(0)), left);
904 } else if (!instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
941 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
942 DeoptimizeIf(overflow, instr->environment());
945 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
952 DeoptimizeIf(no_condition, instr->environment());
956 __ or_(ToRegister(instr->TempAt(0)), ToOperand(right));
957 DeoptimizeIf(sign, instr->environment());
964 void LCodeGen::DoBitI(LBitI* instr) {
965 LOperand* left = instr->InputAt(0);
966 LOperand* right = instr->InputAt(1);
967 ASSERT(left->Equals(instr->result()));
972 switch (instr->op()) {
987 switch (instr->op()) {
1005 void LCodeGen::DoShiftI(LShiftI* instr) {
1006 LOperand* left = instr->InputAt(0);
1007 LOperand* right = instr->InputAt(1);
1008 ASSERT(left->Equals(instr->result()));
1013 switch (instr->op()) {
1019 if (instr->can_deopt()) {
1021 DeoptimizeIf(not_zero, instr->environment());
1034 switch (instr->op()) {
1041 if (shift_count == 0 && instr->can_deopt()) {
1043 DeoptimizeIf(not_zero, instr->environment());
1061 void LCodeGen::DoSubI(LSubI* instr) {
1062 LOperand* left = instr->InputAt(0);
1063 LOperand* right = instr->InputAt(1);
1064 ASSERT(left->Equals(instr->result()));
1071 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
1072 DeoptimizeIf(overflow, instr->environment());
1077 void LCodeGen::DoConstantI(LConstantI* instr) {
1078 ASSERT(instr->result()->IsRegister());
1079 __ Set(ToRegister(instr->result()), Immediate(instr->value()));
1083 void LCodeGen::DoConstantD(LConstantD* instr) {
1084 ASSERT(instr->result()->IsDoubleRegister());
1085 XMMRegister res = ToDoubleRegister(instr->result());
1086 double v = instr->value();
1092 Register temp = ToRegister(instr->TempAt(0));
1122 void LCodeGen::DoConstantT(LConstantT* instr) {
1123 ASSERT(instr->result()->IsRegister());
1124 __ Set(ToRegister(instr->result()), Immediate(instr->value()));
1128 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) {
1129 Register result = ToRegister(instr->result());
1130 Register array = ToRegister(instr->InputAt(0));
1135 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) {
1136 Register result = ToRegister(instr->result());
1137 Register array = ToRegister(instr->InputAt(0));
1142 void LCodeGen::DoExternalArrayLength(LExternalArrayLength* instr) {
1143 Register result = ToRegister(instr->result());
1144 Register array = ToRegister(instr->InputAt(0));
1149 void LCodeGen::DoValueOf(LValueOf* instr) {
1150 Register input = ToRegister(instr->InputAt(0));
1151 Register result = ToRegister(instr->result());
1152 Register map = ToRegister(instr->TempAt(0));
1168 void LCodeGen::DoBitNotI(LBitNotI* instr) {
1169 LOperand* input = instr->InputAt(0);
1170 ASSERT(input->Equals(instr->result()));
1175 void LCodeGen::DoThrow(LThrow* instr) {
1176 __ push(ToOperand(instr->InputAt(0)));
1177 CallRuntime(Runtime::kThrow, 1, instr, RESTORE_CONTEXT);
1186 void LCodeGen::DoAddI(LAddI* instr) {
1187 LOperand* left = instr->InputAt(0);
1188 LOperand* right = instr->InputAt(1);
1189 ASSERT(left->Equals(instr->result()));
1197 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
1198 DeoptimizeIf(overflow, instr->environment());
1203 void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
1204 XMMRegister left = ToDoubleRegister(instr->InputAt(0));
1205 XMMRegister right = ToDoubleRegister(instr->InputAt(1));
1206 XMMRegister result = ToDoubleRegister(instr->result());
1208 ASSERT(instr->op() == Token::MOD || left.is(result));
1209 switch (instr->op()) {
1246 void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
1247 ASSERT(ToRegister(instr->InputAt(0)).is(edx));
1248 ASSERT(ToRegister(instr->InputAt(1)).is(eax));
1249 ASSERT(ToRegister(instr->result()).is(eax));
1251 TypeRecordingBinaryOpStub stub(instr->op(), NO_OVERWRITE);
1252 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, RESTORE_CONTEXT);
1284 void LCodeGen::DoBranch(LBranch* instr) {
1285 int true_block = chunk_->LookupDestination(instr->true_block_id());
1286 int false_block = chunk_->LookupDestination(instr->false_block_id());
1288 Representation r = instr->hydrogen()->representation();
1290 Register reg = ToRegister(instr->InputAt(0));
1294 XMMRegister reg = ToDoubleRegister(instr->InputAt(0));
1300 Register reg = ToRegister(instr->InputAt(0));
1301 if (instr->hydrogen()->type().IsBoolean()) {
1364 void LCodeGen::DoDeferredStackCheck(LGoto* instr) {
1366 CallRuntimeFromDeferred(Runtime::kStackGuard, 0, instr);
1369 void LCodeGen::DoGoto(LGoto* instr) {
1372 DeferredStackCheck(LCodeGen* codegen, LGoto* instr)
1373 : LDeferredCode(codegen), instr_(instr) { }
1380 if (instr->include_stack_check()) {
1381 deferred = new DeferredStackCheck(this, instr);
1383 EmitGoto(instr->block_id(), deferred);
1424 void LCodeGen::DoCmpID(LCmpID* instr) {
1425 LOperand* left = instr->InputAt(0);
1426 LOperand* right = instr->InputAt(1);
1427 LOperand* result = instr->result();
1430 if (instr->is_double()) {
1440 Condition cc = TokenToCondition(instr->op(), instr->is_double());
1450 void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) {
1451 LOperand* left = instr->InputAt(0);
1452 LOperand* right = instr->InputAt(1);
1453 int false_block = chunk_->LookupDestination(instr->false_block_id());
1454 int true_block = chunk_->LookupDestination(instr->true_block_id());
1456 if (instr->is_double()) {
1465 Condition cc = TokenToCondition(instr->op(), instr->is_double());
1470 void LCodeGen::DoCmpJSObjectEq(LCmpJSObjectEq* instr) {
1471 Register left = ToRegister(instr->InputAt(0));
1472 Register right = ToRegister(instr->InputAt(1));
1473 Register result = ToRegister(instr->result());
1484 void LCodeGen::DoCmpJSObjectEqAndBranch(LCmpJSObjectEqAndBranch* instr) {
1485 Register left = ToRegister(instr->InputAt(0));
1486 Register right = ToRegister(instr->InputAt(1));
1487 int false_block = chunk_->LookupDestination(instr->false_block_id());
1488 int true_block = chunk_->LookupDestination(instr->true_block_id());
1495 void LCodeGen::DoIsNull(LIsNull* instr) {
1496 Register reg = ToRegister(instr->InputAt(0));
1497 Register result = ToRegister(instr->result());
1503 if (instr->is_strict()) {
1533 void LCodeGen::DoIsNullAndBranch(LIsNullAndBranch* instr) {
1534 Register reg = ToRegister(instr->InputAt(0));
1539 int true_block = chunk_->LookupDestination(instr->true_block_id());
1540 int false_block = chunk_->LookupDestination(instr->false_block_id());
1543 if (instr->is_strict()) {
1555 Register scratch = ToRegister(instr->TempAt(0));
1593 void LCodeGen::DoIsObject(LIsObject* instr) {
1594 Register reg = ToRegister(instr->InputAt(0));
1595 Register result = ToRegister(instr->result());
1596 Register temp = ToRegister(instr->TempAt(0));
1613 void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) {
1614 Register reg = ToRegister(instr->InputAt(0));
1615 Register temp = ToRegister(instr->TempAt(0));
1616 Register temp2 = ToRegister(instr->TempAt(1));
1618 int true_block = chunk_->LookupDestination(instr->true_block_id());
1619 int false_block = chunk_->LookupDestination(instr->false_block_id());
1629 void LCodeGen::DoIsSmi(LIsSmi* instr) {
1630 Operand input = ToOperand(instr->InputAt(0));
1631 Register result = ToRegister(instr->result());
1633 ASSERT(instr->hydrogen()->value()->representation().IsTagged());
1643 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) {
1644 Operand input = ToOperand(instr->InputAt(0));
1646 int true_block = chunk_->LookupDestination(instr->true_block_id());
1647 int false_block = chunk_->LookupDestination(instr->false_block_id());
1654 static InstanceType TestType(HHasInstanceType* instr) {
1655 InstanceType from = instr->from();
1656 InstanceType to = instr->to();
1663 static Condition BranchCondition(HHasInstanceType* instr) {
1664 InstanceType from = instr->from();
1665 InstanceType to = instr->to();
1674 void LCodeGen::DoHasInstanceType(LHasInstanceType* instr) {
1675 Register input = ToRegister(instr->InputAt(0));
1676 Register result = ToRegister(instr->result());
1678 ASSERT(instr->hydrogen()->value()->representation().IsTagged());
1682 __ CmpObjectType(input, TestType(instr->hydrogen()), result);
1683 __ j(NegateCondition(BranchCondition(instr->hydrogen())), &is_false);
1692 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) {
1693 Register input = ToRegister(instr->InputAt(0));
1694 Register temp = ToRegister(instr->TempAt(0));
1696 int true_block = chunk_->LookupDestination(instr->true_block_id());
1697 int false_block = chunk_->LookupDestination(instr->false_block_id());
1704 __ CmpObjectType(input, TestType(instr->hydrogen()), temp);
1705 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen()));
1709 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
1710 Register input = ToRegister(instr->InputAt(0));
1711 Register result = ToRegister(instr->result());
1722 void LCodeGen::DoHasCachedArrayIndex(LHasCachedArrayIndex* instr) {
1723 Register input = ToRegister(instr->InputAt(0));
1724 Register result = ToRegister(instr->result());
1726 ASSERT(instr->hydrogen()->value()->representation().IsTagged());
1738 LHasCachedArrayIndexAndBranch* instr) {
1739 Register input = ToRegister(instr->InputAt(0));
1741 int true_block = chunk_->LookupDestination(instr->true_block_id());
1742 int false_block = chunk_->LookupDestination(instr->false_block_id());
1807 void LCodeGen::DoClassOfTest(LClassOfTest* instr) {
1808 Register input = ToRegister(instr->InputAt(0));
1809 Register result = ToRegister(instr->result());
1811 Register temp = ToRegister(instr->TempAt(0));
1812 Handle<String> class_name = instr->hydrogen()->class_name();
1830 void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) {
1831 Register input = ToRegister(instr->InputAt(0));
1832 Register temp = ToRegister(instr->TempAt(0));
1833 Register temp2 = ToRegister(instr->TempAt(1));
1840 Handle<String> class_name = instr->hydrogen()->class_name();
1842 int true_block = chunk_->LookupDestination(instr->true_block_id());
1843 int false_block = chunk_->LookupDestination(instr->false_block_id());
1854 void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) {
1855 Register reg = ToRegister(instr->InputAt(0));
1856 int true_block = instr->true_block_id();
1857 int false_block = instr->false_block_id();
1859 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), instr->map());
1864 void LCodeGen::DoInstanceOf(LInstanceOf* instr) {
1866 ASSERT(ToRegister(instr->context()).is(esi));
1868 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, CONTEXT_ADJUSTED);
1873 __ mov(ToRegister(instr->result()), factory()->false_value());
1876 __ mov(ToRegister(instr->result()), factory()->true_value());
1881 void LCodeGen::DoInstanceOfAndBranch(LInstanceOfAndBranch* instr) {
1882 ASSERT(ToRegister(instr->context()).is(esi));
1883 int true_block = chunk_->LookupDestination(instr->true_block_id());
1884 int false_block = chunk_->LookupDestination(instr->false_block_id());
1887 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, CONTEXT_ADJUSTED);
1893 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) {
1897 LInstanceOfKnownGlobal* instr)
1898 : LDeferredCode(codegen), instr_(instr) { }
1911 deferred = new DeferredInstanceOfKnownGlobal(this, instr);
1914 Register object = ToRegister(instr->InputAt(0));
1915 Register temp = ToRegister(instr->TempAt(0));
1925 Register map = ToRegister(instr->TempAt(0));
1948 __ mov(ToRegister(instr->result()), factory()->false_value());
1957 void LCodeGen::DoDeferredLInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
1974 Register temp = ToRegister(instr->TempAt(0));
1976 __ mov(InstanceofStub::right(), Immediate(instr->function()));
1983 instr,
2011 void LCodeGen::DoCmpT(LCmpT* instr) {
2012 Token::Value op = instr->op();
2015 CallCode(ic, RelocInfo::CODE_TARGET, instr, RESTORE_CONTEXT);
2024 __ mov(ToRegister(instr->result()), factory()->false_value());
2027 __ mov(ToRegister(instr->result()), factory()->true_value());
2032 void LCodeGen::DoCmpTAndBranch(LCmpTAndBranch* instr) {
2033 Token::Value op = instr->op();
2034 int true_block = chunk_->LookupDestination(instr->true_block_id());
2035 int false_block = chunk_->LookupDestination(instr->false_block_id());
2038 CallCode(ic, RelocInfo::CODE_TARGET, instr, RESTORE_CONTEXT);
2051 void LCodeGen::DoReturn(LReturn* instr) {
2067 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
2068 Register result = ToRegister(instr->result());
2069 __ mov(result, Operand::Cell(instr->hydrogen()->cell()));
2070 if (instr->hydrogen()->check_hole_value()) {
2072 DeoptimizeIf(equal, instr->environment());
2077 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
2078 ASSERT(ToRegister(instr->context()).is(esi));
2079 ASSERT(ToRegister(instr->global_object()).is(eax));
2080 ASSERT(ToRegister(instr->result()).is(eax));
2082 __ mov(ecx, instr->name());
2083 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET :
2086 CallCode(ic, mode, instr, CONTEXT_ADJUSTED);
2090 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
2091 Register value = ToRegister(instr->InputAt(0));
2092 Operand cell_operand = Operand::Cell(instr->hydrogen()->cell());
2098 if (instr->hydrogen()->check_hole_value()) {
2100 DeoptimizeIf(equal, instr->environment());
2108 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) {
2109 ASSERT(ToRegister(instr->context()).is(esi));
2110 ASSERT(ToRegister(instr->global_object()).is(edx));
2111 ASSERT(ToRegister(instr->value()).is(eax));
2113 __ mov(ecx, instr->name());
2114 Handle<Code> ic = instr->strict_mode()
2117 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr, CONTEXT_ADJUSTED);
2121 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2122 Register context = ToRegister(instr->context());
2123 Register result = ToRegister(instr->result());
2124 __ mov(result, ContextOperand(context, instr->slot_index()));
2128 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
2129 Register context = ToRegister(instr->context());
2130 Register value = ToRegister(instr->value());
2131 __ mov(ContextOperand(context, instr->slot_index()), value);
2132 if (instr->needs_write_barrier()) {
2133 Register temp = ToRegister(instr->TempAt(0));
2134 int offset = Context::SlotOffset(instr->slot_index());
2140 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
2141 Register object = ToRegister(instr->object());
2142 Register result = ToRegister(instr->result());
2143 if (instr->hydrogen()->is_in_object()) {
2144 __ mov(result, FieldOperand(object, instr->hydrogen()->offset()));
2147 __ mov(result, FieldOperand(result, instr->hydrogen()->offset()));
2173 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) {
2174 Register object = ToRegister(instr->object());
2175 Register result = ToRegister(instr->result());
2177 int map_count = instr->hydrogen()->types()->length();
2178 Handle<String> name = instr->hydrogen()->name();
2180 ASSERT(instr->hydrogen()->need_generic());
2183 CallCode(ic, RelocInfo::CODE_TARGET, instr, RESTORE_CONTEXT);
2187 Handle<Map> map = instr->hydrogen()->types()->at(i);
2195 Handle<Map> map = instr->hydrogen()->types()->last();
2197 if (instr->hydrogen()->need_generic()) {
2205 CallCode(ic, RelocInfo::CODE_TARGET, instr, RESTORE_CONTEXT);
2207 DeoptimizeIf(not_equal, instr->environment());
2215 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
2216 ASSERT(ToRegister(instr->context()).is(esi));
2217 ASSERT(ToRegister(instr->object()).is(eax));
2218 ASSERT(ToRegister(instr->result()).is(eax));
2220 __ mov(ecx, instr->name());
2222 CallCode(ic, RelocInfo::CODE_TARGET, instr, CONTEXT_ADJUSTED);
2226 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
2227 Register function = ToRegister(instr->function());
2228 Register temp = ToRegister(instr->TempAt(0));
2229 Register result = ToRegister(instr->result());
2233 DeoptimizeIf(not_equal, instr->environment());
2247 DeoptimizeIf(equal, instr->environment());
2268 void LCodeGen::DoLoadElements(LLoadElements* instr) {
2269 Register result = ToRegister(instr->result());
2270 Register input = ToRegister(instr->InputAt(0));
2294 LLoadExternalArrayPointer* instr) {
2295 Register result = ToRegister(instr->result());
2296 Register input = ToRegister(instr->InputAt(0));
2302 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
2303 Register arguments = ToRegister(instr->arguments());
2304 Register length = ToRegister(instr->length());
2305 Operand index = ToOperand(instr->index());
2306 Register result = ToRegister(instr->result());
2309 DeoptimizeIf(below_equal, instr->environment());
2317 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) {
2318 Register elements = ToRegister(instr->elements());
2319 Register key = ToRegister(instr->key());
2320 Register result = ToRegister(instr->result());
2331 DeoptimizeIf(equal, instr->environment());
2336 LLoadKeyedSpecializedArrayElement* instr) {
2337 Register external_pointer = ToRegister(instr->external_pointer());
2338 Register key = ToRegister(instr->key());
2339 ExternalArrayType array_type = instr->array_type();
2341 XMMRegister result(ToDoubleRegister(instr->result()));
2345 Register result(ToRegister(instr->result()));
2369 DeoptimizeIf(negative, instr->environment());
2379 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
2380 ASSERT(ToRegister(instr->context()).is(esi));
2381 ASSERT(ToRegister(instr->object()).is(edx));
2382 ASSERT(ToRegister(instr->key()).is(eax));
2385 CallCode(ic, RelocInfo::CODE_TARGET, instr, CONTEXT_ADJUSTED);
2389 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
2390 Register result = ToRegister(instr->result());
2414 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) {
2415 Operand elem = ToOperand(instr->InputAt(0));
2416 Register result = ToRegister(instr->result());
2436 void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
2437 Register receiver = ToRegister(instr->receiver());
2438 Register function = ToRegister(instr->function());
2439 Register length = ToRegister(instr->length());
2440 Register elements = ToRegister(instr->elements());
2441 Register scratch = ToRegister(instr->TempAt(0));
2444 ASSERT(ToRegister(instr->result()).is(eax));
2456 DeoptimizeIf(equal, instr->environment());
2458 DeoptimizeIf(below, instr->environment());
2473 DeoptimizeIf(above, instr->environment());
2491 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment());
2492 LPointerMap* pointers = instr->pointer_map();
2493 LEnvironment* env = instr->deoptimization_environment();
2504 void LCodeGen::DoPushArgument(LPushArgument* instr) {
2505 LOperand* argument = instr->InputAt(0);
2514 void LCodeGen::DoContext(LContext* instr) {
2515 Register result = ToRegister(instr->result());
2520 void LCodeGen::DoOuterContext(LOuterContext* instr) {
2521 Register context = ToRegister(instr->context());
2522 Register result = ToRegister(instr->result());
2528 void LCodeGen::DoGlobalObject(LGlobalObject* instr) {
2529 Register context = ToRegister(instr->context());
2530 Register result = ToRegister(instr->result());
2535 void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) {
2536 Register global = ToRegister(instr->global());
2537 Register result = ToRegister(instr->result());
2544 LInstruction* instr) {
2562 LPointerMap* pointers = instr->pointer_map();
2573 RegisterLazyDeoptimization(instr, RECORD_SIMPLE_SAFEPOINT);
2577 void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) {
2578 ASSERT(ToRegister(instr->result()).is(eax));
2579 __ mov(edi, instr->function());
2580 CallKnownFunction(instr->function(), instr->arity(), instr);
2584 void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) {
2585 Register input_reg = ToRegister(instr->InputAt(0));
2588 DeoptimizeIf(not_equal, instr->environment());
2616 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr);
2636 void LCodeGen::EmitIntegerMathAbs(LUnaryMathOperation* instr) {
2637 Register input_reg = ToRegister(instr->InputAt(0));
2643 DeoptimizeIf(negative, instr->environment());
2648 void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) {
2653 LUnaryMathOperation* instr)
2654 : LDeferredCode(codegen), instr_(instr) { }
2662 ASSERT(instr->InputAt(0)->Equals(instr->result()));
2663 Representation r = instr->hydrogen()->value()->representation();
2667 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0));
2672 EmitIntegerMathAbs(instr);
2675 new DeferredMathAbsTaggedHeapNumber(this, instr);
2676 Register input_reg = ToRegister(instr->InputAt(0));
2680 EmitIntegerMathAbs(instr);
2686 void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) {
2688 Register output_reg = ToRegister(instr->result());
2689 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0));
2693 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
2694 DeoptimizeIf(below_equal, instr->environment());
2696 DeoptimizeIf(below, instr->environment());
2704 DeoptimizeIf(equal, instr->environment());
2708 void LCodeGen::DoMathRound(LUnaryMathOperation* instr) {
2710 Register output_reg = ToRegister(instr->result());
2711 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0));
2722 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
2724 DeoptimizeIf(below_equal, instr->environment());
2730 DeoptimizeIf(below, instr->environment());
2739 DeoptimizeIf(equal, instr->environment());
2743 void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) {
2744 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0));
2745 ASSERT(ToDoubleRegister(instr->result()).is(input_reg));
2750 void LCodeGen::DoMathPowHalf(LUnaryMathOperation* instr) {
2752 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0));
2753 ASSERT(ToDoubleRegister(instr->result()).is(input_reg));
2760 void LCodeGen::DoPower(LPower* instr) {
2761 LOperand* left = instr->InputAt(0);
2762 LOperand* right = instr->InputAt(1);
2763 DoubleRegister result_reg = ToDoubleRegister(instr->result());
2764 Representation exponent_type = instr->hydrogen()->right()->representation();
2800 DeoptimizeIf(not_equal, instr->environment());
2820 void LCodeGen::DoMathLog(LUnaryMathOperation* instr) {
2821 ASSERT(instr->InputAt(0)->Equals(instr->result()));
2822 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0));
2850 void LCodeGen::DoMathCos(LUnaryMathOperation* instr) {
2851 ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
2854 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, RESTORE_CONTEXT);
2858 void LCodeGen::DoMathSin(LUnaryMathOperation* instr) {
2859 ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
2862 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, RESTORE_CONTEXT);
2866 void LCodeGen::DoUnaryMathOperation(LUnaryMathOperation* instr) {
2867 switch (instr->op()) {
2869 DoMathAbs(instr);
2872 DoMathFloor(instr);
2875 DoMathRound(instr);
2878 DoMathSqrt(instr);
2881 DoMathPowHalf(instr);
2884 DoMathCos(instr);
2887 DoMathSin(instr);
2890 DoMathLog(instr);
2899 void LCodeGen::DoCallKeyed(LCallKeyed* instr) {
2900 ASSERT(ToRegister(instr->context()).is(esi));
2901 ASSERT(ToRegister(instr->key()).is(ecx));
2902 ASSERT(ToRegister(instr->result()).is(eax));
2904 int arity = instr->arity();
2907 CallCode(ic, RelocInfo::CODE_TARGET, instr, CONTEXT_ADJUSTED);
2911 void LCodeGen::DoCallNamed(LCallNamed* instr) {
2912 ASSERT(ToRegister(instr->context()).is(esi));
2913 ASSERT(ToRegister(instr->result()).is(eax));
2915 int arity = instr->arity();
2918 __ mov(ecx, instr->name());
2919 CallCode(ic, RelocInfo::CODE_TARGET, instr, CONTEXT_ADJUSTED);
2923 void LCodeGen::DoCallFunction(LCallFunction* instr) {
2924 ASSERT(ToRegister(instr->context()).is(esi));
2925 ASSERT(ToRegister(instr->result()).is(eax));
2927 int arity = instr->arity();
2929 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, CONTEXT_ADJUSTED);
2934 void LCodeGen::DoCallGlobal(LCallGlobal* instr) {
2935 ASSERT(ToRegister(instr->context()).is(esi));
2936 ASSERT(ToRegister(instr->result()).is(eax));
2938 int arity = instr->arity();
2941 __ mov(ecx, instr->name());
2942 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr, CONTEXT_ADJUSTED);
2946 void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) {
2947 ASSERT(ToRegister(instr->result()).is(eax));
2948 __ mov(edi, instr->target());
2949 CallKnownFunction(instr->target(), instr->arity(), instr);
2953 void LCodeGen::DoCallNew(LCallNew* instr) {
2954 ASSERT(ToRegister(instr->context()).is(esi));
2955 ASSERT(ToRegister(instr->constructor()).is(edi));
2956 ASSERT(ToRegister(instr->result()).is(eax));
2959 __ Set(eax, Immediate(instr->arity()));
2960 CallCode(builtin, RelocInfo::CONSTRUCT_CALL, instr, CONTEXT_ADJUSTED);
2964 void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
2965 CallRuntime(instr->function(), instr->arity(), instr, RESTORE_CONTEXT);
2969 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
2970 Register object = ToRegister(instr->object());
2971 Register value = ToRegister(instr->value());
2972 int offset = instr->offset();
2974 if (!instr->transition().is_null()) {
2975 __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition());
2979 if (instr->is_in_object()) {
2981 if (instr->needs_write_barrier()) {
2982 Register temp = ToRegister(instr->TempAt(0));
2987 Register temp = ToRegister(instr->TempAt(0));
2990 if (instr->needs_write_barrier()) {
2999 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
3000 ASSERT(ToRegister(instr->context()).is(esi));
3001 ASSERT(ToRegister(instr->object()).is(edx));
3002 ASSERT(ToRegister(instr->value()).is(eax));
3004 __ mov(ecx, instr->name());
3005 Handle<Code> ic = instr->strict_mode()
3008 CallCode(ic, RelocInfo::CODE_TARGET, instr, CONTEXT_ADJUSTED);
3012 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
3013 __ cmp(ToRegister(instr->index()), ToOperand(instr->length()));
3014 DeoptimizeIf(above_equal, instr->environment());
3019 LStoreKeyedSpecializedArrayElement* instr) {
3020 Register external_pointer = ToRegister(instr->external_pointer());
3021 Register key = ToRegister(instr->key());
3022 ExternalArrayType array_type = instr->array_type();
3024 __ cvtsd2ss(xmm0, ToDoubleRegister(instr->value()));
3027 Register value = ToRegister(instr->value());
3031 Register temp = ToRegister(instr->TempAt(0));
3037 __ mov(temp, ToRegister(instr->value()));
3067 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) {
3068 Register value = ToRegister(instr->value());
3069 Register elements = ToRegister(instr->object());
3070 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg;
3073 if (instr->key()->IsConstantOperand()) {
3074 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
3075 LConstantOperand* const_operand = LConstantOperand::cast(instr->key());
3087 if (instr->hydrogen()->NeedsWriteBarrier()) {
3099 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
3100 ASSERT(ToRegister(instr->context()).is(esi));
3101 ASSERT(ToRegister(instr->object()).is(edx));
3102 ASSERT(ToRegister(instr->key()).is(ecx));
3103 ASSERT(ToRegister(instr->value()).is(eax));
3105 Handle<Code> ic = instr->strict_mode()
3108 CallCode(ic, RelocInfo::CODE_TARGET, instr, CONTEXT_ADJUSTED);
3112 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) {
3115 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr)
3116 : LDeferredCode(codegen), instr_(instr) { }
3122 Register string = ToRegister(instr->string());
3125 if (instr->index()->IsConstantOperand()) {
3126 const_index = ToInteger32(LConstantOperand::cast(instr->index()));
3139 index = ToRegister(instr->index());
3141 Register result = ToRegister(instr->result());
3144 new DeferredStringCharCodeAt(this, instr);
3187 if (instr->index()->IsConstantOperand()) {
3203 if (instr->index()->IsConstantOperand()) {
3217 void LCodeGen::DoDeferredStringCharCodeAt(LStringCharCodeAt* instr) {
3218 Register string = ToRegister(instr->string());
3219 Register result = ToRegister(instr->result());
3231 if (instr->index()->IsConstantOperand()) {
3232 int const_index = ToInteger32(LConstantOperand::cast(instr->index()));
3235 Register index = ToRegister(instr->index());
3239 CallRuntimeFromDeferred(Runtime::kStringCharCodeAt, 2, instr);
3248 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) {
3251 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr)
3252 : LDeferredCode(codegen), instr_(instr) { }
3259 new DeferredStringCharFromCode(this, instr);
3261 ASSERT(instr->hydrogen()->value()->representation().IsInteger32());
3262 Register char_code = ToRegister(instr->char_code());
3263 Register result = ToRegister(instr->result());
3278 void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) {
3279 Register char_code = ToRegister(instr->char_code());
3280 Register result = ToRegister(instr->result());
3290 CallRuntimeFromDeferred(Runtime::kCharFromCode, 1, instr);
3295 void LCodeGen::DoStringLength(LStringLength* instr) {
3296 Register string = ToRegister(instr->string());
3297 Register result = ToRegister(instr->result());
3302 void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) {
3303 LOperand* input = instr->InputAt(0);
3305 LOperand* output = instr->result();
3311 void LCodeGen::DoNumberTagI(LNumberTagI* instr) {
3314 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr)
3315 : LDeferredCode(codegen), instr_(instr) { }
3321 LOperand* input = instr->InputAt(0);
3322 ASSERT(input->IsRegister() && input->Equals(instr->result()));
3325 DeferredNumberTagI* deferred = new DeferredNumberTagI(this, instr);
3332 void LCodeGen::DoDeferredNumberTagI(LNumberTagI* instr) {
3334 Register reg = ToRegister(instr->InputAt(0));
3360 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr);
3371 void LCodeGen::DoNumberTagD(LNumberTagD* instr) {
3374 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr)
3375 : LDeferredCode(codegen), instr_(instr) { }
3381 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0));
3382 Register reg = ToRegister(instr->result());
3383 Register tmp = ToRegister(instr->TempAt(0));
3385 DeferredNumberTagD* deferred = new DeferredNumberTagD(this, instr);
3396 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) {
3400 Register reg = ToRegister(instr->result());
3404 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr);
3409 void LCodeGen::DoSmiTag(LSmiTag* instr) {
3410 LOperand* input = instr->InputAt(0);
3411 ASSERT(input->IsRegister() && input->Equals(instr->result()));
3412 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow));
3417 void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
3418 LOperand* input = instr->InputAt(0);
3419 ASSERT(input->IsRegister() && input->Equals(instr->result()));
3420 if (instr->needs_check()) {
3422 DeoptimizeIf(not_zero, instr->environment());
3471 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr)
3472 : LDeferredCode(codegen), instr_(instr) { }
3479 void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
3481 Register input_reg = ToRegister(instr->InputAt(0));
3487 if (instr->truncating()) {
3492 DeoptimizeIf(not_equal, instr->environment());
3513 DeoptimizeIf(no_condition, instr->environment());
3524 XMMRegister xmm_temp = ToDoubleRegister(instr->TempAt(0));
3534 DeoptimizeIf(not_equal, instr->environment());
3535 DeoptimizeIf(parity_even, instr->environment()); // NaN.
3539 DeoptimizeIf(not_equal, instr->environment());
3541 XMMRegister xmm_temp = ToDoubleRegister(instr->TempAt(0));
3546 DeoptimizeIf(not_equal, instr->environment());
3547 DeoptimizeIf(parity_even, instr->environment()); // NaN.
3548 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
3553 DeoptimizeIf(not_zero, instr->environment());
3560 void LCodeGen::DoTaggedToI(LTaggedToI* instr) {
3561 LOperand* input = instr->InputAt(0);
3563 ASSERT(input->Equals(instr->result()));
3567 DeferredTaggedToI* deferred = new DeferredTaggedToI(this, instr);
3580 void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) {
3581 LOperand* input = instr->InputAt(0);
3583 LOperand* result = instr->result();
3590 instr->hydrogen()->deoptimize_on_undefined(),
3591 instr->environment());
3595 void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
3596 LOperand* input = instr->InputAt(0);
3598 LOperand* result = instr->result();
3604 if (instr->truncating()) {
3624 DeoptimizeIf(no_condition, instr->environment());
3634 Register temp_reg = ToRegister(instr->TempAt(0));
3662 DeoptimizeIf(greater, instr->environment());
3693 DeoptimizeIf(not_equal, instr->environment());
3694 DeoptimizeIf(parity_even, instr->environment()); // NaN.
3695 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
3705 DeoptimizeIf(not_zero, instr->environment());
3712 void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
3713 LOperand* input = instr->InputAt(0);
3715 DeoptimizeIf(not_zero, instr->environment());
3719 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
3720 LOperand* input = instr->InputAt(0);
3722 DeoptimizeIf(zero, instr->environment());
3726 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
3727 Register input = ToRegister(instr->InputAt(0));
3728 Register temp = ToRegister(instr->TempAt(0));
3729 InstanceType first = instr->hydrogen()->first();
3730 InstanceType last = instr->hydrogen()->last();
3738 DeoptimizeIf(not_equal, instr->environment());
3742 DeoptimizeIf(not_zero, instr->environment());
3746 DeoptimizeIf(below, instr->environment());
3751 DeoptimizeIf(above, instr->environment());
3757 void LCodeGen::DoCheckFunction(LCheckFunction* instr) {
3758 ASSERT(instr->InputAt(0)->IsRegister());
3759 Register reg = ToRegister(instr->InputAt(0));
3760 __ cmp(reg, instr->hydrogen()->target());
3761 DeoptimizeIf(not_equal, instr->environment());
3765 void LCodeGen::DoCheckMap(LCheckMap* instr) {
3766 LOperand* input = instr->InputAt(0);
3770 instr->hydrogen()->map());
3771 DeoptimizeIf(not_equal, instr->environment());
3786 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) {
3787 Register reg = ToRegister(instr->TempAt(0));
3789 Handle<JSObject> holder = instr->holder();
3790 Handle<JSObject> current_prototype = instr->prototype();
3799 DeoptimizeIf(not_equal, instr->environment());
3809 DeoptimizeIf(not_equal, instr->environment());
3813 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) {
3817 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index())));
3818 __ push(Immediate(instr->hydrogen()->constant_elements()));
3821 int length = instr->hydrogen()->length();
3822 if (instr->hydrogen()->IsCopyOnWrite()) {
3823 ASSERT(instr->hydrogen()->depth() == 1);
3827 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, RESTORE_CONTEXT);
3828 } else if (instr->hydrogen()->depth() > 1) {
3829 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr, RESTORE_CONTEXT);
3831 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr, RESTORE_CONTEXT);
3836 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, RESTORE_CONTEXT);
3841 void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) {
3842 ASSERT(ToRegister(instr->context()).is(esi));
3846 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index())));
3847 __ push(Immediate(instr->hydrogen()->constant_properties()));
3848 int flags = instr->hydrogen()->fast_elements()
3851 flags |= instr->hydrogen()->has_function()
3857 if (instr->hydrogen()->depth() > 1) {
3858 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr, CONTEXT_ADJUSTED);
3862 instr,
3868 void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
3869 ASSERT(ToRegister(instr->InputAt(0)).is(eax));
3871 CallRuntime(Runtime::kToFastProperties, 1, instr, CONTEXT_ADJUSTED);
3875 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) {
3885 instr->hydrogen()->literal_index() * kPointerSize;
3893 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index())));
3894 __ push(Immediate(instr->hydrogen()->pattern()));
3895 __ push(Immediate(instr->hydrogen()->flags()));
3896 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr, RESTORE_CONTEXT);
3908 CallRuntime(Runtime::kAllocateInNewSpace, 1, instr, RESTORE_CONTEXT);
3927 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
3930 Handle<SharedFunctionInfo> shared_info = instr->shared_info();
3931 bool pretenure = instr->hydrogen()->pretenure();
3936 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, RESTORE_CONTEXT);
3943 CallRuntime(Runtime::kNewClosure, 3, instr, RESTORE_CONTEXT);
3948 void LCodeGen::DoTypeof(LTypeof* instr) {
3949 LOperand* input = instr->InputAt(0);
3955 CallRuntime(Runtime::kTypeof, 1, instr, RESTORE_CONTEXT);
3959 void LCodeGen::DoTypeofIs(LTypeofIs* instr) {
3960 Register input = ToRegister(instr->InputAt(0));
3961 Register result = ToRegister(instr->result());
3969 instr->type_literal());
3982 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) {
3983 Register input = ToRegister(instr->InputAt(0));
3984 int true_block = chunk_->LookupDestination(instr->true_block_id());
3985 int false_block = chunk_->LookupDestination(instr->false_block_id());
3992 instr->type_literal());
4065 void LCodeGen::DoIsConstructCall(LIsConstructCall* instr) {
4066 Register result = ToRegister(instr->result());
4084 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) {
4085 Register temp = ToRegister(instr->TempAt(0));
4086 int true_block = chunk_->LookupDestination(instr->true_block_id());
4087 int false_block = chunk_->LookupDestination(instr->false_block_id());
4112 void LCodeGen::DoLazyBailout(LLazyBailout* instr) {
4118 void LCodeGen::DoDeoptimize(LDeoptimize* instr) {
4119 DeoptimizeIf(no_condition, instr->environment());
4123 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) {
4124 LOperand* obj = instr->object();
4125 LOperand* key = instr->key();
4132 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment());
4133 LPointerMap* pointers = instr->pointer_map();
4134 LEnvironment* env = instr->deoptimization_environment();
4149 void LCodeGen::DoStackCheck(LStackCheck* instr) {
4158 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, RESTORE_CONTEXT);
4163 void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
4167 LEnvironment* environment = instr->environment();
4168 environment->SetSpilledRegisters(instr->SpilledRegisterArray(),
4169 instr->SpilledDoubleRegisterArray());