• Home
  • Raw
  • Download

Lines Matching refs:instr

243     LInstruction* instr = instructions_->at(current_instruction_);  in GenerateBody()  local
244 if (instr->IsLabel()) { in GenerateBody()
245 LLabel* label = LLabel::cast(instr); in GenerateBody()
250 Comment(";;; @%d: %s.", current_instruction_, instr->Mnemonic()); in GenerateBody()
251 instr->CompileToNative(this); in GenerateBody()
267 code->instr()->Mnemonic()); in GenerateDeferredCode()
453 LInstruction* instr, in CallCodeGeneric() argument
455 ASSERT(instr != NULL); in CallCodeGeneric()
456 LPointerMap* pointers = instr->pointer_map(); in CallCodeGeneric()
459 RecordSafepointWithLazyDeopt(instr, safepoint_mode); in CallCodeGeneric()
472 LInstruction* instr) { in CallCode() argument
473 CallCodeGeneric(code, mode, instr, RECORD_SIMPLE_SAFEPOINT); in CallCode()
479 LInstruction* instr) { in CallRuntime() argument
480 ASSERT(instr != NULL); in CallRuntime()
481 ASSERT(instr->HasPointerMap()); in CallRuntime()
482 LPointerMap* pointers = instr->pointer_map(); in CallRuntime()
487 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); in CallRuntime()
493 LInstruction* instr, in CallRuntimeFromDeferred() argument
511 instr->pointer_map(), argc, Safepoint::kNoLazyDeopt); in CallRuntimeFromDeferred()
663 LInstruction* instr, SafepointMode safepoint_mode) { in RecordSafepointWithLazyDeopt() argument
665 RecordSafepoint(instr->pointer_map(), Safepoint::kLazyDeopt); in RecordSafepointWithLazyDeopt()
669 instr->pointer_map(), 0, Safepoint::kLazyDeopt); in RecordSafepointWithLazyDeopt()
747 void LCodeGen::DoInstructionGap(LInstructionGap* instr) { in DoInstructionGap() argument
748 DoGap(instr); in DoInstructionGap()
752 void LCodeGen::DoParameter(LParameter* instr) { in DoParameter() argument
757 void LCodeGen::DoCallStub(LCallStub* instr) { in DoCallStub() argument
758 ASSERT(ToRegister(instr->context()).is(esi)); in DoCallStub()
759 ASSERT(ToRegister(instr->result()).is(eax)); in DoCallStub()
760 switch (instr->hydrogen()->major_key()) { in DoCallStub()
763 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
768 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
773 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
778 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
783 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
788 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
792 TranscendentalCacheStub stub(instr->transcendental_type(), in DoCallStub()
794 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallStub()
803 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { in DoUnknownOSRValue() argument
808 void LCodeGen::DoModI(LModI* instr) { in DoModI() argument
809 if (instr->hydrogen()->HasPowerOf2Divisor()) { in DoModI()
810 Register dividend = ToRegister(instr->InputAt(0)); in DoModI()
813 HConstant::cast(instr->hydrogen()->right())->Integer32Value(); in DoModI()
823 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoModI()
825 DeoptimizeIf(no_condition, instr->environment()); in DoModI()
834 Register left_reg = ToRegister(instr->InputAt(0)); in DoModI()
835 Register right_reg = ToRegister(instr->InputAt(1)); in DoModI()
836 Register result_reg = ToRegister(instr->result()); in DoModI()
844 if (instr->hydrogen()->CheckFlag(HValue::kCanBeDivByZero)) { in DoModI()
846 DeoptimizeIf(zero, instr->environment()); in DoModI()
865 Register scratch = ToRegister(instr->TempAt(0)); in DoModI()
892 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoModI()
903 DeoptimizeIf(no_condition, instr->environment()); in DoModI()
920 void LCodeGen::DoDivI(LDivI* instr) { in DoDivI() argument
921 LOperand* right = instr->InputAt(1); in DoDivI()
922 ASSERT(ToRegister(instr->result()).is(eax)); in DoDivI()
923 ASSERT(ToRegister(instr->InputAt(0)).is(eax)); in DoDivI()
924 ASSERT(!ToRegister(instr->InputAt(1)).is(eax)); in DoDivI()
925 ASSERT(!ToRegister(instr->InputAt(1)).is(edx)); in DoDivI()
931 if (instr->hydrogen()->CheckFlag(HValue::kCanBeDivByZero)) { in DoDivI()
933 DeoptimizeIf(zero, instr->environment()); in DoDivI()
937 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoDivI()
942 DeoptimizeIf(sign, instr->environment()); in DoDivI()
947 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { in DoDivI()
952 DeoptimizeIf(zero, instr->environment()); in DoDivI()
962 DeoptimizeIf(not_zero, instr->environment()); in DoDivI()
966 void LCodeGen::DoMulI(LMulI* instr) { in DoMulI() argument
967 Register left = ToRegister(instr->InputAt(0)); in DoMulI()
968 LOperand* right = instr->InputAt(1); in DoMulI()
970 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoMulI()
971 __ mov(ToRegister(instr->TempAt(0)), left); in DoMulI()
985 } else if (!instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { in DoMulI()
1022 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { in DoMulI()
1023 DeoptimizeIf(overflow, instr->environment()); in DoMulI()
1026 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoMulI()
1033 DeoptimizeIf(no_condition, instr->environment()); in DoMulI()
1037 __ or_(ToRegister(instr->TempAt(0)), ToOperand(right)); in DoMulI()
1038 DeoptimizeIf(sign, instr->environment()); in DoMulI()
1045 void LCodeGen::DoBitI(LBitI* instr) { in DoBitI() argument
1046 LOperand* left = instr->InputAt(0); in DoBitI()
1047 LOperand* right = instr->InputAt(1); in DoBitI()
1048 ASSERT(left->Equals(instr->result())); in DoBitI()
1053 switch (instr->op()) { in DoBitI()
1068 switch (instr->op()) { in DoBitI()
1086 void LCodeGen::DoShiftI(LShiftI* instr) { in DoShiftI() argument
1087 LOperand* left = instr->InputAt(0); in DoShiftI()
1088 LOperand* right = instr->InputAt(1); in DoShiftI()
1089 ASSERT(left->Equals(instr->result())); in DoShiftI()
1094 switch (instr->op()) { in DoShiftI()
1100 if (instr->can_deopt()) { in DoShiftI()
1102 DeoptimizeIf(not_zero, instr->environment()); in DoShiftI()
1115 switch (instr->op()) { in DoShiftI()
1122 if (shift_count == 0 && instr->can_deopt()) { in DoShiftI()
1124 DeoptimizeIf(not_zero, instr->environment()); in DoShiftI()
1142 void LCodeGen::DoSubI(LSubI* instr) { in DoSubI() argument
1143 LOperand* left = instr->InputAt(0); in DoSubI()
1144 LOperand* right = instr->InputAt(1); in DoSubI()
1145 ASSERT(left->Equals(instr->result())); in DoSubI()
1152 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { in DoSubI()
1153 DeoptimizeIf(overflow, instr->environment()); in DoSubI()
1158 void LCodeGen::DoConstantI(LConstantI* instr) { in DoConstantI() argument
1159 ASSERT(instr->result()->IsRegister()); in DoConstantI()
1160 __ Set(ToRegister(instr->result()), Immediate(instr->value())); in DoConstantI()
1164 void LCodeGen::DoConstantD(LConstantD* instr) { in DoConstantD() argument
1165 ASSERT(instr->result()->IsDoubleRegister()); in DoConstantD()
1166 XMMRegister res = ToDoubleRegister(instr->result()); in DoConstantD()
1167 double v = instr->value(); in DoConstantD()
1173 Register temp = ToRegister(instr->TempAt(0)); in DoConstantD()
1203 void LCodeGen::DoConstantT(LConstantT* instr) { in DoConstantT() argument
1204 Register reg = ToRegister(instr->result()); in DoConstantT()
1205 Handle<Object> handle = instr->value(); in DoConstantT()
1214 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { in DoJSArrayLength() argument
1215 Register result = ToRegister(instr->result()); in DoJSArrayLength()
1216 Register array = ToRegister(instr->InputAt(0)); in DoJSArrayLength()
1222 LFixedArrayBaseLength* instr) { in DoFixedArrayBaseLength() argument
1223 Register result = ToRegister(instr->result()); in DoFixedArrayBaseLength()
1224 Register array = ToRegister(instr->InputAt(0)); in DoFixedArrayBaseLength()
1229 void LCodeGen::DoElementsKind(LElementsKind* instr) { in DoElementsKind() argument
1230 Register result = ToRegister(instr->result()); in DoElementsKind()
1231 Register input = ToRegister(instr->InputAt(0)); in DoElementsKind()
1244 void LCodeGen::DoValueOf(LValueOf* instr) { in DoValueOf() argument
1245 Register input = ToRegister(instr->InputAt(0)); in DoValueOf()
1246 Register result = ToRegister(instr->result()); in DoValueOf()
1247 Register map = ToRegister(instr->TempAt(0)); in DoValueOf()
1263 void LCodeGen::DoDateField(LDateField* instr) { in DoDateField() argument
1264 Register object = ToRegister(instr->InputAt(0)); in DoDateField()
1265 Register result = ToRegister(instr->result()); in DoDateField()
1266 Register scratch = ToRegister(instr->TempAt(0)); in DoDateField()
1267 Smi* index = instr->index(); in DoDateField()
1300 void LCodeGen::DoBitNotI(LBitNotI* instr) { in DoBitNotI() argument
1301 LOperand* input = instr->InputAt(0); in DoBitNotI()
1302 ASSERT(input->Equals(instr->result())); in DoBitNotI()
1307 void LCodeGen::DoThrow(LThrow* instr) { in DoThrow() argument
1308 __ push(ToOperand(instr->value())); in DoThrow()
1309 ASSERT(ToRegister(instr->context()).is(esi)); in DoThrow()
1310 CallRuntime(Runtime::kThrow, 1, instr); in DoThrow()
1319 void LCodeGen::DoAddI(LAddI* instr) { in DoAddI() argument
1320 LOperand* left = instr->InputAt(0); in DoAddI()
1321 LOperand* right = instr->InputAt(1); in DoAddI()
1322 ASSERT(left->Equals(instr->result())); in DoAddI()
1330 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { in DoAddI()
1331 DeoptimizeIf(overflow, instr->environment()); in DoAddI()
1336 void LCodeGen::DoArithmeticD(LArithmeticD* instr) { in DoArithmeticD() argument
1337 XMMRegister left = ToDoubleRegister(instr->InputAt(0)); in DoArithmeticD()
1338 XMMRegister right = ToDoubleRegister(instr->InputAt(1)); in DoArithmeticD()
1339 XMMRegister result = ToDoubleRegister(instr->result()); in DoArithmeticD()
1341 ASSERT(instr->op() == Token::MOD || left.is(result)); in DoArithmeticD()
1342 switch (instr->op()) { in DoArithmeticD()
1379 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { in DoArithmeticT() argument
1380 ASSERT(ToRegister(instr->context()).is(esi)); in DoArithmeticT()
1381 ASSERT(ToRegister(instr->left()).is(edx)); in DoArithmeticT()
1382 ASSERT(ToRegister(instr->right()).is(eax)); in DoArithmeticT()
1383 ASSERT(ToRegister(instr->result()).is(eax)); in DoArithmeticT()
1385 BinaryOpStub stub(instr->op(), NO_OVERWRITE); in DoArithmeticT()
1386 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoArithmeticT()
1418 void LCodeGen::DoBranch(LBranch* instr) { in DoBranch() argument
1419 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoBranch()
1420 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoBranch()
1422 Representation r = instr->hydrogen()->value()->representation(); in DoBranch()
1424 Register reg = ToRegister(instr->InputAt(0)); in DoBranch()
1428 XMMRegister reg = ToDoubleRegister(instr->InputAt(0)); in DoBranch()
1434 Register reg = ToRegister(instr->InputAt(0)); in DoBranch()
1435 HType type = instr->hydrogen()->value()->type(); in DoBranch()
1446 ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types(); in DoBranch()
1477 DeoptimizeIf(zero, instr->environment()); in DoBranch()
1482 map = ToRegister(instr->TempAt(0)); in DoBranch()
1526 DeoptimizeIf(no_condition, instr->environment()); in DoBranch()
1541 void LCodeGen::DoGoto(LGoto* instr) { in DoGoto() argument
1542 EmitGoto(instr->block_id()); in DoGoto()
1574 void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) { in DoCmpIDAndBranch() argument
1575 LOperand* left = instr->InputAt(0); in DoCmpIDAndBranch()
1576 LOperand* right = instr->InputAt(1); in DoCmpIDAndBranch()
1577 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoCmpIDAndBranch()
1578 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoCmpIDAndBranch()
1579 Condition cc = TokenToCondition(instr->op(), instr->is_double()); in DoCmpIDAndBranch()
1586 EvalComparison(instr->op(), left_val, right_val) ? true_block in DoCmpIDAndBranch()
1590 if (instr->is_double()) { in DoCmpIDAndBranch()
1611 void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { in DoCmpObjectEqAndBranch() argument
1612 Register left = ToRegister(instr->InputAt(0)); in DoCmpObjectEqAndBranch()
1613 Operand right = ToOperand(instr->InputAt(1)); in DoCmpObjectEqAndBranch()
1614 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoCmpObjectEqAndBranch()
1615 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoCmpObjectEqAndBranch()
1622 void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { in DoCmpConstantEqAndBranch() argument
1623 Register left = ToRegister(instr->InputAt(0)); in DoCmpConstantEqAndBranch()
1624 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoCmpConstantEqAndBranch()
1625 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoCmpConstantEqAndBranch()
1627 __ cmp(left, instr->hydrogen()->right()); in DoCmpConstantEqAndBranch()
1632 void LCodeGen::DoIsNilAndBranch(LIsNilAndBranch* instr) { in DoIsNilAndBranch() argument
1633 Register reg = ToRegister(instr->InputAt(0)); in DoIsNilAndBranch()
1634 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsNilAndBranch()
1638 if (instr->hydrogen()->representation().IsSpecialization() || in DoIsNilAndBranch()
1639 instr->hydrogen()->type().IsSmi()) { in DoIsNilAndBranch()
1644 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsNilAndBranch()
1645 Handle<Object> nil_value = instr->nil() == kNullValue ? in DoIsNilAndBranch()
1649 if (instr->kind() == kStrictEquality) { in DoIsNilAndBranch()
1652 Handle<Object> other_nil_value = instr->nil() == kNullValue ? in DoIsNilAndBranch()
1663 Register scratch = ToRegister(instr->TempAt(0)); in DoIsNilAndBranch()
1695 void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { in DoIsObjectAndBranch() argument
1696 Register reg = ToRegister(instr->InputAt(0)); in DoIsObjectAndBranch()
1697 Register temp = ToRegister(instr->TempAt(0)); in DoIsObjectAndBranch()
1699 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsObjectAndBranch()
1700 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsObjectAndBranch()
1721 void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { in DoIsStringAndBranch() argument
1722 Register reg = ToRegister(instr->InputAt(0)); in DoIsStringAndBranch()
1723 Register temp = ToRegister(instr->TempAt(0)); in DoIsStringAndBranch()
1725 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsStringAndBranch()
1726 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsStringAndBranch()
1735 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { in DoIsSmiAndBranch() argument
1736 Operand input = ToOperand(instr->InputAt(0)); in DoIsSmiAndBranch()
1738 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsSmiAndBranch()
1739 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsSmiAndBranch()
1746 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { in DoIsUndetectableAndBranch() argument
1747 Register input = ToRegister(instr->InputAt(0)); in DoIsUndetectableAndBranch()
1748 Register temp = ToRegister(instr->TempAt(0)); in DoIsUndetectableAndBranch()
1750 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsUndetectableAndBranch()
1751 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsUndetectableAndBranch()
1782 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { in DoStringCompareAndBranch() argument
1783 Token::Value op = instr->op(); in DoStringCompareAndBranch()
1784 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoStringCompareAndBranch()
1785 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoStringCompareAndBranch()
1788 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoStringCompareAndBranch()
1797 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { in TestType() argument
1798 InstanceType from = instr->from(); in TestType()
1799 InstanceType to = instr->to(); in TestType()
1806 static Condition BranchCondition(HHasInstanceTypeAndBranch* instr) { in BranchCondition() argument
1807 InstanceType from = instr->from(); in BranchCondition()
1808 InstanceType to = instr->to(); in BranchCondition()
1817 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { in DoHasInstanceTypeAndBranch() argument
1818 Register input = ToRegister(instr->InputAt(0)); in DoHasInstanceTypeAndBranch()
1819 Register temp = ToRegister(instr->TempAt(0)); in DoHasInstanceTypeAndBranch()
1821 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoHasInstanceTypeAndBranch()
1822 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoHasInstanceTypeAndBranch()
1828 __ CmpObjectType(input, TestType(instr->hydrogen()), temp); in DoHasInstanceTypeAndBranch()
1829 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen())); in DoHasInstanceTypeAndBranch()
1833 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { in DoGetCachedArrayIndex() argument
1834 Register input = ToRegister(instr->InputAt(0)); in DoGetCachedArrayIndex()
1835 Register result = ToRegister(instr->result()); in DoGetCachedArrayIndex()
1847 LHasCachedArrayIndexAndBranch* instr) { in DoHasCachedArrayIndexAndBranch() argument
1848 Register input = ToRegister(instr->InputAt(0)); in DoHasCachedArrayIndexAndBranch()
1850 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoHasCachedArrayIndexAndBranch()
1851 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoHasCachedArrayIndexAndBranch()
1924 void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) { in DoClassOfTestAndBranch() argument
1925 Register input = ToRegister(instr->InputAt(0)); in DoClassOfTestAndBranch()
1926 Register temp = ToRegister(instr->TempAt(0)); in DoClassOfTestAndBranch()
1927 Register temp2 = ToRegister(instr->TempAt(1)); in DoClassOfTestAndBranch()
1929 Handle<String> class_name = instr->hydrogen()->class_name(); in DoClassOfTestAndBranch()
1931 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoClassOfTestAndBranch()
1932 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoClassOfTestAndBranch()
1943 void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) { in DoCmpMapAndBranch() argument
1944 Register reg = ToRegister(instr->InputAt(0)); in DoCmpMapAndBranch()
1945 int true_block = instr->true_block_id(); in DoCmpMapAndBranch()
1946 int false_block = instr->false_block_id(); in DoCmpMapAndBranch()
1948 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), instr->map()); in DoCmpMapAndBranch()
1953 void LCodeGen::DoInstanceOf(LInstanceOf* instr) { in DoInstanceOf() argument
1955 ASSERT(ToRegister(instr->context()).is(esi)); in DoInstanceOf()
1957 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoInstanceOf()
1962 __ mov(ToRegister(instr->result()), factory()->false_value()); in DoInstanceOf()
1965 __ mov(ToRegister(instr->result()), factory()->true_value()); in DoInstanceOf()
1970 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { in DoInstanceOfKnownGlobal() argument
1974 LInstanceOfKnownGlobal* instr) in DoInstanceOfKnownGlobal() argument
1975 : LDeferredCode(codegen), instr_(instr) { } in DoInstanceOfKnownGlobal()
1979 virtual LInstruction* instr() { return instr_; } in DoInstanceOfKnownGlobal() function in v8::internal::LCodeGen::DoInstanceOfKnownGlobal::DeferredInstanceOfKnownGlobal
1987 deferred = new DeferredInstanceOfKnownGlobal(this, instr); in DoInstanceOfKnownGlobal()
1990 Register object = ToRegister(instr->InputAt(1)); in DoInstanceOfKnownGlobal()
1991 Register temp = ToRegister(instr->TempAt(0)); in DoInstanceOfKnownGlobal()
2000 Register map = ToRegister(instr->TempAt(0)); in DoInstanceOfKnownGlobal()
2025 __ mov(ToRegister(instr->result()), factory()->false_value()); in DoInstanceOfKnownGlobal()
2034 void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, in DoDeferredInstanceOfKnownGlobal() argument
2051 Register temp = ToRegister(instr->TempAt(0)); in DoDeferredInstanceOfKnownGlobal()
2053 __ LoadHeapObject(InstanceofStub::right(), instr->function()); in DoDeferredInstanceOfKnownGlobal()
2060 instr, in DoDeferredInstanceOfKnownGlobal()
2062 ASSERT(instr->HasDeoptimizationEnvironment()); in DoDeferredInstanceOfKnownGlobal()
2063 LEnvironment* env = instr->deoptimization_environment(); in DoDeferredInstanceOfKnownGlobal()
2071 void LCodeGen::DoCmpT(LCmpT* instr) { in DoCmpT() argument
2072 Token::Value op = instr->op(); in DoCmpT()
2075 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoCmpT()
2081 __ mov(ToRegister(instr->result()), factory()->false_value()); in DoCmpT()
2084 __ mov(ToRegister(instr->result()), factory()->true_value()); in DoCmpT()
2089 void LCodeGen::DoReturn(LReturn* instr) { in DoReturn() argument
2105 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { in DoLoadGlobalCell() argument
2106 Register result = ToRegister(instr->result()); in DoLoadGlobalCell()
2107 __ mov(result, Operand::Cell(instr->hydrogen()->cell())); in DoLoadGlobalCell()
2108 if (instr->hydrogen()->RequiresHoleCheck()) { in DoLoadGlobalCell()
2110 DeoptimizeIf(equal, instr->environment()); in DoLoadGlobalCell()
2115 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { in DoLoadGlobalGeneric() argument
2116 ASSERT(ToRegister(instr->context()).is(esi)); in DoLoadGlobalGeneric()
2117 ASSERT(ToRegister(instr->global_object()).is(eax)); in DoLoadGlobalGeneric()
2118 ASSERT(ToRegister(instr->result()).is(eax)); in DoLoadGlobalGeneric()
2120 __ mov(ecx, instr->name()); in DoLoadGlobalGeneric()
2121 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET : in DoLoadGlobalGeneric()
2124 CallCode(ic, mode, instr); in DoLoadGlobalGeneric()
2128 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { in DoStoreGlobalCell() argument
2129 Register value = ToRegister(instr->value()); in DoStoreGlobalCell()
2130 Handle<JSGlobalPropertyCell> cell_handle = instr->hydrogen()->cell(); in DoStoreGlobalCell()
2136 if (instr->hydrogen()->RequiresHoleCheck()) { in DoStoreGlobalCell()
2138 DeoptimizeIf(equal, instr->environment()); in DoStoreGlobalCell()
2147 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { in DoStoreGlobalGeneric() argument
2148 ASSERT(ToRegister(instr->context()).is(esi)); in DoStoreGlobalGeneric()
2149 ASSERT(ToRegister(instr->global_object()).is(edx)); in DoStoreGlobalGeneric()
2150 ASSERT(ToRegister(instr->value()).is(eax)); in DoStoreGlobalGeneric()
2152 __ mov(ecx, instr->name()); in DoStoreGlobalGeneric()
2153 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) in DoStoreGlobalGeneric()
2156 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); in DoStoreGlobalGeneric()
2160 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { in DoLoadContextSlot() argument
2161 Register context = ToRegister(instr->context()); in DoLoadContextSlot()
2162 Register result = ToRegister(instr->result()); in DoLoadContextSlot()
2163 __ mov(result, ContextOperand(context, instr->slot_index())); in DoLoadContextSlot()
2165 if (instr->hydrogen()->RequiresHoleCheck()) { in DoLoadContextSlot()
2167 if (instr->hydrogen()->DeoptimizesOnHole()) { in DoLoadContextSlot()
2168 DeoptimizeIf(equal, instr->environment()); in DoLoadContextSlot()
2179 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { in DoStoreContextSlot() argument
2180 Register context = ToRegister(instr->context()); in DoStoreContextSlot()
2181 Register value = ToRegister(instr->value()); in DoStoreContextSlot()
2185 Operand target = ContextOperand(context, instr->slot_index()); in DoStoreContextSlot()
2186 if (instr->hydrogen()->RequiresHoleCheck()) { in DoStoreContextSlot()
2188 if (instr->hydrogen()->DeoptimizesOnHole()) { in DoStoreContextSlot()
2189 DeoptimizeIf(equal, instr->environment()); in DoStoreContextSlot()
2196 if (instr->hydrogen()->NeedsWriteBarrier()) { in DoStoreContextSlot()
2197 HType type = instr->hydrogen()->value()->type(); in DoStoreContextSlot()
2200 Register temp = ToRegister(instr->TempAt(0)); in DoStoreContextSlot()
2201 int offset = Context::SlotOffset(instr->slot_index()); in DoStoreContextSlot()
2215 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { in DoLoadNamedField() argument
2216 Register object = ToRegister(instr->object()); in DoLoadNamedField()
2217 Register result = ToRegister(instr->result()); in DoLoadNamedField()
2218 if (instr->hydrogen()->is_in_object()) { in DoLoadNamedField()
2219 __ mov(result, FieldOperand(object, instr->hydrogen()->offset())); in DoLoadNamedField()
2222 __ mov(result, FieldOperand(result, instr->hydrogen()->offset())); in DoLoadNamedField()
2271 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { in DoLoadNamedFieldPolymorphic() argument
2272 Register object = ToRegister(instr->object()); in DoLoadNamedFieldPolymorphic()
2273 Register result = ToRegister(instr->result()); in DoLoadNamedFieldPolymorphic()
2275 int map_count = instr->hydrogen()->types()->length(); in DoLoadNamedFieldPolymorphic()
2276 Handle<String> name = instr->hydrogen()->name(); in DoLoadNamedFieldPolymorphic()
2278 ASSERT(instr->hydrogen()->need_generic()); in DoLoadNamedFieldPolymorphic()
2281 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoLoadNamedFieldPolymorphic()
2285 Handle<Map> map = instr->hydrogen()->types()->at(i); in DoLoadNamedFieldPolymorphic()
2293 Handle<Map> map = instr->hydrogen()->types()->last(); in DoLoadNamedFieldPolymorphic()
2295 if (instr->hydrogen()->need_generic()) { in DoLoadNamedFieldPolymorphic()
2303 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoLoadNamedFieldPolymorphic()
2305 DeoptimizeIf(not_equal, instr->environment()); in DoLoadNamedFieldPolymorphic()
2313 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { in DoLoadNamedGeneric() argument
2314 ASSERT(ToRegister(instr->context()).is(esi)); in DoLoadNamedGeneric()
2315 ASSERT(ToRegister(instr->object()).is(eax)); in DoLoadNamedGeneric()
2316 ASSERT(ToRegister(instr->result()).is(eax)); in DoLoadNamedGeneric()
2318 __ mov(ecx, instr->name()); in DoLoadNamedGeneric()
2320 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoLoadNamedGeneric()
2324 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { in DoLoadFunctionPrototype() argument
2325 Register function = ToRegister(instr->function()); in DoLoadFunctionPrototype()
2326 Register temp = ToRegister(instr->TempAt(0)); in DoLoadFunctionPrototype()
2327 Register result = ToRegister(instr->result()); in DoLoadFunctionPrototype()
2331 DeoptimizeIf(not_equal, instr->environment()); in DoLoadFunctionPrototype()
2345 DeoptimizeIf(equal, instr->environment()); in DoLoadFunctionPrototype()
2366 void LCodeGen::DoLoadElements(LLoadElements* instr) { in DoLoadElements() argument
2367 Register result = ToRegister(instr->result()); in DoLoadElements()
2368 Register input = ToRegister(instr->InputAt(0)); in DoLoadElements()
2400 LLoadExternalArrayPointer* instr) { in DoLoadExternalArrayPointer() argument
2401 Register result = ToRegister(instr->result()); in DoLoadExternalArrayPointer()
2402 Register input = ToRegister(instr->InputAt(0)); in DoLoadExternalArrayPointer()
2408 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { in DoAccessArgumentsAt() argument
2409 Register arguments = ToRegister(instr->arguments()); in DoAccessArgumentsAt()
2410 Register length = ToRegister(instr->length()); in DoAccessArgumentsAt()
2411 Operand index = ToOperand(instr->index()); in DoAccessArgumentsAt()
2412 Register result = ToRegister(instr->result()); in DoAccessArgumentsAt()
2415 DeoptimizeIf(below_equal, instr->environment()); in DoAccessArgumentsAt()
2423 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { in DoLoadKeyedFastElement() argument
2424 Register result = ToRegister(instr->result()); in DoLoadKeyedFastElement()
2428 BuildFastArrayOperand(instr->elements(), instr->key(), in DoLoadKeyedFastElement()
2433 if (instr->hydrogen()->RequiresHoleCheck()) { in DoLoadKeyedFastElement()
2435 DeoptimizeIf(equal, instr->environment()); in DoLoadKeyedFastElement()
2441 LLoadKeyedFastDoubleElement* instr) { in DoLoadKeyedFastDoubleElement() argument
2442 XMMRegister result = ToDoubleRegister(instr->result()); in DoLoadKeyedFastDoubleElement()
2447 instr->elements(), instr->key(), in DoLoadKeyedFastDoubleElement()
2451 DeoptimizeIf(equal, instr->environment()); in DoLoadKeyedFastDoubleElement()
2454 instr->elements(), instr->key(), FAST_DOUBLE_ELEMENTS, in DoLoadKeyedFastDoubleElement()
2482 LLoadKeyedSpecializedArrayElement* instr) { in DoLoadKeyedSpecializedArrayElement() argument
2483 ElementsKind elements_kind = instr->elements_kind(); in DoLoadKeyedSpecializedArrayElement()
2484 Operand operand(BuildFastArrayOperand(instr->external_pointer(), in DoLoadKeyedSpecializedArrayElement()
2485 instr->key(), elements_kind, 0)); in DoLoadKeyedSpecializedArrayElement()
2487 XMMRegister result(ToDoubleRegister(instr->result())); in DoLoadKeyedSpecializedArrayElement()
2491 __ movdbl(ToDoubleRegister(instr->result()), operand); in DoLoadKeyedSpecializedArrayElement()
2493 Register result(ToRegister(instr->result())); in DoLoadKeyedSpecializedArrayElement()
2517 DeoptimizeIf(negative, instr->environment()); in DoLoadKeyedSpecializedArrayElement()
2533 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { in DoLoadKeyedGeneric() argument
2534 ASSERT(ToRegister(instr->context()).is(esi)); in DoLoadKeyedGeneric()
2535 ASSERT(ToRegister(instr->object()).is(edx)); in DoLoadKeyedGeneric()
2536 ASSERT(ToRegister(instr->key()).is(eax)); in DoLoadKeyedGeneric()
2539 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoLoadKeyedGeneric()
2543 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { in DoArgumentsElements() argument
2544 Register result = ToRegister(instr->result()); in DoArgumentsElements()
2568 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { in DoArgumentsLength() argument
2569 Operand elem = ToOperand(instr->InputAt(0)); in DoArgumentsLength()
2570 Register result = ToRegister(instr->result()); in DoArgumentsLength()
2590 void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) { in DoWrapReceiver() argument
2591 Register receiver = ToRegister(instr->receiver()); in DoWrapReceiver()
2592 Register function = ToRegister(instr->function()); in DoWrapReceiver()
2593 Register scratch = ToRegister(instr->TempAt(0)); in DoWrapReceiver()
2621 DeoptimizeIf(equal, instr->environment()); in DoWrapReceiver()
2623 DeoptimizeIf(below, instr->environment()); in DoWrapReceiver()
2638 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { in DoApplyArguments() argument
2639 Register receiver = ToRegister(instr->receiver()); in DoApplyArguments()
2640 Register function = ToRegister(instr->function()); in DoApplyArguments()
2641 Register length = ToRegister(instr->length()); in DoApplyArguments()
2642 Register elements = ToRegister(instr->elements()); in DoApplyArguments()
2645 ASSERT(ToRegister(instr->result()).is(eax)); in DoApplyArguments()
2651 DeoptimizeIf(above, instr->environment()); in DoApplyArguments()
2669 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); in DoApplyArguments()
2670 LPointerMap* pointers = instr->pointer_map(); in DoApplyArguments()
2680 void LCodeGen::DoPushArgument(LPushArgument* instr) { in DoPushArgument() argument
2681 LOperand* argument = instr->InputAt(0); in DoPushArgument()
2686 void LCodeGen::DoThisFunction(LThisFunction* instr) { in DoThisFunction() argument
2687 Register result = ToRegister(instr->result()); in DoThisFunction()
2688 __ LoadHeapObject(result, instr->hydrogen()->closure()); in DoThisFunction()
2692 void LCodeGen::DoContext(LContext* instr) { in DoContext() argument
2693 Register result = ToRegister(instr->result()); in DoContext()
2698 void LCodeGen::DoOuterContext(LOuterContext* instr) { in DoOuterContext() argument
2699 Register context = ToRegister(instr->context()); in DoOuterContext()
2700 Register result = ToRegister(instr->result()); in DoOuterContext()
2706 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { in DoDeclareGlobals() argument
2707 ASSERT(ToRegister(instr->InputAt(0)).is(esi)); in DoDeclareGlobals()
2709 __ push(Immediate(instr->hydrogen()->pairs())); in DoDeclareGlobals()
2710 __ push(Immediate(Smi::FromInt(instr->hydrogen()->flags()))); in DoDeclareGlobals()
2711 CallRuntime(Runtime::kDeclareGlobals, 3, instr); in DoDeclareGlobals()
2715 void LCodeGen::DoGlobalObject(LGlobalObject* instr) { in DoGlobalObject() argument
2716 Register context = ToRegister(instr->context()); in DoGlobalObject()
2717 Register result = ToRegister(instr->result()); in DoGlobalObject()
2722 void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) { in DoGlobalReceiver() argument
2723 Register global = ToRegister(instr->global()); in DoGlobalReceiver()
2724 Register result = ToRegister(instr->result()); in DoGlobalReceiver()
2731 LInstruction* instr, in CallKnownFunction() argument
2736 LPointerMap* pointers = instr->pointer_map(); in CallKnownFunction()
2767 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); in CallKnownFunction()
2778 void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) { in DoCallConstantFunction() argument
2779 ASSERT(ToRegister(instr->result()).is(eax)); in DoCallConstantFunction()
2780 CallKnownFunction(instr->function(), in DoCallConstantFunction()
2781 instr->arity(), in DoCallConstantFunction()
2782 instr, in DoCallConstantFunction()
2787 void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) { in DoDeferredMathAbsTaggedHeapNumber() argument
2788 Register input_reg = ToRegister(instr->value()); in DoDeferredMathAbsTaggedHeapNumber()
2791 DeoptimizeIf(not_equal, instr->environment()); in DoDeferredMathAbsTaggedHeapNumber()
2820 instr, instr->context()); in DoDeferredMathAbsTaggedHeapNumber()
2840 void LCodeGen::EmitIntegerMathAbs(LUnaryMathOperation* instr) { in EmitIntegerMathAbs() argument
2841 Register input_reg = ToRegister(instr->value()); in EmitIntegerMathAbs()
2847 DeoptimizeIf(negative, instr->environment()); in EmitIntegerMathAbs()
2852 void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) { in DoMathAbs() argument
2857 LUnaryMathOperation* instr) in DoMathAbs() argument
2858 : LDeferredCode(codegen), instr_(instr) { } in DoMathAbs()
2862 virtual LInstruction* instr() { return instr_; } in DoMathAbs() function in v8::internal::LCodeGen::DoMathAbs::DeferredMathAbsTaggedHeapNumber
2867 ASSERT(instr->value()->Equals(instr->result())); in DoMathAbs()
2868 Representation r = instr->hydrogen()->value()->representation(); in DoMathAbs()
2872 XMMRegister input_reg = ToDoubleRegister(instr->value()); in DoMathAbs()
2877 EmitIntegerMathAbs(instr); in DoMathAbs()
2880 new DeferredMathAbsTaggedHeapNumber(this, instr); in DoMathAbs()
2881 Register input_reg = ToRegister(instr->value()); in DoMathAbs()
2884 EmitIntegerMathAbs(instr); in DoMathAbs()
2890 void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { in DoMathFloor() argument
2892 Register output_reg = ToRegister(instr->result()); in DoMathFloor()
2893 XMMRegister input_reg = ToDoubleRegister(instr->value()); in DoMathFloor()
2897 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoMathFloor()
2905 DeoptimizeIf(not_zero, instr->environment()); in DoMathFloor()
2912 DeoptimizeIf(equal, instr->environment()); in DoMathFloor()
2918 DeoptimizeIf(below, instr->environment()); in DoMathFloor()
2920 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoMathFloor()
2926 DeoptimizeIf(not_zero, instr->environment()); in DoMathFloor()
2937 DeoptimizeIf(equal, instr->environment()); in DoMathFloor()
2942 void LCodeGen::DoMathRound(LUnaryMathOperation* instr) { in DoMathRound() argument
2944 Register output_reg = ToRegister(instr->result()); in DoMathRound()
2945 XMMRegister input_reg = ToDoubleRegister(instr->value()); in DoMathRound()
2962 DeoptimizeIf(equal, instr->environment()); in DoMathRound()
2969 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoMathRound()
2973 DeoptimizeIf(not_zero, instr->environment()); in DoMathRound()
2980 DeoptimizeIf(below, instr->environment()); in DoMathRound()
2987 void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) { in DoMathSqrt() argument
2988 XMMRegister input_reg = ToDoubleRegister(instr->value()); in DoMathSqrt()
2989 ASSERT(ToDoubleRegister(instr->result()).is(input_reg)); in DoMathSqrt()
2994 void LCodeGen::DoMathPowHalf(LMathPowHalf* instr) { in DoMathPowHalf() argument
2996 XMMRegister input_reg = ToDoubleRegister(instr->value()); in DoMathPowHalf()
2997 Register scratch = ToRegister(instr->temp()); in DoMathPowHalf()
2998 ASSERT(ToDoubleRegister(instr->result()).is(input_reg)); in DoMathPowHalf()
3028 void LCodeGen::DoPower(LPower* instr) { in DoPower() argument
3029 Representation exponent_type = instr->hydrogen()->right()->representation(); in DoPower()
3032 ASSERT(!instr->InputAt(1)->IsDoubleRegister() || in DoPower()
3033 ToDoubleRegister(instr->InputAt(1)).is(xmm1)); in DoPower()
3034 ASSERT(!instr->InputAt(1)->IsRegister() || in DoPower()
3035 ToRegister(instr->InputAt(1)).is(eax)); in DoPower()
3036 ASSERT(ToDoubleRegister(instr->InputAt(0)).is(xmm2)); in DoPower()
3037 ASSERT(ToDoubleRegister(instr->result()).is(xmm3)); in DoPower()
3043 DeoptimizeIf(not_equal, instr->environment()); in DoPower()
3058 void LCodeGen::DoRandom(LRandom* instr) { in DoRandom() argument
3061 DeferredDoRandom(LCodeGen* codegen, LRandom* instr) in DoRandom() argument
3062 : LDeferredCode(codegen), instr_(instr) { } in DoRandom()
3064 virtual LInstruction* instr() { return instr_; } in DoRandom() function in v8::internal::LCodeGen::DoRandom::DeferredDoRandom
3069 DeferredDoRandom* deferred = new DeferredDoRandom(this, instr); in DoRandom()
3073 ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); in DoRandom()
3074 ASSERT(ToRegister(instr->InputAt(0)).is(eax)); in DoRandom()
3129 void LCodeGen::DoDeferredRandom(LRandom* instr) { in DoDeferredRandom() argument
3137 void LCodeGen::DoMathLog(LUnaryMathOperation* instr) { in DoMathLog() argument
3138 ASSERT(instr->value()->Equals(instr->result())); in DoMathLog()
3139 XMMRegister input_reg = ToDoubleRegister(instr->value()); in DoMathLog()
3168 void LCodeGen::DoMathTan(LUnaryMathOperation* instr) { in DoMathTan() argument
3169 ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); in DoMathTan()
3172 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoMathTan()
3176 void LCodeGen::DoMathCos(LUnaryMathOperation* instr) { in DoMathCos() argument
3177 ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); in DoMathCos()
3180 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoMathCos()
3184 void LCodeGen::DoMathSin(LUnaryMathOperation* instr) { in DoMathSin() argument
3185 ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); in DoMathSin()
3188 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoMathSin()
3192 void LCodeGen::DoUnaryMathOperation(LUnaryMathOperation* instr) { in DoUnaryMathOperation() argument
3193 switch (instr->op()) { in DoUnaryMathOperation()
3195 DoMathAbs(instr); in DoUnaryMathOperation()
3198 DoMathFloor(instr); in DoUnaryMathOperation()
3201 DoMathRound(instr); in DoUnaryMathOperation()
3204 DoMathSqrt(instr); in DoUnaryMathOperation()
3207 DoMathCos(instr); in DoUnaryMathOperation()
3210 DoMathSin(instr); in DoUnaryMathOperation()
3213 DoMathTan(instr); in DoUnaryMathOperation()
3216 DoMathLog(instr); in DoUnaryMathOperation()
3225 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { in DoInvokeFunction() argument
3226 ASSERT(ToRegister(instr->context()).is(esi)); in DoInvokeFunction()
3227 ASSERT(ToRegister(instr->function()).is(edi)); in DoInvokeFunction()
3228 ASSERT(instr->HasPointerMap()); in DoInvokeFunction()
3229 ASSERT(instr->HasDeoptimizationEnvironment()); in DoInvokeFunction()
3230 LPointerMap* pointers = instr->pointer_map(); in DoInvokeFunction()
3234 ParameterCount count(instr->arity()); in DoInvokeFunction()
3239 void LCodeGen::DoCallKeyed(LCallKeyed* instr) { in DoCallKeyed() argument
3240 ASSERT(ToRegister(instr->context()).is(esi)); in DoCallKeyed()
3241 ASSERT(ToRegister(instr->key()).is(ecx)); in DoCallKeyed()
3242 ASSERT(ToRegister(instr->result()).is(eax)); in DoCallKeyed()
3244 int arity = instr->arity(); in DoCallKeyed()
3247 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoCallKeyed()
3251 void LCodeGen::DoCallNamed(LCallNamed* instr) { in DoCallNamed() argument
3252 ASSERT(ToRegister(instr->context()).is(esi)); in DoCallNamed()
3253 ASSERT(ToRegister(instr->result()).is(eax)); in DoCallNamed()
3255 int arity = instr->arity(); in DoCallNamed()
3259 __ mov(ecx, instr->name()); in DoCallNamed()
3260 CallCode(ic, mode, instr); in DoCallNamed()
3264 void LCodeGen::DoCallFunction(LCallFunction* instr) { in DoCallFunction() argument
3265 ASSERT(ToRegister(instr->context()).is(esi)); in DoCallFunction()
3266 ASSERT(ToRegister(instr->function()).is(edi)); in DoCallFunction()
3267 ASSERT(ToRegister(instr->result()).is(eax)); in DoCallFunction()
3269 int arity = instr->arity(); in DoCallFunction()
3271 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoCallFunction()
3275 void LCodeGen::DoCallGlobal(LCallGlobal* instr) { in DoCallGlobal() argument
3276 ASSERT(ToRegister(instr->context()).is(esi)); in DoCallGlobal()
3277 ASSERT(ToRegister(instr->result()).is(eax)); in DoCallGlobal()
3279 int arity = instr->arity(); in DoCallGlobal()
3283 __ mov(ecx, instr->name()); in DoCallGlobal()
3284 CallCode(ic, mode, instr); in DoCallGlobal()
3288 void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) { in DoCallKnownGlobal() argument
3289 ASSERT(ToRegister(instr->result()).is(eax)); in DoCallKnownGlobal()
3290 CallKnownFunction(instr->target(), instr->arity(), instr, CALL_AS_FUNCTION); in DoCallKnownGlobal()
3294 void LCodeGen::DoCallNew(LCallNew* instr) { in DoCallNew() argument
3295 ASSERT(ToRegister(instr->context()).is(esi)); in DoCallNew()
3296 ASSERT(ToRegister(instr->constructor()).is(edi)); in DoCallNew()
3297 ASSERT(ToRegister(instr->result()).is(eax)); in DoCallNew()
3300 __ Set(eax, Immediate(instr->arity())); in DoCallNew()
3301 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); in DoCallNew()
3305 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { in DoCallRuntime() argument
3306 CallRuntime(instr->function(), instr->arity(), instr); in DoCallRuntime()
3310 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { in DoStoreNamedField() argument
3311 Register object = ToRegister(instr->object()); in DoStoreNamedField()
3312 Register value = ToRegister(instr->value()); in DoStoreNamedField()
3313 int offset = instr->offset(); in DoStoreNamedField()
3315 if (!instr->transition().is_null()) { in DoStoreNamedField()
3316 __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition()); in DoStoreNamedField()
3320 HType type = instr->hydrogen()->value()->type(); in DoStoreNamedField()
3323 if (instr->is_in_object()) { in DoStoreNamedField()
3325 if (instr->hydrogen()->NeedsWriteBarrier()) { in DoStoreNamedField()
3326 Register temp = ToRegister(instr->TempAt(0)); in DoStoreNamedField()
3337 Register temp = ToRegister(instr->TempAt(0)); in DoStoreNamedField()
3340 if (instr->hydrogen()->NeedsWriteBarrier()) { in DoStoreNamedField()
3355 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { in DoStoreNamedGeneric() argument
3356 ASSERT(ToRegister(instr->context()).is(esi)); in DoStoreNamedGeneric()
3357 ASSERT(ToRegister(instr->object()).is(edx)); in DoStoreNamedGeneric()
3358 ASSERT(ToRegister(instr->value()).is(eax)); in DoStoreNamedGeneric()
3360 __ mov(ecx, instr->name()); in DoStoreNamedGeneric()
3361 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) in DoStoreNamedGeneric()
3364 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoStoreNamedGeneric()
3368 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { in DoBoundsCheck() argument
3369 if (instr->index()->IsConstantOperand()) { in DoBoundsCheck()
3370 __ cmp(ToOperand(instr->length()), in DoBoundsCheck()
3371 Immediate(ToInteger32(LConstantOperand::cast(instr->index())))); in DoBoundsCheck()
3372 DeoptimizeIf(below_equal, instr->environment()); in DoBoundsCheck()
3374 __ cmp(ToRegister(instr->index()), ToOperand(instr->length())); in DoBoundsCheck()
3375 DeoptimizeIf(above_equal, instr->environment()); in DoBoundsCheck()
3381 LStoreKeyedSpecializedArrayElement* instr) { in DoStoreKeyedSpecializedArrayElement() argument
3382 ElementsKind elements_kind = instr->elements_kind(); in DoStoreKeyedSpecializedArrayElement()
3383 Operand operand(BuildFastArrayOperand(instr->external_pointer(), in DoStoreKeyedSpecializedArrayElement()
3384 instr->key(), elements_kind, 0)); in DoStoreKeyedSpecializedArrayElement()
3386 __ cvtsd2ss(xmm0, ToDoubleRegister(instr->value())); in DoStoreKeyedSpecializedArrayElement()
3389 __ movdbl(operand, ToDoubleRegister(instr->value())); in DoStoreKeyedSpecializedArrayElement()
3391 Register value = ToRegister(instr->value()); in DoStoreKeyedSpecializedArrayElement()
3420 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) { in DoStoreKeyedFastElement() argument
3421 Register value = ToRegister(instr->value()); in DoStoreKeyedFastElement()
3422 Register elements = ToRegister(instr->object()); in DoStoreKeyedFastElement()
3423 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg; in DoStoreKeyedFastElement()
3426 if (instr->key()->IsConstantOperand()) { in DoStoreKeyedFastElement()
3427 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); in DoStoreKeyedFastElement()
3428 LConstantOperand* const_operand = LConstantOperand::cast(instr->key()); in DoStoreKeyedFastElement()
3440 if (instr->hydrogen()->NeedsWriteBarrier()) { in DoStoreKeyedFastElement()
3441 HType type = instr->hydrogen()->value()->type(); in DoStoreKeyedFastElement()
3461 LStoreKeyedFastDoubleElement* instr) { in DoStoreKeyedFastDoubleElement() argument
3462 XMMRegister value = ToDoubleRegister(instr->value()); in DoStoreKeyedFastDoubleElement()
3474 instr->elements(), instr->key(), FAST_DOUBLE_ELEMENTS, in DoStoreKeyedFastDoubleElement()
3480 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { in DoStoreKeyedGeneric() argument
3481 ASSERT(ToRegister(instr->context()).is(esi)); in DoStoreKeyedGeneric()
3482 ASSERT(ToRegister(instr->object()).is(edx)); in DoStoreKeyedGeneric()
3483 ASSERT(ToRegister(instr->key()).is(ecx)); in DoStoreKeyedGeneric()
3484 ASSERT(ToRegister(instr->value()).is(eax)); in DoStoreKeyedGeneric()
3486 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) in DoStoreKeyedGeneric()
3489 CallCode(ic, RelocInfo::CODE_TARGET, instr); in DoStoreKeyedGeneric()
3493 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { in DoTransitionElementsKind() argument
3494 Register object_reg = ToRegister(instr->object()); in DoTransitionElementsKind()
3495 Register new_map_reg = ToRegister(instr->new_map_reg()); in DoTransitionElementsKind()
3497 Handle<Map> from_map = instr->original_map(); in DoTransitionElementsKind()
3498 Handle<Map> to_map = instr->transitioned_map(); in DoTransitionElementsKind()
3507 Register object_reg = ToRegister(instr->object()); in DoTransitionElementsKind()
3510 ASSERT_NE(instr->temp_reg(), NULL); in DoTransitionElementsKind()
3512 ToRegister(instr->temp_reg()), kDontSaveFPRegs); in DoTransitionElementsKind()
3515 Register fixed_object_reg = ToRegister(instr->temp_reg()); in DoTransitionElementsKind()
3520 RelocInfo::CODE_TARGET, instr); in DoTransitionElementsKind()
3522 Register fixed_object_reg = ToRegister(instr->temp_reg()); in DoTransitionElementsKind()
3527 RelocInfo::CODE_TARGET, instr); in DoTransitionElementsKind()
3535 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { in DoStringCharCodeAt() argument
3538 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) in DoStringCharCodeAt() argument
3539 : LDeferredCode(codegen), instr_(instr) { } in DoStringCharCodeAt()
3541 virtual LInstruction* instr() { return instr_; } in DoStringCharCodeAt() function in v8::internal::LCodeGen::DoStringCharCodeAt::DeferredStringCharCodeAt
3547 new DeferredStringCharCodeAt(this, instr); in DoStringCharCodeAt()
3551 ToRegister(instr->string()), in DoStringCharCodeAt()
3552 ToRegister(instr->index()), in DoStringCharCodeAt()
3553 ToRegister(instr->result()), in DoStringCharCodeAt()
3559 void LCodeGen::DoDeferredStringCharCodeAt(LStringCharCodeAt* instr) { in DoDeferredStringCharCodeAt() argument
3560 Register string = ToRegister(instr->string()); in DoDeferredStringCharCodeAt()
3561 Register result = ToRegister(instr->result()); in DoDeferredStringCharCodeAt()
3573 if (instr->index()->IsConstantOperand()) { in DoDeferredStringCharCodeAt()
3574 int const_index = ToInteger32(LConstantOperand::cast(instr->index())); in DoDeferredStringCharCodeAt()
3577 Register index = ToRegister(instr->index()); in DoDeferredStringCharCodeAt()
3582 instr, instr->context()); in DoDeferredStringCharCodeAt()
3591 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { in DoStringCharFromCode() argument
3594 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) in DoStringCharFromCode() argument
3595 : LDeferredCode(codegen), instr_(instr) { } in DoStringCharFromCode()
3597 virtual LInstruction* instr() { return instr_; } in DoStringCharFromCode() function in v8::internal::LCodeGen::DoStringCharFromCode::DeferredStringCharFromCode
3603 new DeferredStringCharFromCode(this, instr); in DoStringCharFromCode()
3605 ASSERT(instr->hydrogen()->value()->representation().IsInteger32()); in DoStringCharFromCode()
3606 Register char_code = ToRegister(instr->char_code()); in DoStringCharFromCode()
3607 Register result = ToRegister(instr->result()); in DoStringCharFromCode()
3622 void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) { in DoDeferredStringCharFromCode() argument
3623 Register char_code = ToRegister(instr->char_code()); in DoDeferredStringCharFromCode()
3624 Register result = ToRegister(instr->result()); in DoDeferredStringCharFromCode()
3634 CallRuntimeFromDeferred(Runtime::kCharFromCode, 1, instr, instr->context()); in DoDeferredStringCharFromCode()
3639 void LCodeGen::DoStringLength(LStringLength* instr) { in DoStringLength() argument
3640 Register string = ToRegister(instr->string()); in DoStringLength()
3641 Register result = ToRegister(instr->result()); in DoStringLength()
3646 void LCodeGen::DoStringAdd(LStringAdd* instr) { in DoStringAdd() argument
3647 EmitPushTaggedOperand(instr->left()); in DoStringAdd()
3648 EmitPushTaggedOperand(instr->right()); in DoStringAdd()
3650 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoStringAdd()
3654 void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { in DoInteger32ToDouble() argument
3655 LOperand* input = instr->InputAt(0); in DoInteger32ToDouble()
3657 LOperand* output = instr->result(); in DoInteger32ToDouble()
3663 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { in DoNumberTagI() argument
3666 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) in DoNumberTagI() argument
3667 : LDeferredCode(codegen), instr_(instr) { } in DoNumberTagI()
3669 virtual LInstruction* instr() { return instr_; } in DoNumberTagI() function in v8::internal::LCodeGen::DoNumberTagI::DeferredNumberTagI
3674 LOperand* input = instr->InputAt(0); in DoNumberTagI()
3675 ASSERT(input->IsRegister() && input->Equals(instr->result())); in DoNumberTagI()
3678 DeferredNumberTagI* deferred = new DeferredNumberTagI(this, instr); in DoNumberTagI()
3685 void LCodeGen::DoDeferredNumberTagI(LNumberTagI* instr) { in DoDeferredNumberTagI() argument
3687 Register reg = ToRegister(instr->InputAt(0)); in DoDeferredNumberTagI()
3720 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); in DoDeferredNumberTagI()
3731 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { in DoNumberTagD() argument
3734 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) in DoNumberTagD() argument
3735 : LDeferredCode(codegen), instr_(instr) { } in DoNumberTagD()
3737 virtual LInstruction* instr() { return instr_; } in DoNumberTagD() function in v8::internal::LCodeGen::DoNumberTagD::DeferredNumberTagD
3742 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0)); in DoNumberTagD()
3743 Register reg = ToRegister(instr->result()); in DoNumberTagD()
3744 Register tmp = ToRegister(instr->TempAt(0)); in DoNumberTagD()
3746 DeferredNumberTagD* deferred = new DeferredNumberTagD(this, instr); in DoNumberTagD()
3757 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { in DoDeferredNumberTagD() argument
3761 Register reg = ToRegister(instr->result()); in DoDeferredNumberTagD()
3773 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); in DoDeferredNumberTagD()
3778 void LCodeGen::DoSmiTag(LSmiTag* instr) { in DoSmiTag() argument
3779 LOperand* input = instr->InputAt(0); in DoSmiTag()
3780 ASSERT(input->IsRegister() && input->Equals(instr->result())); in DoSmiTag()
3781 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow)); in DoSmiTag()
3786 void LCodeGen::DoSmiUntag(LSmiUntag* instr) { in DoSmiUntag() argument
3787 LOperand* input = instr->InputAt(0); in DoSmiUntag()
3788 ASSERT(input->IsRegister() && input->Equals(instr->result())); in DoSmiUntag()
3789 if (instr->needs_check()) { in DoSmiUntag()
3791 DeoptimizeIf(not_zero, instr->environment()); in DoSmiUntag()
3850 void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { in DoDeferredTaggedToI() argument
3852 Register input_reg = ToRegister(instr->InputAt(0)); in DoDeferredTaggedToI()
3858 if (instr->truncating()) { in DoDeferredTaggedToI()
3863 DeoptimizeIf(not_equal, instr->environment()); in DoDeferredTaggedToI()
3883 DeoptimizeIf(no_condition, instr->environment()); in DoDeferredTaggedToI()
3893 XMMRegister xmm_temp = ToDoubleRegister(instr->TempAt(0)); in DoDeferredTaggedToI()
3903 DeoptimizeIf(not_equal, instr->environment()); in DoDeferredTaggedToI()
3904 DeoptimizeIf(parity_even, instr->environment()); // NaN. in DoDeferredTaggedToI()
3908 DeoptimizeIf(not_equal, instr->environment()); in DoDeferredTaggedToI()
3910 XMMRegister xmm_temp = ToDoubleRegister(instr->TempAt(0)); in DoDeferredTaggedToI()
3915 DeoptimizeIf(not_equal, instr->environment()); in DoDeferredTaggedToI()
3916 DeoptimizeIf(parity_even, instr->environment()); // NaN. in DoDeferredTaggedToI()
3917 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoDeferredTaggedToI()
3922 DeoptimizeIf(not_zero, instr->environment()); in DoDeferredTaggedToI()
3929 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { in DoTaggedToI() argument
3932 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) in DoTaggedToI() argument
3933 : LDeferredCode(codegen), instr_(instr) { } in DoTaggedToI()
3935 virtual LInstruction* instr() { return instr_; } in DoTaggedToI() function in v8::internal::LCodeGen::DoTaggedToI::DeferredTaggedToI
3940 LOperand* input = instr->InputAt(0); in DoTaggedToI()
3942 ASSERT(input->Equals(instr->result())); in DoTaggedToI()
3946 DeferredTaggedToI* deferred = new DeferredTaggedToI(this, instr); in DoTaggedToI()
3958 void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) { in DoNumberUntagD() argument
3959 LOperand* input = instr->InputAt(0); in DoNumberUntagD()
3961 LOperand* temp = instr->TempAt(0); in DoNumberUntagD()
3963 LOperand* result = instr->result(); in DoNumberUntagD()
3970 instr->hydrogen()->deoptimize_on_minus_zero(); in DoNumberUntagD()
3976 instr->hydrogen()->deoptimize_on_undefined(), in DoNumberUntagD()
3978 instr->environment()); in DoNumberUntagD()
3982 void LCodeGen::DoDoubleToI(LDoubleToI* instr) { in DoDoubleToI() argument
3983 LOperand* input = instr->InputAt(0); in DoDoubleToI()
3985 LOperand* result = instr->result(); in DoDoubleToI()
3991 if (instr->truncating()) { in DoDoubleToI()
4011 DeoptimizeIf(no_condition, instr->environment()); in DoDoubleToI()
4021 Register temp_reg = ToRegister(instr->TempAt(0)); in DoDoubleToI()
4049 DeoptimizeIf(greater, instr->environment()); in DoDoubleToI()
4080 DeoptimizeIf(not_equal, instr->environment()); in DoDoubleToI()
4081 DeoptimizeIf(parity_even, instr->environment()); // NaN. in DoDoubleToI()
4082 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { in DoDoubleToI()
4092 DeoptimizeIf(not_zero, instr->environment()); in DoDoubleToI()
4099 void LCodeGen::DoCheckSmi(LCheckSmi* instr) { in DoCheckSmi() argument
4100 LOperand* input = instr->InputAt(0); in DoCheckSmi()
4102 DeoptimizeIf(not_zero, instr->environment()); in DoCheckSmi()
4106 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { in DoCheckNonSmi() argument
4107 LOperand* input = instr->InputAt(0); in DoCheckNonSmi()
4109 DeoptimizeIf(zero, instr->environment()); in DoCheckNonSmi()
4113 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { in DoCheckInstanceType() argument
4114 Register input = ToRegister(instr->InputAt(0)); in DoCheckInstanceType()
4115 Register temp = ToRegister(instr->TempAt(0)); in DoCheckInstanceType()
4119 if (instr->hydrogen()->is_interval_check()) { in DoCheckInstanceType()
4122 instr->hydrogen()->GetCheckInterval(&first, &last); in DoCheckInstanceType()
4129 DeoptimizeIf(not_equal, instr->environment()); in DoCheckInstanceType()
4131 DeoptimizeIf(below, instr->environment()); in DoCheckInstanceType()
4136 DeoptimizeIf(above, instr->environment()); in DoCheckInstanceType()
4142 instr->hydrogen()->GetCheckMaskAndTag(&mask, &tag); in DoCheckInstanceType()
4147 DeoptimizeIf(tag == 0 ? not_zero : zero, instr->environment()); in DoCheckInstanceType()
4152 DeoptimizeIf(not_equal, instr->environment()); in DoCheckInstanceType()
4158 void LCodeGen::DoCheckFunction(LCheckFunction* instr) { in DoCheckFunction() argument
4159 Handle<JSFunction> target = instr->hydrogen()->target(); in DoCheckFunction()
4161 Register reg = ToRegister(instr->value()); in DoCheckFunction()
4166 Operand operand = ToOperand(instr->value()); in DoCheckFunction()
4169 DeoptimizeIf(not_equal, instr->environment()); in DoCheckFunction()
4184 void LCodeGen::DoCheckMap(LCheckMap* instr) { in DoCheckMap() argument
4185 LOperand* input = instr->InputAt(0); in DoCheckMap()
4188 Handle<Map> map = instr->hydrogen()->map(); in DoCheckMap()
4189 DoCheckMapCommon(reg, map, instr->hydrogen()->mode(), instr->environment()); in DoCheckMap()
4193 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { in DoClampDToUint8() argument
4194 XMMRegister value_reg = ToDoubleRegister(instr->unclamped()); in DoClampDToUint8()
4195 Register result_reg = ToRegister(instr->result()); in DoClampDToUint8()
4200 void LCodeGen::DoClampIToUint8(LClampIToUint8* instr) { in DoClampIToUint8() argument
4201 ASSERT(instr->unclamped()->Equals(instr->result())); in DoClampIToUint8()
4202 Register value_reg = ToRegister(instr->result()); in DoClampIToUint8()
4207 void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) { in DoClampTToUint8() argument
4208 ASSERT(instr->unclamped()->Equals(instr->result())); in DoClampTToUint8()
4209 Register input_reg = ToRegister(instr->unclamped()); in DoClampTToUint8()
4222 DeoptimizeIf(not_equal, instr->environment()); in DoClampTToUint8()
4241 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { in DoCheckPrototypeMaps() argument
4242 Register reg = ToRegister(instr->TempAt(0)); in DoCheckPrototypeMaps()
4244 Handle<JSObject> holder = instr->holder(); in DoCheckPrototypeMaps()
4245 Handle<JSObject> current_prototype = instr->prototype(); in DoCheckPrototypeMaps()
4253 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); in DoCheckPrototypeMaps()
4263 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); in DoCheckPrototypeMaps()
4267 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { in DoAllocateObject() argument
4270 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) in DoAllocateObject() argument
4271 : LDeferredCode(codegen), instr_(instr) { } in DoAllocateObject()
4273 virtual LInstruction* instr() { return instr_; } in DoAllocateObject() function in v8::internal::LCodeGen::DoAllocateObject::DeferredAllocateObject
4278 DeferredAllocateObject* deferred = new DeferredAllocateObject(this, instr); in DoAllocateObject()
4280 Register result = ToRegister(instr->result()); in DoAllocateObject()
4281 Register scratch = ToRegister(instr->TempAt(0)); in DoAllocateObject()
4282 Handle<JSFunction> constructor = instr->hydrogen()->constructor(); in DoAllocateObject()
4339 void LCodeGen::DoDeferredAllocateObject(LAllocateObject* instr) { in DoDeferredAllocateObject() argument
4340 Register result = ToRegister(instr->result()); in DoDeferredAllocateObject()
4341 Handle<JSFunction> constructor = instr->hydrogen()->constructor(); in DoDeferredAllocateObject()
4350 CallRuntimeFromDeferred(Runtime::kNewObject, 1, instr, instr->context()); in DoDeferredAllocateObject()
4355 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { in DoArrayLiteral() argument
4356 ASSERT(ToRegister(instr->context()).is(esi)); in DoArrayLiteral()
4359 instr->hydrogen()->boilerplate_elements_kind(); in DoArrayLiteral()
4365 __ LoadHeapObject(eax, instr->hydrogen()->boilerplate_object()); in DoArrayLiteral()
4373 DeoptimizeIf(not_equal, instr->environment()); in DoArrayLiteral()
4379 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index()))); in DoArrayLiteral()
4385 int length = instr->hydrogen()->length(); in DoArrayLiteral()
4386 if (instr->hydrogen()->IsCopyOnWrite()) { in DoArrayLiteral()
4387 ASSERT(instr->hydrogen()->depth() == 1); in DoArrayLiteral()
4391 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoArrayLiteral()
4392 } else if (instr->hydrogen()->depth() > 1) { in DoArrayLiteral()
4393 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr); in DoArrayLiteral()
4395 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr); in DoArrayLiteral()
4402 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoArrayLiteral()
4510 void LCodeGen::DoFastLiteral(LFastLiteral* instr) { in DoFastLiteral() argument
4511 ASSERT(ToRegister(instr->context()).is(esi)); in DoFastLiteral()
4512 int size = instr->hydrogen()->total_size(); in DoFastLiteral()
4522 CallRuntime(Runtime::kAllocateInNewSpace, 1, instr); in DoFastLiteral()
4526 __ LoadHeapObject(ebx, instr->hydrogen()->boilerplate()); in DoFastLiteral()
4527 EmitDeepCopy(instr->hydrogen()->boilerplate(), eax, ebx, &offset); in DoFastLiteral()
4532 void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) { in DoObjectLiteral() argument
4533 ASSERT(ToRegister(instr->context()).is(esi)); in DoObjectLiteral()
4534 Handle<FixedArray> literals(instr->environment()->closure()->literals()); in DoObjectLiteral()
4536 instr->hydrogen()->constant_properties(); in DoObjectLiteral()
4540 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index()))); in DoObjectLiteral()
4542 int flags = instr->hydrogen()->fast_elements() in DoObjectLiteral()
4545 flags |= instr->hydrogen()->has_function() in DoObjectLiteral()
4552 if (instr->hydrogen()->depth() > 1) { in DoObjectLiteral()
4553 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); in DoObjectLiteral()
4556 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); in DoObjectLiteral()
4559 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoObjectLiteral()
4564 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { in DoToFastProperties() argument
4565 ASSERT(ToRegister(instr->InputAt(0)).is(eax)); in DoToFastProperties()
4567 CallRuntime(Runtime::kToFastProperties, 1, instr); in DoToFastProperties()
4571 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { in DoRegExpLiteral() argument
4572 ASSERT(ToRegister(instr->context()).is(esi)); in DoRegExpLiteral()
4583 instr->hydrogen()->literal_index() * kPointerSize; in DoRegExpLiteral()
4591 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index()))); in DoRegExpLiteral()
4592 __ push(Immediate(instr->hydrogen()->pattern())); in DoRegExpLiteral()
4593 __ push(Immediate(instr->hydrogen()->flags())); in DoRegExpLiteral()
4594 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr); in DoRegExpLiteral()
4606 CallRuntime(Runtime::kAllocateInNewSpace, 1, instr); in DoRegExpLiteral()
4625 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { in DoFunctionLiteral() argument
4626 ASSERT(ToRegister(instr->context()).is(esi)); in DoFunctionLiteral()
4629 Handle<SharedFunctionInfo> shared_info = instr->shared_info(); in DoFunctionLiteral()
4630 bool pretenure = instr->hydrogen()->pretenure(); in DoFunctionLiteral()
4634 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoFunctionLiteral()
4641 CallRuntime(Runtime::kNewClosure, 3, instr); in DoFunctionLiteral()
4646 void LCodeGen::DoTypeof(LTypeof* instr) { in DoTypeof() argument
4647 LOperand* input = instr->InputAt(1); in DoTypeof()
4649 CallRuntime(Runtime::kTypeof, 1, instr); in DoTypeof()
4653 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { in DoTypeofIsAndBranch() argument
4654 Register input = ToRegister(instr->InputAt(0)); in DoTypeofIsAndBranch()
4655 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoTypeofIsAndBranch()
4656 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoTypeofIsAndBranch()
4661 EmitTypeofIs(true_label, false_label, input, instr->type_literal()); in DoTypeofIsAndBranch()
4737 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { in DoIsConstructCallAndBranch() argument
4738 Register temp = ToRegister(instr->TempAt(0)); in DoIsConstructCallAndBranch()
4739 int true_block = chunk_->LookupDestination(instr->true_block_id()); in DoIsConstructCallAndBranch()
4740 int false_block = chunk_->LookupDestination(instr->false_block_id()); in DoIsConstructCallAndBranch()
4778 void LCodeGen::DoLazyBailout(LLazyBailout* instr) { in DoLazyBailout() argument
4780 ASSERT(instr->HasEnvironment()); in DoLazyBailout()
4781 LEnvironment* env = instr->environment(); in DoLazyBailout()
4787 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { in DoDeoptimize() argument
4788 DeoptimizeIf(no_condition, instr->environment()); in DoDeoptimize()
4792 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { in DoDeleteProperty() argument
4793 LOperand* obj = instr->object(); in DoDeleteProperty()
4794 LOperand* key = instr->key(); in DoDeleteProperty()
4797 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); in DoDeleteProperty()
4798 LPointerMap* pointers = instr->pointer_map(); in DoDeleteProperty()
4810 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) { in DoDeferredStackCheck() argument
4815 instr, RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); in DoDeferredStackCheck()
4816 ASSERT(instr->HasEnvironment()); in DoDeferredStackCheck()
4817 LEnvironment* env = instr->environment(); in DoDeferredStackCheck()
4822 void LCodeGen::DoStackCheck(LStackCheck* instr) { in DoStackCheck() argument
4825 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr) in DoStackCheck() argument
4826 : LDeferredCode(codegen), instr_(instr) { } in DoStackCheck()
4828 virtual LInstruction* instr() { return instr_; } in DoStackCheck() function in v8::internal::LCodeGen::DoStackCheck::DeferredStackCheck
4833 ASSERT(instr->HasEnvironment()); in DoStackCheck()
4834 LEnvironment* env = instr->environment(); in DoStackCheck()
4837 if (instr->hydrogen()->is_function_entry()) { in DoStackCheck()
4845 ASSERT(instr->context()->IsRegister()); in DoStackCheck()
4846 ASSERT(ToRegister(instr->context()).is(esi)); in DoStackCheck()
4848 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); in DoStackCheck()
4854 ASSERT(instr->hydrogen()->is_backwards_branch()); in DoStackCheck()
4857 new DeferredStackCheck(this, instr); in DoStackCheck()
4863 __ bind(instr->done_label()); in DoStackCheck()
4864 deferred_stack_check->SetExit(instr->done_label()); in DoStackCheck()
4873 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { in DoOsrEntry() argument
4877 LEnvironment* environment = instr->environment(); in DoOsrEntry()
4878 environment->SetSpilledRegisters(instr->SpilledRegisterArray(), in DoOsrEntry()
4879 instr->SpilledDoubleRegisterArray()); in DoOsrEntry()
4890 void LCodeGen::DoIn(LIn* instr) { in DoIn() argument
4891 LOperand* obj = instr->object(); in DoIn()
4892 LOperand* key = instr->key(); in DoIn()
4895 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); in DoIn()
4896 LPointerMap* pointers = instr->pointer_map(); in DoIn()
4904 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { in DoForInPrepareMap() argument
4906 DeoptimizeIf(equal, instr->environment()); in DoForInPrepareMap()
4909 DeoptimizeIf(equal, instr->environment()); in DoForInPrepareMap()
4912 DeoptimizeIf(zero, instr->environment()); in DoForInPrepareMap()
4916 DeoptimizeIf(below_equal, instr->environment()); in DoForInPrepareMap()
4927 CallRuntime(Runtime::kGetPropertyNamesFast, 1, instr); in DoForInPrepareMap()
4931 DeoptimizeIf(not_equal, instr->environment()); in DoForInPrepareMap()
4936 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { in DoForInCacheArray() argument
4937 Register map = ToRegister(instr->map()); in DoForInCacheArray()
4938 Register result = ToRegister(instr->result()); in DoForInCacheArray()
4943 FieldOperand(result, FixedArray::SizeFor(instr->idx()))); in DoForInCacheArray()
4945 DeoptimizeIf(equal, instr->environment()); in DoForInCacheArray()
4949 void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) { in DoCheckMapValue() argument
4950 Register object = ToRegister(instr->value()); in DoCheckMapValue()
4951 __ cmp(ToRegister(instr->map()), in DoCheckMapValue()
4953 DeoptimizeIf(not_equal, instr->environment()); in DoCheckMapValue()
4957 void LCodeGen::DoLoadFieldByIndex(LLoadFieldByIndex* instr) { in DoLoadFieldByIndex() argument
4958 Register object = ToRegister(instr->object()); in DoLoadFieldByIndex()
4959 Register index = ToRegister(instr->index()); in DoLoadFieldByIndex()