From dec8f63fdf50815f24efe1c03af64208da15f339 Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Fri, 22 Jul 2016 17:10:06 +0100 Subject: Do not emit stack maps for runtime calls to ReadBarrierMarkRegX. * Boot image code size variation on Nexus 5X (aosp_bullhead-userdebug build): - total ARM64 framework Oat files size change: 115584120 bytes -> 109124728 bytes (-5.59%) - total ARM framework Oat files size change: 97387728 bytes -> 92517584 (-5.00%) Test: ART host and target (ARM, ARM64) tests. Bug: 29506760 Bug: 12687968 Change-Id: I979d9fb2b4e09f4c0c7bf33af2cd91750a67f989 --- compiler/optimizing/code_generator.cc | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'compiler/optimizing/code_generator.cc') diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 9c6dcaa7b3..3269dc6605 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -1178,19 +1178,19 @@ void CodeGenerator::ValidateInvokeRuntime(HInstruction* instruction, SlowPathCod << "instruction->DebugName()=" << instruction->DebugName() << " slow_path->GetDescription()=" << slow_path->GetDescription(); DCHECK(instruction->GetSideEffects().Includes(SideEffects::CanTriggerGC()) || - // When read barriers are enabled, some instructions use a - // slow path to emit a read barrier, which does not trigger - // GC, is not fatal, nor is emitted by HDeoptimize - // instructions. + // When (non-Baker) read barriers are enabled, some instructions + // use a slow path to emit a read barrier, which does not trigger + // GC. (kEmitCompilerReadBarrier && + !kUseBakerReadBarrier && (instruction->IsInstanceFieldGet() || instruction->IsStaticFieldGet() || - instruction->IsArraySet() || instruction->IsArrayGet() || instruction->IsLoadClass() || instruction->IsLoadString() || instruction->IsInstanceOf() || - instruction->IsCheckCast()))) + instruction->IsCheckCast() || + (instruction->IsInvokeVirtual() && instruction->GetLocations()->Intrinsified())))) << "instruction->DebugName()=" << instruction->DebugName() << " instruction->GetSideEffects().ToString()=" << instruction->GetSideEffects().ToString() << " slow_path->GetDescription()=" << slow_path->GetDescription(); @@ -1204,6 +1204,27 @@ void CodeGenerator::ValidateInvokeRuntime(HInstruction* instruction, SlowPathCod << instruction->DebugName() << ((slow_path != nullptr) ? slow_path->GetDescription() : ""); } +void CodeGenerator::ValidateInvokeRuntimeWithoutRecordingPcInfo(HInstruction* instruction, + SlowPathCode* slow_path) { + DCHECK(instruction->GetLocations()->OnlyCallsOnSlowPath()) + << "instruction->DebugName()=" << instruction->DebugName() + << " slow_path->GetDescription()=" << slow_path->GetDescription(); + // Only the Baker read barrier marking slow path used by certains + // instructions is expected to invoke the runtime without recording + // PC-related information. + DCHECK(kUseBakerReadBarrier); + DCHECK(instruction->IsInstanceFieldGet() || + instruction->IsStaticFieldGet() || + instruction->IsArrayGet() || + instruction->IsLoadClass() || + instruction->IsLoadString() || + instruction->IsInstanceOf() || + instruction->IsCheckCast() || + (instruction->IsInvokeVirtual() && instruction->GetLocations()->Intrinsified())) + << "instruction->DebugName()=" << instruction->DebugName() + << " slow_path->GetDescription()=" << slow_path->GetDescription(); +} + void SlowPathCode::SaveLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) { RegisterSet* live_registers = locations->GetLiveRegisters(); size_t stack_offset = codegen->GetFirstRegisterSlotInSlowPath(); -- cgit v1.2.3-59-g8ed1b