Home | History | Annotate | Download | only in optimizing

Lines Matching full:instruction

53   explicit NullCheckSlowPathX86_64(HNullCheck* instruction) : instruction_(instruction) {}
69 explicit DivZeroCheckSlowPathX86_64(HDivZeroCheck* instruction) : instruction_(instruction) {}
117 explicit SuspendCheckSlowPathX86_64(HSuspendCheck* instruction, HBasicBlock* successor)
118 : instruction_(instruction), successor_(successor) {}
153 BoundsCheckSlowPathX86_64(HBoundsCheck* instruction,
156 : instruction_(instruction),
224 // The instruction where this slow path is happening.
239 explicit LoadStringSlowPathX86_64(HLoadString* instruction) : instruction_(instruction) {}
268 TypeCheckSlowPathX86_64(HInstruction* instruction,
272 : instruction_(instruction),
326 explicit DeoptimizationSlowPathX86_64(HInstruction* instruction)
327 : instruction_(instruction) {}
689 void CodeGeneratorX86_64::Move(HInstruction* instruction,
692 LocationSummary* locations = instruction->GetLocations();
721 } else if (instruction->IsLoadLocal()) {
722 switch (instruction->GetType()) {
730 Move(location, Location::StackSlot(GetStackSlot(instruction->AsLoadLocal()->GetLocal())));
736 Location::DoubleStackSlot(GetStackSlot(instruction->AsLoadLocal()->GetLocal())));
740 LOG(FATAL) << "Unexpected local type " << instruction->GetType();
742 } else if (instruction->IsTemporary()) {
743 Location temp_location = GetTemporaryLocation(instruction->AsTemporary());
746 DCHECK((instruction->GetNext() == move_for) || instruction->GetNext()->IsTemporary());
747 switch (instruction->GetType()) {
761 LOG(FATAL) << "Unexpected type " << instruction->GetType();
799 void InstructionCodeGeneratorX86_64::GenerateTestAndBranch(HInstruction* instruction,
803 HInstruction* cond = instruction->InputAt(0);
822 && cond->AsCondition()->IsBeforeWhenDisregardMoves(instruction);
826 Location lhs = instruction->GetLocations()->InAt(0);
1531 // Processing a Dex `int-to-byte' instruction.
1549 // Processing a Dex `int-to-short' instruction.
1563 // Processing a Dex `long-to-int' instruction.
1569 // Processing a Dex `float-to-int' instruction.
1576 // Processing a Dex `double-to-int' instruction.
1596 // Processing a Dex `int-to-long' instruction.
1604 // Processing a Dex `float-to-long' instruction.
1611 // Processing a Dex `double-to-long' instruction.
1630 // Processing a Dex `int-to-char' instruction.
1649 // Processing a Dex `int-to-float' instruction.
1655 // Processing a Dex `long-to-float' instruction.
1661 // Processing a Dex `double-to-float' instruction.
1680 // Processing a Dex `int-to-double' instruction.
1686 // Processing a Dex `long-to-double' instruction.
1692 // Processing a Dex `float-to-double' instruction.
1724 // Processing a Dex `int-to-byte' instruction.
1750 // Processing a Dex `int-to-short' instruction.
1772 // Processing a Dex `long-to-int' instruction.
1787 // Processing a Dex `float-to-int' instruction.
1812 // Processing a Dex `double-to-int' instruction.
1851 // Processing a Dex `int-to-long' instruction.
1857 // Processing a Dex `float-to-long' instruction.
1882 // Processing a Dex `double-to-long' instruction.
1919 // Processing a Dex `int-to-char' instruction.
1946 // Processing a Dex `int-to-float' instruction.
1964 // Processing a Dex `long-to-float' instruction.
1982 // Processing a Dex `double-to-float' instruction.
2013 // Processing a Dex `int-to-double' instruction.
2031 // Processing a Dex `long-to-double' instruction.
2049 // Processing a Dex `float-to-double' instruction.
2462 void InstructionCodeGeneratorX86_64::DivRemOneOrMinusOne(HBinaryOperation* instruction) {
2463 DCHECK(instruction->IsDiv() || instruction->IsRem());
2465 LocationSummary* locations = instruction->GetLocations();
2475 switch (instruction->GetResultType()) {
2477 if (instruction->IsRem()) {
2489 if (instruction->IsRem()) {
2501 LOG(FATAL) << "Unexpected type for div by (-)1 " << instruction->GetResultType();
2505 void InstructionCodeGeneratorX86_64::DivByPowerOfTwo(HDiv* instruction) {
2506 LocationSummary* locations = instruction->GetLocations();
2518 if (instruction->GetResultType() == Primitive::kPrimInt) {
2531 DCHECK_EQ(instruction->GetResultType(), Primitive::kPrimLong);
2549 void InstructionCodeGeneratorX86_64::GenerateDivRemWithAnyConstant(HBinaryOperation* instruction) {
2550 DCHECK(instruction->IsDiv() || instruction->IsRem());
2552 LocationSummary* locations = instruction->GetLocations();
2555 CpuRegister numerator = instruction->IsDiv() ? locations->GetTemp(1).AsRegister<CpuRegister>()
2558 CpuRegister edx = instruction->IsDiv() ? locations->GetTemp(0).AsRegister<CpuRegister>()
2564 if (instruction->IsDiv()) {
2574 if (instruction->GetResultType() == Primitive::kPrimInt) {
2608 if (instruction->IsRem()) {
2620 DCHECK_EQ(instruction->GetResultType(), Primitive::kPrimLong);
2654 if (instruction->IsRem()) {
2671 void InstructionCodeGeneratorX86_64::GenerateDivRemIntegral(HBinaryOperation* instruction) {
2672 DCHECK(instruction->IsDiv() || instruction->IsRem());
2673 Primitive::Type type = instruction->GetResultType();
2676 bool is_div = instruction->IsDiv();
2677 LocationSummary* locations = instruction->GetLocations();
2691 DivRemOneOrMinusOne(instruction);
2692 } else if (instruction->IsDiv() && IsPowerOfTwo(std::abs(imm))) {
2693 DivByPowerOfTwo(instruction->AsDiv());
2696 GenerateDivRemWithAnyConstant(instruction);
2860 void LocationsBuilderX86_64::VisitDivZeroCheck(HDivZeroCheck* instruction) {
2862 new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kNoCall);
2864 if (instruction->HasUses()) {
2869 void InstructionCodeGeneratorX86_64::VisitDivZeroCheck(HDivZeroCheck* instruction) {
2871 new (GetGraph()->GetArena()) DivZeroCheckSlowPathX86_64(instruction);
2874 LocationSummary* locations = instruction->GetLocations();
2877 switch (instruction->GetType()) {
2909 LOG(FATAL) << "Unexpected type for HDivZeroCheck " << instruction->GetType();
3014 void LocationsBuilderX86_64::VisitNewInstance(HNewInstance* instruction) {
3016 new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kCall);
3023 void InstructionCodeGeneratorX86_64::VisitNewInstance(HNewInstance* instruction) {
3027 instruction->GetTypeIndex());
3029 Address::Absolute(GetThreadOffset<kX86_64WordSize>(instruction->GetEntrypoint()), true));
3032 codegen_->RecordPcInfo(instruction, instruction->GetDexPc());
3035 void LocationsBuilderX86_64::VisitNewArray(HNewArray* instruction) {
3037 new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kCall);
3045 void InstructionCodeGeneratorX86_64::VisitNewArray(HNewArray* instruction) {
3049 instruction->GetTypeIndex());
3052 Address::Absolute(GetThreadOffset<kX86_64WordSize>(instruction->GetEntrypoint()), true));
3055 codegen_->RecordPcInfo(instruction, instruction->GetDexPc());
3058 void LocationsBuilderX86_64::VisitParameterValue(HParameterValue* instruction) {
3060 new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kNoCall);
3061 Location location = parameter_visitor_.GetNextLocation(instruction->GetType());
3070 void InstructionCodeGeneratorX86_64::VisitParameterValue(HParameterValue* instruction) {
3072 UNUSED(instruction);
3116 void LocationsBuilderX86_64::VisitPhi(HPhi* instruction) {
3118 new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kNoCall);
3119 for (size_t i = 0, e = instruction->InputCount(); i < e; ++i) {
3125 void InstructionCodeGeneratorX86_64::VisitPhi(HPhi* instruction) {
3126 UNUSED(instruction);
3152 void LocationsBuilderX86_64::HandleFieldGet(HInstruction* instruction) {
3153 DCHECK(instruction->IsInstanceFieldGet() || instruction->IsStaticFieldGet());
3156 new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kNoCall);
3158 if (Primitive::IsFloatingPointType(instruction->GetType())) {
3165 void InstructionCodeGeneratorX86_64::HandleFieldGet(HInstruction* instruction,
3167 DCHECK(instruction->IsInstanceFieldGet() || instruction->IsStaticFieldGet());
3169 LocationSummary* locations = instruction->GetLocations();
3223 codegen_->MaybeRecordImplicitNullCheck(instruction);
3230 void LocationsBuilderX86_64::HandleFieldSet(HInstruction* instruction,
3232 DCHECK(instruction->IsInstanceFieldSet() || instruction->IsStaticFieldSet());
3235 new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kNoCall);
3237 CodeGenerator::StoreNeedsWriteBarrier(field_info.GetFieldType(), instruction->InputAt(1));
3240 if (Primitive::IsFloatingPointType(instruction->InputAt(1)->GetType())) {
3243 locations->SetInAt(1, Location::RegisterOrInt32LongConstant(instruction->InputAt(1)));
3252 void InstructionCodeGeneratorX86_64::HandleFieldSet(HInstruction* instruction,
3254 DCHECK(instruction->IsInstanceFieldSet() || instruction->IsStaticFieldSet());
3256 LocationSummary* locations = instruction->GetLocations();
3328 codegen_->MaybeRecordImplicitNullCheck(instruction);
3330 if (CodeGenerator::StoreNeedsWriteBarrier(field_type, instruction->InputAt(1))) {
3341 void LocationsBuilderX86_64::VisitInstanceFieldSet(HInstanceFieldSet* instruction) {
3342 HandleFieldSet(instruction, instruction->GetFieldInfo());
3345 void InstructionCodeGeneratorX86_64::VisitInstanceFieldSet(HInstanceFieldSet* instruction) {
3346 HandleFieldSet(instruction, instruction->GetFieldInfo());
3349 void LocationsBuilderX86_64::VisitInstanceFieldGet(HInstanceFieldGet* instruction) {
3350 HandleFieldGet(instruction);
3353 void InstructionCodeGeneratorX86_64::VisitInstanceFieldGet(HInstanceFieldGet* instruction) {
3354 HandleFieldGet(instruction, instruction->GetFieldInfo());
3357 void LocationsBuilderX86_64::VisitStaticFieldGet(HStaticFieldGet* instruction) {
3358 HandleFieldGet(instruction);
3361 void InstructionCodeGeneratorX86_64::VisitStaticFieldGet(HStaticFieldGet* instruction) {
3362 HandleFieldGet(instruction, instruction->GetFieldInfo());
3365 void LocationsBuilderX86_64::VisitStaticFieldSet(HStaticFieldSet* instruction) {
3366 HandleFieldSet(instruction, instruction->GetFieldInfo());
3369 void InstructionCodeGeneratorX86_64::VisitStaticFieldSet(HStaticFieldSet* instruction) {
3370 HandleFieldSet(instruction, instruction->GetFieldInfo());
3373 void LocationsBuilderX86_64::VisitNullCheck(HNullCheck* instruction) {
3375 new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kNoCall);
3380 if (instruction->HasUses()) {
3385 void InstructionCodeGeneratorX86_64::GenerateImplicitNullCheck(HNullCheck* instruction) {
3386 if (codegen_->CanMoveNullCheckToUser(instruction)) {
3389 LocationSummary* locations = instruction->GetLocations();
3393 codegen_->RecordPcInfo(instruction, instruction->GetDexPc());
3396 void InstructionCodeGeneratorX86_64::GenerateExplicitNullCheck(HNullCheck* instruction) {
3397 SlowPathCodeX86_64* slow_path = new (GetGraph()->GetArena()) NullCheckSlowPathX86_64(instruction);
3400 LocationSummary* locations = instruction->GetLocations();
3416 void InstructionCodeGeneratorX86_64::VisitNullCheck(HNullCheck* instruction) {
3418 GenerateImplicitNullCheck(instruction);
3420 GenerateExplicitNullCheck(instruction);
3424 void LocationsBuilderX86_64::VisitArrayGet(HArrayGet* instruction) {
3426 new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kNoCall);
3428 locations->SetInAt(1, Location::RegisterOrConstant(instruction->InputAt(1)));
3429 if (Primitive::IsFloatingPointType(instruction->GetType())) {
3436 void InstructionCodeGeneratorX86_64::VisitArrayGet(HArrayGet* instruction) {
3437 LocationSummary* locations = instruction->GetLocations();
3441 switch (instruction->GetType()) {
3541 LOG(FATAL) << "Unreachable type " << instruction->GetType();
3544 codegen_->MaybeRecordImplicitNullCheck(instruction);
3547 void LocationsBuilderX86_64::VisitArraySet(HArraySet* instruction) {
3548 Primitive::Type value_type = instruction->GetComponentType();
3551 CodeGenerator::StoreNeedsWriteBarrier(value_type, instruction->GetValue());
3552 bool needs_runtime_call = instruction->NeedsTypeCheck();
3555 instruction, needs_runtime_call ? LocationSummary::kCall : LocationSummary::kNoCall);
3564 1, Location::RegisterOrConstant(instruction->InputAt(1)));
3567 locations->SetInAt(2, Location::RegisterOrInt32LongConstant(instruction->InputAt(2)));
3571 locations->SetInAt(2, Location::RegisterOrConstant(instruction->InputAt(2)));
3582 void InstructionCodeGeneratorX86_64::VisitArraySet(HArraySet* instruction) {
3583 LocationSummary* locations = instruction->GetLocations();
3587 Primitive::Type value_type = instruction->GetComponentType();
3590 CodeGenerator::StoreNeedsWriteBarrier(value_type, instruction->GetValue());
3613 codegen_->MaybeRecordImplicitNullCheck(instruction);
3640 codegen_->MaybeRecordImplicitNullCheck(instruction);
3670 codegen_->MaybeRecordImplicitNullCheck(instruction);
3682 codegen_->RecordPcInfo(instruction, instruction->GetDexPc());
3711 codegen_->MaybeRecordImplicitNullCheck(instruction);
3726 codegen_->MaybeRecordImplicitNullCheck(instruction);
3741 codegen_->MaybeRecordImplicitNullCheck(instruction);
3746 LOG(FATAL) << "Unreachable type " << instruction->GetType();
3751 void LocationsBuilderX86_64::VisitArrayLength(HArrayLength* instruction) {
3753 new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kNoCall);
3758 void InstructionCodeGeneratorX86_64::VisitArrayLength(HArrayLength* instruction) {
3759 LocationSummary* locations = instruction->GetLocations();
3764 codegen_->MaybeRecordImplicitNullCheck(instruction);
3767 void LocationsBuilderX86_64::VisitBoundsCheck(HBoundsCheck* instruction) {
3769 new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kNoCall);
3770 locations->SetInAt(0, Location::RegisterOrConstant(instruction->InputAt(0)));
3771 locations->SetInAt(1, Location::RegisterOrConstant(instruction->InputAt(1)));
3772 if (instruction->HasUses()) {
3777 void InstructionCodeGeneratorX86_64::VisitBoundsCheck(HBoundsCheck* instruction) {
3778 LocationSummary* locations = instruction->GetLocations();
3782 new (GetGraph()->GetArena()) BoundsCheckSlowPathX86_64(instruction, index_loc, length_loc);
3841 void LocationsBuilderX86_64::VisitParallelMove(HParallelMove* instruction) {
3842 UNUSED(instruction);
3846 void InstructionCodeGeneratorX86_64::VisitParallelMove(HParallelMove* instruction) {
3847 codegen_->GetMoveResolver()->EmitNativeCode(instruction);
3850 void LocationsBuilderX86_64::VisitSuspendCheck(HSuspendCheck* instruction) {
3851 new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kCallOnSlowPath);
3854 void InstructionCodeGeneratorX86_64::VisitSuspendCheck(HSuspendCheck* instruction) {
3855 HBasicBlock* block = instruction->GetBlock();
3857 DCHECK(block->GetLoopInformation()->GetSuspendCheck() == instruction);
3861 if (block->IsEntryBlock() && instruction->GetNext()->IsGoto()) {
3865 GenerateSuspendCheck(instruction, nullptr);
3868 void InstructionCodeGeneratorX86_64::GenerateSuspendCheck(HSuspendCheck* instruction,
3871 down_cast<SuspendCheckSlowPathX86_64*>(instruction->GetSlowPath());
3873 slow_path = new (GetGraph()->GetArena()) SuspendCheckSlowPathX86_64(instruction, successor);
3874 instruction->SetSlowPath(slow_path);
3878 codegen_->ClearSpillSlotsFromLoopPhisInStackMap(instruction);
4199 void LocationsBuilderX86_64::VisitThrow(HThrow* instruction) {
4201 new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kCall);
4206 void InstructionCodeGeneratorX86_64::VisitThrow(HThrow* instruction) {
4209 codegen_->RecordPcInfo(instruction, instruction->GetDexPc());
4212 void LocationsBuilderX86_64::VisitInstanceOf(HInstanceOf* instruction) {
4213 LocationSummary::CallKind call_kind = instruction->IsClassFinal()
4216 LocationSummary* locations = new (GetGraph()->GetArena()) LocationSummary(instruction, call_kind);
4222 void InstructionCodeGeneratorX86_64::VisitInstanceOf(HInstanceOf* instruction) {
4223 LocationSummary* locations = instruction->GetLocations();
4233 if (instruction->MustDoNullCheck()) {
4245 if (instruction->IsClassFinal()) {
4254 instruction, locations->InAt(1), locations->Out(), instruction->GetDexPc());
4261 if (instruction->MustDoNullCheck() || instruction->IsClassFinal()) {
4272 void LocationsBuilderX86_64::VisitCheckCast(HCheckCast* instruction) {
4274 instruction, LocationSummary::kCallOnSlowPath);
4280 void InstructionCodeGeneratorX86_64::VisitCheckCast(HCheckCast* instruction) {
4281 LocationSummary* locations = instruction->GetLocations();
4287 instruction, locations->InAt(1), locations->GetTemp(0), instruction->GetDexPc());
4291 if (instruction->MustDoNullCheck()) {
4308 void LocationsBuilderX86_64::VisitMonitorOperation(HMonitorOperation* instruction) {
4310 new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kCall);
4315 void InstructionCodeGeneratorX86_64::VisitMonitorOperation(HMonitorOperation* instruction) {
4316 __ gs()->call(Address::Absolute(instruction->IsEnter()
4320 codegen_->RecordPcInfo(instruction, instruction->GetDexPc());
4323 void LocationsBuilderX86_64::VisitAnd(HAnd* instruction) { HandleBitwiseOperation(instruction); }
4324 void LocationsBuilderX86_64::VisitOr(HOr* instruction) { HandleBitwiseOperation(instruction); }
4325 void LocationsBuilderX86_64::VisitXor(HXor* instruction) { HandleBitwiseOperation(instruction); }
4327 void LocationsBuilderX86_64::HandleBitwiseOperation(HBinaryOperation* instruction) {
4329 new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kNoCall);
4330 DCHECK(instruction->GetResultType() == Primitive::kPrimInt
4331 || instruction->GetResultType() == Primitive::kPrimLong);
4337 void InstructionCodeGeneratorX86_64::VisitAnd(HAnd* instruction) {
4338 HandleBitwiseOperation(instruction);
4341 void InstructionCodeGeneratorX86_64::VisitOr(HOr* instruction) {
4342 HandleBitwiseOperation(instruction);
4345 void InstructionCodeGeneratorX86_64::VisitXor(HXor* instruction) {
4346 HandleBitwiseOperation(instruction);
4349 void InstructionCodeGeneratorX86_64::HandleBitwiseOperation(HBinaryOperation* instruction) {
4350 LocationSummary* locations = instruction->GetLocations();
4355 if (instruction->GetResultType() == Primitive::kPrimInt) {
4357 if (instruction->IsAnd()) {
4359 } else if (instruction->IsOr()) {
4362 DCHECK(instruction->IsXor());
4367 if (instruction->IsAnd()) {
4369 } else if (instruction->IsOr()) {
4372 DCHECK(instruction->IsXor());
4377 if (instruction->IsAnd()) {
4379 } else if (instruction->IsOr()) {
4382 DCHECK(instruction->IsXor());
4387 DCHECK_EQ(instruction->GetResultType(), Primitive::kPrimLong);
4397 if (instruction->IsAnd()) {
4409 } else if (instruction->IsOr()) {
4422 DCHECK(instruction->IsXor());
4438 void LocationsBuilderX86_64::VisitBoundType(HBoundType* instruction) {
4440 UNUSED(instruction);
4444 void InstructionCodeGeneratorX86_64::VisitBoundType(HBoundType* instruction) {
4446 UNUSED(instruction);
4487 // Patch the correct offset for the instruction. We use the address of the
4488 // 'next' instruction, which is 'pos' (patch the 4 bytes before).