Lines Matching refs:instr

225     LInstruction* instr = instructions_->at(current_instruction_);
226 if (instr->IsLabel()) {
227 LLabel* label = LLabel::cast(instr);
232 Comment(";;; @%d: %s.", current_instruction_, instr->Mnemonic());
233 instr->CompileToNative(this);
249 code->instr()->Mnemonic());
564 LInstruction* instr) {
565 CallCodeGeneric(code, mode, instr, RECORD_SIMPLE_SAFEPOINT);
571 LInstruction* instr,
573 ASSERT(instr != NULL);
574 LPointerMap* pointers = instr->pointer_map();
577 RecordSafepointWithLazyDeopt(instr, safepoint_mode);
590 LInstruction* instr) {
591 ASSERT(instr != NULL);
592 LPointerMap* pointers = instr->pointer_map();
597 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT);
603 LInstruction* instr) {
606 instr->pointer_map(), argc, Safepoint::kNoLazyDeopt);
740 LInstruction* instr, SafepointMode safepoint_mode) {
742 RecordSafepoint(instr->pointer_map(), Safepoint::kLazyDeopt);
746 instr->pointer_map(), 0, Safepoint::kLazyDeopt);
839 void LCodeGen::DoInstructionGap(LInstructionGap* instr) {
840 DoGap(instr);
844 void LCodeGen::DoParameter(LParameter* instr) {
849 void LCodeGen::DoCallStub(LCallStub* instr) {
850 ASSERT(ToRegister(instr->result()).is(r0));
851 switch (instr->hydrogen()->major_key()) {
854 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
859 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
864 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
869 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
874 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
879 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
884 TranscendentalCacheStub stub(instr->transcendental_type(),
886 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
895 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) {
900 void LCodeGen::DoModI(LModI* instr) {
901 if (instr->hydrogen()->HasPowerOf2Divisor()) {
902 Register dividend = ToRegister(instr->InputAt(0));
903 Register result = ToRegister(instr->result());
906 HConstant::cast(instr->hydrogen()->right())->Integer32Value();
915 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
916 DeoptimizeIf(eq, instr->environment());
927 Register left = ToRegister(instr->InputAt(0));
928 Register right = ToRegister(instr->InputAt(1));
929 Register result = ToRegister(instr->result());
932 Register scratch2 = ToRegister(instr->TempAt(0));
933 DwVfpRegister dividend = ToDoubleRegister(instr->TempAt(1));
934 DwVfpRegister divisor = ToDoubleRegister(instr->TempAt(2));
947 if (instr->hydrogen()->CheckFlag(HValue::kCanBeDivByZero)) {
949 DeoptimizeIf(eq, instr->environment());
1019 if (!instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
1027 DeoptimizeIf(mi, instr->environment());
1037 void LCodeGen::DoDivI(LDivI* instr) {
1040 DeferredDivI(LCodeGen* codegen, LDivI* instr)
1041 : LDeferredCode(codegen), instr_(instr) { }
1045 virtual LInstruction* instr() { return instr_; }
1050 const Register left = ToRegister(instr->InputAt(0));
1051 const Register right = ToRegister(instr->InputAt(1));
1053 const Register result = ToRegister(instr->result());
1056 if (instr->hydrogen()->CheckFlag(HValue::kCanBeDivByZero)) {
1058 DeoptimizeIf(eq, instr->environment());
1062 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
1067 DeoptimizeIf(mi, instr->environment());
1072 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
1077 DeoptimizeIf(eq, instr->environment());
1099 DeferredDivI* deferred = new DeferredDivI(this, instr);
1113 DeoptimizeIf(al, instr->environment());
1119 void LCodeGen::DoDeferredBinaryOpStub(LTemplateInstruction<1, 2, T>* instr,
1121 Register left = ToRegister(instr->InputAt(0));
1122 Register right = ToRegister(instr->InputAt(1));
1141 RecordSafepointWithRegistersAndDoubles(instr->pointer_map(),
1149 void LCodeGen::DoMulI(LMulI* instr) {
1151 Register result = ToRegister(instr->result());
1153 Register left = ToRegister(instr->InputAt(0));
1154 LOperand* right_op = instr->InputAt(1);
1156 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow);
1158 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero);
1168 DeoptimizeIf(eq, instr->environment());
1180 DeoptimizeIf(mi, instr->environment());
1221 __ orr(ToRegister(instr->TempAt(0)), left, right);
1228 DeoptimizeIf(ne, instr->environment());
1238 __ cmp(ToRegister(instr->TempAt(0)), Operand(0));
1239 DeoptimizeIf(mi, instr->environment());
1246 void LCodeGen::DoBitI(LBitI* instr) {
1247 LOperand* left_op = instr->InputAt(0);
1248 LOperand* right_op = instr->InputAt(1);
1251 Register result = ToRegister(instr->result());
1261 switch (instr->op()) {
1278 void LCodeGen::DoShiftI(LShiftI* instr) {
1281 LOperand* right_op = instr->InputAt(1);
1282 Register left = ToRegister(instr->InputAt(0));
1283 Register result = ToRegister(instr->result());
1288 switch (instr->op()) {
1293 if (instr->can_deopt()) {
1295 DeoptimizeIf(mi, instr->environment());
1311 switch (instr->op()) {
1323 if (instr->can_deopt()) {
1325 DeoptimizeIf(ne, instr->environment());
1345 void LCodeGen::DoSubI(LSubI* instr) {
1346 LOperand* left = instr->InputAt(0);
1347 LOperand* right = instr->InputAt(1);
1348 LOperand* result = instr->result();
1349 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow);
1361 DeoptimizeIf(vs, instr->environment());
1366 void LCodeGen::DoConstantI(LConstantI* instr) {
1367 ASSERT(instr->result()->IsRegister());
1368 __ mov(ToRegister(instr->result()), Operand(instr->value()));
1372 void LCodeGen::DoConstantD(LConstantD* instr) {
1373 ASSERT(instr->result()->IsDoubleRegister());
1374 DwVfpRegister result = ToDoubleRegister(instr->result());
1375 double v = instr->value();
1380 void LCodeGen::DoConstantT(LConstantT* instr) {
1381 Handle<Object> value = instr->value();
1383 __ mov(ToRegister(instr->result()), Operand(value));
1385 __ LoadHeapObject(ToRegister(instr->result()),
1391 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) {
1392 Register result = ToRegister(instr->result());
1393 Register array = ToRegister(instr->InputAt(0));
1398 void LCodeGen::DoFixedArrayBaseLength(LFixedArrayBaseLength* instr) {
1399 Register result = ToRegister(instr->result());
1400 Register array = ToRegister(instr->InputAt(0));
1405 void LCodeGen::DoElementsKind(LElementsKind* instr) {
1406 Register result = ToRegister(instr->result());
1407 Register input = ToRegister(instr->InputAt(0));
1419 void LCodeGen::DoValueOf(LValueOf* instr) {
1420 Register input = ToRegister(instr->InputAt(0));
1421 Register result = ToRegister(instr->result());
1422 Register map = ToRegister(instr->TempAt(0));
1440 void LCodeGen::DoDateField(LDateField* instr) {
1441 Register object = ToRegister(instr->InputAt(0));
1442 Register result = ToRegister(instr->result());
1443 Register scratch = ToRegister(instr->TempAt(0));
1444 Smi* index = instr->index();
1480 void LCodeGen::DoBitNotI(LBitNotI* instr) {
1481 Register input = ToRegister(instr->InputAt(0));
1482 Register result = ToRegister(instr->result());
1487 void LCodeGen::DoThrow(LThrow* instr) {
1488 Register input_reg = EmitLoadRegister(instr->InputAt(0), ip);
1490 CallRuntime(Runtime::kThrow, 1, instr);
1498 void LCodeGen::DoAddI(LAddI* instr) {
1499 LOperand* left = instr->InputAt(0);
1500 LOperand* right = instr->InputAt(1);
1501 LOperand* result = instr->result();
1502 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow);
1514 DeoptimizeIf(vs, instr->environment());
1519 void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
1520 DoubleRegister left = ToDoubleRegister(instr->InputAt(0));
1521 DoubleRegister right = ToDoubleRegister(instr->InputAt(1));
1522 DoubleRegister result = ToDoubleRegister(instr->result());
1523 switch (instr->op()) {
1559 void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
1560 ASSERT(ToRegister(instr->InputAt(0)).is(r1));
1561 ASSERT(ToRegister(instr->InputAt(1)).is(r0));
1562 ASSERT(ToRegister(instr->result()).is(r0));
1564 BinaryOpStub stub(instr->op(), NO_OVERWRITE);
1565 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
1597 void LCodeGen::DoBranch(LBranch* instr) {
1598 int true_block = chunk_->LookupDestination(instr->true_block_id());
1599 int false_block = chunk_->LookupDestination(instr->false_block_id());
1601 Representation r = instr->hydrogen()->value()->representation();
1603 Register reg = ToRegister(instr->InputAt(0));
1607 DoubleRegister reg = ToDoubleRegister(instr->InputAt(0));
1616 Register reg = ToRegister(instr->InputAt(0));
1617 HType type = instr->hydrogen()->value()->type();
1628 ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types();
1658 DeoptimizeIf(eq, instr->environment());
1706 DeoptimizeIf(al, instr->environment());
1721 void LCodeGen::DoGoto(LGoto* instr) {
1722 EmitGoto(instr->block_id());
1754 void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) {
1755 LOperand* left = instr->InputAt(0);
1756 LOperand* right = instr->InputAt(1);
1757 int false_block = chunk_->LookupDestination(instr->false_block_id());
1758 int true_block = chunk_->LookupDestination(instr->true_block_id());
1759 Condition cond = TokenToCondition(instr->op(), false);
1766 EvalComparison(instr->op(), left_val, right_val) ? true_block
1770 if (instr->is_double()) {
1795 void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) {
1796 Register left = ToRegister(instr->InputAt(0));
1797 Register right = ToRegister(instr->InputAt(1));
1798 int false_block = chunk_->LookupDestination(instr->false_block_id());
1799 int true_block = chunk_->LookupDestination(instr->true_block_id());
1806 void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) {
1807 Register left = ToRegister(instr->InputAt(0));
1808 int true_block = chunk_->LookupDestination(instr->true_block_id());
1809 int false_block = chunk_->LookupDestination(instr->false_block_id());
1811 __ cmp(left, Operand(instr->hydrogen()->right()));
1816 void LCodeGen::DoIsNilAndBranch(LIsNilAndBranch* instr) {
1818 Register reg = ToRegister(instr->InputAt(0));
1819 int false_block = chunk_->LookupDestination(instr->false_block_id());
1823 if (instr->hydrogen()->representation().IsSpecialization() ||
1824 instr->hydrogen()->type().IsSmi()) {
1829 int true_block = chunk_->LookupDestination(instr->true_block_id());
1830 Heap::RootListIndex nil_value = instr->nil() == kNullValue ?
1835 if (instr->kind() == kStrictEquality) {
1838 Heap::RootListIndex other_nil_value = instr->nil() == kNullValue ?
1885 void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) {
1886 Register reg = ToRegister(instr->InputAt(0));
1887 Register temp1 = ToRegister(instr->TempAt(0));
1889 int true_block = chunk_->LookupDestination(instr->true_block_id());
1890 int false_block = chunk_->LookupDestination(instr->false_block_id());
1911 void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) {
1912 Register reg = ToRegister(instr->InputAt(0));
1913 Register temp1 = ToRegister(instr->TempAt(0));
1915 int true_block = chunk_->LookupDestination(instr->true_block_id());
1916 int false_block = chunk_->LookupDestination(instr->false_block_id());
1926 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) {
1927 int true_block = chunk_->LookupDestination(instr->true_block_id());
1928 int false_block = chunk_->LookupDestination(instr->false_block_id());
1930 Register input_reg = EmitLoadRegister(instr->InputAt(0), ip);
1936 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) {
1937 Register input = ToRegister(instr->InputAt(0));
1938 Register temp = ToRegister(instr->TempAt(0));
1940 int true_block = chunk_->LookupDestination(instr->true_block_id());
1941 int false_block = chunk_->LookupDestination(instr->false_block_id());
1971 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) {
1972 Token::Value op = instr->op();
1973 int true_block = chunk_->LookupDestination(instr->true_block_id());
1974 int false_block = chunk_->LookupDestination(instr->false_block_id());
1977 CallCode(ic, RelocInfo::CODE_TARGET, instr);
1986 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) {
1987 InstanceType from = instr->from();
1988 InstanceType to = instr->to();
1995 static Condition BranchCondition(HHasInstanceTypeAndBranch* instr) {
1996 InstanceType from = instr->from();
1997 InstanceType to = instr->to();
2006 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) {
2008 Register input = ToRegister(instr->InputAt(0));
2010 int true_block = chunk_->LookupDestination(instr->true_block_id());
2011 int false_block = chunk_->LookupDestination(instr->false_block_id());
2017 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen()));
2018 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen()));
2022 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
2023 Register input = ToRegister(instr->InputAt(0));
2024 Register result = ToRegister(instr->result());
2036 LHasCachedArrayIndexAndBranch* instr) {
2037 Register input = ToRegister(instr->InputAt(0));
2040 int true_block = chunk_->LookupDestination(instr->true_block_id());
2041 int false_block = chunk_->LookupDestination(instr->false_block_id());
2117 void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) {
2118 Register input = ToRegister(instr->InputAt(0));
2120 Register temp2 = ToRegister(instr->TempAt(0));
2121 Handle<String> class_name = instr->hydrogen()->class_name();
2123 int true_block = chunk_->LookupDestination(instr->true_block_id());
2124 int false_block = chunk_->LookupDestination(instr->false_block_id());
2135 void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) {
2136 Register reg = ToRegister(instr->InputAt(0));
2137 Register temp = ToRegister(instr->TempAt(0));
2138 int true_block = instr->true_block_id();
2139 int false_block = instr->false_block_id();
2142 __ cmp(temp, Operand(instr->map()));
2147 void LCodeGen::DoInstanceOf(LInstanceOf* instr) {
2148 ASSERT(ToRegister(instr->InputAt(0)).is(r0)); // Object is in r0.
2149 ASSERT(ToRegister(instr->InputAt(1)).is(r1)); // Function is in r1.
2152 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
2160 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) {
2164 LInstanceOfKnownGlobal* instr)
2165 : LDeferredCode(codegen), instr_(instr) { }
2169 virtual LInstruction* instr() { return instr_; }
2177 deferred = new DeferredInstanceOfKnownGlobal(this, instr);
2180 Register object = ToRegister(instr->InputAt(0));
2181 Register temp = ToRegister(instr->TempAt(0));
2182 Register result = ToRegister(instr->result());
2237 void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
2239 Register result = ToRegister(instr->result());
2256 Register temp = ToRegister(instr->TempAt(0));
2258 __ LoadHeapObject(InstanceofStub::right(), instr->function());
2268 instr,
2270 ASSERT(instr->HasDeoptimizationEnvironment());
2271 LEnvironment* env = instr->deoptimization_environment();
2279 void LCodeGen::DoCmpT(LCmpT* instr) {
2280 Token::Value op = instr->op();
2283 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2287 __ LoadRoot(ToRegister(instr->result()),
2290 __ LoadRoot(ToRegister(instr->result()),
2296 void LCodeGen::DoReturn(LReturn* instr) {
2311 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
2312 Register result = ToRegister(instr->result());
2313 __ mov(ip, Operand(Handle<Object>(instr->hydrogen()->cell())));
2315 if (instr->hydrogen()->RequiresHoleCheck()) {
2318 DeoptimizeIf(eq, instr->environment());
2323 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
2324 ASSERT(ToRegister(instr->global_object()).is(r0));
2325 ASSERT(ToRegister(instr->result()).is(r0));
2327 __ mov(r2, Operand(instr->name()));
2328 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET
2331 CallCode(ic, mode, instr);
2335 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
2336 Register value = ToRegister(instr->value());
2340 __ mov(cell, Operand(instr->hydrogen()->cell()));
2346 if (instr->hydrogen()->RequiresHoleCheck()) {
2348 Register payload = ToRegister(instr->TempAt(0));
2351 DeoptimizeIf(eq, instr->environment());
2360 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) {
2361 ASSERT(ToRegister(instr->global_object()).is(r1));
2362 ASSERT(ToRegister(instr->value()).is(r0));
2364 __ mov(r2, Operand(instr->name()));
2365 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode)
2368 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr);
2372 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2373 Register context = ToRegister(instr->context());
2374 Register result = ToRegister(instr->result());
2375 __ ldr(result, ContextOperand(context, instr->slot_index()));
2376 if (instr->hydrogen()->RequiresHoleCheck()) {
2379 if (instr->hydrogen()->DeoptimizesOnHole()) {
2380 DeoptimizeIf(eq, instr->environment());
2388 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
2389 Register context = ToRegister(instr->context());
2390 Register value = ToRegister(instr->value());
2392 MemOperand target = ContextOperand(context, instr->slot_index());
2396 if (instr->hydrogen()->RequiresHoleCheck()) {
2400 if (instr->hydrogen()->DeoptimizesOnHole()) {
2401 DeoptimizeIf(eq, instr->environment());
2408 if (instr->hydrogen()->NeedsWriteBarrier()) {
2409 HType type = instr->hydrogen()->value()->type();
2426 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
2427 Register object = ToRegister(instr->InputAt(0));
2428 Register result = ToRegister(instr->result());
2429 if (instr->hydrogen()->is_in_object()) {
2430 __ ldr(result, FieldMemOperand(object, instr->hydrogen()->offset()));
2433 __ ldr(result, FieldMemOperand(result, instr->hydrogen()->offset()));
2465 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) {
2466 Register object = ToRegister(instr->object());
2467 Register result = ToRegister(instr->result());
2469 int map_count = instr->hydrogen()->types()->length();
2470 Handle<String> name = instr->hydrogen()->name();
2472 ASSERT(instr->hydrogen()->need_generic());
2475 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2480 Handle<Map> map = instr->hydrogen()->types()->at(i);
2488 Handle<Map> map = instr->hydrogen()->types()->last();
2490 if (instr->hydrogen()->need_generic()) {
2498 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2500 DeoptimizeIf(ne, instr->environment());
2508 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
2509 ASSERT(ToRegister(instr->object()).is(r0));
2510 ASSERT(ToRegister(instr->result()).is(r0));
2513 __ mov(r2, Operand(instr->name()));
2515 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2519 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
2521 Register function = ToRegister(instr->function());
2522 Register result = ToRegister(instr->result());
2527 DeoptimizeIf(ne, instr->environment());
2542 DeoptimizeIf(eq, instr->environment());
2563 void LCodeGen::DoLoadElements(LLoadElements* instr) {
2564 Register result = ToRegister(instr->result());
2565 Register input = ToRegister(instr->InputAt(0));
2596 LLoadExternalArrayPointer* instr) {
2597 Register to_reg = ToRegister(instr->result());
2598 Register from_reg = ToRegister(instr->InputAt(0));
2604 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
2605 Register arguments = ToRegister(instr->arguments());
2606 Register length = ToRegister(instr->length());
2607 Register index = ToRegister(instr->index());
2608 Register result = ToRegister(instr->result());
2613 DeoptimizeIf(ls, instr->environment());
2622 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) {
2623 Register elements = ToRegister(instr->elements());
2624 Register key = EmitLoadRegister(instr->key(), scratch0());
2625 Register result = ToRegister(instr->result());
2633 if (instr->hydrogen()->RequiresHoleCheck()) {
2636 DeoptimizeIf(eq, instr->environment());
2642 LLoadKeyedFastDoubleElement* instr) {
2643 Register elements = ToRegister(instr->elements());
2644 bool key_is_constant = instr->key()->IsConstantOperand();
2646 DwVfpRegister result = ToDoubleRegister(instr->result());
2653 constant_key = ToInteger32(LConstantOperand::cast(instr->key()));
2658 key = ToRegister(instr->key());
2673 DeoptimizeIf(eq, instr->environment());
2680 LLoadKeyedSpecializedArrayElement* instr) {
2681 Register external_pointer = ToRegister(instr->external_pointer());
2683 ElementsKind elements_kind = instr->elements_kind();
2684 bool key_is_constant = instr->key()->IsConstantOperand();
2687 constant_key = ToInteger32(LConstantOperand::cast(instr->key()));
2692 key = ToRegister(instr->key());
2699 DwVfpRegister result = ToDoubleRegister(instr->result());
2711 Register result = ToRegister(instr->result());
2738 DeoptimizeIf(cs, instr->environment());
2754 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
2755 ASSERT(ToRegister(instr->object()).is(r1));
2756 ASSERT(ToRegister(instr->key()).is(r0));
2759 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2763 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
2765 Register result = ToRegister(instr->result());
2780 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) {
2781 Register elem = ToRegister(instr->InputAt(0));
2782 Register result = ToRegister(instr->result());
2802 void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
2803 Register receiver = ToRegister(instr->receiver());
2804 Register function = ToRegister(instr->function());
2836 DeoptimizeIf(eq, instr->environment());
2838 DeoptimizeIf(lt, instr->environment());
2849 void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
2850 Register receiver = ToRegister(instr->receiver());
2851 Register function = ToRegister(instr->function());
2852 Register length = ToRegister(instr->length());
2853 Register elements = ToRegister(instr->elements());
2857 ASSERT(ToRegister(instr->result()).is(r0));
2863 DeoptimizeIf(hi, instr->environment());
2885 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment());
2886 LPointerMap* pointers = instr->pointer_map();
2899 void LCodeGen::DoPushArgument(LPushArgument* instr) {
2900 LOperand* argument = instr->InputAt(0);
2910 void LCodeGen::DoThisFunction(LThisFunction* instr) {
2911 Register result = ToRegister(instr->result());
2912 __ LoadHeapObject(result, instr->hydrogen()->closure());
2916 void LCodeGen::DoContext(LContext* instr) {
2917 Register result = ToRegister(instr->result());
2922 void LCodeGen::DoOuterContext(LOuterContext* instr) {
2923 Register context = ToRegister(instr->context());
2924 Register result = ToRegister(instr->result());
2930 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) {
2932 __ LoadHeapObject(scratch0(), instr->hydrogen()->pairs());
2934 __ mov(scratch0(), Operand(Smi::FromInt(instr->hydrogen()->flags())));
2936 CallRuntime(Runtime::kDeclareGlobals, 3, instr);
2940 void LCodeGen::DoGlobalObject(LGlobalObject* instr) {
2941 Register result = ToRegister(instr->result());
2946 void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) {
2947 Register global = ToRegister(instr->global());
2948 Register result = ToRegister(instr->result());
2955 LInstruction* instr,
2960 LPointerMap* pointers = instr->pointer_map();
2986 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT);
2998 void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) {
2999 ASSERT(ToRegister(instr->result()).is(r0));
3000 CallKnownFunction(instr->function(),
3001 instr->arity(),
3002 instr,
3007 void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) {
3008 Register input = ToRegister(instr->InputAt(0));
3009 Register result = ToRegister(instr->result());
3016 DeoptimizeIf(ne, instr->environment());
3051 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr);
3073 void LCodeGen::EmitIntegerMathAbs(LUnaryMathOperation* instr) {
3074 Register input = ToRegister(instr->InputAt(0));
3075 Register result = ToRegister(instr->result());
3083 DeoptimizeIf(vs, instr->environment());
3087 void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) {
3092 LUnaryMathOperation* instr)
3093 : LDeferredCode(codegen), instr_(instr) { }
3097 virtual LInstruction* instr() { return instr_; }
3102 Representation r = instr->hydrogen()->value()->representation();
3104 DwVfpRegister input = ToDoubleRegister(instr->InputAt(0));
3105 DwVfpRegister result = ToDoubleRegister(instr->result());
3108 EmitIntegerMathAbs(instr);
3112 new DeferredMathAbsTaggedHeapNumber(this, instr);
3113 Register input = ToRegister(instr->InputAt(0));
3117 EmitIntegerMathAbs(instr);
3123 void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) {
3124 DoubleRegister input = ToDoubleRegister(instr->InputAt(0));
3125 Register result = ToRegister(instr->result());
3128 Register scratch2 = ToRegister(instr->TempAt(0));
3135 DeoptimizeIf(ne, instr->environment());
3140 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
3147 DeoptimizeIf(ne, instr->environment());
3153 void LCodeGen::DoMathRound(LUnaryMathOperation* instr) {
3154 DoubleRegister input = ToDoubleRegister(instr->InputAt(0));
3155 Register result = ToRegister(instr->result());
3169 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
3178 DeoptimizeIf(ge, instr->environment());
3190 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
3191 DeoptimizeIf(mi, instr->environment());
3202 DeoptimizeIf(ne, instr->environment());
3205 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
3212 DeoptimizeIf(ne, instr->environment());
3218 void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) {
3219 DoubleRegister input = ToDoubleRegister(instr->InputAt(0));
3220 DoubleRegister result = ToDoubleRegister(instr->result());
3225 void LCodeGen::DoMathPowHalf(LUnaryMathOperation* instr) {
3226 DoubleRegister input = ToDoubleRegister(instr->InputAt(0));
3227 DoubleRegister result = ToDoubleRegister(instr->result());
3228 DoubleRegister temp = ToDoubleRegister(instr->TempAt(0));
3246 void LCodeGen::DoPower(LPower* instr) {
3247 Representation exponent_type = instr->hydrogen()->right()->representation();
3250 ASSERT(!instr->InputAt(1)->IsDoubleRegister() ||
3251 ToDoubleRegister(instr->InputAt(1)).is(d2));
3252 ASSERT(!instr->InputAt(1)->IsRegister() ||
3253 ToRegister(instr->InputAt(1)).is(r2));
3254 ASSERT(ToDoubleRegister(instr->InputAt(0)).is(d1));
3255 ASSERT(ToDoubleRegister(instr->result()).is(d3));
3263 DeoptimizeIf(ne, instr->environment());
3278 void LCodeGen::DoRandom(LRandom* instr) {
3281 DeferredDoRandom(LCodeGen* codegen, LRandom* instr)
3282 : LDeferredCode(codegen), instr_(instr) { }
3284 virtual LInstruction* instr() { return instr_; }
3289 DeferredDoRandom* deferred = new DeferredDoRandom(this, instr);
3293 ASSERT(ToDoubleRegister(instr->result()).is(d7));
3294 ASSERT(ToRegister(instr->InputAt(0)).is(r0));
3349 void LCodeGen::DoDeferredRandom(LRandom* instr) {
3356 void LCodeGen::DoMathLog(LUnaryMathOperation* instr) {
3357 ASSERT(ToDoubleRegister(instr->result()).is(d2));
3360 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
3364 void LCodeGen::DoMathTan(LUnaryMathOperation* instr) {
3365 ASSERT(ToDoubleRegister(instr->result()).is(d2));
3368 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
3372 void LCodeGen::DoMathCos(LUnaryMathOperation* instr) {
3373 ASSERT(ToDoubleRegister(instr->result()).is(d2));
3376 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
3380 void LCodeGen::DoMathSin(LUnaryMathOperation* instr) {
3381 ASSERT(ToDoubleRegister(instr->result()).is(d2));
3384 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
3388 void LCodeGen::DoUnaryMathOperation(LUnaryMathOperation* instr) {
3389 switch (instr->op()) {
3391 DoMathAbs(instr);
3394 DoMathFloor(instr);
3397 DoMathRound(instr);
3400 DoMathSqrt(instr);
3403 DoMathPowHalf(instr);
3406 DoMathCos(instr);
3409 DoMathSin(instr);
3412 DoMathTan(instr);
3415 DoMathLog(instr);
3424 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
3425 ASSERT(ToRegister(instr->function()).is(r1));
3426 ASSERT(instr->HasPointerMap());
3427 ASSERT(instr->HasDeoptimizationEnvironment());
3428 LPointerMap* pointers = instr->pointer_map();
3431 ParameterCount count(instr->arity());
3437 void LCodeGen::DoCallKeyed(LCallKeyed* instr) {
3438 ASSERT(ToRegister(instr->result()).is(r0));
3440 int arity = instr->arity();
3443 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3448 void LCodeGen::DoCallNamed(LCallNamed* instr) {
3449 ASSERT(ToRegister(instr->result()).is(r0));
3451 int arity = instr->arity();
3455 __ mov(r2, Operand(instr->name()));
3456 CallCode(ic, mode, instr);
3462 void LCodeGen::DoCallFunction(LCallFunction* instr) {
3463 ASSERT(ToRegister(instr->function()).is(r1));
3464 ASSERT(ToRegister(instr->result()).is(r0));
3466 int arity = instr->arity();
3468 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
3473 void LCodeGen::DoCallGlobal(LCallGlobal* instr) {
3474 ASSERT(ToRegister(instr->result()).is(r0));
3476 int arity = instr->arity();
3480 __ mov(r2, Operand(instr->name()));
3481 CallCode(ic, mode, instr);
3486 void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) {
3487 ASSERT(ToRegister(instr->result()).is(r0));
3488 CallKnownFunction(instr->target(), instr->arity(), instr, CALL_AS_FUNCTION);
3492 void LCodeGen::DoCallNew(LCallNew* instr) {
3493 ASSERT(ToRegister(instr->InputAt(0)).is(r1));
3494 ASSERT(ToRegister(instr->result()).is(r0));
3497 __ mov(r0, Operand(instr->arity()));
3498 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
3502 void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
3503 CallRuntime(instr->function(), instr->arity(), instr);
3507 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
3508 Register object = ToRegister(instr->object());
3509 Register value = ToRegister(instr->value());
3511 int offset = instr->offset();
3515 if (!instr->transition().is_null()) {
3516 __ mov(scratch, Operand(instr->transition()));
3521 HType type = instr->hydrogen()->value()->type();
3524 if (instr->is_in_object()) {
3526 if (instr->hydrogen()->NeedsWriteBarrier()) {
3540 if (instr->hydrogen()->NeedsWriteBarrier()) {
3556 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
3557 ASSERT(ToRegister(instr->object()).is(r1));
3558 ASSERT(ToRegister(instr->value()).is(r0));
3561 __ mov(r2, Operand(instr->name()));
3562 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode)
3565 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3569 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
3570 __ cmp(ToRegister(instr->index()), ToRegister(instr->length()));
3571 DeoptimizeIf(hs, instr->environment());
3575 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) {
3576 Register value = ToRegister(instr->value());
3577 Register elements = ToRegister(instr->object());
3578 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg;
3582 if (instr->key()->IsConstantOperand()) {
3583 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
3584 LConstantOperand* const_operand = LConstantOperand::cast(instr->key());
3593 if (instr->hydrogen()->NeedsWriteBarrier()) {
3594 HType type = instr->hydrogen()->value()->type();
3611 LStoreKeyedFastDoubleElement* instr) {
3612 DwVfpRegister value = ToDoubleRegister(instr->value());
3613 Register elements = ToRegister(instr->elements());
3616 bool key_is_constant = instr->key()->IsConstantOperand();
3623 constant_key = ToInteger32(LConstantOperand::cast(instr->key()));
3628 key = ToRegister(instr->key());
3653 LStoreKeyedSpecializedArrayElement* instr) {
3655 Register external_pointer = ToRegister(instr->external_pointer());
3657 ElementsKind elements_kind = instr->elements_kind();
3658 bool key_is_constant = instr->key()->IsConstantOperand();
3661 constant_key = ToInteger32(LConstantOperand::cast(instr->key()));
3666 key = ToRegister(instr->key());
3673 DwVfpRegister value(ToDoubleRegister(instr->value()));
3684 Register value(ToRegister(instr->value()));
3716 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
3717 ASSERT(ToRegister(instr->object()).is(r2));
3718 ASSERT(ToRegister(instr->key()).is(r1));
3719 ASSERT(ToRegister(instr->value()).is(r0));
3721 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode)
3724 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3728 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
3729 Register object_reg = ToRegister(instr->object());
3730 Register new_map_reg = ToRegister(instr->new_map_reg());
3733 Handle<Map> from_map = instr->original_map();
3734 Handle<Map> to_map = instr->transitioned_map();
3750 Register fixed_object_reg = ToRegister(instr->temp_reg());
3755 RelocInfo::CODE_TARGET, instr);
3757 Register fixed_object_reg = ToRegister(instr->temp_reg());
3762 RelocInfo::CODE_TARGET, instr);
3770 void LCodeGen::DoStringAdd(LStringAdd* instr) {
3771 __ push(ToRegister(instr->left()));
3772 __ push(ToRegister(instr->right()));
3774 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
3778 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) {
3781 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr)
3782 : LDeferredCode(codegen), instr_(instr) { }
3784 virtual LInstruction* instr() { return instr_; }
3790 new DeferredStringCharCodeAt(this, instr);
3793 ToRegister(instr->string()),
3794 ToRegister(instr->index()),
3795 ToRegister(instr->result()),
3801 void LCodeGen::DoDeferredStringCharCodeAt(LStringCharCodeAt* instr) {
3802 Register string = ToRegister(instr->string());
3803 Register result = ToRegister(instr->result());
3815 if (instr->index()->IsConstantOperand()) {
3816 int const_index = ToInteger32(LConstantOperand::cast(instr->index()));
3820 Register index = ToRegister(instr->index());
3824 CallRuntimeFromDeferred(Runtime::kStringCharCodeAt, 2, instr);
3833 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) {
3836 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr)
3837 : LDeferredCode(codegen), instr_(instr) { }
3839 virtual LInstruction* instr() { return instr_; }
3845 new DeferredStringCharFromCode(this, instr);
3847 ASSERT(instr->hydrogen()->value()->representation().IsInteger32());
3848 Register char_code = ToRegister(instr->char_code());
3849 Register result = ToRegister(instr->result());
3864 void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) {
3865 Register char_code = ToRegister(instr->char_code());
3866 Register result = ToRegister(instr->result());
3876 CallRuntimeFromDeferred(Runtime::kCharFromCode, 1, instr);
3881 void LCodeGen::DoStringLength(LStringLength* instr) {
3882 Register string = ToRegister(instr->InputAt(0));
3883 Register result = ToRegister(instr->result());
3888 void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) {
3889 LOperand* input = instr->InputAt(0);
3891 LOperand* output = instr->result();
3905 void LCodeGen::DoNumberTagI(LNumberTagI* instr) {
3908 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr)
3909 : LDeferredCode(codegen), instr_(instr) { }
3911 virtual LInstruction* instr() { return instr_; }
3916 Register src = ToRegister(instr->InputAt(0));
3917 Register dst = ToRegister(instr->result());
3919 DeferredNumberTagI* deferred = new DeferredNumberTagI(this, instr);
3926 void LCodeGen::DoDeferredNumberTagI(LNumberTagI* instr) {
3928 Register src = ToRegister(instr->InputAt(0));
3929 Register dst = ToRegister(instr->result());
3961 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr);
3973 void LCodeGen::DoNumberTagD(LNumberTagD* instr) {
3976 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr)
3977 : LDeferredCode(codegen), instr_(instr) { }
3979 virtual LInstruction* instr() { return instr_; }
3984 DoubleRegister input_reg = ToDoubleRegister(instr->InputAt(0));
3986 Register reg = ToRegister(instr->result());
3987 Register temp1 = ToRegister(instr->TempAt(0));
3988 Register temp2 = ToRegister(instr->TempAt(1));
3990 DeferredNumberTagD* deferred = new DeferredNumberTagD(this, instr);
4003 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) {
4007 Register reg = ToRegister(instr->result());
4011 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr);
4016 void LCodeGen::DoSmiTag(LSmiTag* instr) {
4017 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow));
4018 __ SmiTag(ToRegister(instr->result()), ToRegister(instr->InputAt(0)));
4022 void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
4023 Register input = ToRegister(instr->InputAt(0));
4024 Register result = ToRegister(instr->result());
4025 if (instr->needs_check()) {
4029 DeoptimizeIf(cs, instr->environment());
4094 void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
4095 Register input_reg = ToRegister(instr->InputAt(0));
4097 Register scratch2 = ToRegister(instr->TempAt(0));
4117 if (instr->truncating()) {
4118 Register scratch3 = ToRegister(instr->TempAt(1));
4119 DwVfpRegister double_scratch2 = ToDoubleRegister(instr->TempAt(2));
4131 DeoptimizeIf(ne, instr->environment());
4149 DeoptimizeIf(ne, instr->environment());
4159 DeoptimizeIf(ne, instr->environment());
4163 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
4168 DeoptimizeIf(ne, instr->environment());
4175 void LCodeGen::DoTaggedToI(LTaggedToI* instr) {
4178 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr)
4179 : LDeferredCode(codegen), instr_(instr) { }
4181 virtual LInstruction* instr() { return instr_; }
4186 LOperand* input = instr->InputAt(0);
4188 ASSERT(input->Equals(instr->result()));
4192 DeferredTaggedToI* deferred = new DeferredTaggedToI(this, instr);
4204 void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) {
4205 LOperand* input = instr->InputAt(0);
4207 LOperand* result = instr->result();
4214 instr->hydrogen()->deoptimize_on_undefined(),
4215 instr->hydrogen()->deoptimize_on_minus_zero(),
4216 instr->environment());
4220 void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
4221 Register result_reg = ToRegister(instr->result());
4223 Register scratch2 = ToRegister(instr->TempAt(0));
4224 DwVfpRegister double_input = ToDoubleRegister(instr->InputAt(0));
4229 if (instr->truncating()) {
4230 Register scratch3 = ToRegister(instr->TempAt(1));
4247 DeoptimizeIf(ne, instr->environment());
4255 void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
4256 LOperand* input = instr->InputAt(0);
4258 DeoptimizeIf(ne, instr->environment());
4262 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
4263 LOperand* input = instr->InputAt(0);
4265 DeoptimizeIf(eq, instr->environment());
4269 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
4270 Register input = ToRegister(instr->InputAt(0));
4276 if (instr->hydrogen()->is_interval_check()) {
4279 instr->hydrogen()->GetCheckInterval(&first, &last);
4285 DeoptimizeIf(ne, instr->environment());
4287 DeoptimizeIf(lo, instr->environment());
4291 DeoptimizeIf(hi, instr->environment());
4297 instr->hydrogen()->GetCheckMaskAndTag(&mask, &tag);
4302 DeoptimizeIf(tag == 0 ? ne : eq, instr->environment());
4306 DeoptimizeIf(ne, instr->environment());
4312 void LCodeGen::DoCheckFunction(LCheckFunction* instr) {
4313 Register reg = ToRegister(instr->value());
4314 Handle<JSFunction> target = instr->hydrogen()->target();
4316 Register reg = ToRegister(instr->value());
4325 DeoptimizeIf(ne, instr->environment());
4341 void LCodeGen::DoCheckMap(LCheckMap* instr) {
4343 LOperand* input = instr->InputAt(0);
4346 Handle<Map> map = instr->hydrogen()->map();
4347 DoCheckMapCommon(reg, scratch, map, instr->hydrogen()->mode(),
4348 instr->environment());
4352 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) {
4353 DoubleRegister value_reg = ToDoubleRegister(instr->unclamped());
4354 Register result_reg = ToRegister(instr->result());
4355 DoubleRegister temp_reg = ToDoubleRegister(instr->TempAt(0));
4360 void LCodeGen::DoClampIToUint8(LClampIToUint8* instr) {
4361 Register unclamped_reg = ToRegister(instr->unclamped());
4362 Register result_reg = ToRegister(instr->result());
4367 void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) {
4369 Register input_reg = ToRegister(instr->unclamped());
4370 Register result_reg = ToRegister(instr->result());
4371 DoubleRegister temp_reg = ToDoubleRegister(instr->TempAt(0));
4385 DeoptimizeIf(ne, instr->environment());
4404 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) {
4405 Register temp1 = ToRegister(instr->TempAt(0));
4406 Register temp2 = ToRegister(instr->TempAt(1));
4408 Handle<JSObject> holder = instr->holder();
4409 Handle<JSObject> current_prototype = instr->prototype();
4418 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment());
4428 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment());
4429 DeoptimizeIf(ne, instr->environment());
4433 void LCodeGen::DoAllocateObject(LAllocateObject* instr) {
4436 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr)
4437 : LDeferredCode(codegen), instr_(instr) { }
4439 virtual LInstruction* instr() { return instr_; }
4444 DeferredAllocateObject* deferred = new DeferredAllocateObject(this, instr);
4446 Register result = ToRegister(instr->result());
4447 Register scratch = ToRegister(instr->TempAt(0));
4448 Register scratch2 = ToRegister(instr->TempAt(1));
4449 Handle<JSFunction> constructor = instr->hydrogen()->constructor();
4490 void LCodeGen::DoDeferredAllocateObject(LAllocateObject* instr) {
4491 Register result = ToRegister(instr->result());
4492 Handle<JSFunction> constructor = instr->hydrogen()->constructor();
4502 CallRuntimeFromDeferred(Runtime::kNewObject, 1, instr);
4507 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) {
4510 instr->hydrogen()->boilerplate_elements_kind();
4516 __ LoadHeapObject(r1, instr->hydrogen()->boilerplate_object());
4524 DeoptimizeIf(ne, instr->environment());
4529 __ mov(r2, Operand(Smi::FromInt(instr->hydrogen()->literal_index())));
4536 int length = instr->hydrogen()->length();
4537 if (instr->hydrogen()->IsCopyOnWrite()) {
4538 ASSERT(instr->hydrogen()->depth() == 1);
4542 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
4543 } else if (instr->hydrogen()->depth() > 1) {
4544 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr);
4546 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr);
4553 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
4660 void LCodeGen::DoFastLiteral(LFastLiteral* instr) {
4661 int size = instr->hydrogen()->total_size();
4672 CallRuntime(Runtime::kAllocateInNewSpace, 1, instr);
4676 __ LoadHeapObject(r1, instr->hydrogen()->boilerplate());
4677 EmitDeepCopy(instr->hydrogen()->boilerplate(), r0, r1, &offset);
4682 void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) {
4683 Handle<FixedArray> literals(instr->environment()->closure()->literals());
4685 instr->hydrogen()->constant_properties();
4689 __ mov(r3, Operand(Smi::FromInt(instr->hydrogen()->literal_index())));
4691 int flags = instr->hydrogen()->fast_elements()
4699 if (instr->hydrogen()->depth() > 1) {
4700 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr);
4703 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr);
4706 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
4711 void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
4712 ASSERT(ToRegister(instr->InputAt(0)).is(r0));
4714 CallRuntime(Runtime::kToFastProperties, 1, instr);
4718 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) {
4729 instr->hydrogen()->literal_index() * kPointerSize;
4737 __ mov(r6, Operand(Smi::FromInt(instr->hydrogen()->literal_index())));
4738 __ mov(r5, Operand(instr->hydrogen()->pattern()));
4739 __ mov(r4, Operand(instr->hydrogen()->flags()));
4741 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr);
4754 CallRuntime(Runtime::kAllocateInNewSpace, 1, instr);
4773 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
4776 Handle<SharedFunctionInfo> shared_info = instr->shared_info();
4777 bool pretenure = instr->hydrogen()->pretenure();
4782 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
4789 CallRuntime(Runtime::kNewClosure, 3, instr);
4794 void LCodeGen::DoTypeof(LTypeof* instr) {
4795 Register input = ToRegister(instr->InputAt(0));
4797 CallRuntime(Runtime::kTypeof, 1, instr);
4801 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) {
4802 Register input = ToRegister(instr->InputAt(0));
4803 int true_block = chunk_->LookupDestination(instr->true_block_id());
4804 int false_block = chunk_->LookupDestination(instr->false_block_id());
4811 instr->type_literal());
4891 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) {
4892 Register temp1 = ToRegister(instr->TempAt(0));
4893 int true_block = chunk_->LookupDestination(instr->true_block_id());
4894 int false_block = chunk_->LookupDestination(instr->false_block_id());
4937 void LCodeGen::DoLazyBailout(LLazyBailout* instr) {
4939 ASSERT(instr->HasEnvironment());
4940 LEnvironment* env = instr->environment();
4946 void LCodeGen::DoDeoptimize(LDeoptimize* instr) {
4947 DeoptimizeIf(al, instr->environment());
4951 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) {
4952 Register object = ToRegister(instr->object());
4953 Register key = ToRegister(instr->key());
4957 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment());
4958 LPointerMap* pointers = instr->pointer_map();
4966 void LCodeGen::DoIn(LIn* instr) {
4967 Register obj = ToRegister(instr->object());
4968 Register key = ToRegister(instr->key());
4970 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment());
4971 LPointerMap* pointers = instr->pointer_map();
4978 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) {
4982 instr, RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS);
4983 ASSERT(instr->HasEnvironment());
4984 LEnvironment* env = instr->environment();
4989 void LCodeGen::DoStackCheck(LStackCheck* instr) {
4992 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr)
4993 : LDeferredCode(codegen), instr_(instr) { }
4995 virtual LInstruction* instr() { return instr_; }
5000 ASSERT(instr->HasEnvironment());
5001 LEnvironment* env = instr->environment();
5004 if (instr->hydrogen()->is_function_entry()) {
5011 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
5017 ASSERT(instr->hydrogen()->is_backwards_branch());
5020 new DeferredStackCheck(this, instr);
5025 __ bind(instr->done_label());
5026 deferred_stack_check->SetExit(instr->done_label());
5035 void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
5039 LEnvironment* environment = instr->environment();
5040 environment->SetSpilledRegisters(instr->SpilledRegisterArray(),
5041 instr->SpilledDoubleRegisterArray());
5052 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
5055 DeoptimizeIf(eq, instr->environment());
5060 DeoptimizeIf(eq, instr->environment());
5063 DeoptimizeIf(eq, instr->environment());
5067 DeoptimizeIf(le, instr->environment());
5078 CallRuntime(Runtime::kGetPropertyNamesFast, 1, instr);
5083 DeoptimizeIf(ne, instr->environment());
5088 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
5089 Register map = ToRegister(instr->map());
5090 Register result = ToRegister(instr->result());
5095 FieldMemOperand(result, FixedArray::SizeFor(instr->idx())));
5097 DeoptimizeIf(eq, instr->environment());
5101 void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) {
5102 Register object = ToRegister(instr->value());
5103 Register map = ToRegister(instr->map());
5106 DeoptimizeIf(ne, instr->environment());
5110 void LCodeGen::DoLoadFieldByIndex(LLoadFieldByIndex* instr) {
5111 Register object = ToRegister(instr->object());
5112 Register index = ToRegister(instr->index());
5113 Register result = ToRegister(instr->result());