Lines Matching refs:instr
235 LInstruction* instr = instructions_->at(current_instruction_); in GenerateBody() local
236 if (instr->IsLabel()) { in GenerateBody()
237 LLabel* label = LLabel::cast(instr); in GenerateBody()
242 Comment(";;; @%d: %s.", current_instruction_, instr->Mnemonic()); in GenerateBody()
243 instr->CompileToNative(this); in GenerateBody()
268 code->instr()->Mnemonic()); in GenerateDeferredCode()
453 LInstruction* instr, in CallCodeGeneric() argument
457 ASSERT(instr != NULL); in CallCodeGeneric()
458 LPointerMap* pointers = instr->pointer_map(); in CallCodeGeneric()
461 RecordSafepointWithLazyDeopt(instr, safepoint_mode, argc); in CallCodeGeneric()
474 LInstruction* instr) { in CallCode() argument
475 CallCodeGeneric(code, mode, instr, RECORD_SIMPLE_SAFEPOINT, 0); in CallCode()
481 LInstruction* instr) { in CallRuntime() argument
482 ASSERT(instr != NULL); in CallRuntime()
483 ASSERT(instr->HasPointerMap()); in CallRuntime()
484 LPointerMap* pointers = instr->pointer_map(); in CallRuntime()
488 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT, 0); in CallRuntime()
494 LInstruction* instr) { in CallRuntimeFromDeferred() argument
498 instr->pointer_map(), argc, Safepoint::kNoLazyDeopt); in CallRuntimeFromDeferred()
622 LInstruction* instr, SafepointMode safepoint_mode, int argc) { in RecordSafepointWithLazyDeopt() argument
624 RecordSafepoint(instr->pointer_map(), Safepoint::kLazyDeopt); in RecordSafepointWithLazyDeopt()
628 instr->pointer_map(), argc, Safepoint::kLazyDeopt); in RecordSafepointWithLazyDeopt()
712 void LCodeGen::DoInstructionGap(LInstructionGap* instr) { in DoInstructionGap() argument
713 DoGap(instr); in DoInstructionGap()
717 void LCodeGen::DoParameter(LParameter* instr) { in DoParameter() argument
722 void LCodeGen::DoCallStub(LCallStub* instr) { in DoCallStub() argument
723 ASSERT(ToRegister(instr->result()).is(rax)); in DoCallStub()
724 switch (instr->hydrogen()->major_key()) { in DoCallStub()
727 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
732 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
737 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
742 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
747 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
752 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
756 TranscendentalCacheStub stub(instr->transcendental_type(), in DoCallStub()
758 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
767 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { in DoUnknownOSRValue() argument
772 void LCodeGen::DoModI(LModI* instr) { in DoModI() argument
773 if (instr->hydrogen()->HasPowerOf2Divisor()) { in DoModI()
774 Register dividend = ToRegister(instr->InputAt(0)); in DoModI()
777 HConstant::cast(instr->hydrogen()->right())->Integer32Value(); in DoModI()
787 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoModI()
789 DeoptimizeIf(no_condition, instr->environment()); in DoModI()
798 Register left_reg = ToRegister(instr->InputAt(0)); in DoModI()
799 Register right_reg = ToRegister(instr->InputAt(1)); in DoModI()
800 Register result_reg = ToRegister(instr->result()); in DoModI()
808 if (instr->hydrogen()->CheckFlag(HValue::kCanBeDivByZero)) { in DoModI()
810 DeoptimizeIf(zero, instr->environment()); in DoModI()
829 Register scratch = ToRegister(instr->TempAt(0)); in DoModI()
857 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoModI()
868 DeoptimizeIf(no_condition, instr->environment()); in DoModI()
885 void LCodeGen::DoDivI(LDivI* instr) { in DoDivI() argument
886 LOperand* right = instr->InputAt(1); in DoDivI()
887 ASSERT(ToRegister(instr->result()).is(rax)); in DoDivI()
888 ASSERT(ToRegister(instr->InputAt(0)).is(rax)); in DoDivI()
889 ASSERT(!ToRegister(instr->InputAt(1)).is(rax)); in DoDivI()
890 ASSERT(!ToRegister(instr->InputAt(1)).is(rdx)); in DoDivI()
896 if (instr->hydrogen()->CheckFlag(HValue::kCanBeDivByZero)) { in DoDivI()
898 DeoptimizeIf(zero, instr->environment()); in DoDivI()
902 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoDivI()
907 DeoptimizeIf(sign, instr->environment()); in DoDivI()
912 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { in DoDivI()
917 DeoptimizeIf(zero, instr->environment()); in DoDivI()
927 DeoptimizeIf(not_zero, instr->environment()); in DoDivI()
931 void LCodeGen::DoMulI(LMulI* instr) { in DoMulI() argument
932 Register left = ToRegister(instr->InputAt(0)); in DoMulI()
933 LOperand* right = instr->InputAt(1); in DoMulI()
935 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoMulI()
940 instr->hydrogen()->CheckFlag(HValue::kCanOverflow); in DoMulI()
989 DeoptimizeIf(overflow, instr->environment()); in DoMulI()
992 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoMulI()
999 DeoptimizeIf(no_condition, instr->environment()); in DoMulI()
1003 DeoptimizeIf(sign, instr->environment()); in DoMulI()
1007 DeoptimizeIf(sign, instr->environment()); in DoMulI()
1014 void LCodeGen::DoBitI(LBitI* instr) { in DoBitI() argument
1015 LOperand* left = instr->InputAt(0); in DoBitI()
1016 LOperand* right = instr->InputAt(1); in DoBitI()
1017 ASSERT(left->Equals(instr->result())); in DoBitI()
1022 switch (instr->op()) { in DoBitI()
1037 switch (instr->op()) { in DoBitI()
1053 switch (instr->op()) { in DoBitI()
1071 void LCodeGen::DoShiftI(LShiftI* instr) { in DoShiftI() argument
1072 LOperand* left = instr->InputAt(0); in DoShiftI()
1073 LOperand* right = instr->InputAt(1); in DoShiftI()
1074 ASSERT(left->Equals(instr->result())); in DoShiftI()
1079 switch (instr->op()) { in DoShiftI()
1085 if (instr->can_deopt()) { in DoShiftI()
1087 DeoptimizeIf(negative, instr->environment()); in DoShiftI()
1100 switch (instr->op()) { in DoShiftI()
1107 if (shift_count == 0 && instr->can_deopt()) { in DoShiftI()
1109 DeoptimizeIf(negative, instr->environment()); in DoShiftI()
1127 void LCodeGen::DoSubI(LSubI* instr) { in DoSubI() argument
1128 LOperand* left = instr->InputAt(0); in DoSubI()
1129 LOperand* right = instr->InputAt(1); in DoSubI()
1130 ASSERT(left->Equals(instr->result())); in DoSubI()
1141 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { in DoSubI()
1142 DeoptimizeIf(overflow, instr->environment()); in DoSubI()
1147 void LCodeGen::DoConstantI(LConstantI* instr) { in DoConstantI() argument
1148 ASSERT(instr->result()->IsRegister()); in DoConstantI()
1149 __ Set(ToRegister(instr->result()), instr->value()); in DoConstantI()
1153 void LCodeGen::DoConstantD(LConstantD* instr) { in DoConstantD() argument
1154 ASSERT(instr->result()->IsDoubleRegister()); in DoConstantD()
1155 XMMRegister res = ToDoubleRegister(instr->result()); in DoConstantD()
1156 double v = instr->value(); in DoConstantD()
1163 Register tmp = ToRegister(instr->TempAt(0)); in DoConstantD()
1170 void LCodeGen::DoConstantT(LConstantT* instr) { in DoConstantT() argument
1171 Handle<Object> value = instr->value(); in DoConstantT()
1173 __ Move(ToRegister(instr->result()), value); in DoConstantT()
1175 __ LoadHeapObject(ToRegister(instr->result()), in DoConstantT()
1181 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { in DoJSArrayLength() argument
1182 Register result = ToRegister(instr->result()); in DoJSArrayLength()
1183 Register array = ToRegister(instr->InputAt(0)); in DoJSArrayLength()
1188 void LCodeGen::DoFixedArrayBaseLength(LFixedArrayBaseLength* instr) { in DoFixedArrayBaseLength() argument
1189 Register result = ToRegister(instr->result()); in DoFixedArrayBaseLength()
1190 Register array = ToRegister(instr->InputAt(0)); in DoFixedArrayBaseLength()
1195 void LCodeGen::DoElementsKind(LElementsKind* instr) { in DoElementsKind() argument
1196 Register result = ToRegister(instr->result()); in DoElementsKind()
1197 Register input = ToRegister(instr->InputAt(0)); in DoElementsKind()
1209 void LCodeGen::DoValueOf(LValueOf* instr) { in DoValueOf() argument
1210 Register input = ToRegister(instr->InputAt(0)); in DoValueOf()
1211 Register result = ToRegister(instr->result()); in DoValueOf()
1226 void LCodeGen::DoDateField(LDateField* instr) { in DoDateField() argument
1227 Register object = ToRegister(instr->InputAt(0)); in DoDateField()
1228 Register result = ToRegister(instr->result()); in DoDateField()
1229 Smi* index = instr->index(); in DoDateField()
1269 void LCodeGen::DoBitNotI(LBitNotI* instr) { in DoBitNotI() argument
1270 LOperand* input = instr->InputAt(0); in DoBitNotI()
1271 ASSERT(input->Equals(instr->result())); in DoBitNotI()
1276 void LCodeGen::DoThrow(LThrow* instr) { in DoThrow() argument
1277 __ push(ToRegister(instr->InputAt(0))); in DoThrow()
1278 CallRuntime(Runtime::kThrow, 1, instr); in DoThrow()
1287 void LCodeGen::DoAddI(LAddI* instr) { in DoAddI() argument
1288 LOperand* left = instr->InputAt(0); in DoAddI()
1289 LOperand* right = instr->InputAt(1); in DoAddI()
1290 ASSERT(left->Equals(instr->result())); in DoAddI()
1301 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { in DoAddI()
1302 DeoptimizeIf(overflow, instr->environment()); in DoAddI()
1307 void LCodeGen::DoArithmeticD(LArithmeticD* instr) { in DoArithmeticD() argument
1308 XMMRegister left = ToDoubleRegister(instr->InputAt(0)); in DoArithmeticD()
1309 XMMRegister right = ToDoubleRegister(instr->InputAt(1)); in DoArithmeticD()
1310 XMMRegister result = ToDoubleRegister(instr->result()); in DoArithmeticD()
1312 ASSERT(instr->op() == Token::MOD || left.is(result)); in DoArithmeticD()
1313 switch (instr->op()) { in DoArithmeticD()
1342 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { in DoArithmeticT() argument
1343 ASSERT(ToRegister(instr->InputAt(0)).is(rdx)); in DoArithmeticT()
1344 ASSERT(ToRegister(instr->InputAt(1)).is(rax)); in DoArithmeticT()
1345 ASSERT(ToRegister(instr->result()).is(rax)); in DoArithmeticT()
1347 BinaryOpStub stub(instr->op(), NO_OVERWRITE); in DoArithmeticT()
1348 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoArithmeticT()
1382 void LCodeGen::DoBranch(LBranch* instr) { in DoBranch() argument
1383 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoBranch()
1384 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoBranch()
1386 Representation r = instr->hydrogen()->value()->representation(); in DoBranch()
1388 Register reg = ToRegister(instr->InputAt(0)); in DoBranch()
1392 XMMRegister reg = ToDoubleRegister(instr->InputAt(0)); in DoBranch()
1398 Register reg = ToRegister(instr->InputAt(0)); in DoBranch()
1399 HType type = instr->hydrogen()->value()->type(); in DoBranch()
1410 ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types(); in DoBranch()
1441 DeoptimizeIf(zero, instr->environment()); in DoBranch()
1486 DeoptimizeIf(no_condition, instr->environment()); in DoBranch()
1501 void LCodeGen::DoGoto(LGoto* instr) { in DoGoto() argument
1502 EmitGoto(instr->block_id()); in DoGoto()
1534 void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) { in DoCmpIDAndBranch() argument
1535 LOperand* left = instr->InputAt(0); in DoCmpIDAndBranch()
1536 LOperand* right = instr->InputAt(1); in DoCmpIDAndBranch()
1537 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoCmpIDAndBranch()
1538 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoCmpIDAndBranch()
1539 Condition cc = TokenToCondition(instr->op(), instr->is_double()); in DoCmpIDAndBranch()
1546 EvalComparison(instr->op(), left_val, right_val) ? true_block in DoCmpIDAndBranch()
1550 if (instr->is_double()) { in DoCmpIDAndBranch()
1582 void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { in DoCmpObjectEqAndBranch() argument
1583 Register left = ToRegister(instr->InputAt(0)); in DoCmpObjectEqAndBranch()
1584 Register right = ToRegister(instr->InputAt(1)); in DoCmpObjectEqAndBranch()
1585 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoCmpObjectEqAndBranch()
1586 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoCmpObjectEqAndBranch()
1593 void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { in DoCmpConstantEqAndBranch() argument
1594 Register left = ToRegister(instr->InputAt(0)); in DoCmpConstantEqAndBranch()
1595 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoCmpConstantEqAndBranch()
1596 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoCmpConstantEqAndBranch()
1598 __ cmpq(left, Immediate(instr->hydrogen()->right())); in DoCmpConstantEqAndBranch()
1603 void LCodeGen::DoIsNilAndBranch(LIsNilAndBranch* instr) { in DoIsNilAndBranch() argument
1604 Register reg = ToRegister(instr->InputAt(0)); in DoIsNilAndBranch()
1605 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsNilAndBranch()
1609 if (instr->hydrogen()->representation().IsSpecialization() || in DoIsNilAndBranch()
1610 instr->hydrogen()->type().IsSmi()) { in DoIsNilAndBranch()
1615 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsNilAndBranch()
1616 Heap::RootListIndex nil_value = instr->nil() == kNullValue ? in DoIsNilAndBranch()
1620 if (instr->kind() == kStrictEquality) { in DoIsNilAndBranch()
1623 Heap::RootListIndex other_nil_value = instr->nil() == kNullValue ? in DoIsNilAndBranch()
1634 Register scratch = ToRegister(instr->TempAt(0)); in DoIsNilAndBranch()
1668 void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { in DoIsObjectAndBranch() argument
1669 Register reg = ToRegister(instr->InputAt(0)); in DoIsObjectAndBranch()
1671 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsObjectAndBranch()
1672 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsObjectAndBranch()
1692 void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { in DoIsStringAndBranch() argument
1693 Register reg = ToRegister(instr->InputAt(0)); in DoIsStringAndBranch()
1694 Register temp = ToRegister(instr->TempAt(0)); in DoIsStringAndBranch()
1696 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsStringAndBranch()
1697 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsStringAndBranch()
1706 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { in DoIsSmiAndBranch() argument
1707 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsSmiAndBranch()
1708 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsSmiAndBranch()
1711 if (instr->InputAt(0)->IsRegister()) { in DoIsSmiAndBranch()
1712 Register input = ToRegister(instr->InputAt(0)); in DoIsSmiAndBranch()
1715 Operand input = ToOperand(instr->InputAt(0)); in DoIsSmiAndBranch()
1722 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { in DoIsUndetectableAndBranch() argument
1723 Register input = ToRegister(instr->InputAt(0)); in DoIsUndetectableAndBranch()
1724 Register temp = ToRegister(instr->TempAt(0)); in DoIsUndetectableAndBranch()
1726 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsUndetectableAndBranch()
1727 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsUndetectableAndBranch()
1737 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { in DoStringCompareAndBranch() argument
1738 Token::Value op = instr->op(); in DoStringCompareAndBranch()
1739 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoStringCompareAndBranch()
1740 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoStringCompareAndBranch()
1743 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoStringCompareAndBranch()
1752 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { in TestType() argument
1753 InstanceType from = instr->from(); in TestType()
1754 InstanceType to = instr->to(); in TestType()
1761 static Condition BranchCondition(HHasInstanceTypeAndBranch* instr) { in BranchCondition() argument
1762 InstanceType from = instr->from(); in BranchCondition()
1763 InstanceType to = instr->to(); in BranchCondition()
1772 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { in DoHasInstanceTypeAndBranch() argument
1773 Register input = ToRegister(instr->InputAt(0)); in DoHasInstanceTypeAndBranch()
1775 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoHasInstanceTypeAndBranch()
1776 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoHasInstanceTypeAndBranch()
1782 __ CmpObjectType(input, TestType(instr->hydrogen()), kScratchRegister); in DoHasInstanceTypeAndBranch()
1783 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen())); in DoHasInstanceTypeAndBranch()
1787 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { in DoGetCachedArrayIndex() argument
1788 Register input = ToRegister(instr->InputAt(0)); in DoGetCachedArrayIndex()
1789 Register result = ToRegister(instr->result()); in DoGetCachedArrayIndex()
1802 LHasCachedArrayIndexAndBranch* instr) { in DoHasCachedArrayIndexAndBranch() argument
1803 Register input = ToRegister(instr->InputAt(0)); in DoHasCachedArrayIndexAndBranch()
1805 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoHasCachedArrayIndexAndBranch()
1806 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoHasCachedArrayIndexAndBranch()
1882 void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) { in DoClassOfTestAndBranch() argument
1883 Register input = ToRegister(instr->InputAt(0)); in DoClassOfTestAndBranch()
1884 Register temp = ToRegister(instr->TempAt(0)); in DoClassOfTestAndBranch()
1885 Register temp2 = ToRegister(instr->TempAt(1)); in DoClassOfTestAndBranch()
1886 Handle<String> class_name = instr->hydrogen()->class_name(); in DoClassOfTestAndBranch()
1888 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoClassOfTestAndBranch()
1889 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoClassOfTestAndBranch()
1900 void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) { in DoCmpMapAndBranch() argument
1901 Register reg = ToRegister(instr->InputAt(0)); in DoCmpMapAndBranch()
1902 int true_block = instr->true_block_id(); in DoCmpMapAndBranch()
1903 int false_block = instr->false_block_id(); in DoCmpMapAndBranch()
1905 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), instr->map()); in DoCmpMapAndBranch()
1910 void LCodeGen::DoInstanceOf(LInstanceOf* instr) { in DoInstanceOf() argument
1912 __ push(ToRegister(instr->InputAt(0))); in DoInstanceOf()
1913 __ push(ToRegister(instr->InputAt(1))); in DoInstanceOf()
1914 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoInstanceOf()
1918 __ LoadRoot(ToRegister(instr->result()), Heap::kFalseValueRootIndex); in DoInstanceOf()
1921 __ LoadRoot(ToRegister(instr->result()), Heap::kTrueValueRootIndex); in DoInstanceOf()
1926 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { in DoInstanceOfKnownGlobal() argument
1930 LInstanceOfKnownGlobal* instr) in DoInstanceOfKnownGlobal() argument
1931 : LDeferredCode(codegen), instr_(instr) { } in DoInstanceOfKnownGlobal()
1935 virtual LInstruction* instr() { return instr_; } in DoInstanceOfKnownGlobal() function in v8::internal::LCodeGen::DoInstanceOfKnownGlobal::DeferredInstanceOfKnownGlobal
1944 deferred = new DeferredInstanceOfKnownGlobal(this, instr); in DoInstanceOfKnownGlobal()
1947 Register object = ToRegister(instr->InputAt(0)); in DoInstanceOfKnownGlobal()
1957 Register map = ToRegister(instr->TempAt(0)); in DoInstanceOfKnownGlobal()
1966 __ LoadRoot(ToRegister(instr->result()), Heap::kTheHoleValueRootIndex); in DoInstanceOfKnownGlobal()
1985 __ LoadRoot(ToRegister(instr->result()), Heap::kFalseValueRootIndex); in DoInstanceOfKnownGlobal()
1992 void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, in DoDeferredInstanceOfKnownGlobal() argument
2000 __ push(ToRegister(instr->InputAt(0))); in DoDeferredInstanceOfKnownGlobal()
2001 __ PushHeapObject(instr->function()); in DoDeferredInstanceOfKnownGlobal()
2015 instr, in DoDeferredInstanceOfKnownGlobal()
2019 ASSERT(instr->HasDeoptimizationEnvironment()); in DoDeferredInstanceOfKnownGlobal()
2020 LEnvironment* env = instr->deoptimization_environment(); in DoDeferredInstanceOfKnownGlobal()
2038 void LCodeGen::DoCmpT(LCmpT* instr) { in DoCmpT() argument
2039 Token::Value op = instr->op(); in DoCmpT()
2042 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoCmpT()
2048 __ LoadRoot(ToRegister(instr->result()), Heap::kFalseValueRootIndex); in DoCmpT()
2051 __ LoadRoot(ToRegister(instr->result()), Heap::kTrueValueRootIndex); in DoCmpT()
2056 void LCodeGen::DoReturn(LReturn* instr) { in DoReturn() argument
2069 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { in DoLoadGlobalCell() argument
2070 Register result = ToRegister(instr->result()); in DoLoadGlobalCell()
2071 __ LoadGlobalCell(result, instr->hydrogen()->cell()); in DoLoadGlobalCell()
2072 if (instr->hydrogen()->RequiresHoleCheck()) { in DoLoadGlobalCell()
2074 DeoptimizeIf(equal, instr->environment()); in DoLoadGlobalCell()
2079 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { in DoLoadGlobalGeneric() argument
2080 ASSERT(ToRegister(instr->global_object()).is(rax)); in DoLoadGlobalGeneric()
2081 ASSERT(ToRegister(instr->result()).is(rax)); in DoLoadGlobalGeneric()
2083 __ Move(rcx, instr->name()); in DoLoadGlobalGeneric()
2084 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET : in DoLoadGlobalGeneric()
2087 CallCode(ic, mode, instr); in DoLoadGlobalGeneric()
2091 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { in DoStoreGlobalCell() argument
2092 Register value = ToRegister(instr->value()); in DoStoreGlobalCell()
2093 Handle<JSGlobalPropertyCell> cell_handle = instr->hydrogen()->cell(); in DoStoreGlobalCell()
2099 if (instr->hydrogen()->RequiresHoleCheck()) { in DoStoreGlobalCell()
2101 Register cell = ToRegister(instr->TempAt(0)); in DoStoreGlobalCell()
2105 DeoptimizeIf(equal, instr->environment()); in DoStoreGlobalCell()
2117 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { in DoStoreGlobalGeneric() argument
2118 ASSERT(ToRegister(instr->global_object()).is(rdx)); in DoStoreGlobalGeneric()
2119 ASSERT(ToRegister(instr->value()).is(rax)); in DoStoreGlobalGeneric()
2121 __ Move(rcx, instr->name()); in DoStoreGlobalGeneric()
2122 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) in DoStoreGlobalGeneric()
2125 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); in DoStoreGlobalGeneric()
2129 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { in DoLoadContextSlot() argument
2130 Register context = ToRegister(instr->context()); in DoLoadContextSlot()
2131 Register result = ToRegister(instr->result()); in DoLoadContextSlot()
2132 __ movq(result, ContextOperand(context, instr->slot_index())); in DoLoadContextSlot()
2133 if (instr->hydrogen()->RequiresHoleCheck()) { in DoLoadContextSlot()
2135 if (instr->hydrogen()->DeoptimizesOnHole()) { in DoLoadContextSlot()
2136 DeoptimizeIf(equal, instr->environment()); in DoLoadContextSlot()
2147 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { in DoStoreContextSlot() argument
2148 Register context = ToRegister(instr->context()); in DoStoreContextSlot()
2149 Register value = ToRegister(instr->value()); in DoStoreContextSlot()
2151 Operand target = ContextOperand(context, instr->slot_index()); in DoStoreContextSlot()
2154 if (instr->hydrogen()->RequiresHoleCheck()) { in DoStoreContextSlot()
2156 if (instr->hydrogen()->DeoptimizesOnHole()) { in DoStoreContextSlot()
2157 DeoptimizeIf(equal, instr->environment()); in DoStoreContextSlot()
2164 if (instr->hydrogen()->NeedsWriteBarrier()) { in DoStoreContextSlot()
2165 HType type = instr->hydrogen()->value()->type(); in DoStoreContextSlot()
2168 int offset = Context::SlotOffset(instr->slot_index()); in DoStoreContextSlot()
2169 Register scratch = ToRegister(instr->TempAt(0)); in DoStoreContextSlot()
2183 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { in DoLoadNamedField() argument
2184 Register object = ToRegister(instr->InputAt(0)); in DoLoadNamedField()
2185 Register result = ToRegister(instr->result()); in DoLoadNamedField()
2186 if (instr->hydrogen()->is_in_object()) { in DoLoadNamedField()
2187 __ movq(result, FieldOperand(object, instr->hydrogen()->offset())); in DoLoadNamedField()
2190 __ movq(result, FieldOperand(result, instr->hydrogen()->offset())); in DoLoadNamedField()
2222 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { in DoLoadNamedFieldPolymorphic() argument
2223 Register object = ToRegister(instr->object()); in DoLoadNamedFieldPolymorphic()
2224 Register result = ToRegister(instr->result()); in DoLoadNamedFieldPolymorphic()
2226 int map_count = instr->hydrogen()->types()->length(); in DoLoadNamedFieldPolymorphic()
2227 Handle<String> name = instr->hydrogen()->name(); in DoLoadNamedFieldPolymorphic()
2230 ASSERT(instr->hydrogen()->need_generic()); in DoLoadNamedFieldPolymorphic()
2231 __ Move(rcx, instr->hydrogen()->name()); in DoLoadNamedFieldPolymorphic()
2233 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoLoadNamedFieldPolymorphic()
2237 Handle<Map> map = instr->hydrogen()->types()->at(i); in DoLoadNamedFieldPolymorphic()
2245 Handle<Map> map = instr->hydrogen()->types()->last(); in DoLoadNamedFieldPolymorphic()
2247 if (instr->hydrogen()->need_generic()) { in DoLoadNamedFieldPolymorphic()
2253 __ Move(rcx, instr->hydrogen()->name()); in DoLoadNamedFieldPolymorphic()
2255 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoLoadNamedFieldPolymorphic()
2257 DeoptimizeIf(not_equal, instr->environment()); in DoLoadNamedFieldPolymorphic()
2265 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { in DoLoadNamedGeneric() argument
2266 ASSERT(ToRegister(instr->object()).is(rax)); in DoLoadNamedGeneric()
2267 ASSERT(ToRegister(instr->result()).is(rax)); in DoLoadNamedGeneric()
2269 __ Move(rcx, instr->name()); in DoLoadNamedGeneric()
2271 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoLoadNamedGeneric()
2275 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { in DoLoadFunctionPrototype() argument
2276 Register function = ToRegister(instr->function()); in DoLoadFunctionPrototype()
2277 Register result = ToRegister(instr->result()); in DoLoadFunctionPrototype()
2281 DeoptimizeIf(not_equal, instr->environment()); in DoLoadFunctionPrototype()
2295 DeoptimizeIf(equal, instr->environment()); in DoLoadFunctionPrototype()
2316 void LCodeGen::DoLoadElements(LLoadElements* instr) { in DoLoadElements() argument
2317 Register result = ToRegister(instr->result()); in DoLoadElements()
2318 Register input = ToRegister(instr->InputAt(0)); in DoLoadElements()
2350 LLoadExternalArrayPointer* instr) { in DoLoadExternalArrayPointer() argument
2351 Register result = ToRegister(instr->result()); in DoLoadExternalArrayPointer()
2352 Register input = ToRegister(instr->InputAt(0)); in DoLoadExternalArrayPointer()
2358 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { in DoAccessArgumentsAt() argument
2359 Register arguments = ToRegister(instr->arguments()); in DoAccessArgumentsAt()
2360 Register length = ToRegister(instr->length()); in DoAccessArgumentsAt()
2361 Register result = ToRegister(instr->result()); in DoAccessArgumentsAt()
2363 if (instr->index()->IsRegister()) { in DoAccessArgumentsAt()
2364 __ subl(length, ToRegister(instr->index())); in DoAccessArgumentsAt()
2366 __ subl(length, ToOperand(instr->index())); in DoAccessArgumentsAt()
2368 DeoptimizeIf(below_equal, instr->environment()); in DoAccessArgumentsAt()
2376 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { in DoLoadKeyedFastElement() argument
2377 Register result = ToRegister(instr->result()); in DoLoadKeyedFastElement()
2381 BuildFastArrayOperand(instr->elements(), instr->key(), in DoLoadKeyedFastElement()
2386 if (instr->hydrogen()->RequiresHoleCheck()) { in DoLoadKeyedFastElement()
2388 DeoptimizeIf(equal, instr->environment()); in DoLoadKeyedFastElement()
2394 LLoadKeyedFastDoubleElement* instr) { in DoLoadKeyedFastDoubleElement() argument
2395 XMMRegister result(ToDoubleRegister(instr->result())); in DoLoadKeyedFastDoubleElement()
2400 instr->elements(), in DoLoadKeyedFastDoubleElement()
2401 instr->key(), in DoLoadKeyedFastDoubleElement()
2405 DeoptimizeIf(equal, instr->environment()); in DoLoadKeyedFastDoubleElement()
2408 instr->elements(), instr->key(), FAST_DOUBLE_ELEMENTS, in DoLoadKeyedFastDoubleElement()
2437 LLoadKeyedSpecializedArrayElement* instr) { in DoLoadKeyedSpecializedArrayElement() argument
2438 ElementsKind elements_kind = instr->elements_kind(); in DoLoadKeyedSpecializedArrayElement()
2439 Operand operand(BuildFastArrayOperand(instr->external_pointer(), in DoLoadKeyedSpecializedArrayElement()
2440 instr->key(), elements_kind, 0)); in DoLoadKeyedSpecializedArrayElement()
2442 XMMRegister result(ToDoubleRegister(instr->result())); in DoLoadKeyedSpecializedArrayElement()
2446 __ movsd(ToDoubleRegister(instr->result()), operand); in DoLoadKeyedSpecializedArrayElement()
2448 Register result(ToRegister(instr->result())); in DoLoadKeyedSpecializedArrayElement()
2472 DeoptimizeIf(negative, instr->environment()); in DoLoadKeyedSpecializedArrayElement()
2488 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { in DoLoadKeyedGeneric() argument
2489 ASSERT(ToRegister(instr->object()).is(rdx)); in DoLoadKeyedGeneric()
2490 ASSERT(ToRegister(instr->key()).is(rax)); in DoLoadKeyedGeneric()
2493 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoLoadKeyedGeneric()
2497 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { in DoArgumentsElements() argument
2498 Register result = ToRegister(instr->result()); in DoArgumentsElements()
2521 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { in DoArgumentsLength() argument
2522 Register result = ToRegister(instr->result()); in DoArgumentsLength()
2527 if (instr->InputAt(0)->IsRegister()) { in DoArgumentsLength()
2528 __ cmpq(rbp, ToRegister(instr->InputAt(0))); in DoArgumentsLength()
2530 __ cmpq(rbp, ToOperand(instr->InputAt(0))); in DoArgumentsLength()
2546 void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) { in DoWrapReceiver() argument
2547 Register receiver = ToRegister(instr->receiver()); in DoWrapReceiver()
2548 Register function = ToRegister(instr->function()); in DoWrapReceiver()
2578 DeoptimizeIf(is_smi, instr->environment()); in DoWrapReceiver()
2580 DeoptimizeIf(below, instr->environment()); in DoWrapReceiver()
2594 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { in DoApplyArguments() argument
2595 Register receiver = ToRegister(instr->receiver()); in DoApplyArguments()
2596 Register function = ToRegister(instr->function()); in DoApplyArguments()
2597 Register length = ToRegister(instr->length()); in DoApplyArguments()
2598 Register elements = ToRegister(instr->elements()); in DoApplyArguments()
2601 ASSERT(ToRegister(instr->result()).is(rax)); in DoApplyArguments()
2607 DeoptimizeIf(above, instr->environment()); in DoApplyArguments()
2625 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); in DoApplyArguments()
2626 LPointerMap* pointers = instr->pointer_map(); in DoApplyArguments()
2637 void LCodeGen::DoPushArgument(LPushArgument* instr) { in DoPushArgument() argument
2638 LOperand* argument = instr->InputAt(0); in DoPushArgument()
2643 void LCodeGen::DoThisFunction(LThisFunction* instr) { in DoThisFunction() argument
2644 Register result = ToRegister(instr->result()); in DoThisFunction()
2645 __ LoadHeapObject(result, instr->hydrogen()->closure()); in DoThisFunction()
2649 void LCodeGen::DoContext(LContext* instr) { in DoContext() argument
2650 Register result = ToRegister(instr->result()); in DoContext()
2655 void LCodeGen::DoOuterContext(LOuterContext* instr) { in DoOuterContext() argument
2656 Register context = ToRegister(instr->context()); in DoOuterContext()
2657 Register result = ToRegister(instr->result()); in DoOuterContext()
2663 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { in DoDeclareGlobals() argument
2665 __ PushHeapObject(instr->hydrogen()->pairs()); in DoDeclareGlobals()
2666 __ Push(Smi::FromInt(instr->hydrogen()->flags())); in DoDeclareGlobals()
2667 CallRuntime(Runtime::kDeclareGlobals, 3, instr); in DoDeclareGlobals()
2671 void LCodeGen::DoGlobalObject(LGlobalObject* instr) { in DoGlobalObject() argument
2672 Register result = ToRegister(instr->result()); in DoGlobalObject()
2677 void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) { in DoGlobalReceiver() argument
2678 Register global = ToRegister(instr->global()); in DoGlobalReceiver()
2679 Register result = ToRegister(instr->result()); in DoGlobalReceiver()
2686 LInstruction* instr, in CallKnownFunction() argument
2691 LPointerMap* pointers = instr->pointer_map(); in CallKnownFunction()
2721 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT, 0); in CallKnownFunction()
2735 void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) { in DoCallConstantFunction() argument
2736 ASSERT(ToRegister(instr->result()).is(rax)); in DoCallConstantFunction()
2737 CallKnownFunction(instr->function(), in DoCallConstantFunction()
2738 instr->arity(), in DoCallConstantFunction()
2739 instr, in DoCallConstantFunction()
2744 void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) { in DoDeferredMathAbsTaggedHeapNumber() argument
2745 Register input_reg = ToRegister(instr->InputAt(0)); in DoDeferredMathAbsTaggedHeapNumber()
2748 DeoptimizeIf(not_equal, instr->environment()); in DoDeferredMathAbsTaggedHeapNumber()
2776 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr); in DoDeferredMathAbsTaggedHeapNumber()
2796 void LCodeGen::EmitIntegerMathAbs(LUnaryMathOperation* instr) { in EmitIntegerMathAbs() argument
2797 Register input_reg = ToRegister(instr->InputAt(0)); in EmitIntegerMathAbs()
2802 DeoptimizeIf(negative, instr->environment()); in EmitIntegerMathAbs()
2807 void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) { in DoMathAbs() argument
2812 LUnaryMathOperation* instr) in DoMathAbs() argument
2813 : LDeferredCode(codegen), instr_(instr) { } in DoMathAbs()
2817 virtual LInstruction* instr() { return instr_; } in DoMathAbs() function in v8::internal::LCodeGen::DoMathAbs::DeferredMathAbsTaggedHeapNumber
2822 ASSERT(instr->InputAt(0)->Equals(instr->result())); in DoMathAbs()
2823 Representation r = instr->hydrogen()->value()->representation(); in DoMathAbs()
2827 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0)); in DoMathAbs()
2832 EmitIntegerMathAbs(instr); in DoMathAbs()
2835 new DeferredMathAbsTaggedHeapNumber(this, instr); in DoMathAbs()
2836 Register input_reg = ToRegister(instr->InputAt(0)); in DoMathAbs()
2840 EmitIntegerMathAbs(instr); in DoMathAbs()
2847 void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { in DoMathFloor() argument
2849 Register output_reg = ToRegister(instr->result()); in DoMathFloor()
2850 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0)); in DoMathFloor()
2855 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoMathFloor()
2859 DeoptimizeIf(overflow, instr->environment()); in DoMathFloor()
2864 DeoptimizeIf(equal, instr->environment()); in DoMathFloor()
2869 DeoptimizeIf(below, instr->environment()); in DoMathFloor()
2870 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoMathFloor()
2876 DeoptimizeIf(not_zero, instr->environment()); in DoMathFloor()
2887 DeoptimizeIf(equal, instr->environment()); in DoMathFloor()
2893 void LCodeGen::DoMathRound(LUnaryMathOperation* instr) { in DoMathRound() argument
2895 Register output_reg = ToRegister(instr->result()); in DoMathRound()
2896 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0)); in DoMathRound()
2916 DeoptimizeIf(equal, instr->environment()); in DoMathRound()
2920 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoMathRound()
2924 DeoptimizeIf(negative, instr->environment()); in DoMathRound()
2932 DeoptimizeIf(below, instr->environment()); in DoMathRound()
2940 void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) { in DoMathSqrt() argument
2941 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0)); in DoMathSqrt()
2942 ASSERT(ToDoubleRegister(instr->result()).is(input_reg)); in DoMathSqrt()
2947 void LCodeGen::DoMathPowHalf(LUnaryMathOperation* instr) { in DoMathPowHalf() argument
2949 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0)); in DoMathPowHalf()
2950 ASSERT(ToDoubleRegister(instr->result()).is(input_reg)); in DoMathPowHalf()
2979 void LCodeGen::DoPower(LPower* instr) { in DoPower() argument
2980 Representation exponent_type = instr->hydrogen()->right()->representation(); in DoPower()
2990 ASSERT(!instr->InputAt(1)->IsRegister() || in DoPower()
2991 ToRegister(instr->InputAt(1)).is(exponent)); in DoPower()
2992 ASSERT(!instr->InputAt(1)->IsDoubleRegister() || in DoPower()
2993 ToDoubleRegister(instr->InputAt(1)).is(xmm1)); in DoPower()
2994 ASSERT(ToDoubleRegister(instr->InputAt(0)).is(xmm2)); in DoPower()
2995 ASSERT(ToDoubleRegister(instr->result()).is(xmm3)); in DoPower()
3001 DeoptimizeIf(not_equal, instr->environment()); in DoPower()
3016 void LCodeGen::DoRandom(LRandom* instr) { in DoRandom() argument
3019 DeferredDoRandom(LCodeGen* codegen, LRandom* instr) in DoRandom() argument
3020 : LDeferredCode(codegen), instr_(instr) { } in DoRandom()
3022 virtual LInstruction* instr() { return instr_; } in DoRandom() function in v8::internal::LCodeGen::DoRandom::DeferredDoRandom
3027 DeferredDoRandom* deferred = new DeferredDoRandom(this, instr); in DoRandom()
3031 ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); in DoRandom()
3036 ASSERT(ToRegister(instr->InputAt(0)).is(rcx)); in DoRandom()
3039 ASSERT(ToRegister(instr->InputAt(0)).is(rdi)); in DoRandom()
3098 void LCodeGen::DoDeferredRandom(LRandom* instr) { in DoDeferredRandom() argument
3106 void LCodeGen::DoMathLog(LUnaryMathOperation* instr) { in DoMathLog() argument
3107 ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); in DoMathLog()
3110 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoMathLog()
3114 void LCodeGen::DoMathTan(LUnaryMathOperation* instr) { in DoMathTan() argument
3115 ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); in DoMathTan()
3118 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoMathTan()
3122 void LCodeGen::DoMathCos(LUnaryMathOperation* instr) { in DoMathCos() argument
3123 ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); in DoMathCos()
3126 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoMathCos()
3130 void LCodeGen::DoMathSin(LUnaryMathOperation* instr) { in DoMathSin() argument
3131 ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); in DoMathSin()
3134 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoMathSin()
3138 void LCodeGen::DoUnaryMathOperation(LUnaryMathOperation* instr) { in DoUnaryMathOperation() argument
3139 switch (instr->op()) { in DoUnaryMathOperation()
3141 DoMathAbs(instr); in DoUnaryMathOperation()
3144 DoMathFloor(instr); in DoUnaryMathOperation()
3147 DoMathRound(instr); in DoUnaryMathOperation()
3150 DoMathSqrt(instr); in DoUnaryMathOperation()
3153 DoMathPowHalf(instr); in DoUnaryMathOperation()
3156 DoMathCos(instr); in DoUnaryMathOperation()
3159 DoMathSin(instr); in DoUnaryMathOperation()
3162 DoMathTan(instr); in DoUnaryMathOperation()
3165 DoMathLog(instr); in DoUnaryMathOperation()
3174 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { in DoInvokeFunction() argument
3175 ASSERT(ToRegister(instr->function()).is(rdi)); in DoInvokeFunction()
3176 ASSERT(instr->HasPointerMap()); in DoInvokeFunction()
3177 ASSERT(instr->HasDeoptimizationEnvironment()); in DoInvokeFunction()
3178 LPointerMap* pointers = instr->pointer_map(); in DoInvokeFunction()
3181 ParameterCount count(instr->arity()); in DoInvokeFunction()
3187 void LCodeGen::DoCallKeyed(LCallKeyed* instr) { in DoCallKeyed() argument
3188 ASSERT(ToRegister(instr->key()).is(rcx)); in DoCallKeyed()
3189 ASSERT(ToRegister(instr->result()).is(rax)); in DoCallKeyed()
3191 int arity = instr->arity(); in DoCallKeyed()
3194 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoCallKeyed()
3199 void LCodeGen::DoCallNamed(LCallNamed* instr) { in DoCallNamed() argument
3200 ASSERT(ToRegister(instr->result()).is(rax)); in DoCallNamed()
3202 int arity = instr->arity(); in DoCallNamed()
3206 __ Move(rcx, instr->name()); in DoCallNamed()
3207 CallCode(ic, mode, instr); in DoCallNamed()
3212 void LCodeGen::DoCallFunction(LCallFunction* instr) { in DoCallFunction() argument
3213 ASSERT(ToRegister(instr->function()).is(rdi)); in DoCallFunction()
3214 ASSERT(ToRegister(instr->result()).is(rax)); in DoCallFunction()
3216 int arity = instr->arity(); in DoCallFunction()
3218 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallFunction()
3223 void LCodeGen::DoCallGlobal(LCallGlobal* instr) { in DoCallGlobal() argument
3224 ASSERT(ToRegister(instr->result()).is(rax)); in DoCallGlobal()
3225 int arity = instr->arity(); in DoCallGlobal()
3229 __ Move(rcx, instr->name()); in DoCallGlobal()
3230 CallCode(ic, mode, instr); in DoCallGlobal()
3235 void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) { in DoCallKnownGlobal() argument
3236 ASSERT(ToRegister(instr->result()).is(rax)); in DoCallKnownGlobal()
3237 CallKnownFunction(instr->target(), instr->arity(), instr, CALL_AS_FUNCTION); in DoCallKnownGlobal()
3241 void LCodeGen::DoCallNew(LCallNew* instr) { in DoCallNew() argument
3242 ASSERT(ToRegister(instr->InputAt(0)).is(rdi)); in DoCallNew()
3243 ASSERT(ToRegister(instr->result()).is(rax)); in DoCallNew()
3246 __ Set(rax, instr->arity()); in DoCallNew()
3247 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); in DoCallNew()
3251 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { in DoCallRuntime() argument
3252 CallRuntime(instr->function(), instr->arity(), instr); in DoCallRuntime()
3256 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { in DoStoreNamedField() argument
3257 Register object = ToRegister(instr->object()); in DoStoreNamedField()
3258 Register value = ToRegister(instr->value()); in DoStoreNamedField()
3259 int offset = instr->offset(); in DoStoreNamedField()
3261 if (!instr->transition().is_null()) { in DoStoreNamedField()
3262 __ Move(FieldOperand(object, HeapObject::kMapOffset), instr->transition()); in DoStoreNamedField()
3266 HType type = instr->hydrogen()->value()->type(); in DoStoreNamedField()
3269 if (instr->is_in_object()) { in DoStoreNamedField()
3271 if (instr->hydrogen()->NeedsWriteBarrier()) { in DoStoreNamedField()
3272 Register temp = ToRegister(instr->TempAt(0)); in DoStoreNamedField()
3283 Register temp = ToRegister(instr->TempAt(0)); in DoStoreNamedField()
3286 if (instr->hydrogen()->NeedsWriteBarrier()) { in DoStoreNamedField()
3301 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { in DoStoreNamedGeneric() argument
3302 ASSERT(ToRegister(instr->object()).is(rdx)); in DoStoreNamedGeneric()
3303 ASSERT(ToRegister(instr->value()).is(rax)); in DoStoreNamedGeneric()
3305 __ Move(rcx, instr->hydrogen()->name()); in DoStoreNamedGeneric()
3306 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) in DoStoreNamedGeneric()
3309 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoStoreNamedGeneric()
3314 LStoreKeyedSpecializedArrayElement* instr) { in DoStoreKeyedSpecializedArrayElement() argument
3315 ElementsKind elements_kind = instr->elements_kind(); in DoStoreKeyedSpecializedArrayElement()
3316 Operand operand(BuildFastArrayOperand(instr->external_pointer(), in DoStoreKeyedSpecializedArrayElement()
3317 instr->key(), elements_kind, 0)); in DoStoreKeyedSpecializedArrayElement()
3319 XMMRegister value(ToDoubleRegister(instr->value())); in DoStoreKeyedSpecializedArrayElement()
3323 __ movsd(operand, ToDoubleRegister(instr->value())); in DoStoreKeyedSpecializedArrayElement()
3325 Register value(ToRegister(instr->value())); in DoStoreKeyedSpecializedArrayElement()
3354 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { in DoBoundsCheck() argument
3355 if (instr->length()->IsRegister()) { in DoBoundsCheck()
3356 Register reg = ToRegister(instr->length()); in DoBoundsCheck()
3360 if (instr->index()->IsConstantOperand()) { in DoBoundsCheck()
3362 Immediate(ToInteger32(LConstantOperand::cast(instr->index())))); in DoBoundsCheck()
3364 Register reg2 = ToRegister(instr->index()); in DoBoundsCheck()
3371 if (instr->index()->IsConstantOperand()) { in DoBoundsCheck()
3372 __ cmpq(ToOperand(instr->length()), in DoBoundsCheck()
3373 Immediate(ToInteger32(LConstantOperand::cast(instr->index())))); in DoBoundsCheck()
3375 __ cmpq(ToOperand(instr->length()), ToRegister(instr->index())); in DoBoundsCheck()
3378 DeoptimizeIf(below_equal, instr->environment()); in DoBoundsCheck()
3382 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) { in DoStoreKeyedFastElement() argument
3383 Register value = ToRegister(instr->value()); in DoStoreKeyedFastElement()
3384 Register elements = ToRegister(instr->object()); in DoStoreKeyedFastElement()
3385 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg; in DoStoreKeyedFastElement()
3388 if (instr->key()->IsConstantOperand()) { in DoStoreKeyedFastElement()
3389 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); in DoStoreKeyedFastElement()
3390 LConstantOperand* const_operand = LConstantOperand::cast(instr->key()); in DoStoreKeyedFastElement()
3402 if (instr->hydrogen()->NeedsWriteBarrier()) { in DoStoreKeyedFastElement()
3403 HType type = instr->hydrogen()->value()->type(); in DoStoreKeyedFastElement()
3422 LStoreKeyedFastDoubleElement* instr) { in DoStoreKeyedFastDoubleElement() argument
3423 XMMRegister value = ToDoubleRegister(instr->value()); in DoStoreKeyedFastDoubleElement()
3435 instr->elements(), instr->key(), FAST_DOUBLE_ELEMENTS, in DoStoreKeyedFastDoubleElement()
3440 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { in DoStoreKeyedGeneric() argument
3441 ASSERT(ToRegister(instr->object()).is(rdx)); in DoStoreKeyedGeneric()
3442 ASSERT(ToRegister(instr->key()).is(rcx)); in DoStoreKeyedGeneric()
3443 ASSERT(ToRegister(instr->value()).is(rax)); in DoStoreKeyedGeneric()
3445 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) in DoStoreKeyedGeneric()
3448 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoStoreKeyedGeneric()
3452 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { in DoTransitionElementsKind() argument
3453 Register object_reg = ToRegister(instr->object()); in DoTransitionElementsKind()
3454 Register new_map_reg = ToRegister(instr->new_map_reg()); in DoTransitionElementsKind()
3456 Handle<Map> from_map = instr->original_map(); in DoTransitionElementsKind()
3457 Handle<Map> to_map = instr->transitioned_map(); in DoTransitionElementsKind()
3468 ASSERT_NE(instr->temp_reg(), NULL); in DoTransitionElementsKind()
3470 ToRegister(instr->temp_reg()), kDontSaveFPRegs); in DoTransitionElementsKind()
3473 Register fixed_object_reg = ToRegister(instr->temp_reg()); in DoTransitionElementsKind()
3478 RelocInfo::CODE_TARGET, instr); in DoTransitionElementsKind()
3480 Register fixed_object_reg = ToRegister(instr->temp_reg()); in DoTransitionElementsKind()
3485 RelocInfo::CODE_TARGET, instr); in DoTransitionElementsKind()
3493 void LCodeGen::DoStringAdd(LStringAdd* instr) { in DoStringAdd() argument
3494 EmitPushTaggedOperand(instr->left()); in DoStringAdd()
3495 EmitPushTaggedOperand(instr->right()); in DoStringAdd()
3497 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoStringAdd()
3501 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { in DoStringCharCodeAt() argument
3504 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) in DoStringCharCodeAt() argument
3505 : LDeferredCode(codegen), instr_(instr) { } in DoStringCharCodeAt()
3507 virtual LInstruction* instr() { return instr_; } in DoStringCharCodeAt() function in v8::internal::LCodeGen::DoStringCharCodeAt::DeferredStringCharCodeAt
3513 new DeferredStringCharCodeAt(this, instr); in DoStringCharCodeAt()
3516 ToRegister(instr->string()), in DoStringCharCodeAt()
3517 ToRegister(instr->index()), in DoStringCharCodeAt()
3518 ToRegister(instr->result()), in DoStringCharCodeAt()
3524 void LCodeGen::DoDeferredStringCharCodeAt(LStringCharCodeAt* instr) { in DoDeferredStringCharCodeAt() argument
3525 Register string = ToRegister(instr->string()); in DoDeferredStringCharCodeAt()
3526 Register result = ToRegister(instr->result()); in DoDeferredStringCharCodeAt()
3538 if (instr->index()->IsConstantOperand()) { in DoDeferredStringCharCodeAt()
3539 int const_index = ToInteger32(LConstantOperand::cast(instr->index())); in DoDeferredStringCharCodeAt()
3542 Register index = ToRegister(instr->index()); in DoDeferredStringCharCodeAt()
3546 CallRuntimeFromDeferred(Runtime::kStringCharCodeAt, 2, instr); in DoDeferredStringCharCodeAt()
3555 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { in DoStringCharFromCode() argument
3558 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) in DoStringCharFromCode() argument
3559 : LDeferredCode(codegen), instr_(instr) { } in DoStringCharFromCode()
3561 virtual LInstruction* instr() { return instr_; } in DoStringCharFromCode() function in v8::internal::LCodeGen::DoStringCharFromCode::DeferredStringCharFromCode
3567 new DeferredStringCharFromCode(this, instr); in DoStringCharFromCode()
3569 ASSERT(instr->hydrogen()->value()->representation().IsInteger32()); in DoStringCharFromCode()
3570 Register char_code = ToRegister(instr->char_code()); in DoStringCharFromCode()
3571 Register result = ToRegister(instr->result()); in DoStringCharFromCode()
3586 void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) { in DoDeferredStringCharFromCode() argument
3587 Register char_code = ToRegister(instr->char_code()); in DoDeferredStringCharFromCode()
3588 Register result = ToRegister(instr->result()); in DoDeferredStringCharFromCode()
3598 CallRuntimeFromDeferred(Runtime::kCharFromCode, 1, instr); in DoDeferredStringCharFromCode()
3603 void LCodeGen::DoStringLength(LStringLength* instr) { in DoStringLength() argument
3604 Register string = ToRegister(instr->string()); in DoStringLength()
3605 Register result = ToRegister(instr->result()); in DoStringLength()
3610 void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { in DoInteger32ToDouble() argument
3611 LOperand* input = instr->InputAt(0); in DoInteger32ToDouble()
3613 LOperand* output = instr->result(); in DoInteger32ToDouble()
3623 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { in DoNumberTagI() argument
3624 LOperand* input = instr->InputAt(0); in DoNumberTagI()
3625 ASSERT(input->IsRegister() && input->Equals(instr->result())); in DoNumberTagI()
3632 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { in DoNumberTagD() argument
3635 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) in DoNumberTagD() argument
3636 : LDeferredCode(codegen), instr_(instr) { } in DoNumberTagD()
3638 virtual LInstruction* instr() { return instr_; } in DoNumberTagD() function in v8::internal::LCodeGen::DoNumberTagD::DeferredNumberTagD
3643 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0)); in DoNumberTagD()
3644 Register reg = ToRegister(instr->result()); in DoNumberTagD()
3645 Register tmp = ToRegister(instr->TempAt(0)); in DoNumberTagD()
3647 DeferredNumberTagD* deferred = new DeferredNumberTagD(this, instr); in DoNumberTagD()
3658 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { in DoDeferredNumberTagD() argument
3662 Register reg = ToRegister(instr->result()); in DoDeferredNumberTagD()
3667 CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr); in DoDeferredNumberTagD()
3675 void LCodeGen::DoSmiTag(LSmiTag* instr) { in DoSmiTag() argument
3676 ASSERT(instr->InputAt(0)->Equals(instr->result())); in DoSmiTag()
3677 Register input = ToRegister(instr->InputAt(0)); in DoSmiTag()
3678 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow)); in DoSmiTag()
3683 void LCodeGen::DoSmiUntag(LSmiUntag* instr) { in DoSmiUntag() argument
3684 ASSERT(instr->InputAt(0)->Equals(instr->result())); in DoSmiUntag()
3685 Register input = ToRegister(instr->InputAt(0)); in DoSmiUntag()
3686 if (instr->needs_check()) { in DoSmiUntag()
3688 DeoptimizeIf(NegateCondition(is_smi), instr->environment()); in DoSmiUntag()
3744 void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { in DoDeferredTaggedToI() argument
3746 Register input_reg = ToRegister(instr->InputAt(0)); in DoDeferredTaggedToI()
3752 if (instr->truncating()) { in DoDeferredTaggedToI()
3757 DeoptimizeIf(not_equal, instr->environment()); in DoDeferredTaggedToI()
3767 DeoptimizeIf(equal, instr->environment()); in DoDeferredTaggedToI()
3770 DeoptimizeIf(not_equal, instr->environment()); in DoDeferredTaggedToI()
3772 XMMRegister xmm_temp = ToDoubleRegister(instr->TempAt(0)); in DoDeferredTaggedToI()
3777 DeoptimizeIf(not_equal, instr->environment()); in DoDeferredTaggedToI()
3778 DeoptimizeIf(parity_even, instr->environment()); // NaN. in DoDeferredTaggedToI()
3779 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoDeferredTaggedToI()
3784 DeoptimizeIf(not_zero, instr->environment()); in DoDeferredTaggedToI()
3791 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { in DoTaggedToI() argument
3794 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) in DoTaggedToI() argument
3795 : LDeferredCode(codegen), instr_(instr) { } in DoTaggedToI()
3797 virtual LInstruction* instr() { return instr_; } in DoTaggedToI() function in v8::internal::LCodeGen::DoTaggedToI::DeferredTaggedToI
3802 LOperand* input = instr->InputAt(0); in DoTaggedToI()
3804 ASSERT(input->Equals(instr->result())); in DoTaggedToI()
3807 DeferredTaggedToI* deferred = new DeferredTaggedToI(this, instr); in DoTaggedToI()
3814 void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) { in DoNumberUntagD() argument
3815 LOperand* input = instr->InputAt(0); in DoNumberUntagD()
3817 LOperand* result = instr->result(); in DoNumberUntagD()
3824 instr->hydrogen()->deoptimize_on_undefined(), in DoNumberUntagD()
3825 instr->hydrogen()->deoptimize_on_minus_zero(), in DoNumberUntagD()
3826 instr->environment()); in DoNumberUntagD()
3830 void LCodeGen::DoDoubleToI(LDoubleToI* instr) { in DoDoubleToI() argument
3831 LOperand* input = instr->InputAt(0); in DoDoubleToI()
3833 LOperand* result = instr->result(); in DoDoubleToI()
3839 if (instr->truncating()) { in DoDoubleToI()
3845 DeoptimizeIf(equal, instr->environment()); in DoDoubleToI()
3850 DeoptimizeIf(not_equal, instr->environment()); in DoDoubleToI()
3851 DeoptimizeIf(parity_even, instr->environment()); // NaN. in DoDoubleToI()
3852 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoDoubleToI()
3863 DeoptimizeIf(not_zero, instr->environment()); in DoDoubleToI()
3870 void LCodeGen::DoCheckSmi(LCheckSmi* instr) { in DoCheckSmi() argument
3871 LOperand* input = instr->InputAt(0); in DoCheckSmi()
3873 DeoptimizeIf(NegateCondition(cc), instr->environment()); in DoCheckSmi()
3877 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { in DoCheckNonSmi() argument
3878 LOperand* input = instr->InputAt(0); in DoCheckNonSmi()
3880 DeoptimizeIf(cc, instr->environment()); in DoCheckNonSmi()
3884 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { in DoCheckInstanceType() argument
3885 Register input = ToRegister(instr->InputAt(0)); in DoCheckInstanceType()
3889 if (instr->hydrogen()->is_interval_check()) { in DoCheckInstanceType()
3892 instr->hydrogen()->GetCheckInterval(&first, &last); in DoCheckInstanceType()
3899 DeoptimizeIf(not_equal, instr->environment()); in DoCheckInstanceType()
3901 DeoptimizeIf(below, instr->environment()); in DoCheckInstanceType()
3906 DeoptimizeIf(above, instr->environment()); in DoCheckInstanceType()
3912 instr->hydrogen()->GetCheckMaskAndTag(&mask, &tag); in DoCheckInstanceType()
3918 DeoptimizeIf(tag == 0 ? not_zero : zero, instr->environment()); in DoCheckInstanceType()
3924 DeoptimizeIf(not_equal, instr->environment()); in DoCheckInstanceType()
3930 void LCodeGen::DoCheckFunction(LCheckFunction* instr) { in DoCheckFunction() argument
3931 Register reg = ToRegister(instr->value()); in DoCheckFunction()
3932 Handle<JSFunction> target = instr->hydrogen()->target(); in DoCheckFunction()
3941 DeoptimizeIf(not_equal, instr->environment()); in DoCheckFunction()
3956 void LCodeGen::DoCheckMap(LCheckMap* instr) { in DoCheckMap() argument
3957 LOperand* input = instr->InputAt(0); in DoCheckMap()
3960 Handle<Map> map = instr->hydrogen()->map(); in DoCheckMap()
3961 DoCheckMapCommon(reg, map, instr->hydrogen()->mode(), instr->environment()); in DoCheckMap()
3965 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { in DoClampDToUint8() argument
3966 XMMRegister value_reg = ToDoubleRegister(instr->unclamped()); in DoClampDToUint8()
3967 Register result_reg = ToRegister(instr->result()); in DoClampDToUint8()
3968 Register temp_reg = ToRegister(instr->TempAt(0)); in DoClampDToUint8()
3973 void LCodeGen::DoClampIToUint8(LClampIToUint8* instr) { in DoClampIToUint8() argument
3974 ASSERT(instr->unclamped()->Equals(instr->result())); in DoClampIToUint8()
3975 Register value_reg = ToRegister(instr->result()); in DoClampIToUint8()
3980 void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) { in DoClampTToUint8() argument
3981 ASSERT(instr->unclamped()->Equals(instr->result())); in DoClampTToUint8()
3982 Register input_reg = ToRegister(instr->unclamped()); in DoClampTToUint8()
3983 Register temp_reg = ToRegister(instr->TempAt(0)); in DoClampTToUint8()
3984 XMMRegister temp_xmm_reg = ToDoubleRegister(instr->TempAt(1)); in DoClampTToUint8()
3997 DeoptimizeIf(not_equal, instr->environment()); in DoClampTToUint8()
4016 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { in DoCheckPrototypeMaps() argument
4017 Register reg = ToRegister(instr->TempAt(0)); in DoCheckPrototypeMaps()
4019 Handle<JSObject> holder = instr->holder(); in DoCheckPrototypeMaps()
4020 Handle<JSObject> current_prototype = instr->prototype(); in DoCheckPrototypeMaps()
4028 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); in DoCheckPrototypeMaps()
4037 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); in DoCheckPrototypeMaps()
4041 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { in DoAllocateObject() argument
4044 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) in DoAllocateObject() argument
4045 : LDeferredCode(codegen), instr_(instr) { } in DoAllocateObject()
4047 virtual LInstruction* instr() { return instr_; } in DoAllocateObject() function in v8::internal::LCodeGen::DoAllocateObject::DeferredAllocateObject
4052 DeferredAllocateObject* deferred = new DeferredAllocateObject(this, instr); in DoAllocateObject()
4054 Register result = ToRegister(instr->result()); in DoAllocateObject()
4055 Register scratch = ToRegister(instr->TempAt(0)); in DoAllocateObject()
4056 Handle<JSFunction> constructor = instr->hydrogen()->constructor(); in DoAllocateObject()
4113 void LCodeGen::DoDeferredAllocateObject(LAllocateObject* instr) { in DoDeferredAllocateObject() argument
4114 Register result = ToRegister(instr->result()); in DoDeferredAllocateObject()
4115 Handle<JSFunction> constructor = instr->hydrogen()->constructor(); in DoDeferredAllocateObject()
4124 CallRuntimeFromDeferred(Runtime::kNewObject, 1, instr); in DoDeferredAllocateObject()
4129 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { in DoArrayLiteral() argument
4132 instr->hydrogen()->boilerplate_elements_kind(); in DoArrayLiteral()
4138 __ LoadHeapObject(rax, instr->hydrogen()->boilerplate_object()); in DoArrayLiteral()
4146 DeoptimizeIf(not_equal, instr->environment()); in DoArrayLiteral()
4152 __ Push(Smi::FromInt(instr->hydrogen()->literal_index())); in DoArrayLiteral()
4158 int length = instr->hydrogen()->length(); in DoArrayLiteral()
4159 if (instr->hydrogen()->IsCopyOnWrite()) { in DoArrayLiteral()
4160 ASSERT(instr->hydrogen()->depth() == 1); in DoArrayLiteral()
4164 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoArrayLiteral()
4165 } else if (instr->hydrogen()->depth() > 1) { in DoArrayLiteral()
4166 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr); in DoArrayLiteral()
4168 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr); in DoArrayLiteral()
4175 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoArrayLiteral()
4277 void LCodeGen::DoFastLiteral(LFastLiteral* instr) { in DoFastLiteral() argument
4278 int size = instr->hydrogen()->total_size(); in DoFastLiteral()
4288 CallRuntime(Runtime::kAllocateInNewSpace, 1, instr); in DoFastLiteral()
4292 __ LoadHeapObject(rbx, instr->hydrogen()->boilerplate()); in DoFastLiteral()
4293 EmitDeepCopy(instr->hydrogen()->boilerplate(), rax, rbx, &offset); in DoFastLiteral()
4298 void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) { in DoObjectLiteral() argument
4299 Handle<FixedArray> literals(instr->environment()->closure()->literals()); in DoObjectLiteral()
4301 instr->hydrogen()->constant_properties(); in DoObjectLiteral()
4305 __ Push(Smi::FromInt(instr->hydrogen()->literal_index())); in DoObjectLiteral()
4307 int flags = instr->hydrogen()->fast_elements() in DoObjectLiteral()
4310 flags |= instr->hydrogen()->has_function() in DoObjectLiteral()
4317 if (instr->hydrogen()->depth() > 1) { in DoObjectLiteral()
4318 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); in DoObjectLiteral()
4321 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); in DoObjectLiteral()
4324 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoObjectLiteral()
4329 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { in DoToFastProperties() argument
4330 ASSERT(ToRegister(instr->InputAt(0)).is(rax)); in DoToFastProperties()
4332 CallRuntime(Runtime::kToFastProperties, 1, instr); in DoToFastProperties()
4336 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { in DoRegExpLiteral() argument
4346 instr->hydrogen()->literal_index() * kPointerSize; in DoRegExpLiteral()
4354 __ Push(Smi::FromInt(instr->hydrogen()->literal_index())); in DoRegExpLiteral()
4355 __ Push(instr->hydrogen()->pattern()); in DoRegExpLiteral()
4356 __ Push(instr->hydrogen()->flags()); in DoRegExpLiteral()
4357 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr); in DoRegExpLiteral()
4369 CallRuntime(Runtime::kAllocateInNewSpace, 1, instr); in DoRegExpLiteral()
4388 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { in DoFunctionLiteral() argument
4391 Handle<SharedFunctionInfo> shared_info = instr->shared_info(); in DoFunctionLiteral()
4392 bool pretenure = instr->hydrogen()->pretenure(); in DoFunctionLiteral()
4396 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoFunctionLiteral()
4403 CallRuntime(Runtime::kNewClosure, 3, instr); in DoFunctionLiteral()
4408 void LCodeGen::DoTypeof(LTypeof* instr) { in DoTypeof() argument
4409 LOperand* input = instr->InputAt(0); in DoTypeof()
4411 CallRuntime(Runtime::kTypeof, 1, instr); in DoTypeof()
4432 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { in DoTypeofIsAndBranch() argument
4433 Register input = ToRegister(instr->InputAt(0)); in DoTypeofIsAndBranch()
4434 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoTypeofIsAndBranch()
4435 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoTypeofIsAndBranch()
4440 EmitTypeofIs(true_label, false_label, input, instr->type_literal()); in DoTypeofIsAndBranch()
4518 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { in DoIsConstructCallAndBranch() argument
4519 Register temp = ToRegister(instr->TempAt(0)); in DoIsConstructCallAndBranch()
4520 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsConstructCallAndBranch()
4521 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsConstructCallAndBranch()
4557 void LCodeGen::DoLazyBailout(LLazyBailout* instr) { in DoLazyBailout() argument
4560 ASSERT(instr->HasEnvironment()); in DoLazyBailout()
4561 LEnvironment* env = instr->environment(); in DoLazyBailout()
4567 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { in DoDeoptimize() argument
4568 DeoptimizeIf(no_condition, instr->environment()); in DoDeoptimize()
4572 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { in DoDeleteProperty() argument
4573 LOperand* obj = instr->object(); in DoDeleteProperty()
4574 LOperand* key = instr->key(); in DoDeleteProperty()
4577 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); in DoDeleteProperty()
4578 LPointerMap* pointers = instr->pointer_map(); in DoDeleteProperty()
4590 void LCodeGen::DoIn(LIn* instr) { in DoIn() argument
4591 LOperand* obj = instr->object(); in DoIn()
4592 LOperand* key = instr->key(); in DoIn()
4595 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); in DoIn()
4596 LPointerMap* pointers = instr->pointer_map(); in DoIn()
4604 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) { in DoDeferredStackCheck() argument
4608 RecordSafepointWithLazyDeopt(instr, RECORD_SAFEPOINT_WITH_REGISTERS, 0); in DoDeferredStackCheck()
4609 ASSERT(instr->HasEnvironment()); in DoDeferredStackCheck()
4610 LEnvironment* env = instr->environment(); in DoDeferredStackCheck()
4615 void LCodeGen::DoStackCheck(LStackCheck* instr) { in DoStackCheck() argument
4618 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr) in DoStackCheck() argument
4619 : LDeferredCode(codegen), instr_(instr) { } in DoStackCheck()
4621 virtual LInstruction* instr() { return instr_; } in DoStackCheck() function in v8::internal::LCodeGen::DoStackCheck::DeferredStackCheck
4626 ASSERT(instr->HasEnvironment()); in DoStackCheck()
4627 LEnvironment* env = instr->environment(); in DoStackCheck()
4630 if (instr->hydrogen()->is_function_entry()) { in DoStackCheck()
4636 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoStackCheck()
4643 ASSERT(instr->hydrogen()->is_backwards_branch()); in DoStackCheck()
4646 new DeferredStackCheck(this, instr); in DoStackCheck()
4651 __ bind(instr->done_label()); in DoStackCheck()
4652 deferred_stack_check->SetExit(instr->done_label()); in DoStackCheck()
4661 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { in DoOsrEntry() argument
4665 LEnvironment* environment = instr->environment(); in DoOsrEntry()
4666 environment->SetSpilledRegisters(instr->SpilledRegisterArray(), in DoOsrEntry()
4667 instr->SpilledDoubleRegisterArray()); in DoOsrEntry()
4678 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { in DoForInPrepareMap() argument
4680 DeoptimizeIf(equal, instr->environment()); in DoForInPrepareMap()
4685 DeoptimizeIf(equal, instr->environment()); in DoForInPrepareMap()
4688 DeoptimizeIf(cc, instr->environment()); in DoForInPrepareMap()
4692 DeoptimizeIf(below_equal, instr->environment()); in DoForInPrepareMap()
4703 CallRuntime(Runtime::kGetPropertyNamesFast, 1, instr); in DoForInPrepareMap()
4707 DeoptimizeIf(not_equal, instr->environment()); in DoForInPrepareMap()
4712 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { in DoForInCacheArray() argument
4713 Register map = ToRegister(instr->map()); in DoForInCacheArray()
4714 Register result = ToRegister(instr->result()); in DoForInCacheArray()
4719 FieldOperand(result, FixedArray::SizeFor(instr->idx()))); in DoForInCacheArray()
4721 DeoptimizeIf(cc, instr->environment()); in DoForInCacheArray()
4725 void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) { in DoCheckMapValue() argument
4726 Register object = ToRegister(instr->value()); in DoCheckMapValue()
4727 __ cmpq(ToRegister(instr->map()), in DoCheckMapValue()
4729 DeoptimizeIf(not_equal, instr->environment()); in DoCheckMapValue()
4733 void LCodeGen::DoLoadFieldByIndex(LLoadFieldByIndex* instr) { in DoLoadFieldByIndex() argument
4734 Register object = ToRegister(instr->object()); in DoLoadFieldByIndex()
4735 Register index = ToRegister(instr->index()); in DoLoadFieldByIndex()