Lines Matching refs:instr
224 LInstruction* instr = instructions_->at(current_instruction_); in GenerateBody() local
225 if (instr->IsLabel()) { in GenerateBody()
226 LLabel* label = LLabel::cast(instr); in GenerateBody()
231 Comment(";;; @%d: %s.", current_instruction_, instr->Mnemonic()); in GenerateBody()
232 instr->CompileToNative(this); in GenerateBody()
247 code->instr()->Mnemonic()); in GenerateDeferredCode()
532 LInstruction* instr) { in CallCode() argument
533 CallCodeGeneric(code, mode, instr, RECORD_SIMPLE_SAFEPOINT); in CallCode()
539 LInstruction* instr, in CallCodeGeneric() argument
541 ASSERT(instr != NULL); in CallCodeGeneric()
542 LPointerMap* pointers = instr->pointer_map(); in CallCodeGeneric()
545 RecordSafepointWithLazyDeopt(instr, safepoint_mode); in CallCodeGeneric()
551 LInstruction* instr) { in CallRuntime() argument
552 ASSERT(instr != NULL); in CallRuntime()
553 LPointerMap* pointers = instr->pointer_map(); in CallRuntime()
558 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); in CallRuntime()
564 LInstruction* instr) { in CallRuntimeFromDeferred() argument
567 instr->pointer_map(), argc, Safepoint::kNoLazyDeopt); in CallRuntimeFromDeferred()
703 LInstruction* instr, SafepointMode safepoint_mode) { in RecordSafepointWithLazyDeopt() argument
705 RecordSafepoint(instr->pointer_map(), Safepoint::kLazyDeopt); in RecordSafepointWithLazyDeopt()
709 instr->pointer_map(), 0, Safepoint::kLazyDeopt); in RecordSafepointWithLazyDeopt()
802 void LCodeGen::DoInstructionGap(LInstructionGap* instr) { in DoInstructionGap() argument
803 DoGap(instr); in DoInstructionGap()
807 void LCodeGen::DoParameter(LParameter* instr) { in DoParameter() argument
812 void LCodeGen::DoCallStub(LCallStub* instr) { in DoCallStub() argument
813 ASSERT(ToRegister(instr->result()).is(v0)); in DoCallStub()
814 switch (instr->hydrogen()->major_key()) { in DoCallStub()
817 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
822 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
827 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
832 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
837 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
842 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
847 TranscendentalCacheStub stub(instr->transcendental_type(), in DoCallStub()
849 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
858 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { in DoUnknownOSRValue() argument
863 void LCodeGen::DoModI(LModI* instr) { in DoModI() argument
865 const Register left = ToRegister(instr->InputAt(0)); in DoModI()
866 const Register result = ToRegister(instr->result()); in DoModI()
870 if (instr->hydrogen()->HasPowerOf2Divisor()) { in DoModI()
875 instr->hydrogen()->right())->Integer32Value(); in DoModI()
884 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoModI()
885 DeoptimizeIf(eq, instr->environment(), result, Operand(zero_reg)); in DoModI()
893 Register right = EmitLoadRegister(instr->InputAt(1), scratch); in DoModI()
897 if (instr->hydrogen()->CheckFlag(HValue::kCanBeDivByZero)) { in DoModI()
898 DeoptimizeIf(eq, instr->environment(), right, Operand(zero_reg)); in DoModI()
904 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoModI()
905 DeoptimizeIf(eq, instr->environment(), result, Operand(zero_reg)); in DoModI()
912 void LCodeGen::DoDivI(LDivI* instr) { in DoDivI() argument
913 const Register left = ToRegister(instr->InputAt(0)); in DoDivI()
914 const Register right = ToRegister(instr->InputAt(1)); in DoDivI()
915 const Register result = ToRegister(instr->result()); in DoDivI()
922 if (instr->hydrogen()->CheckFlag(HValue::kCanBeDivByZero)) { in DoDivI()
923 DeoptimizeIf(eq, instr->environment(), right, Operand(zero_reg)); in DoDivI()
927 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoDivI()
930 DeoptimizeIf(lt, instr->environment(), right, Operand(zero_reg)); in DoDivI()
935 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { in DoDivI()
938 DeoptimizeIf(eq, instr->environment(), right, Operand(-1)); in DoDivI()
943 DeoptimizeIf(ne, instr->environment(), result, Operand(zero_reg)); in DoDivI()
948 void LCodeGen::DoMulI(LMulI* instr) { in DoMulI() argument
950 Register result = ToRegister(instr->result()); in DoMulI()
952 Register left = ToRegister(instr->InputAt(0)); in DoMulI()
953 LOperand* right_op = instr->InputAt(1); in DoMulI()
955 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); in DoMulI()
957 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero); in DoMulI()
966 DeoptimizeIf(eq, instr->environment(), left, Operand(zero_reg)); in DoMulI()
977 DeoptimizeIf(lt, instr->environment(), left, Operand(zero_reg)); in DoMulI()
1023 __ Or(ToRegister(instr->TempAt(0)), left, right); in DoMulI()
1032 DeoptimizeIf(ne, instr->environment(), scratch, Operand(at)); in DoMulI()
1042 instr->environment(), in DoMulI()
1043 ToRegister(instr->TempAt(0)), in DoMulI()
1051 void LCodeGen::DoBitI(LBitI* instr) { in DoBitI() argument
1052 LOperand* left_op = instr->InputAt(0); in DoBitI()
1053 LOperand* right_op = instr->InputAt(1); in DoBitI()
1056 Register result = ToRegister(instr->result()); in DoBitI()
1066 switch (instr->op()) { in DoBitI()
1083 void LCodeGen::DoShiftI(LShiftI* instr) { in DoShiftI() argument
1086 LOperand* right_op = instr->InputAt(1); in DoShiftI()
1087 Register left = ToRegister(instr->InputAt(0)); in DoShiftI()
1088 Register result = ToRegister(instr->result()); in DoShiftI()
1093 switch (instr->op()) { in DoShiftI()
1099 if (instr->can_deopt()) { in DoShiftI()
1100 DeoptimizeIf(lt, instr->environment(), result, Operand(zero_reg)); in DoShiftI()
1114 switch (instr->op()) { in DoShiftI()
1126 if (instr->can_deopt()) { in DoShiftI()
1128 DeoptimizeIf(ne, instr->environment(), at, Operand(zero_reg)); in DoShiftI()
1148 void LCodeGen::DoSubI(LSubI* instr) { in DoSubI() argument
1149 LOperand* left = instr->InputAt(0); in DoSubI()
1150 LOperand* right = instr->InputAt(1); in DoSubI()
1151 LOperand* result = instr->result(); in DoSubI()
1152 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); in DoSubI()
1182 DeoptimizeIf(lt, instr->environment(), overflow, Operand(zero_reg)); in DoSubI()
1187 void LCodeGen::DoConstantI(LConstantI* instr) { in DoConstantI() argument
1188 ASSERT(instr->result()->IsRegister()); in DoConstantI()
1189 __ li(ToRegister(instr->result()), Operand(instr->value())); in DoConstantI()
1193 void LCodeGen::DoConstantD(LConstantD* instr) { in DoConstantD() argument
1194 ASSERT(instr->result()->IsDoubleRegister()); in DoConstantD()
1195 DoubleRegister result = ToDoubleRegister(instr->result()); in DoConstantD()
1196 double v = instr->value(); in DoConstantD()
1201 void LCodeGen::DoConstantT(LConstantT* instr) { in DoConstantT() argument
1202 Handle<Object> value = instr->value(); in DoConstantT()
1204 __ li(ToRegister(instr->result()), Operand(value)); in DoConstantT()
1206 __ LoadHeapObject(ToRegister(instr->result()), in DoConstantT()
1212 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { in DoJSArrayLength() argument
1213 Register result = ToRegister(instr->result()); in DoJSArrayLength()
1214 Register array = ToRegister(instr->InputAt(0)); in DoJSArrayLength()
1219 void LCodeGen::DoFixedArrayBaseLength(LFixedArrayBaseLength* instr) { in DoFixedArrayBaseLength() argument
1220 Register result = ToRegister(instr->result()); in DoFixedArrayBaseLength()
1221 Register array = ToRegister(instr->InputAt(0)); in DoFixedArrayBaseLength()
1226 void LCodeGen::DoElementsKind(LElementsKind* instr) { in DoElementsKind() argument
1227 Register result = ToRegister(instr->result()); in DoElementsKind()
1228 Register input = ToRegister(instr->InputAt(0)); in DoElementsKind()
1240 void LCodeGen::DoValueOf(LValueOf* instr) { in DoValueOf() argument
1241 Register input = ToRegister(instr->InputAt(0)); in DoValueOf()
1242 Register result = ToRegister(instr->result()); in DoValueOf()
1243 Register map = ToRegister(instr->TempAt(0)); in DoValueOf()
1259 void LCodeGen::DoDateField(LDateField* instr) { in DoDateField() argument
1260 Register object = ToRegister(instr->InputAt(0)); in DoDateField()
1261 Register result = ToRegister(instr->result()); in DoDateField()
1262 Register scratch = ToRegister(instr->TempAt(0)); in DoDateField()
1263 Smi* index = instr->index(); in DoDateField()
1299 void LCodeGen::DoBitNotI(LBitNotI* instr) { in DoBitNotI() argument
1300 Register input = ToRegister(instr->InputAt(0)); in DoBitNotI()
1301 Register result = ToRegister(instr->result()); in DoBitNotI()
1306 void LCodeGen::DoThrow(LThrow* instr) { in DoThrow() argument
1307 Register input_reg = EmitLoadRegister(instr->InputAt(0), at); in DoThrow()
1309 CallRuntime(Runtime::kThrow, 1, instr); in DoThrow()
1317 void LCodeGen::DoAddI(LAddI* instr) { in DoAddI() argument
1318 LOperand* left = instr->InputAt(0); in DoAddI()
1319 LOperand* right = instr->InputAt(1); in DoAddI()
1320 LOperand* result = instr->result(); in DoAddI()
1321 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); in DoAddI()
1351 DeoptimizeIf(lt, instr->environment(), overflow, Operand(zero_reg)); in DoAddI()
1356 void LCodeGen::DoArithmeticD(LArithmeticD* instr) { in DoArithmeticD() argument
1357 DoubleRegister left = ToDoubleRegister(instr->InputAt(0)); in DoArithmeticD()
1358 DoubleRegister right = ToDoubleRegister(instr->InputAt(1)); in DoArithmeticD()
1359 DoubleRegister result = ToDoubleRegister(instr->result()); in DoArithmeticD()
1360 switch (instr->op()) { in DoArithmeticD()
1397 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { in DoArithmeticT() argument
1398 ASSERT(ToRegister(instr->InputAt(0)).is(a1)); in DoArithmeticT()
1399 ASSERT(ToRegister(instr->InputAt(1)).is(a0)); in DoArithmeticT()
1400 ASSERT(ToRegister(instr->result()).is(v0)); in DoArithmeticT()
1402 BinaryOpStub stub(instr->op(), NO_OVERWRITE); in DoArithmeticT()
1403 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoArithmeticT()
1457 void LCodeGen::DoBranch(LBranch* instr) { in DoBranch() argument
1458 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoBranch()
1459 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoBranch()
1461 Representation r = instr->hydrogen()->value()->representation(); in DoBranch()
1463 Register reg = ToRegister(instr->InputAt(0)); in DoBranch()
1466 DoubleRegister reg = ToDoubleRegister(instr->InputAt(0)); in DoBranch()
1471 Register reg = ToRegister(instr->InputAt(0)); in DoBranch()
1472 HType type = instr->hydrogen()->value()->type(); in DoBranch()
1482 ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types(); in DoBranch()
1511 DeoptimizeIf(eq, instr->environment(), at, Operand(zero_reg)); in DoBranch()
1556 DeoptimizeIf(al, instr->environment(), zero_reg, Operand(zero_reg)); in DoBranch()
1571 void LCodeGen::DoGoto(LGoto* instr) { in DoGoto() argument
1572 EmitGoto(instr->block_id()); in DoGoto()
1604 void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) { in DoCmpIDAndBranch() argument
1605 LOperand* left = instr->InputAt(0); in DoCmpIDAndBranch()
1606 LOperand* right = instr->InputAt(1); in DoCmpIDAndBranch()
1607 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoCmpIDAndBranch()
1608 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoCmpIDAndBranch()
1610 Condition cond = TokenToCondition(instr->op(), false); in DoCmpIDAndBranch()
1617 EvalComparison(instr->op(), left_val, right_val) ? true_block in DoCmpIDAndBranch()
1621 if (instr->is_double()) { in DoCmpIDAndBranch()
1656 void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { in DoCmpObjectEqAndBranch() argument
1657 Register left = ToRegister(instr->InputAt(0)); in DoCmpObjectEqAndBranch()
1658 Register right = ToRegister(instr->InputAt(1)); in DoCmpObjectEqAndBranch()
1659 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoCmpObjectEqAndBranch()
1660 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoCmpObjectEqAndBranch()
1666 void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { in DoCmpConstantEqAndBranch() argument
1667 Register left = ToRegister(instr->InputAt(0)); in DoCmpConstantEqAndBranch()
1668 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoCmpConstantEqAndBranch()
1669 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoCmpConstantEqAndBranch()
1672 Operand(instr->hydrogen()->right())); in DoCmpConstantEqAndBranch()
1677 void LCodeGen::DoIsNilAndBranch(LIsNilAndBranch* instr) { in DoIsNilAndBranch() argument
1679 Register reg = ToRegister(instr->InputAt(0)); in DoIsNilAndBranch()
1680 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsNilAndBranch()
1684 if (instr->hydrogen()->representation().IsSpecialization() || in DoIsNilAndBranch()
1685 instr->hydrogen()->type().IsSmi()) { in DoIsNilAndBranch()
1690 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsNilAndBranch()
1692 Heap::RootListIndex nil_value = instr->nil() == kNullValue ? in DoIsNilAndBranch()
1696 if (instr->kind() == kStrictEquality) { in DoIsNilAndBranch()
1699 Heap::RootListIndex other_nil_value = instr->nil() == kNullValue ? in DoIsNilAndBranch()
1744 void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { in DoIsObjectAndBranch() argument
1745 Register reg = ToRegister(instr->InputAt(0)); in DoIsObjectAndBranch()
1746 Register temp1 = ToRegister(instr->TempAt(0)); in DoIsObjectAndBranch()
1749 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsObjectAndBranch()
1750 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsObjectAndBranch()
1772 void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { in DoIsStringAndBranch() argument
1773 Register reg = ToRegister(instr->InputAt(0)); in DoIsStringAndBranch()
1774 Register temp1 = ToRegister(instr->TempAt(0)); in DoIsStringAndBranch()
1776 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsStringAndBranch()
1777 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsStringAndBranch()
1788 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { in DoIsSmiAndBranch() argument
1789 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsSmiAndBranch()
1790 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsSmiAndBranch()
1792 Register input_reg = EmitLoadRegister(instr->InputAt(0), at); in DoIsSmiAndBranch()
1798 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { in DoIsUndetectableAndBranch() argument
1799 Register input = ToRegister(instr->InputAt(0)); in DoIsUndetectableAndBranch()
1800 Register temp = ToRegister(instr->TempAt(0)); in DoIsUndetectableAndBranch()
1802 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsUndetectableAndBranch()
1803 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsUndetectableAndBranch()
1833 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { in DoStringCompareAndBranch() argument
1834 Token::Value op = instr->op(); in DoStringCompareAndBranch()
1835 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoStringCompareAndBranch()
1836 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoStringCompareAndBranch()
1839 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoStringCompareAndBranch()
1847 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { in TestType() argument
1848 InstanceType from = instr->from(); in TestType()
1849 InstanceType to = instr->to(); in TestType()
1856 static Condition BranchCondition(HHasInstanceTypeAndBranch* instr) { in BranchCondition() argument
1857 InstanceType from = instr->from(); in BranchCondition()
1858 InstanceType to = instr->to(); in BranchCondition()
1867 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { in DoHasInstanceTypeAndBranch() argument
1869 Register input = ToRegister(instr->InputAt(0)); in DoHasInstanceTypeAndBranch()
1871 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoHasInstanceTypeAndBranch()
1872 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoHasInstanceTypeAndBranch()
1881 BranchCondition(instr->hydrogen()), in DoHasInstanceTypeAndBranch()
1883 Operand(TestType(instr->hydrogen()))); in DoHasInstanceTypeAndBranch()
1887 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { in DoGetCachedArrayIndex() argument
1888 Register input = ToRegister(instr->InputAt(0)); in DoGetCachedArrayIndex()
1889 Register result = ToRegister(instr->result()); in DoGetCachedArrayIndex()
1901 LHasCachedArrayIndexAndBranch* instr) { in DoHasCachedArrayIndexAndBranch() argument
1902 Register input = ToRegister(instr->InputAt(0)); in DoHasCachedArrayIndexAndBranch()
1905 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoHasCachedArrayIndexAndBranch()
1906 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoHasCachedArrayIndexAndBranch()
1981 void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) { in DoClassOfTestAndBranch() argument
1982 Register input = ToRegister(instr->InputAt(0)); in DoClassOfTestAndBranch()
1984 Register temp2 = ToRegister(instr->TempAt(0)); in DoClassOfTestAndBranch()
1985 Handle<String> class_name = instr->hydrogen()->class_name(); in DoClassOfTestAndBranch()
1987 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoClassOfTestAndBranch()
1988 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoClassOfTestAndBranch()
1999 void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) { in DoCmpMapAndBranch() argument
2000 Register reg = ToRegister(instr->InputAt(0)); in DoCmpMapAndBranch()
2001 Register temp = ToRegister(instr->TempAt(0)); in DoCmpMapAndBranch()
2002 int true_block = instr->true_block_id(); in DoCmpMapAndBranch()
2003 int false_block = instr->false_block_id(); in DoCmpMapAndBranch()
2006 EmitBranch(true_block, false_block, eq, temp, Operand(instr->map())); in DoCmpMapAndBranch()
2010 void LCodeGen::DoInstanceOf(LInstanceOf* instr) { in DoInstanceOf() argument
2012 ASSERT(ToRegister(instr->InputAt(0)).is(a0)); // Object is in a0. in DoInstanceOf()
2013 ASSERT(ToRegister(instr->InputAt(1)).is(a1)); // Function is in a1. in DoInstanceOf()
2014 Register result = ToRegister(instr->result()); in DoInstanceOf()
2018 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoInstanceOf()
2029 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { in DoInstanceOfKnownGlobal() argument
2033 LInstanceOfKnownGlobal* instr) in DoInstanceOfKnownGlobal() argument
2034 : LDeferredCode(codegen), instr_(instr) { } in DoInstanceOfKnownGlobal()
2038 virtual LInstruction* instr() { return instr_; } in DoInstanceOfKnownGlobal() function in v8::internal::LCodeGen::DoInstanceOfKnownGlobal::DeferredInstanceOfKnownGlobal
2047 deferred = new DeferredInstanceOfKnownGlobal(this, instr); in DoInstanceOfKnownGlobal()
2050 Register object = ToRegister(instr->InputAt(0)); in DoInstanceOfKnownGlobal()
2051 Register temp = ToRegister(instr->TempAt(0)); in DoInstanceOfKnownGlobal()
2052 Register result = ToRegister(instr->result()); in DoInstanceOfKnownGlobal()
2107 void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, in DoDeferredInstanceOfKnownGlobal() argument
2109 Register result = ToRegister(instr->result()); in DoDeferredInstanceOfKnownGlobal()
2126 Register temp = ToRegister(instr->TempAt(0)); in DoDeferredInstanceOfKnownGlobal()
2128 __ LoadHeapObject(InstanceofStub::right(), instr->function()); in DoDeferredInstanceOfKnownGlobal()
2140 instr, in DoDeferredInstanceOfKnownGlobal()
2142 ASSERT(instr->HasDeoptimizationEnvironment()); in DoDeferredInstanceOfKnownGlobal()
2143 LEnvironment* env = instr->deoptimization_environment(); in DoDeferredInstanceOfKnownGlobal()
2151 void LCodeGen::DoCmpT(LCmpT* instr) { in DoCmpT() argument
2152 Token::Value op = instr->op(); in DoCmpT()
2155 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoCmpT()
2164 __ LoadRoot(ToRegister(instr->result()), Heap::kTrueValueRootIndex); in DoCmpT()
2165 __ LoadRoot(ToRegister(instr->result()), Heap::kFalseValueRootIndex); in DoCmpT()
2171 void LCodeGen::DoReturn(LReturn* instr) { in DoReturn() argument
2186 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { in DoLoadGlobalCell() argument
2187 Register result = ToRegister(instr->result()); in DoLoadGlobalCell()
2188 __ li(at, Operand(Handle<Object>(instr->hydrogen()->cell()))); in DoLoadGlobalCell()
2190 if (instr->hydrogen()->RequiresHoleCheck()) { in DoLoadGlobalCell()
2192 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); in DoLoadGlobalCell()
2197 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { in DoLoadGlobalGeneric() argument
2198 ASSERT(ToRegister(instr->global_object()).is(a0)); in DoLoadGlobalGeneric()
2199 ASSERT(ToRegister(instr->result()).is(v0)); in DoLoadGlobalGeneric()
2201 __ li(a2, Operand(instr->name())); in DoLoadGlobalGeneric()
2202 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET in DoLoadGlobalGeneric()
2205 CallCode(ic, mode, instr); in DoLoadGlobalGeneric()
2209 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { in DoStoreGlobalCell() argument
2210 Register value = ToRegister(instr->value()); in DoStoreGlobalCell()
2214 __ li(cell, Operand(instr->hydrogen()->cell())); in DoStoreGlobalCell()
2220 if (instr->hydrogen()->RequiresHoleCheck()) { in DoStoreGlobalCell()
2222 Register payload = ToRegister(instr->TempAt(0)); in DoStoreGlobalCell()
2225 DeoptimizeIf(eq, instr->environment(), payload, Operand(at)); in DoStoreGlobalCell()
2234 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { in DoStoreGlobalGeneric() argument
2235 ASSERT(ToRegister(instr->global_object()).is(a1)); in DoStoreGlobalGeneric()
2236 ASSERT(ToRegister(instr->value()).is(a0)); in DoStoreGlobalGeneric()
2238 __ li(a2, Operand(instr->name())); in DoStoreGlobalGeneric()
2239 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) in DoStoreGlobalGeneric()
2242 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); in DoStoreGlobalGeneric()
2246 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { in DoLoadContextSlot() argument
2247 Register context = ToRegister(instr->context()); in DoLoadContextSlot()
2248 Register result = ToRegister(instr->result()); in DoLoadContextSlot()
2250 __ lw(result, ContextOperand(context, instr->slot_index())); in DoLoadContextSlot()
2251 if (instr->hydrogen()->RequiresHoleCheck()) { in DoLoadContextSlot()
2254 if (instr->hydrogen()->DeoptimizesOnHole()) { in DoLoadContextSlot()
2255 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); in DoLoadContextSlot()
2266 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { in DoStoreContextSlot() argument
2267 Register context = ToRegister(instr->context()); in DoStoreContextSlot()
2268 Register value = ToRegister(instr->value()); in DoStoreContextSlot()
2270 MemOperand target = ContextOperand(context, instr->slot_index()); in DoStoreContextSlot()
2274 if (instr->hydrogen()->RequiresHoleCheck()) { in DoStoreContextSlot()
2278 if (instr->hydrogen()->DeoptimizesOnHole()) { in DoStoreContextSlot()
2279 DeoptimizeIf(eq, instr->environment(), scratch, Operand(at)); in DoStoreContextSlot()
2286 if (instr->hydrogen()->NeedsWriteBarrier()) { in DoStoreContextSlot()
2287 HType type = instr->hydrogen()->value()->type(); in DoStoreContextSlot()
2304 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { in DoLoadNamedField() argument
2305 Register object = ToRegister(instr->InputAt(0)); in DoLoadNamedField()
2306 Register result = ToRegister(instr->result()); in DoLoadNamedField()
2307 if (instr->hydrogen()->is_in_object()) { in DoLoadNamedField()
2308 __ lw(result, FieldMemOperand(object, instr->hydrogen()->offset())); in DoLoadNamedField()
2311 __ lw(result, FieldMemOperand(result, instr->hydrogen()->offset())); in DoLoadNamedField()
2343 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { in DoLoadNamedFieldPolymorphic() argument
2344 Register object = ToRegister(instr->object()); in DoLoadNamedFieldPolymorphic()
2345 Register result = ToRegister(instr->result()); in DoLoadNamedFieldPolymorphic()
2347 int map_count = instr->hydrogen()->types()->length(); in DoLoadNamedFieldPolymorphic()
2348 Handle<String> name = instr->hydrogen()->name(); in DoLoadNamedFieldPolymorphic()
2350 ASSERT(instr->hydrogen()->need_generic()); in DoLoadNamedFieldPolymorphic()
2353 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoLoadNamedFieldPolymorphic()
2358 Handle<Map> map = instr->hydrogen()->types()->at(i); in DoLoadNamedFieldPolymorphic()
2365 Handle<Map> map = instr->hydrogen()->types()->last(); in DoLoadNamedFieldPolymorphic()
2366 if (instr->hydrogen()->need_generic()) { in DoLoadNamedFieldPolymorphic()
2374 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoLoadNamedFieldPolymorphic()
2376 DeoptimizeIf(ne, instr->environment(), scratch, Operand(map)); in DoLoadNamedFieldPolymorphic()
2384 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { in DoLoadNamedGeneric() argument
2385 ASSERT(ToRegister(instr->object()).is(a0)); in DoLoadNamedGeneric()
2386 ASSERT(ToRegister(instr->result()).is(v0)); in DoLoadNamedGeneric()
2389 __ li(a2, Operand(instr->name())); in DoLoadNamedGeneric()
2391 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoLoadNamedGeneric()
2395 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { in DoLoadFunctionPrototype() argument
2397 Register function = ToRegister(instr->function()); in DoLoadFunctionPrototype()
2398 Register result = ToRegister(instr->result()); in DoLoadFunctionPrototype()
2403 DeoptimizeIf(ne, instr->environment(), scratch, Operand(JS_FUNCTION_TYPE)); in DoLoadFunctionPrototype()
2417 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); in DoLoadFunctionPrototype()
2438 void LCodeGen::DoLoadElements(LLoadElements* instr) { in DoLoadElements() argument
2439 Register result = ToRegister(instr->result()); in DoLoadElements()
2440 Register input = ToRegister(instr->InputAt(0)); in DoLoadElements()
2469 LLoadExternalArrayPointer* instr) { in DoLoadExternalArrayPointer() argument
2470 Register to_reg = ToRegister(instr->result()); in DoLoadExternalArrayPointer()
2471 Register from_reg = ToRegister(instr->InputAt(0)); in DoLoadExternalArrayPointer()
2477 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { in DoAccessArgumentsAt() argument
2478 Register arguments = ToRegister(instr->arguments()); in DoAccessArgumentsAt()
2479 Register length = ToRegister(instr->length()); in DoAccessArgumentsAt()
2480 Register index = ToRegister(instr->index()); in DoAccessArgumentsAt()
2481 Register result = ToRegister(instr->result()); in DoAccessArgumentsAt()
2488 DeoptimizeIf(ls, instr->environment(), length, Operand(index)); in DoAccessArgumentsAt()
2500 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { in DoLoadKeyedFastElement() argument
2501 Register elements = ToRegister(instr->elements()); in DoLoadKeyedFastElement()
2502 Register key = EmitLoadRegister(instr->key(), scratch0()); in DoLoadKeyedFastElement()
2503 Register result = ToRegister(instr->result()); in DoLoadKeyedFastElement()
2512 if (instr->hydrogen()->RequiresHoleCheck()) { in DoLoadKeyedFastElement()
2514 DeoptimizeIf(eq, instr->environment(), result, Operand(scratch)); in DoLoadKeyedFastElement()
2520 LLoadKeyedFastDoubleElement* instr) { in DoLoadKeyedFastDoubleElement() argument
2521 Register elements = ToRegister(instr->elements()); in DoLoadKeyedFastDoubleElement()
2522 bool key_is_constant = instr->key()->IsConstantOperand(); in DoLoadKeyedFastDoubleElement()
2524 DoubleRegister result = ToDoubleRegister(instr->result()); in DoLoadKeyedFastDoubleElement()
2531 constant_key = ToInteger32(LConstantOperand::cast(instr->key())); in DoLoadKeyedFastDoubleElement()
2536 key = ToRegister(instr->key()); in DoLoadKeyedFastDoubleElement()
2550 DeoptimizeIf(eq, instr->environment(), scratch, Operand(kHoleNanUpper32)); in DoLoadKeyedFastDoubleElement()
2557 LLoadKeyedSpecializedArrayElement* instr) { in DoLoadKeyedSpecializedArrayElement() argument
2558 Register external_pointer = ToRegister(instr->external_pointer()); in DoLoadKeyedSpecializedArrayElement()
2560 ElementsKind elements_kind = instr->elements_kind(); in DoLoadKeyedSpecializedArrayElement()
2561 bool key_is_constant = instr->key()->IsConstantOperand(); in DoLoadKeyedSpecializedArrayElement()
2564 constant_key = ToInteger32(LConstantOperand::cast(instr->key())); in DoLoadKeyedSpecializedArrayElement()
2569 key = ToRegister(instr->key()); in DoLoadKeyedSpecializedArrayElement()
2575 FPURegister result = ToDoubleRegister(instr->result()); in DoLoadKeyedSpecializedArrayElement()
2590 Register result = ToRegister(instr->result()); in DoLoadKeyedSpecializedArrayElement()
2623 DeoptimizeIf(Ugreater_equal, instr->environment(), in DoLoadKeyedSpecializedArrayElement()
2640 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { in DoLoadKeyedGeneric() argument
2641 ASSERT(ToRegister(instr->object()).is(a1)); in DoLoadKeyedGeneric()
2642 ASSERT(ToRegister(instr->key()).is(a0)); in DoLoadKeyedGeneric()
2645 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoLoadKeyedGeneric()
2649 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { in DoArgumentsElements() argument
2652 Register result = ToRegister(instr->result()); in DoArgumentsElements()
2667 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { in DoArgumentsLength() argument
2668 Register elem = ToRegister(instr->InputAt(0)); in DoArgumentsLength()
2669 Register result = ToRegister(instr->result()); in DoArgumentsLength()
2688 void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) { in DoWrapReceiver() argument
2689 Register receiver = ToRegister(instr->receiver()); in DoWrapReceiver()
2690 Register function = ToRegister(instr->function()); in DoWrapReceiver()
2720 DeoptimizeIf(eq, instr->environment(), scratch, Operand(zero_reg)); in DoWrapReceiver()
2723 DeoptimizeIf(lt, instr->environment(), in DoWrapReceiver()
2734 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { in DoApplyArguments() argument
2735 Register receiver = ToRegister(instr->receiver()); in DoApplyArguments()
2736 Register function = ToRegister(instr->function()); in DoApplyArguments()
2737 Register length = ToRegister(instr->length()); in DoApplyArguments()
2738 Register elements = ToRegister(instr->elements()); in DoApplyArguments()
2742 ASSERT(ToRegister(instr->result()).is(v0)); in DoApplyArguments()
2747 DeoptimizeIf(hi, instr->environment(), length, Operand(kArgumentsLimit)); in DoApplyArguments()
2771 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); in DoApplyArguments()
2772 LPointerMap* pointers = instr->pointer_map(); in DoApplyArguments()
2785 void LCodeGen::DoPushArgument(LPushArgument* instr) { in DoPushArgument() argument
2786 LOperand* argument = instr->InputAt(0); in DoPushArgument()
2796 void LCodeGen::DoThisFunction(LThisFunction* instr) { in DoThisFunction() argument
2797 Register result = ToRegister(instr->result()); in DoThisFunction()
2798 __ LoadHeapObject(result, instr->hydrogen()->closure()); in DoThisFunction()
2802 void LCodeGen::DoContext(LContext* instr) { in DoContext() argument
2803 Register result = ToRegister(instr->result()); in DoContext()
2808 void LCodeGen::DoOuterContext(LOuterContext* instr) { in DoOuterContext() argument
2809 Register context = ToRegister(instr->context()); in DoOuterContext()
2810 Register result = ToRegister(instr->result()); in DoOuterContext()
2816 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { in DoDeclareGlobals() argument
2817 __ LoadHeapObject(scratch0(), instr->hydrogen()->pairs()); in DoDeclareGlobals()
2818 __ li(scratch1(), Operand(Smi::FromInt(instr->hydrogen()->flags()))); in DoDeclareGlobals()
2821 CallRuntime(Runtime::kDeclareGlobals, 3, instr); in DoDeclareGlobals()
2825 void LCodeGen::DoGlobalObject(LGlobalObject* instr) { in DoGlobalObject() argument
2826 Register result = ToRegister(instr->result()); in DoGlobalObject()
2831 void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) { in DoGlobalReceiver() argument
2832 Register global = ToRegister(instr->global()); in DoGlobalReceiver()
2833 Register result = ToRegister(instr->result()); in DoGlobalReceiver()
2840 LInstruction* instr, in CallKnownFunction() argument
2845 LPointerMap* pointers = instr->pointer_map(); in CallKnownFunction()
2871 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); in CallKnownFunction()
2883 void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) { in DoCallConstantFunction() argument
2884 ASSERT(ToRegister(instr->result()).is(v0)); in DoCallConstantFunction()
2886 CallKnownFunction(instr->function(), instr->arity(), instr, CALL_AS_METHOD); in DoCallConstantFunction()
2890 void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) { in DoDeferredMathAbsTaggedHeapNumber() argument
2891 Register input = ToRegister(instr->InputAt(0)); in DoDeferredMathAbsTaggedHeapNumber()
2892 Register result = ToRegister(instr->result()); in DoDeferredMathAbsTaggedHeapNumber()
2898 DeoptimizeIf(ne, instr->environment(), scratch, Operand(at)); in DoDeferredMathAbsTaggedHeapNumber()
2932 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr); in DoDeferredMathAbsTaggedHeapNumber()
2955 void LCodeGen::EmitIntegerMathAbs(LUnaryMathOperation* instr) { in EmitIntegerMathAbs() argument
2956 Register input = ToRegister(instr->InputAt(0)); in EmitIntegerMathAbs()
2957 Register result = ToRegister(instr->result()); in EmitIntegerMathAbs()
2965 DeoptimizeIf(lt, instr->environment(), result, Operand(zero_reg)); in EmitIntegerMathAbs()
2970 void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) { in DoMathAbs() argument
2975 LUnaryMathOperation* instr) in DoMathAbs() argument
2976 : LDeferredCode(codegen), instr_(instr) { } in DoMathAbs()
2980 virtual LInstruction* instr() { return instr_; } in DoMathAbs() function in v8::internal::LCodeGen::DoMathAbs::DeferredMathAbsTaggedHeapNumber
2985 Representation r = instr->hydrogen()->value()->representation(); in DoMathAbs()
2987 FPURegister input = ToDoubleRegister(instr->InputAt(0)); in DoMathAbs()
2988 FPURegister result = ToDoubleRegister(instr->result()); in DoMathAbs()
2991 EmitIntegerMathAbs(instr); in DoMathAbs()
2995 new DeferredMathAbsTaggedHeapNumber(this, instr); in DoMathAbs()
2996 Register input = ToRegister(instr->InputAt(0)); in DoMathAbs()
3000 EmitIntegerMathAbs(instr); in DoMathAbs()
3006 void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { in DoMathFloor() argument
3007 DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); in DoMathFloor()
3008 Register result = ToRegister(instr->result()); in DoMathFloor()
3011 Register except_flag = ToRegister(instr->TempAt(0)); in DoMathFloor()
3020 DeoptimizeIf(ne, instr->environment(), except_flag, Operand(zero_reg)); in DoMathFloor()
3025 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoMathFloor()
3031 DeoptimizeIf(ne, instr->environment(), scratch1, Operand(zero_reg)); in DoMathFloor()
3037 void LCodeGen::DoMathRound(LUnaryMathOperation* instr) { in DoMathRound() argument
3038 DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); in DoMathRound()
3039 Register result = ToRegister(instr->result()); in DoMathRound()
3054 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoMathRound()
3063 DeoptimizeIf(ge, instr->environment(), scratch, in DoMathRound()
3076 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoMathRound()
3078 DeoptimizeIf(lt, instr->environment(), result, in DoMathRound()
3098 DeoptimizeIf(ne, instr->environment(), except_flag, Operand(zero_reg)); in DoMathRound()
3102 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoMathRound()
3108 DeoptimizeIf(ne, instr->environment(), scratch, Operand(zero_reg)); in DoMathRound()
3114 void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) { in DoMathSqrt() argument
3115 DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); in DoMathSqrt()
3116 DoubleRegister result = ToDoubleRegister(instr->result()); in DoMathSqrt()
3121 void LCodeGen::DoMathPowHalf(LUnaryMathOperation* instr) { in DoMathPowHalf() argument
3122 DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); in DoMathPowHalf()
3123 DoubleRegister result = ToDoubleRegister(instr->result()); in DoMathPowHalf()
3124 DoubleRegister temp = ToDoubleRegister(instr->TempAt(0)); in DoMathPowHalf()
3145 void LCodeGen::DoPower(LPower* instr) { in DoPower() argument
3146 Representation exponent_type = instr->hydrogen()->right()->representation(); in DoPower()
3149 ASSERT(!instr->InputAt(1)->IsDoubleRegister() || in DoPower()
3150 ToDoubleRegister(instr->InputAt(1)).is(f4)); in DoPower()
3151 ASSERT(!instr->InputAt(1)->IsRegister() || in DoPower()
3152 ToRegister(instr->InputAt(1)).is(a2)); in DoPower()
3153 ASSERT(ToDoubleRegister(instr->InputAt(0)).is(f2)); in DoPower()
3154 ASSERT(ToDoubleRegister(instr->result()).is(f0)); in DoPower()
3160 DeoptimizeIf(ne, instr->environment(), t3, Operand(at)); in DoPower()
3175 void LCodeGen::DoRandom(LRandom* instr) { in DoRandom() argument
3178 DeferredDoRandom(LCodeGen* codegen, LRandom* instr) in DoRandom() argument
3179 : LDeferredCode(codegen), instr_(instr) { } in DoRandom()
3181 virtual LInstruction* instr() { return instr_; } in DoRandom() function in v8::internal::LCodeGen::DoRandom::DeferredDoRandom
3186 DeferredDoRandom* deferred = new DeferredDoRandom(this, instr); in DoRandom()
3189 ASSERT(ToDoubleRegister(instr->result()).is(f0)); in DoRandom()
3190 ASSERT(ToRegister(instr->InputAt(0)).is(a0)); in DoRandom()
3244 void LCodeGen::DoDeferredRandom(LRandom* instr) { in DoDeferredRandom() argument
3251 void LCodeGen::DoMathLog(LUnaryMathOperation* instr) { in DoMathLog() argument
3252 ASSERT(ToDoubleRegister(instr->result()).is(f4)); in DoMathLog()
3255 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoMathLog()
3259 void LCodeGen::DoMathTan(LUnaryMathOperation* instr) { in DoMathTan() argument
3260 ASSERT(ToDoubleRegister(instr->result()).is(f4)); in DoMathTan()
3263 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoMathTan()
3267 void LCodeGen::DoMathCos(LUnaryMathOperation* instr) { in DoMathCos() argument
3268 ASSERT(ToDoubleRegister(instr->result()).is(f4)); in DoMathCos()
3271 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoMathCos()
3275 void LCodeGen::DoMathSin(LUnaryMathOperation* instr) { in DoMathSin() argument
3276 ASSERT(ToDoubleRegister(instr->result()).is(f4)); in DoMathSin()
3279 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoMathSin()
3283 void LCodeGen::DoUnaryMathOperation(LUnaryMathOperation* instr) { in DoUnaryMathOperation() argument
3284 switch (instr->op()) { in DoUnaryMathOperation()
3286 DoMathAbs(instr); in DoUnaryMathOperation()
3289 DoMathFloor(instr); in DoUnaryMathOperation()
3292 DoMathRound(instr); in DoUnaryMathOperation()
3295 DoMathSqrt(instr); in DoUnaryMathOperation()
3298 DoMathPowHalf(instr); in DoUnaryMathOperation()
3301 DoMathCos(instr); in DoUnaryMathOperation()
3304 DoMathSin(instr); in DoUnaryMathOperation()
3307 DoMathTan(instr); in DoUnaryMathOperation()
3310 DoMathLog(instr); in DoUnaryMathOperation()
3319 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { in DoInvokeFunction() argument
3320 ASSERT(ToRegister(instr->function()).is(a1)); in DoInvokeFunction()
3321 ASSERT(instr->HasPointerMap()); in DoInvokeFunction()
3322 ASSERT(instr->HasDeoptimizationEnvironment()); in DoInvokeFunction()
3323 LPointerMap* pointers = instr->pointer_map(); in DoInvokeFunction()
3326 ParameterCount count(instr->arity()); in DoInvokeFunction()
3332 void LCodeGen::DoCallKeyed(LCallKeyed* instr) { in DoCallKeyed() argument
3333 ASSERT(ToRegister(instr->result()).is(v0)); in DoCallKeyed()
3335 int arity = instr->arity(); in DoCallKeyed()
3338 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoCallKeyed()
3343 void LCodeGen::DoCallNamed(LCallNamed* instr) { in DoCallNamed() argument
3344 ASSERT(ToRegister(instr->result()).is(v0)); in DoCallNamed()
3346 int arity = instr->arity(); in DoCallNamed()
3350 __ li(a2, Operand(instr->name())); in DoCallNamed()
3351 CallCode(ic, mode, instr); in DoCallNamed()
3357 void LCodeGen::DoCallFunction(LCallFunction* instr) { in DoCallFunction() argument
3358 ASSERT(ToRegister(instr->function()).is(a1)); in DoCallFunction()
3359 ASSERT(ToRegister(instr->result()).is(v0)); in DoCallFunction()
3361 int arity = instr->arity(); in DoCallFunction()
3363 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallFunction()
3368 void LCodeGen::DoCallGlobal(LCallGlobal* instr) { in DoCallGlobal() argument
3369 ASSERT(ToRegister(instr->result()).is(v0)); in DoCallGlobal()
3371 int arity = instr->arity(); in DoCallGlobal()
3375 __ li(a2, Operand(instr->name())); in DoCallGlobal()
3376 CallCode(ic, mode, instr); in DoCallGlobal()
3381 void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) { in DoCallKnownGlobal() argument
3382 ASSERT(ToRegister(instr->result()).is(v0)); in DoCallKnownGlobal()
3383 CallKnownFunction(instr->target(), instr->arity(), instr, CALL_AS_FUNCTION); in DoCallKnownGlobal()
3387 void LCodeGen::DoCallNew(LCallNew* instr) { in DoCallNew() argument
3388 ASSERT(ToRegister(instr->InputAt(0)).is(a1)); in DoCallNew()
3389 ASSERT(ToRegister(instr->result()).is(v0)); in DoCallNew()
3392 __ li(a0, Operand(instr->arity())); in DoCallNew()
3393 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); in DoCallNew()
3397 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { in DoCallRuntime() argument
3398 CallRuntime(instr->function(), instr->arity(), instr); in DoCallRuntime()
3402 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { in DoStoreNamedField() argument
3403 Register object = ToRegister(instr->object()); in DoStoreNamedField()
3404 Register value = ToRegister(instr->value()); in DoStoreNamedField()
3406 int offset = instr->offset(); in DoStoreNamedField()
3410 if (!instr->transition().is_null()) { in DoStoreNamedField()
3411 __ li(scratch, Operand(instr->transition())); in DoStoreNamedField()
3416 HType type = instr->hydrogen()->value()->type(); in DoStoreNamedField()
3419 if (instr->is_in_object()) { in DoStoreNamedField()
3421 if (instr->hydrogen()->NeedsWriteBarrier()) { in DoStoreNamedField()
3435 if (instr->hydrogen()->NeedsWriteBarrier()) { in DoStoreNamedField()
3451 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { in DoStoreNamedGeneric() argument
3452 ASSERT(ToRegister(instr->object()).is(a1)); in DoStoreNamedGeneric()
3453 ASSERT(ToRegister(instr->value()).is(a0)); in DoStoreNamedGeneric()
3456 __ li(a2, Operand(instr->name())); in DoStoreNamedGeneric()
3457 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) in DoStoreNamedGeneric()
3460 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoStoreNamedGeneric()
3464 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { in DoBoundsCheck() argument
3466 instr->environment(), in DoBoundsCheck()
3467 ToRegister(instr->index()), in DoBoundsCheck()
3468 Operand(ToRegister(instr->length()))); in DoBoundsCheck()
3472 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) { in DoStoreKeyedFastElement() argument
3473 Register value = ToRegister(instr->value()); in DoStoreKeyedFastElement()
3474 Register elements = ToRegister(instr->object()); in DoStoreKeyedFastElement()
3475 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg; in DoStoreKeyedFastElement()
3479 if (instr->key()->IsConstantOperand()) { in DoStoreKeyedFastElement()
3480 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); in DoStoreKeyedFastElement()
3481 LConstantOperand* const_operand = LConstantOperand::cast(instr->key()); in DoStoreKeyedFastElement()
3491 if (instr->hydrogen()->NeedsWriteBarrier()) { in DoStoreKeyedFastElement()
3492 HType type = instr->hydrogen()->value()->type(); in DoStoreKeyedFastElement()
3509 LStoreKeyedFastDoubleElement* instr) { in DoStoreKeyedFastDoubleElement() argument
3510 DoubleRegister value = ToDoubleRegister(instr->value()); in DoStoreKeyedFastDoubleElement()
3511 Register elements = ToRegister(instr->elements()); in DoStoreKeyedFastDoubleElement()
3514 bool key_is_constant = instr->key()->IsConstantOperand(); in DoStoreKeyedFastDoubleElement()
3521 constant_key = ToInteger32(LConstantOperand::cast(instr->key())); in DoStoreKeyedFastDoubleElement()
3526 key = ToRegister(instr->key()); in DoStoreKeyedFastDoubleElement()
3554 LStoreKeyedSpecializedArrayElement* instr) { in DoStoreKeyedSpecializedArrayElement() argument
3556 Register external_pointer = ToRegister(instr->external_pointer()); in DoStoreKeyedSpecializedArrayElement()
3558 ElementsKind elements_kind = instr->elements_kind(); in DoStoreKeyedSpecializedArrayElement()
3559 bool key_is_constant = instr->key()->IsConstantOperand(); in DoStoreKeyedSpecializedArrayElement()
3562 constant_key = ToInteger32(LConstantOperand::cast(instr->key())); in DoStoreKeyedSpecializedArrayElement()
3567 key = ToRegister(instr->key()); in DoStoreKeyedSpecializedArrayElement()
3573 FPURegister value(ToDoubleRegister(instr->value())); in DoStoreKeyedSpecializedArrayElement()
3588 Register value(ToRegister(instr->value())); in DoStoreKeyedSpecializedArrayElement()
3626 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { in DoStoreKeyedGeneric() argument
3627 ASSERT(ToRegister(instr->object()).is(a2)); in DoStoreKeyedGeneric()
3628 ASSERT(ToRegister(instr->key()).is(a1)); in DoStoreKeyedGeneric()
3629 ASSERT(ToRegister(instr->value()).is(a0)); in DoStoreKeyedGeneric()
3631 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) in DoStoreKeyedGeneric()
3634 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoStoreKeyedGeneric()
3638 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { in DoTransitionElementsKind() argument
3639 Register object_reg = ToRegister(instr->object()); in DoTransitionElementsKind()
3640 Register new_map_reg = ToRegister(instr->new_map_reg()); in DoTransitionElementsKind()
3643 Handle<Map> from_map = instr->original_map(); in DoTransitionElementsKind()
3644 Handle<Map> to_map = instr->transitioned_map(); in DoTransitionElementsKind()
3648 __ mov(ToRegister(instr->result()), object_reg); in DoTransitionElementsKind()
3662 Register fixed_object_reg = ToRegister(instr->temp_reg()); in DoTransitionElementsKind()
3667 RelocInfo::CODE_TARGET, instr); in DoTransitionElementsKind()
3669 Register fixed_object_reg = ToRegister(instr->temp_reg()); in DoTransitionElementsKind()
3674 RelocInfo::CODE_TARGET, instr); in DoTransitionElementsKind()
3682 void LCodeGen::DoStringAdd(LStringAdd* instr) { in DoStringAdd() argument
3683 __ push(ToRegister(instr->left())); in DoStringAdd()
3684 __ push(ToRegister(instr->right())); in DoStringAdd()
3686 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoStringAdd()
3690 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { in DoStringCharCodeAt() argument
3693 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) in DoStringCharCodeAt() argument
3694 : LDeferredCode(codegen), instr_(instr) { } in DoStringCharCodeAt()
3696 virtual LInstruction* instr() { return instr_; } in DoStringCharCodeAt() function in v8::internal::LCodeGen::DoStringCharCodeAt::DeferredStringCharCodeAt
3702 new DeferredStringCharCodeAt(this, instr); in DoStringCharCodeAt()
3704 ToRegister(instr->string()), in DoStringCharCodeAt()
3705 ToRegister(instr->index()), in DoStringCharCodeAt()
3706 ToRegister(instr->result()), in DoStringCharCodeAt()
3712 void LCodeGen::DoDeferredStringCharCodeAt(LStringCharCodeAt* instr) { in DoDeferredStringCharCodeAt() argument
3713 Register string = ToRegister(instr->string()); in DoDeferredStringCharCodeAt()
3714 Register result = ToRegister(instr->result()); in DoDeferredStringCharCodeAt()
3726 if (instr->index()->IsConstantOperand()) { in DoDeferredStringCharCodeAt()
3727 int const_index = ToInteger32(LConstantOperand::cast(instr->index())); in DoDeferredStringCharCodeAt()
3731 Register index = ToRegister(instr->index()); in DoDeferredStringCharCodeAt()
3735 CallRuntimeFromDeferred(Runtime::kStringCharCodeAt, 2, instr); in DoDeferredStringCharCodeAt()
3744 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { in DoStringCharFromCode() argument
3747 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) in DoStringCharFromCode() argument
3748 : LDeferredCode(codegen), instr_(instr) { } in DoStringCharFromCode()
3750 virtual LInstruction* instr() { return instr_; } in DoStringCharFromCode() function in v8::internal::LCodeGen::DoStringCharFromCode::DeferredStringCharFromCode
3756 new DeferredStringCharFromCode(this, instr); in DoStringCharFromCode()
3758 ASSERT(instr->hydrogen()->value()->representation().IsInteger32()); in DoStringCharFromCode()
3759 Register char_code = ToRegister(instr->char_code()); in DoStringCharFromCode()
3760 Register result = ToRegister(instr->result()); in DoStringCharFromCode()
3776 void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) { in DoDeferredStringCharFromCode() argument
3777 Register char_code = ToRegister(instr->char_code()); in DoDeferredStringCharFromCode()
3778 Register result = ToRegister(instr->result()); in DoDeferredStringCharFromCode()
3788 CallRuntimeFromDeferred(Runtime::kCharFromCode, 1, instr); in DoDeferredStringCharFromCode()
3793 void LCodeGen::DoStringLength(LStringLength* instr) { in DoStringLength() argument
3794 Register string = ToRegister(instr->InputAt(0)); in DoStringLength()
3795 Register result = ToRegister(instr->result()); in DoStringLength()
3800 void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { in DoInteger32ToDouble() argument
3801 LOperand* input = instr->InputAt(0); in DoInteger32ToDouble()
3803 LOperand* output = instr->result(); in DoInteger32ToDouble()
3817 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { in DoNumberTagI() argument
3820 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) in DoNumberTagI() argument
3821 : LDeferredCode(codegen), instr_(instr) { } in DoNumberTagI()
3823 virtual LInstruction* instr() { return instr_; } in DoNumberTagI() function in v8::internal::LCodeGen::DoNumberTagI::DeferredNumberTagI
3828 Register src = ToRegister(instr->InputAt(0)); in DoNumberTagI()
3829 Register dst = ToRegister(instr->result()); in DoNumberTagI()
3832 DeferredNumberTagI* deferred = new DeferredNumberTagI(this, instr); in DoNumberTagI()
3839 void LCodeGen::DoDeferredNumberTagI(LNumberTagI* instr) { in DoDeferredNumberTagI() argument
3841 Register src = ToRegister(instr->InputAt(0)); in DoDeferredNumberTagI()
3842 Register dst = ToRegister(instr->result()); in DoDeferredNumberTagI()
3872 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr); in DoDeferredNumberTagI()
3883 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { in DoNumberTagD() argument
3886 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) in DoNumberTagD() argument
3887 : LDeferredCode(codegen), instr_(instr) { } in DoNumberTagD()
3889 virtual LInstruction* instr() { return instr_; } in DoNumberTagD() function in v8::internal::LCodeGen::DoNumberTagD::DeferredNumberTagD
3894 DoubleRegister input_reg = ToDoubleRegister(instr->InputAt(0)); in DoNumberTagD()
3896 Register reg = ToRegister(instr->result()); in DoNumberTagD()
3897 Register temp1 = ToRegister(instr->TempAt(0)); in DoNumberTagD()
3898 Register temp2 = ToRegister(instr->TempAt(1)); in DoNumberTagD()
3900 DeferredNumberTagD* deferred = new DeferredNumberTagD(this, instr); in DoNumberTagD()
3912 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { in DoDeferredNumberTagD() argument
3916 Register reg = ToRegister(instr->result()); in DoDeferredNumberTagD()
3920 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr); in DoDeferredNumberTagD()
3925 void LCodeGen::DoSmiTag(LSmiTag* instr) { in DoSmiTag() argument
3926 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow)); in DoSmiTag()
3927 __ SmiTag(ToRegister(instr->result()), ToRegister(instr->InputAt(0))); in DoSmiTag()
3931 void LCodeGen::DoSmiUntag(LSmiUntag* instr) { in DoSmiUntag() argument
3933 Register input = ToRegister(instr->InputAt(0)); in DoSmiUntag()
3934 Register result = ToRegister(instr->result()); in DoSmiUntag()
3935 if (instr->needs_check()) { in DoSmiUntag()
3940 DeoptimizeIf(ne, instr->environment(), scratch, Operand(zero_reg)); in DoSmiUntag()
3997 void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { in DoDeferredTaggedToI() argument
3998 Register input_reg = ToRegister(instr->InputAt(0)); in DoDeferredTaggedToI()
4000 Register scratch2 = ToRegister(instr->TempAt(0)); in DoDeferredTaggedToI()
4016 if (instr->truncating()) { in DoDeferredTaggedToI()
4017 Register scratch3 = ToRegister(instr->TempAt(1)); in DoDeferredTaggedToI()
4018 DoubleRegister double_scratch2 = ToDoubleRegister(instr->TempAt(2)); in DoDeferredTaggedToI()
4029 DeoptimizeIf(ne, instr->environment(), input_reg, Operand(at)); in DoDeferredTaggedToI()
4030 ASSERT(ToRegister(instr->result()).is(input_reg)); in DoDeferredTaggedToI()
4045 DeoptimizeIf(ne, instr->environment(), scratch1, Operand(at)); in DoDeferredTaggedToI()
4060 DeoptimizeIf(ne, instr->environment(), except_flag, Operand(zero_reg)); in DoDeferredTaggedToI()
4065 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoDeferredTaggedToI()
4070 DeoptimizeIf(ne, instr->environment(), scratch1, Operand(zero_reg)); in DoDeferredTaggedToI()
4077 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { in DoTaggedToI() argument
4080 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) in DoTaggedToI() argument
4081 : LDeferredCode(codegen), instr_(instr) { } in DoTaggedToI()
4083 virtual LInstruction* instr() { return instr_; } in DoTaggedToI() function in v8::internal::LCodeGen::DoTaggedToI::DeferredTaggedToI
4088 LOperand* input = instr->InputAt(0); in DoTaggedToI()
4090 ASSERT(input->Equals(instr->result())); in DoTaggedToI()
4094 DeferredTaggedToI* deferred = new DeferredTaggedToI(this, instr); in DoTaggedToI()
4105 void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) { in DoNumberUntagD() argument
4106 LOperand* input = instr->InputAt(0); in DoNumberUntagD()
4108 LOperand* result = instr->result(); in DoNumberUntagD()
4115 instr->hydrogen()->deoptimize_on_undefined(), in DoNumberUntagD()
4116 instr->hydrogen()->deoptimize_on_minus_zero(), in DoNumberUntagD()
4117 instr->environment()); in DoNumberUntagD()
4121 void LCodeGen::DoDoubleToI(LDoubleToI* instr) { in DoDoubleToI() argument
4122 Register result_reg = ToRegister(instr->result()); in DoDoubleToI()
4124 Register scratch2 = ToRegister(instr->TempAt(0)); in DoDoubleToI()
4125 DoubleRegister double_input = ToDoubleRegister(instr->InputAt(0)); in DoDoubleToI()
4128 if (instr->truncating()) { in DoDoubleToI()
4129 Register scratch3 = ToRegister(instr->TempAt(1)); in DoDoubleToI()
4147 DeoptimizeIf(ne, instr->environment(), except_flag, Operand(zero_reg)); in DoDoubleToI()
4155 void LCodeGen::DoCheckSmi(LCheckSmi* instr) { in DoCheckSmi() argument
4156 LOperand* input = instr->InputAt(0); in DoCheckSmi()
4158 DeoptimizeIf(ne, instr->environment(), at, Operand(zero_reg)); in DoCheckSmi()
4162 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { in DoCheckNonSmi() argument
4163 LOperand* input = instr->InputAt(0); in DoCheckNonSmi()
4165 DeoptimizeIf(eq, instr->environment(), at, Operand(zero_reg)); in DoCheckNonSmi()
4169 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { in DoCheckInstanceType() argument
4170 Register input = ToRegister(instr->InputAt(0)); in DoCheckInstanceType()
4175 if (instr->hydrogen()->is_interval_check()) { in DoCheckInstanceType()
4178 instr->hydrogen()->GetCheckInterval(&first, &last); in DoCheckInstanceType()
4182 DeoptimizeIf(ne, instr->environment(), scratch, Operand(first)); in DoCheckInstanceType()
4184 DeoptimizeIf(lo, instr->environment(), scratch, Operand(first)); in DoCheckInstanceType()
4187 DeoptimizeIf(hi, instr->environment(), scratch, Operand(last)); in DoCheckInstanceType()
4193 instr->hydrogen()->GetCheckMaskAndTag(&mask, &tag); in DoCheckInstanceType()
4198 DeoptimizeIf(tag == 0 ? ne : eq, instr->environment(), in DoCheckInstanceType()
4202 DeoptimizeIf(ne, instr->environment(), scratch, Operand(tag)); in DoCheckInstanceType()
4208 void LCodeGen::DoCheckFunction(LCheckFunction* instr) { in DoCheckFunction() argument
4209 Register reg = ToRegister(instr->value()); in DoCheckFunction()
4210 Handle<JSFunction> target = instr->hydrogen()->target(); in DoCheckFunction()
4212 Register reg = ToRegister(instr->value()); in DoCheckFunction()
4217 DeoptimizeIf(ne, instr->environment(), reg, in DoCheckFunction()
4220 DeoptimizeIf(ne, instr->environment(), reg, in DoCheckFunction()
4238 void LCodeGen::DoCheckMap(LCheckMap* instr) { in DoCheckMap() argument
4240 LOperand* input = instr->InputAt(0); in DoCheckMap()
4243 Handle<Map> map = instr->hydrogen()->map(); in DoCheckMap()
4244 DoCheckMapCommon(reg, scratch, map, instr->hydrogen()->mode(), in DoCheckMap()
4245 instr->environment()); in DoCheckMap()
4249 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { in DoClampDToUint8() argument
4250 DoubleRegister value_reg = ToDoubleRegister(instr->unclamped()); in DoClampDToUint8()
4251 Register result_reg = ToRegister(instr->result()); in DoClampDToUint8()
4252 DoubleRegister temp_reg = ToDoubleRegister(instr->TempAt(0)); in DoClampDToUint8()
4257 void LCodeGen::DoClampIToUint8(LClampIToUint8* instr) { in DoClampIToUint8() argument
4258 Register unclamped_reg = ToRegister(instr->unclamped()); in DoClampIToUint8()
4259 Register result_reg = ToRegister(instr->result()); in DoClampIToUint8()
4264 void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) { in DoClampTToUint8() argument
4266 Register input_reg = ToRegister(instr->unclamped()); in DoClampTToUint8()
4267 Register result_reg = ToRegister(instr->result()); in DoClampTToUint8()
4268 DoubleRegister temp_reg = ToDoubleRegister(instr->TempAt(0)); in DoClampTToUint8()
4280 DeoptimizeIf(ne, instr->environment(), input_reg, in DoClampTToUint8()
4299 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { in DoCheckPrototypeMaps() argument
4300 Register temp1 = ToRegister(instr->TempAt(0)); in DoCheckPrototypeMaps()
4301 Register temp2 = ToRegister(instr->TempAt(1)); in DoCheckPrototypeMaps()
4303 Handle<JSObject> holder = instr->holder(); in DoCheckPrototypeMaps()
4304 Handle<JSObject> current_prototype = instr->prototype(); in DoCheckPrototypeMaps()
4313 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); in DoCheckPrototypeMaps()
4323 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); in DoCheckPrototypeMaps()
4327 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { in DoAllocateObject() argument
4330 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) in DoAllocateObject() argument
4331 : LDeferredCode(codegen), instr_(instr) { } in DoAllocateObject()
4333 virtual LInstruction* instr() { return instr_; } in DoAllocateObject() function in v8::internal::LCodeGen::DoAllocateObject::DeferredAllocateObject
4338 DeferredAllocateObject* deferred = new DeferredAllocateObject(this, instr); in DoAllocateObject()
4340 Register result = ToRegister(instr->result()); in DoAllocateObject()
4341 Register scratch = ToRegister(instr->TempAt(0)); in DoAllocateObject()
4342 Register scratch2 = ToRegister(instr->TempAt(1)); in DoAllocateObject()
4343 Handle<JSFunction> constructor = instr->hydrogen()->constructor(); in DoAllocateObject()
4384 void LCodeGen::DoDeferredAllocateObject(LAllocateObject* instr) { in DoDeferredAllocateObject() argument
4385 Register result = ToRegister(instr->result()); in DoDeferredAllocateObject()
4386 Handle<JSFunction> constructor = instr->hydrogen()->constructor(); in DoDeferredAllocateObject()
4396 CallRuntimeFromDeferred(Runtime::kNewObject, 1, instr); in DoDeferredAllocateObject()
4401 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { in DoArrayLiteral() argument
4404 instr->hydrogen()->boilerplate_elements_kind(); in DoArrayLiteral()
4410 __ LoadHeapObject(a1, instr->hydrogen()->boilerplate_object()); in DoArrayLiteral()
4418 instr->environment(), in DoArrayLiteral()
4424 __ li(a2, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); in DoArrayLiteral()
4431 int length = instr->hydrogen()->length(); in DoArrayLiteral()
4432 if (instr->hydrogen()->IsCopyOnWrite()) { in DoArrayLiteral()
4433 ASSERT(instr->hydrogen()->depth() == 1); in DoArrayLiteral()
4437 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoArrayLiteral()
4438 } else if (instr->hydrogen()->depth() > 1) { in DoArrayLiteral()
4439 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr); in DoArrayLiteral()
4441 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr); in DoArrayLiteral()
4448 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoArrayLiteral()
4556 void LCodeGen::DoFastLiteral(LFastLiteral* instr) { in DoFastLiteral() argument
4557 int size = instr->hydrogen()->total_size(); in DoFastLiteral()
4568 CallRuntime(Runtime::kAllocateInNewSpace, 1, instr); in DoFastLiteral()
4572 __ LoadHeapObject(a1, instr->hydrogen()->boilerplate()); in DoFastLiteral()
4573 EmitDeepCopy(instr->hydrogen()->boilerplate(), v0, a1, &offset); in DoFastLiteral()
4578 void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) { in DoObjectLiteral() argument
4579 ASSERT(ToRegister(instr->result()).is(v0)); in DoObjectLiteral()
4580 Handle<FixedArray> literals(instr->environment()->closure()->literals()); in DoObjectLiteral()
4582 instr->hydrogen()->constant_properties(); in DoObjectLiteral()
4586 __ li(a3, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); in DoObjectLiteral()
4588 int flags = instr->hydrogen()->fast_elements() in DoObjectLiteral()
4596 if (instr->hydrogen()->depth() > 1) { in DoObjectLiteral()
4597 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); in DoObjectLiteral()
4600 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); in DoObjectLiteral()
4603 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoObjectLiteral()
4608 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { in DoToFastProperties() argument
4609 ASSERT(ToRegister(instr->InputAt(0)).is(a0)); in DoToFastProperties()
4610 ASSERT(ToRegister(instr->result()).is(v0)); in DoToFastProperties()
4612 CallRuntime(Runtime::kToFastProperties, 1, instr); in DoToFastProperties()
4616 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { in DoRegExpLiteral() argument
4627 instr->hydrogen()->literal_index() * kPointerSize; in DoRegExpLiteral()
4634 __ li(t2, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); in DoRegExpLiteral()
4635 __ li(t1, Operand(instr->hydrogen()->pattern())); in DoRegExpLiteral()
4636 __ li(t0, Operand(instr->hydrogen()->flags())); in DoRegExpLiteral()
4638 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr); in DoRegExpLiteral()
4651 CallRuntime(Runtime::kAllocateInNewSpace, 1, instr); in DoRegExpLiteral()
4670 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { in DoFunctionLiteral() argument
4673 Handle<SharedFunctionInfo> shared_info = instr->shared_info(); in DoFunctionLiteral()
4674 bool pretenure = instr->hydrogen()->pretenure(); in DoFunctionLiteral()
4679 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoFunctionLiteral()
4686 CallRuntime(Runtime::kNewClosure, 3, instr); in DoFunctionLiteral()
4691 void LCodeGen::DoTypeof(LTypeof* instr) { in DoTypeof() argument
4692 ASSERT(ToRegister(instr->result()).is(v0)); in DoTypeof()
4693 Register input = ToRegister(instr->InputAt(0)); in DoTypeof()
4695 CallRuntime(Runtime::kTypeof, 1, instr); in DoTypeof()
4699 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { in DoTypeofIsAndBranch() argument
4700 Register input = ToRegister(instr->InputAt(0)); in DoTypeofIsAndBranch()
4701 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoTypeofIsAndBranch()
4702 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoTypeofIsAndBranch()
4712 instr->type_literal(), in DoTypeofIsAndBranch()
4826 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { in DoIsConstructCallAndBranch() argument
4827 Register temp1 = ToRegister(instr->TempAt(0)); in DoIsConstructCallAndBranch()
4828 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsConstructCallAndBranch()
4829 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsConstructCallAndBranch()
4873 void LCodeGen::DoLazyBailout(LLazyBailout* instr) { in DoLazyBailout() argument
4875 ASSERT(instr->HasEnvironment()); in DoLazyBailout()
4876 LEnvironment* env = instr->environment(); in DoLazyBailout()
4882 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { in DoDeoptimize() argument
4883 DeoptimizeIf(al, instr->environment(), zero_reg, Operand(zero_reg)); in DoDeoptimize()
4887 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { in DoDeleteProperty() argument
4888 Register object = ToRegister(instr->object()); in DoDeleteProperty()
4889 Register key = ToRegister(instr->key()); in DoDeleteProperty()
4893 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); in DoDeleteProperty()
4894 LPointerMap* pointers = instr->pointer_map(); in DoDeleteProperty()
4902 void LCodeGen::DoIn(LIn* instr) { in DoIn() argument
4903 Register obj = ToRegister(instr->object()); in DoIn()
4904 Register key = ToRegister(instr->key()); in DoIn()
4906 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); in DoIn()
4907 LPointerMap* pointers = instr->pointer_map(); in DoIn()
4914 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) { in DoDeferredStackCheck() argument
4918 instr, RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); in DoDeferredStackCheck()
4919 ASSERT(instr->HasEnvironment()); in DoDeferredStackCheck()
4920 LEnvironment* env = instr->environment(); in DoDeferredStackCheck()
4925 void LCodeGen::DoStackCheck(LStackCheck* instr) { in DoStackCheck() argument
4928 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr) in DoStackCheck() argument
4929 : LDeferredCode(codegen), instr_(instr) { } in DoStackCheck()
4931 virtual LInstruction* instr() { return instr_; } in DoStackCheck() function in v8::internal::LCodeGen::DoStackCheck::DeferredStackCheck
4936 ASSERT(instr->HasEnvironment()); in DoStackCheck()
4937 LEnvironment* env = instr->environment(); in DoStackCheck()
4940 if (instr->hydrogen()->is_function_entry()) { in DoStackCheck()
4946 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoStackCheck()
4952 ASSERT(instr->hydrogen()->is_backwards_branch()); in DoStackCheck()
4955 new DeferredStackCheck(this, instr); in DoStackCheck()
4959 __ bind(instr->done_label()); in DoStackCheck()
4960 deferred_stack_check->SetExit(instr->done_label()); in DoStackCheck()
4969 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { in DoOsrEntry() argument
4973 LEnvironment* environment = instr->environment(); in DoOsrEntry()
4974 environment->SetSpilledRegisters(instr->SpilledRegisterArray(), in DoOsrEntry()
4975 instr->SpilledDoubleRegisterArray()); in DoOsrEntry()
4986 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { in DoForInPrepareMap() argument
4987 Register result = ToRegister(instr->result()); in DoForInPrepareMap()
4988 Register object = ToRegister(instr->object()); in DoForInPrepareMap()
4990 DeoptimizeIf(eq, instr->environment(), object, Operand(at)); in DoForInPrepareMap()
4994 DeoptimizeIf(eq, instr->environment(), object, Operand(null_value)); in DoForInPrepareMap()
4997 DeoptimizeIf(eq, instr->environment(), at, Operand(zero_reg)); in DoForInPrepareMap()
5001 DeoptimizeIf(le, instr->environment(), a1, Operand(LAST_JS_PROXY_TYPE)); in DoForInPrepareMap()
5013 CallRuntime(Runtime::kGetPropertyNamesFast, 1, instr); in DoForInPrepareMap()
5018 DeoptimizeIf(ne, instr->environment(), a1, Operand(at)); in DoForInPrepareMap()
5023 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { in DoForInCacheArray() argument
5024 Register map = ToRegister(instr->map()); in DoForInCacheArray()
5025 Register result = ToRegister(instr->result()); in DoForInCacheArray()
5030 FieldMemOperand(result, FixedArray::SizeFor(instr->idx()))); in DoForInCacheArray()
5031 DeoptimizeIf(eq, instr->environment(), result, Operand(zero_reg)); in DoForInCacheArray()
5035 void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) { in DoCheckMapValue() argument
5036 Register object = ToRegister(instr->value()); in DoCheckMapValue()
5037 Register map = ToRegister(instr->map()); in DoCheckMapValue()
5039 DeoptimizeIf(ne, instr->environment(), map, Operand(scratch0())); in DoCheckMapValue()
5043 void LCodeGen::DoLoadFieldByIndex(LLoadFieldByIndex* instr) { in DoLoadFieldByIndex() argument
5044 Register object = ToRegister(instr->object()); in DoLoadFieldByIndex()
5045 Register index = ToRegister(instr->index()); in DoLoadFieldByIndex()
5046 Register result = ToRegister(instr->result()); in DoLoadFieldByIndex()