Lines Matching refs:instr

341     LInstruction* instr = instructions_->at(current_instruction_);
344 if (instr->IsLabel()) {
345 emit_instructions = !LLabel::cast(instr)->HasReplacement();
349 if (FLAG_code_comments && instr->HasInterestingComment(this)) {
352 instr->hydrogen_value()->id(),
353 instr->Mnemonic());
356 if (!CpuFeatures::IsSupported(SSE2)) FlushX87StackIfNecessary(instr);
358 RecordAndUpdatePosition(instr->position());
360 instr->CompileToNative(this);
434 code->instr()->hydrogen_value()->id(),
435 code->instr()->Mnemonic());
622 void LCodeGen::FlushX87StackIfNecessary(LInstruction* instr) {
623 if (x87_stack_depth_ > 0 && instr->ClobbersDoubleRegisters()) {
624 bool double_inputs = instr->HasDoubleRegisterInput();
631 if (double_inputs && instr->IsDoubleInput(reg, this)) {
638 if (instr->IsReturn()) {
861 LInstruction* instr,
863 ASSERT(instr != NULL);
864 LPointerMap* pointers = instr->pointer_map();
867 RecordSafepointWithLazyDeopt(instr, safepoint_mode);
880 LInstruction* instr) {
881 CallCodeGeneric(code, mode, instr, RECORD_SIMPLE_SAFEPOINT);
887 LInstruction* instr) {
888 ASSERT(instr != NULL);
889 ASSERT(instr->HasPointerMap());
890 LPointerMap* pointers = instr->pointer_map();
895 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT);
919 LInstruction* instr,
925 instr->pointer_map(), argc, Safepoint::kNoLazyDeopt);
1141 LInstruction* instr, SafepointMode safepoint_mode) {
1143 RecordSafepoint(instr->pointer_map(), Safepoint::kLazyDeopt);
1147 instr->pointer_map(), 0, Safepoint::kLazyDeopt);
1240 void LCodeGen::DoInstructionGap(LInstructionGap* instr) {
1241 DoGap(instr);
1245 void LCodeGen::DoParameter(LParameter* instr) {
1250 void LCodeGen::DoCallStub(LCallStub* instr) {
1251 ASSERT(ToRegister(instr->context()).is(esi));
1252 ASSERT(ToRegister(instr->result()).is(eax));
1253 switch (instr->hydrogen()->major_key()) {
1256 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
1261 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
1266 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
1271 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
1276 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
1280 TranscendentalCacheStub stub(instr->transcendental_type(),
1282 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
1291 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) {
1297 void LCodeGen::DoModI(LModI* instr) {
1298 HMod* hmod = instr->hydrogen();
1304 Register left_reg = ToRegister(instr->left());
1305 ASSERT(left_reg.is(ToRegister(instr->result())));
1318 DeoptimizeIf(zero, instr->environment());
1328 Register left_reg = ToRegister(instr->left());
1329 ASSERT(left_reg.is(ToRegister(instr->result())));
1330 Register right_reg = ToRegister(instr->right());
1337 DeoptimizeIf(not_equal, instr->environment());
1347 DeoptimizeIf(zero, instr->environment());
1357 Register left_reg = ToRegister(instr->left());
1359 Register right_reg = ToRegister(instr->right());
1362 Register result_reg = ToRegister(instr->result());
1370 DeoptimizeIf(zero, instr->environment());
1381 DeoptimizeIf(equal, instr->environment());
1402 DeoptimizeIf(zero, instr->environment());
1412 void LCodeGen::DoDivI(LDivI* instr) {
1413 if (!instr->is_flooring() && instr->hydrogen()->HasPowerOf2Divisor()) {
1414 Register dividend = ToRegister(instr->left());
1415 int32_t divisor = instr->hydrogen()->right()->GetInteger32Constant();
1424 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
1426 DeoptimizeIf(zero, instr->environment());
1429 if (divisor == -1 && instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
1431 DeoptimizeIf(zero, instr->environment());
1438 if (instr->hydrogen()->CheckFlag(
1456 DeoptimizeIf(not_zero, instr->environment());
1466 LOperand* right = instr->right();
1467 ASSERT(ToRegister(instr->result()).is(eax));
1468 ASSERT(ToRegister(instr->left()).is(eax));
1469 ASSERT(!ToRegister(instr->right()).is(eax));
1470 ASSERT(!ToRegister(instr->right()).is(edx));
1476 if (instr->hydrogen_value()->CheckFlag(HValue::kCanBeDivByZero)) {
1478 DeoptimizeIf(zero, instr->environment());
1482 if (instr->hydrogen_value()->CheckFlag(HValue::kBailoutOnMinusZero)) {
1487 DeoptimizeIf(sign, instr->environment());
1492 if (instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow)) {
1497 DeoptimizeIf(zero, instr->environment());
1505 if (instr->is_flooring()) {
1513 } else if (!instr->hydrogen()->CheckFlag(
1517 DeoptimizeIf(not_zero, instr->environment());
1522 void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) {
1523 ASSERT(instr->right()->IsConstantOperand());
1525 Register dividend = ToRegister(instr->left());
1526 int32_t divisor = ToInteger32(LConstantOperand::cast(instr->right()));
1527 Register result = ToRegister(instr->result());
1531 DeoptimizeIf(no_condition, instr->environment());
1541 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
1542 DeoptimizeIf(zero, instr->environment());
1544 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
1545 DeoptimizeIf(overflow, instr->environment());
1559 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
1560 DeoptimizeIf(zero, instr->environment());
1572 ASSERT(ToRegister(instr->left()).is(eax));
1573 ASSERT(ToRegister(instr->result()).is(edx));
1574 Register scratch = ToRegister(instr->temp());
1592 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
1594 DeoptimizeIf(zero, instr->environment());
1625 void LCodeGen::DoMulI(LMulI* instr) {
1626 Register left = ToRegister(instr->left());
1627 LOperand* right = instr->right();
1629 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
1630 __ mov(ToRegister(instr->temp()), left);
1644 } else if (!instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
1678 if (instr->hydrogen()->representation().IsSmi()) {
1684 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
1685 DeoptimizeIf(overflow, instr->environment());
1688 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
1695 DeoptimizeIf(no_condition, instr->environment());
1697 __ cmp(ToRegister(instr->temp()), Immediate(0));
1698 DeoptimizeIf(less, instr->environment());
1702 __ or_(ToRegister(instr->temp()), ToOperand(right));
1703 DeoptimizeIf(sign, instr->environment());
1710 void LCodeGen::DoBitI(LBitI* instr) {
1711 LOperand* left = instr->left();
1712 LOperand* right = instr->right();
1713 ASSERT(left->Equals(instr->result()));
1719 instr->hydrogen()->representation());
1720 switch (instr->op()) {
1739 switch (instr->op()) {
1757 void LCodeGen::DoShiftI(LShiftI* instr) {
1758 LOperand* left = instr->left();
1759 LOperand* right = instr->right();
1760 ASSERT(left->Equals(instr->result()));
1765 switch (instr->op()) {
1768 if (instr->can_deopt()) {
1770 DeoptimizeIf(not_zero, instr->environment());
1778 if (instr->can_deopt()) {
1780 DeoptimizeIf(not_zero, instr->environment());
1793 switch (instr->op()) {
1795 if (shift_count == 0 && instr->can_deopt()) {
1797 DeoptimizeIf(not_zero, instr->environment());
1808 if (shift_count == 0 && instr->can_deopt()) {
1810 DeoptimizeIf(not_zero, instr->environment());
1817 if (instr->hydrogen_value()->representation().IsSmi() &&
1818 instr->can_deopt()) {
1823 DeoptimizeIf(overflow, instr->environment());
1837 void LCodeGen::DoSubI(LSubI* instr) {
1838 LOperand* left = instr->left();
1839 LOperand* right = instr->right();
1840 ASSERT(left->Equals(instr->result()));
1844 ToImmediate(right, instr->hydrogen()->representation()));
1848 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
1849 DeoptimizeIf(overflow, instr->environment());
1854 void LCodeGen::DoConstantI(LConstantI* instr) {
1855 __ Set(ToRegister(instr->result()), Immediate(instr->value()));
1859 void LCodeGen::DoConstantS(LConstantS* instr) {
1860 __ Set(ToRegister(instr->result()), Immediate(instr->value()));
1864 void LCodeGen::DoConstantD(LConstantD* instr) {
1865 double v = instr->value();
1873 X87Mov(ToX87Register(instr->result()), Operand(esp, 0));
1877 ASSERT(instr->result()->IsDoubleRegister());
1878 XMMRegister res = ToDoubleRegister(instr->result());
1882 Register temp = ToRegister(instr->temp());
1910 void LCodeGen::DoConstantE(LConstantE* instr) {
1911 __ lea(ToRegister(instr->result()), Operand::StaticVariable(instr->value()));
1915 void LCodeGen::DoConstantT(LConstantT* instr) {
1916 Register reg = ToRegister(instr->result());
1917 Handle<Object> handle = instr->value();
1923 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) {
1924 Register result = ToRegister(instr->result());
1925 Register map = ToRegister(instr->value());
1930 void LCodeGen::DoElementsKind(LElementsKind* instr) {
1931 Register result = ToRegister(instr->result());
1932 Register input = ToRegister(instr->value());
1945 void LCodeGen::DoValueOf(LValueOf* instr) {
1946 Register input = ToRegister(instr->value());
1947 Register result = ToRegister(instr->result());
1948 Register map = ToRegister(instr->temp());
1953 if (!instr->hydrogen()->value()->IsHeapObject()) {
1967 void LCodeGen::DoDateField(LDateField* instr) {
1968 Register object = ToRegister(instr->date());
1969 Register result = ToRegister(instr->result());
1970 Register scratch = ToRegister(instr->temp());
1971 Smi* index = instr->index();
1977 DeoptimizeIf(zero, instr->environment());
1979 DeoptimizeIf(not_equal, instr->environment());
2003 void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) {
2004 Register string = ToRegister(instr->string());
2005 Register index = ToRegister(instr->index());
2006 Register value = ToRegister(instr->value());
2007 String::Encoding encoding = instr->encoding();
2033 void LCodeGen::DoThrow(LThrow* instr) {
2034 __ push(ToOperand(instr->value()));
2035 ASSERT(ToRegister(instr->context()).is(esi));
2036 CallRuntime(Runtime::kThrow, 1, instr);
2045 void LCodeGen::DoAddI(LAddI* instr) {
2046 LOperand* left = instr->left();
2047 LOperand* right = instr->right();
2049 if (LAddI::UseLea(instr->hydrogen()) && !left->Equals(instr->result())) {
2052 instr->hydrogen()->representation());
2053 __ lea(ToRegister(instr->result()), MemOperand(ToRegister(left), offset));
2056 __ lea(ToRegister(instr->result()), address);
2061 ToImmediate(right, instr->hydrogen()->representation()));
2065 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
2066 DeoptimizeIf(overflow, instr->environment());
2072 void LCodeGen::DoMathMinMax(LMathMinMax* instr) {
2074 LOperand* left = instr->left();
2075 LOperand* right = instr->right();
2076 ASSERT(left->Equals(instr->result()));
2077 HMathMinMax::Operation operation = instr->hydrogen()->operation();
2078 if (instr->hydrogen()->representation().IsSmiOrInteger32()) {
2085 Immediate immediate = ToImmediate(LConstantOperand::cast(instr->right()),
2086 instr->hydrogen()->representation());
2099 ASSERT(instr->hydrogen()->representation().IsDouble());
2135 void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
2138 XMMRegister left = ToDoubleRegister(instr->left());
2139 XMMRegister right = ToDoubleRegister(instr->right());
2140 XMMRegister result = ToDoubleRegister(instr->result());
2142 ASSERT(instr->op() == Token::MOD || left.is(result));
2143 switch (instr->op()) {
2181 X87Register left = ToX87Register(instr->left());
2182 X87Register right = ToX87Register(instr->right());
2183 X87Register result = ToX87Register(instr->result());
2185 switch (instr->op()) {
2197 void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
2198 ASSERT(ToRegister(instr->context()).is(esi));
2199 ASSERT(ToRegister(instr->left()).is(edx));
2200 ASSERT(ToRegister(instr->right()).is(eax));
2201 ASSERT(ToRegister(instr->result()).is(eax));
2203 BinaryOpStub stub(instr->op(), NO_OVERWRITE);
2204 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
2218 void LCodeGen::EmitBranch(InstrType instr, Condition cc) {
2219 int left_block = instr->TrueDestination(chunk_);
2220 int right_block = instr->FalseDestination(chunk_);
2238 void LCodeGen::EmitFalseBranch(InstrType instr, Condition cc) {
2239 int false_block = instr->FalseDestination(chunk_);
2248 void LCodeGen::DoIsNumberAndBranch(LIsNumberAndBranch* instr) {
2249 Representation r = instr->hydrogen()->value()->representation();
2251 EmitBranch(instr, no_condition);
2254 Register reg = ToRegister(instr->value());
2255 HType type = instr->hydrogen()->value()->type();
2257 EmitBranch(instr, no_condition);
2259 __ JumpIfSmi(reg, instr->TrueLabel(chunk_));
2262 EmitBranch(instr, equal);
2267 void LCodeGen::DoBranch(LBranch* instr) {
2268 Representation r = instr->hydrogen()->value()->representation();
2271 Register reg = ToRegister(instr->value());
2273 EmitBranch(instr, not_zero);
2277 XMMRegister reg = ToDoubleRegister(instr->value());
2280 EmitBranch(instr, not_equal);
2283 Register reg = ToRegister(instr->value());
2284 HType type = instr->hydrogen()->value()->type();
2288 EmitBranch(instr, equal);
2292 EmitBranch(instr, not_equal);
2295 EmitBranch(instr, no_condition);
2301 EmitBranch(instr, not_equal);
2305 EmitBranch(instr, not_equal);
2307 ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types();
2313 __ j(equal, instr->FalseLabel(chunk_));
2318 __ j(equal, instr->TrueLabel(chunk_));
2321 __ j(equal, instr->FalseLabel(chunk_));
2326 __ j(equal, instr->FalseLabel(chunk_));
2332 __ j(equal, instr->FalseLabel(chunk_));
2333 __ JumpIfSmi(reg, instr->TrueLabel(chunk_));
2337 DeoptimizeIf(zero, instr->environment());
2342 map = ToRegister(instr->temp());
2350 __ j(not_zero, instr->FalseLabel(chunk_));
2357 __ j(above_equal, instr->TrueLabel(chunk_));
2366 __ j(not_zero, instr->TrueLabel(chunk_));
2367 __ jmp(instr->FalseLabel(chunk_));
2374 __ j(equal, instr->TrueLabel(chunk_));
2392 __ j(zero, instr->FalseLabel(chunk_));
2393 __ jmp(instr->TrueLabel(chunk_));
2400 DeoptimizeIf(no_condition, instr->environment());
2414 void LCodeGen::DoGoto(LGoto* instr) {
2415 EmitGoto(instr->block_id());
2447 void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) {
2448 LOperand* left = instr->left();
2449 LOperand* right = instr->right();
2450 Condition cc = TokenToCondition(instr->op(), instr->is_double());
2456 int next_block = EvalComparison(instr->op(), left_val, right_val) ?
2457 instr->TrueDestination(chunk_) : instr->FalseDestination(chunk_);
2460 if (instr->is_double()) {
2465 __ j(parity_even, instr->FalseLabel(chunk_));
2469 ToImmediate(right, instr->hydrogen()->representation()));
2472 ToImmediate(left, instr->hydrogen()->representation()));
2479 EmitBranch(instr, cc);
2484 void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) {
2485 Register left = ToRegister(instr->left());
2487 if (instr->right()->IsConstantOperand()) {
2488 Handle<Object> right = ToHandle(LConstantOperand::cast(instr->right()));
2491 Operand right = ToOperand(instr->right());
2494 EmitBranch(instr, equal);
2498 void LCodeGen::DoCmpHoleAndBranch(LCmpHoleAndBranch* instr) {
2499 if (instr->hydrogen()->representation().IsTagged()) {
2500 Register input_reg = ToRegister(instr->object());
2502 EmitBranch(instr, equal);
2509 XMMRegister input_reg = ToDoubleRegister(instr->object());
2511 EmitFalseBranch(instr, parity_odd);
2514 X87Register src = ToX87Register(instr->object());
2522 EmitFalseBranch(instr, no_condition);
2530 XMMRegister input_reg = ToDoubleRegister(instr->object());
2539 EmitBranch(instr, equal);
2566 void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) {
2567 Register reg = ToRegister(instr->value());
2568 Register temp = ToRegister(instr->temp());
2571 reg, temp, instr->FalseLabel(chunk_), instr->TrueLabel(chunk_));
2573 EmitBranch(instr, true_cond);
2591 void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) {
2592 Register reg = ToRegister(instr->value());
2593 Register temp = ToRegister(instr->temp());
2596 instr->hydrogen()->value()->IsHeapObject()
2600 reg, temp, instr->FalseLabel(chunk_), check_needed);
2602 EmitBranch(instr, true_cond);
2606 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) {
2607 Operand input = ToOperand(instr->value());
2610 EmitBranch(instr, zero);
2614 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) {
2615 Register input = ToRegister(instr->value());
2616 Register temp = ToRegister(instr->temp());
2618 if (!instr->hydrogen()->value()->IsHeapObject()) {
2620 __ JumpIfSmi(input, instr->FalseLabel(chunk_));
2625 EmitBranch(instr, not_zero);
2649 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) {
2650 Token::Value op = instr->op();
2653 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2658 EmitBranch(instr, condition);
2662 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) {
2663 InstanceType from = instr->from();
2664 InstanceType to = instr->to();
2671 static Condition BranchCondition(HHasInstanceTypeAndBranch* instr) {
2672 InstanceType from = instr->from();
2673 InstanceType to = instr->to();
2682 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) {
2683 Register input = ToRegister(instr->value());
2684 Register temp = ToRegister(instr->temp());
2686 if (!instr->hydrogen()->value()->IsHeapObject()) {
2687 __ JumpIfSmi(input, instr->FalseLabel(chunk_));
2690 __ CmpObjectType(input, TestType(instr->hydrogen()), temp);
2691 EmitBranch(instr, BranchCondition(instr->hydrogen()));
2695 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
2696 Register input = ToRegister(instr->value());
2697 Register result = ToRegister(instr->result());
2707 LHasCachedArrayIndexAndBranch* instr) {
2708 Register input = ToRegister(instr->value());
2712 EmitBranch(instr, equal);
2781 void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) {
2782 Register input = ToRegister(instr->value());
2783 Register temp = ToRegister(instr->temp());
2784 Register temp2 = ToRegister(instr->temp2());
2786 Handle<String> class_name = instr->hydrogen()->class_name();
2788 EmitClassOfTest(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_),
2791 EmitBranch(instr, equal);
2795 void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) {
2796 Register reg = ToRegister(instr->value());
2797 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), instr->map());
2798 EmitBranch(instr, equal);
2802 void LCodeGen::DoInstanceOf(LInstanceOf* instr) {
2804 ASSERT(ToRegister(instr->context()).is(esi));
2806 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
2811 __ mov(ToRegister(instr->result()), factory()->false_value());
2814 __ mov(ToRegister(instr->result()), factory()->true_value());
2819 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) {
2823 LInstanceOfKnownGlobal* instr)
2824 : LDeferredCode(codegen), instr_(instr) { }
2828 virtual LInstruction* instr() { return instr_; }
2836 deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr);
2839 Register object = ToRegister(instr->value());
2840 Register temp = ToRegister(instr->temp());
2849 Register map = ToRegister(instr->temp());
2873 __ mov(ToRegister(instr->result()), factory()->false_value());
2882 void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
2899 Register temp = ToRegister(instr->temp());
2901 __ LoadHeapObject(InstanceofStub::right(), instr->function());
2908 instr,
2912 LEnvironment* env = instr->GetDeferredLazyDeoptimizationEnvironment();
2920 void LCodeGen::DoInstanceSize(LInstanceSize* instr) {
2921 Register object = ToRegister(instr->object());
2922 Register result = ToRegister(instr->result());
2928 void LCodeGen::DoCmpT(LCmpT* instr) {
2929 Token::Value op = instr->op();
2932 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2938 __ mov(ToRegister(instr->result()), factory()->false_value());
2941 __ mov(ToRegister(instr->result()), factory()->true_value());
2946 void LCodeGen::EmitReturn(LReturn* instr, bool dynamic_frame_alignment) {
2949 if (instr->has_constant_parameter_count()) {
2950 int parameter_count = ToInteger32(instr->constant_parameter_count());
2959 Register reg = ToRegister(instr->parameter_count());
2971 // emit code to restore stack based on instr->parameter_count()
2983 void LCodeGen::DoReturn(LReturn* instr) {
3022 EmitReturn(instr, true);
3026 EmitReturn(instr, false);
3033 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
3034 Register result = ToRegister(instr->result());
3035 __ mov(result, Operand::ForCell(instr->hydrogen()->cell()));
3036 if (instr->hydrogen()->RequiresHoleCheck()) {
3038 DeoptimizeIf(equal, instr->environment());
3043 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
3044 ASSERT(ToRegister(instr->context()).is(esi));
3045 ASSERT(ToRegister(instr->global_object()).is(edx));
3046 ASSERT(ToRegister(instr->result()).is(eax));
3048 __ mov(ecx, instr->name());
3049 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET :
3052 CallCode(ic, mode, instr);
3056 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
3057 Register value = ToRegister(instr->value());
3058 Handle<PropertyCell> cell_handle = instr->hydrogen()->cell();
3064 if (instr->hydrogen()->RequiresHoleCheck()) {
3066 DeoptimizeIf(equal, instr->environment());
3075 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) {
3076 ASSERT(ToRegister(instr->context()).is(esi));
3077 ASSERT(ToRegister(instr->global_object()).is(edx));
3078 ASSERT(ToRegister(instr->value()).is(eax));
3080 __ mov(ecx, instr->name());
3081 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode)
3084 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr);
3088 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
3089 Register context = ToRegister(instr->context());
3090 Register result = ToRegister(instr->result());
3091 __ mov(result, ContextOperand(context, instr->slot_index()));
3093 if (instr->hydrogen()->RequiresHoleCheck()) {
3095 if (instr->hydrogen()->DeoptimizesOnHole()) {
3096 DeoptimizeIf(equal, instr->environment());
3107 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
3108 Register context = ToRegister(instr->context());
3109 Register value = ToRegister(instr->value());
3113 Operand target = ContextOperand(context, instr->slot_index());
3114 if (instr->hydrogen()->RequiresHoleCheck()) {
3116 if (instr->hydrogen()->DeoptimizesOnHole()) {
3117 DeoptimizeIf(equal, instr->environment());
3124 if (instr->hydrogen()->NeedsWriteBarrier()) {
3126 instr->hydrogen()->value()->IsHeapObject()
3128 Register temp = ToRegister(instr->temp());
3129 int offset = Context::SlotOffset(instr->slot_index());
3143 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
3144 HObjectAccess access = instr->hydrogen()->access();
3148 Register result = ToRegister(instr->result());
3149 if (instr->object()->IsConstantOperand()) {
3151 LConstantOperand::cast(instr->object()));
3154 __ mov(result, MemOperand(ToRegister(instr->object()), offset));
3159 Register object = ToRegister(instr->object());
3161 instr->hydrogen()->representation().IsDouble()) {
3164 XMMRegister result = ToDoubleRegister(instr->result());
3167 X87Mov(ToX87Register(instr->result()), FieldOperand(object, offset));
3172 Register result = ToRegister(instr->result());
3200 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
3201 ASSERT(ToRegister(instr->context()).is(esi));
3202 ASSERT(ToRegister(instr->object()).is(edx));
3203 ASSERT(ToRegister(instr->result()).is(eax));
3205 __ mov(ecx, instr->name());
3207 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3211 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
3212 Register function = ToRegister(instr->function());
3213 Register temp = ToRegister(instr->temp());
3214 Register result = ToRegister(instr->result());
3218 DeoptimizeIf(not_equal, instr->environment());
3232 DeoptimizeIf(equal, instr->environment());
3254 LLoadExternalArrayPointer* instr) {
3255 Register result = ToRegister(instr->result());
3256 Register input = ToRegister(instr->object());
3262 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
3263 Register arguments = ToRegister(instr->arguments());
3264 Register result = ToRegister(instr->result());
3265 if (instr->length()->IsConstantOperand() &&
3266 instr->index()->IsConstantOperand()) {
3267 int const_index = ToInteger32(LConstantOperand::cast(instr->index()));
3268 int const_length = ToInteger32(LConstantOperand::cast(instr->length()));
3272 Register length = ToRegister(instr->length());
3273 Operand index = ToOperand(instr->index());
3282 void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) {
3283 ElementsKind elements_kind = instr->elements_kind();
3284 LOperand* key = instr->key();
3286 ExternalArrayOpRequiresTemp(instr->hydrogen()->key()->representation(),
3291 instr->elements(),
3293 instr->hydrogen()->key()->representation(),
3296 instr->additional_index()));
3300 XMMRegister result(ToDoubleRegister(instr->result()));
3304 X87Mov(ToX87Register(instr->result()), operand, kX87FloatOperand);
3309 __ movdbl(ToDoubleRegister(instr->result()), operand);
3311 X87Mov(ToX87Register(instr->result()), operand);
3314 Register result(ToRegister(instr->result()));
3334 if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) {
3336 DeoptimizeIf(negative, instr->environment());
3356 void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) {
3357 if (instr->hydrogen()->RequiresHoleCheck()) {
3361 instr->elements(), instr->key(),
3362 instr->hydrogen()->key()->representation(),
3365 instr->additional_index());
3367 DeoptimizeIf(equal, instr->environment());
3371 instr->elements(),
3372 instr->key(),
3373 instr->hydrogen()->key()->representation(),
3376 instr->additional_index());
3379 XMMRegister result = ToDoubleRegister(instr->result());
3382 X87Mov(ToX87Register(instr->result()), double_load_operand);
3387 void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
3388 Register result = ToRegister(instr->result());
3392 BuildFastArrayOperand(instr->elements(),
3393 instr->key(),
3394 instr->hydrogen()->key()->representation(),
3397 instr->additional_index()));
3400 if (instr->hydrogen()->RequiresHoleCheck()) {
3401 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) {
3403 DeoptimizeIf(not_equal, instr->environment());
3406 DeoptimizeIf(equal, instr->environment());
3412 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) {
3413 if (instr->is_external()) {
3414 DoLoadKeyedExternalArray(instr);
3415 } else if (instr->hydrogen()->representation().IsDouble()) {
3416 DoLoadKeyedFixedDoubleArray(instr);
3418 DoLoadKeyedFixedArray(instr);
3455 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
3456 ASSERT(ToRegister(instr->context()).is(esi));
3457 ASSERT(ToRegister(instr->object()).is(edx));
3458 ASSERT(ToRegister(instr->key()).is(ecx));
3461 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3465 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
3466 Register result = ToRegister(instr->result());
3468 if (instr->hydrogen()->from_inlined()) {
3494 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) {
3495 Operand elem = ToOperand(instr->elements());
3496 Register result = ToRegister(instr->result());
3516 void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
3517 Register receiver = ToRegister(instr->receiver());
3518 Register function = ToRegister(instr->function());
3519 Register scratch = ToRegister(instr->temp());
3547 DeoptimizeIf(equal, instr->environment());
3549 DeoptimizeIf(below, instr->environment());
3564 void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
3565 Register receiver = ToRegister(instr->receiver());
3566 Register function = ToRegister(instr->function());
3567 Register length = ToRegister(instr->length());
3568 Register elements = ToRegister(instr->elements());
3571 ASSERT(ToRegister(instr->result()).is(eax));
3577 DeoptimizeIf(above, instr->environment());
3595 ASSERT(instr->HasPointerMap());
3596 LPointerMap* pointers = instr->pointer_map();
3606 void LCodeGen::DoDebugBreak(LDebugBreak* instr) {
3611 void LCodeGen::DoPushArgument(LPushArgument* instr) {
3612 LOperand* argument = instr->value();
3617 void LCodeGen::DoDrop(LDrop* instr) {
3618 __ Drop(instr->count());
3622 void LCodeGen::DoThisFunction(LThisFunction* instr) {
3623 Register result = ToRegister(instr->result());
3628 void LCodeGen::DoContext(LContext* instr) {
3629 Register result = ToRegister(instr->result());
3639 void LCodeGen::DoOuterContext(LOuterContext* instr) {
3640 Register context = ToRegister(instr->context());
3641 Register result = ToRegister(instr->result());
3647 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) {
3648 ASSERT(ToRegister(instr->context()).is(esi));
3650 __ push(Immediate(instr->hydrogen()->pairs()));
3651 __ push(Immediate(Smi::FromInt(instr->hydrogen()->flags())));
3652 CallRuntime(Runtime::kDeclareGlobals, 3, instr);
3656 void LCodeGen::DoGlobalObject(LGlobalObject* instr) {
3657 Register context = ToRegister(instr->context());
3658 Register result = ToRegister(instr->result());
3664 void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) {
3665 Register global = ToRegister(instr->global());
3666 Register result = ToRegister(instr->result());
3674 LInstruction* instr,
3682 LPointerMap* pointers = instr->pointer_map();
3706 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT);
3719 void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) {
3720 ASSERT(ToRegister(instr->result()).is(eax));
3721 CallKnownFunction(instr->hydrogen()->function(),
3722 instr->hydrogen()->formal_parameter_count(),
3723 instr->arity(),
3724 instr,
3730 void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) {
3731 Register input_reg = ToRegister(instr->value());
3734 DeoptimizeIf(not_equal, instr->environment());
3757 instr, instr->context());
3775 void LCodeGen::EmitIntegerMathAbs(LMathAbs* instr) {
3776 Register input_reg = ToRegister(instr->value());
3781 DeoptimizeIf(negative, instr->environment());
3786 void LCodeGen::DoMathAbs(LMathAbs* instr) {
3790 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, LMathAbs* instr)
3791 : LDeferredCode(codegen), instr_(instr) { }
3795 virtual LInstruction* instr() { return instr_; }
3800 ASSERT(instr->value()->Equals(instr->result()));
3801 Representation r = instr->hydrogen()->value()->representation();
3806 XMMRegister input_reg = ToDoubleRegister(instr->value());
3811 EmitIntegerMathAbs(instr);
3814 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr);
3815 Register input_reg = ToRegister(instr->value());
3818 EmitIntegerMathAbs(instr);
3824 void LCodeGen::DoMathFloor(LMathFloor* instr) {
3827 Register output_reg = ToRegister(instr->result());
3828 XMMRegister input_reg = ToDoubleRegister(instr->value());
3832 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
3840 DeoptimizeIf(not_zero, instr->environment());
3847 DeoptimizeIf(equal, instr->environment());
3853 DeoptimizeIf(parity_even, instr->environment());
3856 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
3862 DeoptimizeIf(not_zero, instr->environment());
3872 DeoptimizeIf(equal, instr->environment());
3883 DeoptimizeIf(overflow, instr->environment());
3890 void LCodeGen::DoMathRound(LMathRound* instr) {
3892 Register output_reg = ToRegister(instr->result());
3893 XMMRegister input_reg = ToDoubleRegister(instr->value());
3895 XMMRegister input_temp = ToDoubleRegister(instr->temp());
3911 DeoptimizeIf(equal, instr->environment());
3927 DeoptimizeIf(equal, instr->environment());
3939 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
3944 DeoptimizeIf(not_zero, instr->environment());
3951 void LCodeGen::DoMathSqrt(LMathSqrt* instr) {
3953 XMMRegister input_reg = ToDoubleRegister(instr->value());
3954 ASSERT(ToDoubleRegister(instr->result()).is(input_reg));
3959 void LCodeGen::DoMathPowHalf(LMathPowHalf* instr) {
3962 XMMRegister input_reg = ToDoubleRegister(instr->value());
3963 Register scratch = ToRegister(instr->temp());
3964 ASSERT(ToDoubleRegister(instr->result()).is(input_reg));
3994 void LCodeGen::DoPower(LPower* instr) {
3995 Representation exponent_type = instr->hydrogen()->right()->representation();
3998 ASSERT(!instr->right()->IsDoubleRegister() ||
3999 ToDoubleRegister(instr->right()).is(xmm1));
4000 ASSERT(!instr->right()->IsRegister() ||
4001 ToRegister(instr->right()).is(eax));
4002 ASSERT(ToDoubleRegister(instr->left()).is(xmm2));
4003 ASSERT(ToDoubleRegister(instr->result()).is(xmm3));
4012 DeoptimizeIf(not_equal, instr->environment());
4027 void LCodeGen::DoRandom(LRandom* instr) {
4030 DeferredDoRandom(LCodeGen* codegen, LRandom* instr)
4031 : LDeferredCode(codegen), instr_(instr) { }
4033 virtual LInstruction* instr() { return instr_; }
4038 DeferredDoRandom* deferred = new(zone()) DeferredDoRandom(this, instr);
4043 ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
4044 ASSERT(ToRegister(instr->global_object()).is(eax));
4099 void LCodeGen::DoDeferredRandom(LRandom* instr) {
4107 void LCodeGen::DoMathLog(LMathLog* instr) {
4109 ASSERT(instr->value()->Equals(instr->result()));
4110 XMMRegister input_reg = ToDoubleRegister(instr->value());
4139 void LCodeGen::DoMathExp(LMathExp* instr) {
4141 XMMRegister input = ToDoubleRegister(instr->value());
4142 XMMRegister result = ToDoubleRegister(instr->result());
4143 Register temp1 = ToRegister(instr->temp1());
4144 Register temp2 = ToRegister(instr->temp2());
4150 void LCodeGen::DoMathTan(LMathTan* instr) {
4151 ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
4157 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
4161 void LCodeGen::DoMathCos(LMathCos* instr) {
4162 ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
4168 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
4172 void LCodeGen::DoMathSin(LMathSin* instr) {
4173 ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
4179 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
4183 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
4184 ASSERT(ToRegister(instr->context()).is(esi));
4185 ASSERT(ToRegister(instr->function()).is(edi));
4186 ASSERT(instr->HasPointerMap());
4188 Handle<JSFunction> known_function = instr->hydrogen()->known_function();
4190 LPointerMap* pointers = instr->pointer_map();
4194 ParameterCount count(instr->arity());
4198 instr->hydrogen()->formal_parameter_count(),
4199 instr->arity(),
4200 instr,
4207 void LCodeGen::DoCallKeyed(LCallKeyed* instr) {
4208 ASSERT(ToRegister(instr->context()).is(esi));
4209 ASSERT(ToRegister(instr->key()).is(ecx));
4210 ASSERT(ToRegister(instr->result()).is(eax));
4212 int arity = instr->arity();
4215 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4219 void LCodeGen::DoCallNamed(LCallNamed* instr) {
4220 ASSERT(ToRegister(instr->context()).is(esi));
4221 ASSERT(ToRegister(instr->result()).is(eax));
4223 int arity = instr->arity();
4227 __ mov(ecx, instr->name());
4228 CallCode(ic, mode, instr);
4232 void LCodeGen::DoCallFunction(LCallFunction* instr) {
4233 ASSERT(ToRegister(instr->context()).is(esi));
4234 ASSERT(ToRegister(instr->function()).is(edi));
4235 ASSERT(ToRegister(instr->result()).is(eax));
4237 int arity = instr->arity();
4239 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
4243 void LCodeGen::DoCallGlobal(LCallGlobal* instr) {
4244 ASSERT(ToRegister(instr->context()).is(esi));
4245 ASSERT(ToRegister(instr->result()).is(eax));
4247 int arity = instr->arity();
4251 __ mov(ecx, instr->name());
4252 CallCode(ic, mode, instr);
4256 void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) {
4257 ASSERT(ToRegister(instr->result()).is(eax));
4258 CallKnownFunction(instr->hydrogen()->target(),
4259 instr->hydrogen()->formal_parameter_count(),
4260 instr->arity(),
4261 instr,
4267 void LCodeGen::DoCallNew(LCallNew* instr) {
4268 ASSERT(ToRegister(instr->context()).is(esi));
4269 ASSERT(ToRegister(instr->constructor()).is(edi));
4270 ASSERT(ToRegister(instr->result()).is(eax));
4276 __ Set(eax, Immediate(instr->arity()));
4277 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4281 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
4282 ASSERT(ToRegister(instr->context()).is(esi));
4283 ASSERT(ToRegister(instr->constructor()).is(edi));
4284 ASSERT(ToRegister(instr->result()).is(eax));
4286 __ Set(eax, Immediate(instr->arity()));
4287 __ mov(ebx, instr->hydrogen()->property_cell());
4288 ElementsKind kind = instr->hydrogen()->elements_kind();
4295 if (instr->arity() == 0) {
4297 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4298 } else if (instr->arity() == 1) {
4311 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4317 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4321 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4326 void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
4327 CallRuntime(instr->function(), instr->arity(), instr);
4331 void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) {
4332 Register result = ToRegister(instr->result());
4333 Register base = ToRegister(instr->base_object());
4334 __ lea(result, Operand(base, instr->offset()));
4338 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
4339 Representation representation = instr->representation();
4341 HObjectAccess access = instr->hydrogen()->access();
4345 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
4346 MemOperand operand = instr->object()->IsConstantOperand()
4348 ToExternalReference(LConstantOperand::cast(instr->object())))
4349 : MemOperand(ToRegister(instr->object()), offset);
4350 if (instr->value()->IsConstantOperand()) {
4351 LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
4354 Register value = ToRegister(instr->value());
4360 Register object = ToRegister(instr->object());
4361 Handle<Map> transition = instr->transition();
4364 if (instr->value()->IsConstantOperand()) {
4365 LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
4367 DeoptimizeIf(no_condition, instr->environment());
4371 if (instr->value()->IsConstantOperand()) {
4372 LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
4374 DeoptimizeIf(no_condition, instr->environment());
4377 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
4378 Register value = ToRegister(instr->value());
4380 DeoptimizeIf(zero, instr->environment());
4386 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
4389 XMMRegister value = ToDoubleRegister(instr->value());
4392 X87Register value = ToX87Register(instr->value());
4399 if (!instr->hydrogen()->NeedsWriteBarrierForMap()) {
4402 Register temp = ToRegister(instr->temp());
4403 Register temp_map = ToRegister(instr->temp_map());
4419 instr->hydrogen()->value()->IsHeapObject()
4424 write_register = ToRegister(instr->temp());
4428 if (instr->value()->IsConstantOperand()) {
4429 LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
4434 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
4438 __ mov(FieldOperand(write_register, offset), ToRegister(instr->value()));
4441 if (instr->hydrogen()->NeedsWriteBarrier()) {
4442 Register value = ToRegister(instr->value());
4443 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object;
4456 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
4457 ASSERT(ToRegister(instr->context()).is(esi));
4458 ASSERT(ToRegister(instr->object()).is(edx));
4459 ASSERT(ToRegister(instr->value()).is(eax));
4461 __ mov(ecx, instr->name());
4462 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode)
4465 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4481 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4482 if (instr->hydrogen()->skip_check() && !FLAG_debug_code) return;
4484 if (instr->index()->IsConstantOperand()) {
4486 ToImmediate(LConstantOperand::cast(instr->index()),
4487 instr->hydrogen()->length()->representation());
4488 __ cmp(ToOperand(instr->length()), immediate);
4490 instr->hydrogen()->allow_equality() ? below : below_equal;
4491 ApplyCheckIf(condition, instr);
4493 __ cmp(ToRegister(instr->index()), ToOperand(instr->length()));
4495 instr->hydrogen()->allow_equality() ? above : above_equal;
4496 ApplyCheckIf(condition, instr);
4501 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
4502 ElementsKind elements_kind = instr->elements_kind();
4503 LOperand* key = instr->key();
4505 ExternalArrayOpRequiresTemp(instr->hydrogen()->key()->representation(),
4510 instr->elements(),
4512 instr->hydrogen()->key()->representation(),
4515 instr->additional_index()));
4519 __ cvtsd2ss(xmm0, ToDoubleRegister(instr->value()));
4528 __ movdbl(operand, ToDoubleRegister(instr->value()));
4530 X87Mov(operand, ToX87Register(instr->value()));
4533 Register value = ToRegister(instr->value());
4565 void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) {
4569 instr->elements(),
4570 instr->key(),
4571 instr->hydrogen()->key()->representation(),
4574 instr->additional_index());
4578 XMMRegister value = ToDoubleRegister(instr->value());
4580 if (instr->NeedsCanonicalization()) {
4593 if (instr->hydrogen()->IsConstantHoleStore()) {
4603 instr->elements(),
4604 instr->key(),
4605 instr->hydrogen()->key()->representation(),
4608 instr->additional_index());
4612 X87Register value = ToX87Register(instr->value());
4615 if (instr->NeedsCanonicalization()) {
4641 void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) {
4642 Register elements = ToRegister(instr->elements());
4643 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg;
4646 instr->elements(),
4647 instr->key(),
4648 instr->hydrogen()->key()->representation(),
4651 instr->additional_index());
4652 if (instr->value()->IsRegister()) {
4653 __ mov(operand, ToRegister(instr->value()));
4655 LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
4666 if (instr->hydrogen()->NeedsWriteBarrier()) {
4667 ASSERT(instr->value()->IsRegister());
4668 Register value = ToRegister(instr->value());
4669 ASSERT(!instr->key()->IsConstantOperand());
4671 instr->hydrogen()->value()->IsHeapObject()
4685 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) {
4687 if (instr->is_external()) {
4688 DoStoreKeyedExternalArray(instr);
4689 } else if (instr->hydrogen()->value()->representation().IsDouble()) {
4690 DoStoreKeyedFixedDoubleArray(instr);
4692 DoStoreKeyedFixedArray(instr);
4697 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
4698 ASSERT(ToRegister(instr->context()).is(esi));
4699 ASSERT(ToRegister(instr->object()).is(edx));
4700 ASSERT(ToRegister(instr->key()).is(ecx));
4701 ASSERT(ToRegister(instr->value()).is(eax));
4703 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode)
4706 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4710 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) {
4711 Register object = ToRegister(instr->object());
4712 Register temp = ToRegister(instr->temp());
4714 DeoptimizeIf(equal, instr->environment());
4718 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
4719 Register object_reg = ToRegister(instr->object());
4721 Handle<Map> from_map = instr->original_map();
4722 Handle<Map> to_map = instr->transitioned_map();
4723 ElementsKind from_kind = instr->from_kind();
4724 ElementsKind to_kind = instr->to_kind();
4734 Register new_map_reg = ToRegister(instr->new_map_temp());
4735 Handle<Map> map = instr->hydrogen()->transitioned_map();
4739 ASSERT_NE(instr->temp(), NULL);
4741 ToRegister(instr->temp()),
4748 LoadContextFromDeferred(instr->context());
4756 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt);
4762 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) {
4765 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr)
4766 : LDeferredCode(codegen), instr_(instr) { }
4768 virtual LInstruction* instr() { return instr_; }
4774 new(zone()) DeferredStringCharCodeAt(this, instr);
4778 ToRegister(instr->string()),
4779 ToRegister(instr->index()),
4780 ToRegister(instr->result()),
4786 void LCodeGen::DoDeferredStringCharCodeAt(LStringCharCodeAt* instr) {
4787 Register string = ToRegister(instr->string());
4788 Register result = ToRegister(instr->result());
4800 if (instr->index()->IsConstantOperand()) {
4801 Immediate immediate = ToImmediate(LConstantOperand::cast(instr->index()),
4805 Register index = ToRegister(instr->index());
4810 instr, instr->context());
4817 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) {
4820 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr)
4821 : LDeferredCode(codegen), instr_(instr) { }
4823 virtual LInstruction* instr() { return instr_; }
4829 new(zone()) DeferredStringCharFromCode(this, instr);
4831 ASSERT(instr->hydrogen()->value()->representation().IsInteger32());
4832 Register char_code = ToRegister(instr->char_code());
4833 Register result = ToRegister(instr->result());
4848 void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) {
4849 Register char_code = ToRegister(instr->char_code());
4850 Register result = ToRegister(instr->result());
4860 CallRuntimeFromDeferred(Runtime::kCharFromCode, 1, instr, instr->context());
4865 void LCodeGen::DoStringAdd(LStringAdd* instr) {
4866 EmitPushTaggedOperand(instr->left());
4867 EmitPushTaggedOperand(instr->right());
4868 StringAddStub stub(instr->hydrogen()->flags());
4869 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
4873 void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) {
4876 LOperand* input = instr->value();
4878 LOperand* output = instr->result();
4887 void LCodeGen::DoInteger32ToSmi(LInteger32ToSmi* instr) {
4888 Register input = ToRegister(instr->value());
4890 if (!instr->hydrogen()->value()->HasRange() ||
4891 !instr->hydrogen()->value()->range()->IsInSmiRange()) {
4892 DeoptimizeIf(overflow, instr->environment());
4897 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) {
4899 LOperand* input = instr->value();
4900 LOperand* output = instr->result();
4901 LOperand* temp = instr->temp();
4909 void LCodeGen::DoUint32ToSmi(LUint32ToSmi* instr) {
4910 Register input = ToRegister(instr->value());
4911 if (!instr->hydrogen()->value()->HasRange() ||
4912 !instr->hydrogen()->value()->range()->IsInSmiRange()) {
4914 DeoptimizeIf(not_zero, instr->environment());
4920 void LCodeGen::DoNumberTagI(LNumberTagI* instr) {
4923 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr)
4924 : LDeferredCode(codegen), instr_(instr) { }
4928 virtual LInstruction* instr() { return instr_; }
4933 LOperand* input = instr->value();
4934 ASSERT(input->IsRegister() && input->Equals(instr->result()));
4937 DeferredNumberTagI* deferred = new(zone()) DeferredNumberTagI(this, instr);
4944 void LCodeGen::DoNumberTagU(LNumberTagU* instr) {
4947 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr)
4948 : LDeferredCode(codegen), instr_(instr) { }
4952 virtual LInstruction* instr() { return instr_; }
4957 LOperand* input = instr->value();
4958 ASSERT(input->IsRegister() && input->Equals(instr->result()));
4961 DeferredNumberTagU* deferred = new(zone()) DeferredNumberTagU(this, instr);
4969 void LCodeGen::DoDeferredNumberTagI(LInstruction* instr,
4999 ToDoubleRegister(LNumberTagU::cast(instr)->temp()));
5031 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt);
5047 void LCodeGen::DoNumberTagD(LNumberTagD* instr) {
5050 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr)
5051 : LDeferredCode(codegen), instr_(instr) { }
5053 virtual LInstruction* instr() { return instr_; }
5058 Register reg = ToRegister(instr->result());
5063 X87Register src = ToX87Register(instr->value());
5067 DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr);
5069 Register tmp = ToRegister(instr->temp());
5077 XMMRegister input_reg = ToDoubleRegister(instr->value());
5085 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) {
5089 Register reg = ToRegister(instr->result());
5101 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt);
5106 void LCodeGen::DoSmiTag(LSmiTag* instr) {
5107 LOperand* input = instr->value();
5108 ASSERT(input->IsRegister() && input->Equals(instr->result()));
5109 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow));
5114 void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
5115 LOperand* input = instr->value();
5117 ASSERT(input->IsRegister() && input->Equals(instr->result()));
5118 if (instr->needs_check()) {
5120 DeoptimizeIf(not_zero, instr->environment());
5255 void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
5257 Register input_reg = ToRegister(instr->value());
5263 if (instr->truncating()) {
5269 DeoptimizeIf(not_equal, instr->environment());
5290 DeoptimizeIf(no_condition, instr->environment());
5301 XMMRegister xmm_temp = ToDoubleRegister(instr->temp());
5311 DeoptimizeIf(not_equal, instr->environment());
5312 DeoptimizeIf(parity_even, instr->environment()); // NaN.
5320 DeoptimizeIf(not_equal, instr->environment());
5322 XMMRegister xmm_temp = ToDoubleRegister(instr->temp());
5328 DeoptimizeIf(not_equal, instr->environment());
5330 DeoptimizeIf(parity_even, instr->environment()); // NaN.
5331 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
5337 DeoptimizeIf(not_zero, instr->environment());
5346 void LCodeGen::DoTaggedToI(LTaggedToI* instr) {
5349 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr)
5350 : LDeferredCode(codegen), instr_(instr) { }
5352 virtual LInstruction* instr() { return instr_; }
5357 LOperand* input = instr->value();
5360 ASSERT(input_reg.is(ToRegister(instr->result())));
5362 DeferredTaggedToI* deferred = new(zone()) DeferredTaggedToI(this, instr);
5370 void LCodeGen::DoDeferredTaggedToINoSSE2(LTaggedToINoSSE2* instr) {
5372 Register result_reg = ToRegister(instr->result());
5373 Register input_reg = ToRegister(instr->value());
5378 if (instr->truncating()) {
5384 DeoptimizeIf(not_equal, instr->environment());
5390 DeoptimizeIf(not_equal, instr->environment());
5396 Register scratch = ToRegister(instr->scratch());
5397 Register scratch2 = ToRegister(instr->scratch2());
5404 if (instr->truncating()) {
5409 DeoptimizeIf(not_zero, instr->environment());
5411 DeoptimizeIf(not_equal, instr->environment());
5415 if (!instr->truncating()) {
5416 DeoptimizeIf(negative, instr->environment());
5424 Register scratch3 = ToRegister(instr->scratch3());
5433 DeoptimizeIf(greater, instr->environment());
5455 if (!instr->truncating()) {
5459 DeoptimizeIf(not_equal, instr->environment());
5465 if (!instr->truncating()) {
5473 DeoptimizeIf(not_equal, instr->environment());
5487 DeoptimizeIf(less, instr->environment());
5494 if (!instr->truncating()) {
5496 DeoptimizeIf(zero, instr->environment());
5500 DeoptimizeIf(positive, instr->environment());
5505 void LCodeGen::DoTaggedToINoSSE2(LTaggedToINoSSE2* instr) {
5508 DeferredTaggedToINoSSE2(LCodeGen* codegen, LTaggedToINoSSE2* instr)
5509 : LDeferredCode(codegen), instr_(instr) { }
5511 virtual LInstruction* instr() { return instr_; }
5516 LOperand* input = instr->value();
5519 ASSERT(input_reg.is(ToRegister(instr->result())));
5522 new(zone()) DeferredTaggedToINoSSE2(this, instr);
5531 void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) {
5532 LOperand* input = instr->value();
5534 LOperand* temp = instr->temp();
5536 LOperand* result = instr->result();
5541 instr->hydrogen()->deoptimize_on_minus_zero();
5544 HValue* value = instr->hydrogen()->value();
5554 instr->hydrogen()->can_convert_undefined_to_nan(),
5556 instr->environment(),
5561 ToX87Register(instr->result()),
5562 instr->hydrogen()->can_convert_undefined_to_nan(),
5564 instr->environment(),
5570 void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
5571 LOperand* input = instr->value();
5573 LOperand* result = instr->result();
5582 if (instr->truncating()) {
5598 DeoptimizeIf(not_equal, instr->environment());
5599 DeoptimizeIf(parity_even, instr->environment()); // NaN.
5600 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
5610 DeoptimizeIf(not_zero, instr->environment());
5617 void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) {
5618 LOperand* input = instr->value();
5620 LOperand* result = instr->result();
5631 DeoptimizeIf(not_equal, instr->environment());
5632 DeoptimizeIf(parity_even, instr->environment()); // NaN.
5634 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
5644 DeoptimizeIf(not_zero, instr->environment());
5648 DeoptimizeIf(overflow, instr->environment());
5652 void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
5653 LOperand* input = instr->value();
5655 DeoptimizeIf(not_zero, instr->environment());
5659 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
5660 if (!instr->hydrogen()->value()->IsHeapObject()) {
5661 LOperand* input = instr->value();
5663 DeoptimizeIf(zero, instr->environment());
5668 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
5669 Register input = ToRegister(instr->value());
5670 Register temp = ToRegister(instr->temp());
5674 if (instr->hydrogen()->is_interval_check()) {
5677 instr->hydrogen()->GetCheckInterval(&first, &last);
5684 DeoptimizeIf(not_equal, instr->environment());
5686 DeoptimizeIf(below, instr->environment());
5691 DeoptimizeIf(above, instr->environment());
5697 instr->hydrogen()->GetCheckMaskAndTag(&mask, &tag);
5702 DeoptimizeIf(tag == 0 ? not_zero : zero, instr->environment());
5707 DeoptimizeIf(not_equal, instr->environment());
5713 void LCodeGen::DoCheckFunction(LCheckFunction* instr) {
5714 Handle<JSFunction> target = instr->hydrogen()->target();
5715 if (instr->hydrogen()->target_in_new_space()) {
5716 Register reg = ToRegister(instr->value());
5720 Operand operand = ToOperand(instr->value());
5723 DeoptimizeIf(not_equal, instr->environment());
5727 void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) {
5734 instr->pointer_map(), 1, Safepoint::kNoLazyDeopt);
5738 DeoptimizeIf(zero, instr->environment());
5742 void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
5745 DeferredCheckMaps(LCodeGen* codegen, LCheckMaps* instr, Register object)
5746 : LDeferredCode(codegen), instr_(instr), object_(object) {
5753 virtual LInstruction* instr() { return instr_; }
5760 if (instr->hydrogen()->CanOmitMapChecks()) return;
5762 LOperand* input = instr->value();
5766 SmallMapList* map_set = instr->hydrogen()->map_set();
5769 if (instr->hydrogen()->has_migration_target()) {
5770 deferred = new(zone()) DeferredCheckMaps(this, instr, reg);
5783 if (instr->hydrogen()->has_migration_target()) {
5786 DeoptimizeIf(not_equal, instr->environment());
5793 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) {
5795 XMMRegister value_reg = ToDoubleRegister(instr->unclamped());
5796 Register result_reg = ToRegister(instr->result());
5801 void LCodeGen::DoClampIToUint8(LClampIToUint8* instr) {
5802 ASSERT(instr->unclamped()->Equals(instr->result()));
5803 Register value_reg = ToRegister(instr->result());
5808 void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) {
5811 ASSERT(instr->unclamped()->Equals(instr->result()));
5812 Register input_reg = ToRegister(instr->unclamped());
5825 DeoptimizeIf(not_equal, instr->environment());
5843 void LCodeGen::DoClampTToUint8NoSSE2(LClampTToUint8NoSSE2* instr) {
5844 Register input_reg = ToRegister(instr->unclamped());
5845 Register result_reg = ToRegister(instr->result());
5846 Register scratch = ToRegister(instr->scratch());
5847 Register scratch2 = ToRegister(instr->scratch2());
5848 Register scratch3 = ToRegister(instr->scratch3());
5862 DeoptimizeIf(not_equal, instr->environment());
5965 void LCodeGen::DoAllocate(LAllocate* instr) {
5968 DeferredAllocate(LCodeGen* codegen, LAllocate* instr)
5969 : LDeferredCode(codegen), instr_(instr) { }
5971 virtual LInstruction* instr() { return instr_; }
5977 new(zone()) DeferredAllocate(this, instr);
5979 Register result = ToRegister(instr->result());
5980 Register temp = ToRegister(instr->temp());
5984 if (instr->hydrogen()->MustAllocateDoubleAligned()) {
5987 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) {
5988 ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation());
5989 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
5991 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) {
5992 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
5996 if (instr->size()->IsConstantOperand()) {
5997 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
6000 Register size = ToRegister(instr->size());
6006 if (instr->hydrogen()->MustPrefillWithFiller()) {
6007 if (instr->size()->IsConstantOperand()) {
6008 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
6011 temp = ToRegister(instr->size());
6025 void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
6026 Register result = ToRegister(instr->result());
6034 if (instr->size()->IsRegister()) {
6035 Register size = ToRegister(instr->size());
6037 __ SmiTag(ToRegister(instr->size()));
6040 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
6044 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) {
6045 ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation());
6046 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
6048 Runtime::kAllocateInOldPointerSpace, 1, instr, instr->context());
6049 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) {
6050 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
6052 Runtime::kAllocateInOldDataSpace, 1, instr, instr->context());
6055 Runtime::kAllocateInNewSpace, 1, instr, instr->context());
6061 void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
6062 ASSERT(ToRegister(instr->value()).is(eax));
6064 CallRuntime(Runtime::kToFastProperties, 1, instr);
6068 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) {
6069 ASSERT(ToRegister(instr->context()).is(esi));
6077 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index());
6078 __ LoadHeapObject(ecx, instr->hydrogen()->literals());
6086 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index())));
6087 __ push(Immediate(instr->hydrogen()->pattern()));
6088 __ push(Immediate(instr->hydrogen()->flags()));
6089 CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr);
6101 CallRuntime(Runtime::kAllocateInNewSpace, 1, instr);
6120 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
6121 ASSERT(ToRegister(instr->context()).is(esi));
6124 bool pretenure = instr->hydrogen()->pretenure();
6125 if (!pretenure && instr->hydrogen()->has_no_literals()) {
6126 FastNewClosureStub stub(instr->hydrogen()->language_mode(),
6127 instr->hydrogen()->is_generator());
6128 __ push(Immediate(instr->hydrogen()->shared_info()));
6129 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
6132 __ push(Immediate(instr->hydrogen()->shared_info()));
6135 CallRuntime(Runtime::kNewClosure, 3, instr);
6140 void LCodeGen::DoTypeof(LTypeof* instr) {
6141 LOperand* input = instr->value();
6143 CallRuntime(Runtime::kTypeof, 1, instr);
6147 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) {
6148 Register input = ToRegister(instr->value());
6151 EmitTypeofIs(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_),
6152 input, instr->type_literal());
6154 EmitBranch(instr, final_branch_condition);
6233 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) {
6234 Register temp = ToRegister(instr->temp());
6237 EmitBranch(instr, equal);
6274 void LCodeGen::DoLazyBailout(LLazyBailout* instr) {
6276 ASSERT(instr->HasEnvironment());
6277 LEnvironment* env = instr->environment();
6283 void LCodeGen::DoDeoptimize(LDeoptimize* instr) {
6284 Deoptimizer::BailoutType type = instr->hydrogen()->type();
6292 Comment(";;; deoptimize: %s", instr->hydrogen()->reason());
6293 DeoptimizeIf(no_condition, instr->environment(), type);
6297 void LCodeGen::DoDummyUse(LDummyUse* instr) {
6302 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) {
6307 instr, RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS);
6308 ASSERT(instr->HasEnvironment());
6309 LEnvironment* env = instr->environment();
6314 void LCodeGen::DoStackCheck(LStackCheck* instr) {
6317 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr)
6318 : LDeferredCode(codegen), instr_(instr) { }
6320 virtual LInstruction* instr() { return instr_; }
6325 ASSERT(instr->HasEnvironment());
6326 LEnvironment* env = instr->environment();
6329 if (instr->hydrogen()->is_function_entry()) {
6337 ASSERT(instr->context()->IsRegister());
6338 ASSERT(ToRegister(instr->context()).is(esi));
6340 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
6346 ASSERT(instr->hydrogen()->is_backwards_branch());
6349 new(zone()) DeferredStackCheck(this, instr);
6355 __ bind(instr->done_label());
6356 deferred_stack_check->SetExit(instr->done_label());
6365 void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
6369 LEnvironment* environment = instr->environment();
6382 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
6384 DeoptimizeIf(equal, instr->environment());
6387 DeoptimizeIf(equal, instr->environment());
6390 DeoptimizeIf(zero, instr->environment());
6394 DeoptimizeIf(below_equal, instr->environment());
6405 CallRuntime(Runtime::kGetPropertyNamesFast, 1, instr);
6409 DeoptimizeIf(not_equal, instr->environment());
6414 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
6415 Register map = ToRegister(instr->map());
6416 Register result = ToRegister(instr->result());
6429 FieldOperand(result, FixedArray::SizeFor(instr->idx())));
6432 DeoptimizeIf(equal, instr->environment());
6436 void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) {
6437 Register object = ToRegister(instr->value());
6438 __ cmp(ToRegister(instr->map()),
6440 DeoptimizeIf(not_equal, instr->environment());
6444 void LCodeGen::DoLoadFieldByIndex(LLoadFieldByIndex* instr) {
6445 Register object = ToRegister(instr->object());
6446 Register index = ToRegister(instr->index());