diff options
| author | 2016-09-09 12:49:55 -0700 | |
|---|---|---|
| committer | 2016-09-09 13:28:02 -0700 | |
| commit | e0576d15f3ad0e9316f96838af01f7cc7acf6c3c (patch) | |
| tree | abc6ce4677243c84a4c70ecd0240056f95e874fb /compiler/optimizing | |
| parent | 280764498fdba371f972301daa870e33bef31d6a (diff) | |
Re-enable boot image direct string loads for read barriers
Boot.oat code size with CC baker:
ARM32: 70775656 -> 69817028 (-1.35%)
ARM64: 80819424 -> 79417072 (-1.74%)
X86 unmeasured.
X86_64 unmeasured.
Performance unmeasured, should be faster.
Bug: 29516974
Test: test-art-host CC baker, N6P booting CC baker
Change-Id: I219faaca9ed17af81d2815fb5e124120f307af83
Diffstat (limited to 'compiler/optimizing')
| -rw-r--r-- | compiler/optimizing/code_generator_arm.cc | 14 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_arm64.cc | 14 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_x86.cc | 14 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_x86_64.cc | 13 | 
4 files changed, 0 insertions, 55 deletions
| diff --git a/compiler/optimizing/code_generator_arm.cc b/compiler/optimizing/code_generator_arm.cc index 3c4a3e8e18..e76190f3da 100644 --- a/compiler/optimizing/code_generator_arm.cc +++ b/compiler/optimizing/code_generator_arm.cc @@ -5422,17 +5422,6 @@ void InstructionCodeGeneratorARM::GenerateClassInitializationCheck(  HLoadString::LoadKind CodeGeneratorARM::GetSupportedLoadStringKind(      HLoadString::LoadKind desired_string_load_kind) { -  if (kEmitCompilerReadBarrier) { -    switch (desired_string_load_kind) { -      case HLoadString::LoadKind::kBootImageLinkTimeAddress: -      case HLoadString::LoadKind::kBootImageLinkTimePcRelative: -      case HLoadString::LoadKind::kBootImageAddress: -        // TODO: Implement for read barrier. -        return HLoadString::LoadKind::kDexCacheViaMethod; -      default: -        break; -    } -  }    switch (desired_string_load_kind) {      case HLoadString::LoadKind::kBootImageLinkTimeAddress:        DCHECK(!GetCompilerOptions().GetCompilePic()); @@ -5485,13 +5474,11 @@ void InstructionCodeGeneratorARM::VisitLoadString(HLoadString* load) {    switch (load_kind) {      case HLoadString::LoadKind::kBootImageLinkTimeAddress: { -      DCHECK(!kEmitCompilerReadBarrier);        __ LoadLiteral(out, codegen_->DeduplicateBootImageStringLiteral(load->GetDexFile(),                                                                        load->GetStringIndex()));        return;  // No dex cache slow path.      }      case HLoadString::LoadKind::kBootImageLinkTimePcRelative: { -      DCHECK(!kEmitCompilerReadBarrier);        CodeGeneratorARM::PcRelativePatchInfo* labels =            codegen_->NewPcRelativeStringPatch(load->GetDexFile(), load->GetStringIndex());        __ BindTrackedLabel(&labels->movw_label); @@ -5503,7 +5490,6 @@ void InstructionCodeGeneratorARM::VisitLoadString(HLoadString* load) {        return;  // No dex cache slow path.      }      case HLoadString::LoadKind::kBootImageAddress: { -      DCHECK(!kEmitCompilerReadBarrier);        DCHECK_NE(load->GetAddress(), 0u);        uint32_t address = dchecked_integral_cast<uint32_t>(load->GetAddress());        __ LoadLiteral(out, codegen_->DeduplicateBootImageAddressLiteral(address)); diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc index 1d2f33405e..64231ade7e 100644 --- a/compiler/optimizing/code_generator_arm64.cc +++ b/compiler/optimizing/code_generator_arm64.cc @@ -4124,17 +4124,6 @@ void InstructionCodeGeneratorARM64::VisitClearException(HClearException* clear A  HLoadString::LoadKind CodeGeneratorARM64::GetSupportedLoadStringKind(      HLoadString::LoadKind desired_string_load_kind) { -  if (kEmitCompilerReadBarrier) { -    switch (desired_string_load_kind) { -      case HLoadString::LoadKind::kBootImageLinkTimeAddress: -      case HLoadString::LoadKind::kBootImageLinkTimePcRelative: -      case HLoadString::LoadKind::kBootImageAddress: -        // TODO: Implement for read barrier. -        return HLoadString::LoadKind::kDexCacheViaMethod; -      default: -        break; -    } -  }    switch (desired_string_load_kind) {      case HLoadString::LoadKind::kBootImageLinkTimeAddress:        DCHECK(!GetCompilerOptions().GetCompilePic()); @@ -4175,12 +4164,10 @@ void InstructionCodeGeneratorARM64::VisitLoadString(HLoadString* load) {    switch (load->GetLoadKind()) {      case HLoadString::LoadKind::kBootImageLinkTimeAddress: -      DCHECK(!kEmitCompilerReadBarrier);        __ Ldr(out, codegen_->DeduplicateBootImageStringLiteral(load->GetDexFile(),                                                                load->GetStringIndex()));        return;  // No dex cache slow path.      case HLoadString::LoadKind::kBootImageLinkTimePcRelative: { -      DCHECK(!kEmitCompilerReadBarrier);        // Add ADRP with its PC-relative String patch.        const DexFile& dex_file = load->GetDexFile();        uint32_t string_index = load->GetStringIndex(); @@ -4201,7 +4188,6 @@ void InstructionCodeGeneratorARM64::VisitLoadString(HLoadString* load) {        return;  // No dex cache slow path.      }      case HLoadString::LoadKind::kBootImageAddress: { -      DCHECK(!kEmitCompilerReadBarrier);        DCHECK(load->GetAddress() != 0u && IsUint<32>(load->GetAddress()));        __ Ldr(out.W(), codegen_->DeduplicateBootImageAddressLiteral(load->GetAddress()));        return;  // No dex cache slow path. diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc index 5953badb07..72ab6150f6 100644 --- a/compiler/optimizing/code_generator_x86.cc +++ b/compiler/optimizing/code_generator_x86.cc @@ -6065,17 +6065,6 @@ void InstructionCodeGeneratorX86::GenerateClassInitializationCheck(  HLoadString::LoadKind CodeGeneratorX86::GetSupportedLoadStringKind(      HLoadString::LoadKind desired_string_load_kind) { -  if (kEmitCompilerReadBarrier) { -    switch (desired_string_load_kind) { -      case HLoadString::LoadKind::kBootImageLinkTimeAddress: -      case HLoadString::LoadKind::kBootImageLinkTimePcRelative: -      case HLoadString::LoadKind::kBootImageAddress: -        // TODO: Implement for read barrier. -        return HLoadString::LoadKind::kDexCacheViaMethod; -      default: -        break; -    } -  }    switch (desired_string_load_kind) {      case HLoadString::LoadKind::kBootImageLinkTimeAddress:        DCHECK(!GetCompilerOptions().GetCompilePic()); @@ -6129,20 +6118,17 @@ void InstructionCodeGeneratorX86::VisitLoadString(HLoadString* load) {    switch (load->GetLoadKind()) {      case HLoadString::LoadKind::kBootImageLinkTimeAddress: { -      DCHECK(!kEmitCompilerReadBarrier);        __ movl(out, Immediate(/* placeholder */ 0));        codegen_->RecordStringPatch(load);        return;  // No dex cache slow path.      }      case HLoadString::LoadKind::kBootImageLinkTimePcRelative: { -      DCHECK(!kEmitCompilerReadBarrier);        Register method_address = locations->InAt(0).AsRegister<Register>();        __ leal(out, Address(method_address, CodeGeneratorX86::kDummy32BitOffset));        codegen_->RecordStringPatch(load);        return;  // No dex cache slow path.      }      case HLoadString::LoadKind::kBootImageAddress: { -      DCHECK(!kEmitCompilerReadBarrier);        DCHECK_NE(load->GetAddress(), 0u);        uint32_t address = dchecked_integral_cast<uint32_t>(load->GetAddress());        __ movl(out, Immediate(address)); diff --git a/compiler/optimizing/code_generator_x86_64.cc b/compiler/optimizing/code_generator_x86_64.cc index 46f90603b5..cbb5799d52 100644 --- a/compiler/optimizing/code_generator_x86_64.cc +++ b/compiler/optimizing/code_generator_x86_64.cc @@ -5495,17 +5495,6 @@ void InstructionCodeGeneratorX86_64::VisitClinitCheck(HClinitCheck* check) {  HLoadString::LoadKind CodeGeneratorX86_64::GetSupportedLoadStringKind(      HLoadString::LoadKind desired_string_load_kind) { -  if (kEmitCompilerReadBarrier) { -    switch (desired_string_load_kind) { -      case HLoadString::LoadKind::kBootImageLinkTimeAddress: -      case HLoadString::LoadKind::kBootImageLinkTimePcRelative: -      case HLoadString::LoadKind::kBootImageAddress: -        // TODO: Implement for read barrier. -        return HLoadString::LoadKind::kDexCacheViaMethod; -      default: -        break; -    } -  }    switch (desired_string_load_kind) {      case HLoadString::LoadKind::kBootImageLinkTimeAddress:        DCHECK(!GetCompilerOptions().GetCompilePic()); @@ -5548,13 +5537,11 @@ void InstructionCodeGeneratorX86_64::VisitLoadString(HLoadString* load) {    switch (load->GetLoadKind()) {      case HLoadString::LoadKind::kBootImageLinkTimePcRelative: { -      DCHECK(!kEmitCompilerReadBarrier);        __ leal(out, Address::Absolute(CodeGeneratorX86_64::kDummy32BitOffset, /* no_rip */ false));        codegen_->RecordStringPatch(load);        return;  // No dex cache slow path.      }      case HLoadString::LoadKind::kBootImageAddress: { -      DCHECK(!kEmitCompilerReadBarrier);        DCHECK_NE(load->GetAddress(), 0u);        uint32_t address = dchecked_integral_cast<uint32_t>(load->GetAddress());        __ movl(out, Immediate(address));  // Zero-extended. |