summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2018-04-13 09:34:00 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2018-04-13 09:34:00 +0000
commit8a78f81a16a7c8225b48bf634b67f5697f72e15f (patch)
tree1e7e6ee76ec6dc88d55d8681bf5816108b18b51b
parentbe2d2ad255585f639d657022ab55a78b682298be (diff)
parent6d66fcf87dee9d2207ea745969b1f89836b0f8c5 (diff)
Merge changes I8687ab9e,I61f879f2
* changes: Move RelativePatcher from libart-compiler.so to dex2oat. Rewrite null checks in read barrier introspection thunks.
-rw-r--r--compiler/Android.bp18
-rw-r--r--compiler/optimizing/code_generator_arm64.cc38
-rw-r--r--compiler/optimizing/code_generator_arm_vixl.cc42
-rw-r--r--dex2oat/Android.bp72
-rw-r--r--dex2oat/linker/arm/relative_patcher_arm_base.cc (renamed from compiler/linker/arm/relative_patcher_arm_base.cc)0
-rw-r--r--dex2oat/linker/arm/relative_patcher_arm_base.h (renamed from compiler/linker/arm/relative_patcher_arm_base.h)6
-rw-r--r--dex2oat/linker/arm/relative_patcher_thumb2.cc (renamed from compiler/linker/arm/relative_patcher_thumb2.cc)0
-rw-r--r--dex2oat/linker/arm/relative_patcher_thumb2.h (renamed from compiler/linker/arm/relative_patcher_thumb2.h)6
-rw-r--r--dex2oat/linker/arm/relative_patcher_thumb2_test.cc (renamed from compiler/linker/arm/relative_patcher_thumb2_test.cc)0
-rw-r--r--dex2oat/linker/arm64/relative_patcher_arm64.cc (renamed from compiler/linker/arm64/relative_patcher_arm64.cc)0
-rw-r--r--dex2oat/linker/arm64/relative_patcher_arm64.h (renamed from compiler/linker/arm64/relative_patcher_arm64.h)6
-rw-r--r--dex2oat/linker/arm64/relative_patcher_arm64_test.cc (renamed from compiler/linker/arm64/relative_patcher_arm64_test.cc)0
-rw-r--r--dex2oat/linker/mips/relative_patcher_mips.cc (renamed from compiler/linker/mips/relative_patcher_mips.cc)0
-rw-r--r--dex2oat/linker/mips/relative_patcher_mips.h (renamed from compiler/linker/mips/relative_patcher_mips.h)6
-rw-r--r--dex2oat/linker/mips/relative_patcher_mips32r6_test.cc (renamed from compiler/linker/mips/relative_patcher_mips32r6_test.cc)0
-rw-r--r--dex2oat/linker/mips/relative_patcher_mips_test.cc (renamed from compiler/linker/mips/relative_patcher_mips_test.cc)0
-rw-r--r--dex2oat/linker/mips64/relative_patcher_mips64.cc (renamed from compiler/linker/mips64/relative_patcher_mips64.cc)0
-rw-r--r--dex2oat/linker/mips64/relative_patcher_mips64.h (renamed from compiler/linker/mips64/relative_patcher_mips64.h)6
-rw-r--r--dex2oat/linker/mips64/relative_patcher_mips64_test.cc (renamed from compiler/linker/mips64/relative_patcher_mips64_test.cc)0
-rw-r--r--dex2oat/linker/relative_patcher.cc (renamed from compiler/linker/relative_patcher.cc)2
-rw-r--r--dex2oat/linker/relative_patcher.h (renamed from compiler/linker/relative_patcher.h)6
-rw-r--r--dex2oat/linker/relative_patcher_test.h (renamed from compiler/linker/relative_patcher_test.h)8
-rw-r--r--dex2oat/linker/x86/relative_patcher_x86.cc (renamed from compiler/linker/x86/relative_patcher_x86.cc)0
-rw-r--r--dex2oat/linker/x86/relative_patcher_x86.h (renamed from compiler/linker/x86/relative_patcher_x86.h)6
-rw-r--r--dex2oat/linker/x86/relative_patcher_x86_base.cc (renamed from compiler/linker/x86/relative_patcher_x86_base.cc)0
-rw-r--r--dex2oat/linker/x86/relative_patcher_x86_base.h (renamed from compiler/linker/x86/relative_patcher_x86_base.h)6
-rw-r--r--dex2oat/linker/x86/relative_patcher_x86_test.cc (renamed from compiler/linker/x86/relative_patcher_x86_test.cc)0
-rw-r--r--dex2oat/linker/x86_64/relative_patcher_x86_64.cc (renamed from compiler/linker/x86_64/relative_patcher_x86_64.cc)0
-rw-r--r--dex2oat/linker/x86_64/relative_patcher_x86_64.h (renamed from compiler/linker/x86_64/relative_patcher_x86_64.h)6
-rw-r--r--dex2oat/linker/x86_64/relative_patcher_x86_64_test.cc (renamed from compiler/linker/x86_64/relative_patcher_x86_64_test.cc)0
30 files changed, 146 insertions, 88 deletions
diff --git a/compiler/Android.bp b/compiler/Android.bp
index 6bed48e107..cde64b058c 100644
--- a/compiler/Android.bp
+++ b/compiler/Android.bp
@@ -39,7 +39,6 @@ art_cc_defaults {
"linker/file_output_stream.cc",
"linker/output_stream.cc",
"linker/vector_output_stream.cc",
- "linker/relative_patcher.cc",
"jit/jit_compiler.cc",
"jit/jit_logger.cc",
"jni/quick/calling_convention.cc",
@@ -102,8 +101,6 @@ art_cc_defaults {
arm: {
srcs: [
"jni/quick/arm/calling_convention_arm.cc",
- "linker/arm/relative_patcher_arm_base.cc",
- "linker/arm/relative_patcher_thumb2.cc",
"optimizing/code_generator_arm_vixl.cc",
"optimizing/code_generator_vector_arm_vixl.cc",
"optimizing/instruction_simplifier_arm.cc",
@@ -120,7 +117,6 @@ art_cc_defaults {
arm64: {
srcs: [
"jni/quick/arm64/calling_convention_arm64.cc",
- "linker/arm64/relative_patcher_arm64.cc",
"optimizing/code_generator_arm64.cc",
"optimizing/code_generator_vector_arm64.cc",
"optimizing/scheduler_arm64.cc",
@@ -134,7 +130,6 @@ art_cc_defaults {
mips: {
srcs: [
"jni/quick/mips/calling_convention_mips.cc",
- "linker/mips/relative_patcher_mips.cc",
"optimizing/code_generator_mips.cc",
"optimizing/code_generator_vector_mips.cc",
"optimizing/instruction_simplifier_mips.cc",
@@ -147,7 +142,6 @@ art_cc_defaults {
mips64: {
srcs: [
"jni/quick/mips64/calling_convention_mips64.cc",
- "linker/mips64/relative_patcher_mips64.cc",
"optimizing/code_generator_mips64.cc",
"optimizing/code_generator_vector_mips64.cc",
"optimizing/intrinsics_mips64.cc",
@@ -158,8 +152,6 @@ art_cc_defaults {
x86: {
srcs: [
"jni/quick/x86/calling_convention_x86.cc",
- "linker/x86/relative_patcher_x86.cc",
- "linker/x86/relative_patcher_x86_base.cc",
"optimizing/code_generator_x86.cc",
"optimizing/code_generator_vector_x86.cc",
"optimizing/intrinsics_x86.cc",
@@ -173,7 +165,6 @@ art_cc_defaults {
x86_64: {
srcs: [
"jni/quick/x86_64/calling_convention_x86_64.cc",
- "linker/x86_64/relative_patcher_x86_64.cc",
"optimizing/intrinsics_x86_64.cc",
"optimizing/code_generator_x86_64.cc",
"optimizing/code_generator_vector_x86_64.cc",
@@ -373,31 +364,25 @@ art_cc_test {
codegen: {
arm: {
srcs: [
- "linker/arm/relative_patcher_thumb2_test.cc",
"utils/arm/managed_register_arm_test.cc",
],
},
arm64: {
srcs: [
- "linker/arm64/relative_patcher_arm64_test.cc",
"utils/arm64/managed_register_arm64_test.cc",
],
},
mips: {
srcs: [
- "linker/mips/relative_patcher_mips_test.cc",
- "linker/mips/relative_patcher_mips32r6_test.cc",
],
},
mips64: {
srcs: [
- "linker/mips64/relative_patcher_mips64_test.cc",
"utils/mips64/managed_register_mips64_test.cc",
],
},
x86: {
srcs: [
- "linker/x86/relative_patcher_x86_test.cc",
"utils/x86/managed_register_x86_test.cc",
// These tests are testing architecture-independent
@@ -413,7 +398,8 @@ art_cc_test {
},
x86_64: {
srcs: [
- "linker/x86_64/relative_patcher_x86_64_test.cc",
+ // Is this test a bit-rotten copy of the x86 test? b/77951326
+ // "utils/x86_64/managed_register_x86_64_test.cc",
],
},
},
diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc
index 31887d92e8..d4cfab82de 100644
--- a/compiler/optimizing/code_generator_arm64.cc
+++ b/compiler/optimizing/code_generator_arm64.cc
@@ -6838,7 +6838,8 @@ void CodeGeneratorARM64::EmitJitRootPatches(uint8_t* code, const uint8_t* roots_
static void EmitGrayCheckAndFastPath(arm64::Arm64Assembler& assembler,
vixl::aarch64::Register base_reg,
vixl::aarch64::MemOperand& lock_word,
- vixl::aarch64::Label* slow_path) {
+ vixl::aarch64::Label* slow_path,
+ vixl::aarch64::Label* throw_npe = nullptr) {
// Load the lock word containing the rb_state.
__ Ldr(ip0.W(), lock_word);
// Given the numeric representation, it's enough to check the low bit of the rb_state.
@@ -6848,6 +6849,10 @@ static void EmitGrayCheckAndFastPath(arm64::Arm64Assembler& assembler,
static_assert(
BAKER_MARK_INTROSPECTION_ARRAY_LDR_OFFSET == BAKER_MARK_INTROSPECTION_FIELD_LDR_OFFSET,
"Field and array LDR offsets must be the same to reuse the same code.");
+ // To throw NPE, we return to the fast path; the artificial dependence below does not matter.
+ if (throw_npe != nullptr) {
+ __ Bind(throw_npe);
+ }
// Adjust the return address back to the LDR (1 instruction; 2 for heap poisoning).
static_assert(BAKER_MARK_INTROSPECTION_FIELD_LDR_OFFSET == (kPoisonHeapReferences ? -8 : -4),
"Field LDR must be 1 instruction (4B) before the return address label; "
@@ -6877,10 +6882,6 @@ void CodeGeneratorARM64::CompileBakerReadBarrierThunk(Arm64Assembler& assembler,
BakerReadBarrierKind kind = BakerReadBarrierKindField::Decode(encoded_data);
switch (kind) {
case BakerReadBarrierKind::kField: {
- // Check if the holder is gray and, if not, add fake dependency to the base register
- // and return to the LDR instruction to load the reference. Otherwise, use introspection
- // to load the reference and call the entrypoint (in IP1) that performs further checks
- // on the reference and marks it if needed.
auto base_reg =
Register::GetXRegFromCode(BakerReadBarrierFirstRegField::Decode(encoded_data));
CheckValidReg(base_reg.GetCode());
@@ -6889,16 +6890,22 @@ void CodeGeneratorARM64::CompileBakerReadBarrierThunk(Arm64Assembler& assembler,
CheckValidReg(holder_reg.GetCode());
UseScratchRegisterScope temps(assembler.GetVIXLAssembler());
temps.Exclude(ip0, ip1);
- // If base_reg differs from holder_reg, the offset was too large and we must have
- // emitted an explicit null check before the load. Otherwise, we need to null-check
- // the holder as we do not necessarily do that check before going to the thunk.
- vixl::aarch64::Label throw_npe;
- if (holder_reg.Is(base_reg)) {
- __ Cbz(holder_reg.W(), &throw_npe);
+ // If base_reg differs from holder_reg, the offset was too large and we must have emitted
+ // an explicit null check before the load. Otherwise, for implicit null checks, we need to
+ // null-check the holder as we do not necessarily do that check before going to the thunk.
+ vixl::aarch64::Label throw_npe_label;
+ vixl::aarch64::Label* throw_npe = nullptr;
+ if (GetCompilerOptions().GetImplicitNullChecks() && holder_reg.Is(base_reg)) {
+ throw_npe = &throw_npe_label;
+ __ Cbz(holder_reg.W(), throw_npe);
}
+ // Check if the holder is gray and, if not, add fake dependency to the base register
+ // and return to the LDR instruction to load the reference. Otherwise, use introspection
+ // to load the reference and call the entrypoint that performs further checks on the
+ // reference and marks it if needed.
vixl::aarch64::Label slow_path;
MemOperand lock_word(holder_reg, mirror::Object::MonitorOffset().Int32Value());
- EmitGrayCheckAndFastPath(assembler, base_reg, lock_word, &slow_path);
+ EmitGrayCheckAndFastPath(assembler, base_reg, lock_word, &slow_path, throw_npe);
__ Bind(&slow_path);
MemOperand ldr_address(lr, BAKER_MARK_INTROSPECTION_FIELD_LDR_OFFSET);
__ Ldr(ip0.W(), ldr_address); // Load the LDR (immediate) unsigned offset.
@@ -6907,13 +6914,6 @@ void CodeGeneratorARM64::CompileBakerReadBarrierThunk(Arm64Assembler& assembler,
__ Ldr(ip0.W(), MemOperand(base_reg, ip0, LSL, 2)); // Load the reference.
// Do not unpoison. With heap poisoning enabled, the entrypoint expects a poisoned reference.
__ Br(ip1); // Jump to the entrypoint.
- if (holder_reg.Is(base_reg)) {
- // Add null check slow path. The stack map is at the address pointed to by LR.
- __ Bind(&throw_npe);
- int32_t offset = GetThreadOffset<kArm64PointerSize>(kQuickThrowNullPointer).Int32Value();
- __ Ldr(ip0, MemOperand(/* Thread* */ vixl::aarch64::x19, offset));
- __ Br(ip0);
- }
break;
}
case BakerReadBarrierKind::kArray: {
diff --git a/compiler/optimizing/code_generator_arm_vixl.cc b/compiler/optimizing/code_generator_arm_vixl.cc
index 15d952608d..7350b146f9 100644
--- a/compiler/optimizing/code_generator_arm_vixl.cc
+++ b/compiler/optimizing/code_generator_arm_vixl.cc
@@ -29,7 +29,6 @@
#include "gc/accounting/card_table.h"
#include "heap_poisoning.h"
#include "intrinsics_arm_vixl.h"
-#include "linker/arm/relative_patcher_thumb2.h"
#include "linker/linker_patch.h"
#include "mirror/array-inl.h"
#include "mirror/class-inl.h"
@@ -9905,7 +9904,8 @@ static void EmitGrayCheckAndFastPath(ArmVIXLAssembler& assembler,
vixl32::Register base_reg,
vixl32::MemOperand& lock_word,
vixl32::Label* slow_path,
- int32_t raw_ldr_offset) {
+ int32_t raw_ldr_offset,
+ vixl32::Label* throw_npe = nullptr) {
// Load the lock word containing the rb_state.
__ Ldr(ip, lock_word);
// Given the numeric representation, it's enough to check the low bit of the rb_state.
@@ -9913,6 +9913,10 @@ static void EmitGrayCheckAndFastPath(ArmVIXLAssembler& assembler,
static_assert(ReadBarrier::GrayState() == 1, "Expecting gray to have value 1");
__ Tst(ip, Operand(LockWord::kReadBarrierStateMaskShifted));
__ B(ne, slow_path, /* is_far_target */ false);
+ // To throw NPE, we return to the fast path; the artificial dependence below does not matter.
+ if (throw_npe != nullptr) {
+ __ Bind(throw_npe);
+ }
__ Add(lr, lr, raw_ldr_offset);
// Introduce a dependency on the lock_word including rb_state,
// to prevent load-load reordering, and without using
@@ -9926,7 +9930,7 @@ static void EmitGrayCheckAndFastPath(ArmVIXLAssembler& assembler,
static void LoadReadBarrierMarkIntrospectionEntrypoint(ArmVIXLAssembler& assembler,
vixl32::Register entrypoint) {
// The register where the read barrier introspection entrypoint is loaded
- // is fixed: `Thumb2RelativePatcher::kBakerCcEntrypointRegister` (R4).
+ // is fixed: `kBakerCcEntrypointRegister` (R4).
DCHECK(entrypoint.Is(kBakerCcEntrypointRegister));
// entrypoint = Thread::Current()->pReadBarrierMarkReg12, i.e. pReadBarrierMarkIntrospection.
DCHECK_EQ(ip.GetCode(), 12u);
@@ -9941,10 +9945,6 @@ void CodeGeneratorARMVIXL::CompileBakerReadBarrierThunk(ArmVIXLAssembler& assemb
BakerReadBarrierKind kind = BakerReadBarrierKindField::Decode(encoded_data);
switch (kind) {
case BakerReadBarrierKind::kField: {
- // Check if the holder is gray and, if not, add fake dependency to the base register
- // and return to the LDR instruction to load the reference. Otherwise, use introspection
- // to load the reference and call the entrypoint (in kBakerCcEntrypointRegister)
- // that performs further checks on the reference and marks it if needed.
vixl32::Register base_reg(BakerReadBarrierFirstRegField::Decode(encoded_data));
CheckValidReg(base_reg.GetCode());
vixl32::Register holder_reg(BakerReadBarrierSecondRegField::Decode(encoded_data));
@@ -9952,19 +9952,26 @@ void CodeGeneratorARMVIXL::CompileBakerReadBarrierThunk(ArmVIXLAssembler& assemb
BakerReadBarrierWidth width = BakerReadBarrierWidthField::Decode(encoded_data);
UseScratchRegisterScope temps(assembler.GetVIXLAssembler());
temps.Exclude(ip);
- // If base_reg differs from holder_reg, the offset was too large and we must have
- // emitted an explicit null check before the load. Otherwise, we need to null-check
- // the holder as we do not necessarily do that check before going to the thunk.
- vixl32::Label throw_npe;
- if (holder_reg.Is(base_reg)) {
- __ CompareAndBranchIfZero(holder_reg, &throw_npe, /* is_far_target */ false);
+ // If base_reg differs from holder_reg, the offset was too large and we must have emitted
+ // an explicit null check before the load. Otherwise, for implicit null checks, we need to
+ // null-check the holder as we do not necessarily do that check before going to the thunk.
+ vixl32::Label throw_npe_label;
+ vixl32::Label* throw_npe = nullptr;
+ if (GetCompilerOptions().GetImplicitNullChecks() && holder_reg.Is(base_reg)) {
+ throw_npe = &throw_npe_label;
+ __ CompareAndBranchIfZero(holder_reg, throw_npe, /* is_far_target */ false);
}
+ // Check if the holder is gray and, if not, add fake dependency to the base register
+ // and return to the LDR instruction to load the reference. Otherwise, use introspection
+ // to load the reference and call the entrypoint that performs further checks on the
+ // reference and marks it if needed.
vixl32::Label slow_path;
MemOperand lock_word(holder_reg, mirror::Object::MonitorOffset().Int32Value());
const int32_t raw_ldr_offset = (width == BakerReadBarrierWidth::kWide)
? BAKER_MARK_INTROSPECTION_FIELD_LDR_WIDE_OFFSET
: BAKER_MARK_INTROSPECTION_FIELD_LDR_NARROW_OFFSET;
- EmitGrayCheckAndFastPath(assembler, base_reg, lock_word, &slow_path, raw_ldr_offset);
+ EmitGrayCheckAndFastPath(
+ assembler, base_reg, lock_word, &slow_path, raw_ldr_offset, throw_npe);
__ Bind(&slow_path);
const int32_t ldr_offset = /* Thumb state adjustment (LR contains Thumb state). */ -1 +
raw_ldr_offset;
@@ -9986,13 +9993,6 @@ void CodeGeneratorARMVIXL::CompileBakerReadBarrierThunk(ArmVIXLAssembler& assemb
}
// Do not unpoison. With heap poisoning enabled, the entrypoint expects a poisoned reference.
__ Bx(ep_reg); // Jump to the entrypoint.
- if (holder_reg.Is(base_reg)) {
- // Add null check slow path. The stack map is at the address pointed to by LR.
- __ Bind(&throw_npe);
- int32_t offset = GetThreadOffset<kArmPointerSize>(kQuickThrowNullPointer).Int32Value();
- __ Ldr(ip, MemOperand(/* Thread* */ vixl32::r9, offset));
- __ Bx(ip);
- }
break;
}
case BakerReadBarrierKind::kArray: {
diff --git a/dex2oat/Android.bp b/dex2oat/Android.bp
index b158231bc3..49b65fd35e 100644
--- a/dex2oat/Android.bp
+++ b/dex2oat/Android.bp
@@ -24,7 +24,44 @@ art_cc_defaults {
"linker/image_writer.cc",
"linker/multi_oat_relative_patcher.cc",
"linker/oat_writer.cc",
+ "linker/relative_patcher.cc",
],
+
+ codegen: {
+ arm: {
+ srcs: [
+ "linker/arm/relative_patcher_arm_base.cc",
+ "linker/arm/relative_patcher_thumb2.cc",
+ ],
+ },
+ arm64: {
+ srcs: [
+ "linker/arm64/relative_patcher_arm64.cc",
+ ],
+ },
+ mips: {
+ srcs: [
+ "linker/mips/relative_patcher_mips.cc",
+ ],
+ },
+ mips64: {
+ srcs: [
+ "linker/mips64/relative_patcher_mips64.cc",
+ ],
+ },
+ x86: {
+ srcs: [
+ "linker/x86/relative_patcher_x86.cc",
+ "linker/x86/relative_patcher_x86_base.cc",
+ ],
+ },
+ x86_64: {
+ srcs: [
+ "linker/x86_64/relative_patcher_x86_64.cc",
+ ],
+ },
+ },
+
target: {
android: {
// For atrace.
@@ -245,6 +282,41 @@ art_cc_test {
"linker/multi_oat_relative_patcher_test.cc",
"linker/oat_writer_test.cc",
],
+
+ codegen: {
+ arm: {
+ srcs: [
+ "linker/arm/relative_patcher_thumb2_test.cc",
+ ],
+ },
+ arm64: {
+ srcs: [
+ "linker/arm64/relative_patcher_arm64_test.cc",
+ ],
+ },
+ mips: {
+ srcs: [
+ "linker/mips/relative_patcher_mips_test.cc",
+ "linker/mips/relative_patcher_mips32r6_test.cc",
+ ],
+ },
+ mips64: {
+ srcs: [
+ "linker/mips64/relative_patcher_mips64_test.cc",
+ ],
+ },
+ x86: {
+ srcs: [
+ "linker/x86/relative_patcher_x86_test.cc",
+ ],
+ },
+ x86_64: {
+ srcs: [
+ "linker/x86_64/relative_patcher_x86_64_test.cc",
+ ],
+ },
+ },
+
header_libs: ["dex2oat_headers"],
include_dirs: [
"external/zlib",
diff --git a/compiler/linker/arm/relative_patcher_arm_base.cc b/dex2oat/linker/arm/relative_patcher_arm_base.cc
index 7cb8ae55c5..7cb8ae55c5 100644
--- a/compiler/linker/arm/relative_patcher_arm_base.cc
+++ b/dex2oat/linker/arm/relative_patcher_arm_base.cc
diff --git a/compiler/linker/arm/relative_patcher_arm_base.h b/dex2oat/linker/arm/relative_patcher_arm_base.h
index 963d6690b0..f5a1395bdd 100644
--- a/compiler/linker/arm/relative_patcher_arm_base.h
+++ b/dex2oat/linker/arm/relative_patcher_arm_base.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_COMPILER_LINKER_ARM_RELATIVE_PATCHER_ARM_BASE_H_
-#define ART_COMPILER_LINKER_ARM_RELATIVE_PATCHER_ARM_BASE_H_
+#ifndef ART_DEX2OAT_LINKER_ARM_RELATIVE_PATCHER_ARM_BASE_H_
+#define ART_DEX2OAT_LINKER_ARM_RELATIVE_PATCHER_ARM_BASE_H_
#include <deque>
#include <vector>
@@ -155,4 +155,4 @@ class ArmBaseRelativePatcher : public RelativePatcher {
} // namespace linker
} // namespace art
-#endif // ART_COMPILER_LINKER_ARM_RELATIVE_PATCHER_ARM_BASE_H_
+#endif // ART_DEX2OAT_LINKER_ARM_RELATIVE_PATCHER_ARM_BASE_H_
diff --git a/compiler/linker/arm/relative_patcher_thumb2.cc b/dex2oat/linker/arm/relative_patcher_thumb2.cc
index 697fb09f73..697fb09f73 100644
--- a/compiler/linker/arm/relative_patcher_thumb2.cc
+++ b/dex2oat/linker/arm/relative_patcher_thumb2.cc
diff --git a/compiler/linker/arm/relative_patcher_thumb2.h b/dex2oat/linker/arm/relative_patcher_thumb2.h
index 68610d69e1..3a42928466 100644
--- a/compiler/linker/arm/relative_patcher_thumb2.h
+++ b/dex2oat/linker/arm/relative_patcher_thumb2.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_COMPILER_LINKER_ARM_RELATIVE_PATCHER_THUMB2_H_
-#define ART_COMPILER_LINKER_ARM_RELATIVE_PATCHER_THUMB2_H_
+#ifndef ART_DEX2OAT_LINKER_ARM_RELATIVE_PATCHER_THUMB2_H_
+#define ART_DEX2OAT_LINKER_ARM_RELATIVE_PATCHER_THUMB2_H_
#include "arch/arm/registers_arm.h"
#include "base/array_ref.h"
@@ -70,4 +70,4 @@ class Thumb2RelativePatcher FINAL : public ArmBaseRelativePatcher {
} // namespace linker
} // namespace art
-#endif // ART_COMPILER_LINKER_ARM_RELATIVE_PATCHER_THUMB2_H_
+#endif // ART_DEX2OAT_LINKER_ARM_RELATIVE_PATCHER_THUMB2_H_
diff --git a/compiler/linker/arm/relative_patcher_thumb2_test.cc b/dex2oat/linker/arm/relative_patcher_thumb2_test.cc
index e7b11bd16b..e7b11bd16b 100644
--- a/compiler/linker/arm/relative_patcher_thumb2_test.cc
+++ b/dex2oat/linker/arm/relative_patcher_thumb2_test.cc
diff --git a/compiler/linker/arm64/relative_patcher_arm64.cc b/dex2oat/linker/arm64/relative_patcher_arm64.cc
index 71d1287c87..71d1287c87 100644
--- a/compiler/linker/arm64/relative_patcher_arm64.cc
+++ b/dex2oat/linker/arm64/relative_patcher_arm64.cc
diff --git a/compiler/linker/arm64/relative_patcher_arm64.h b/dex2oat/linker/arm64/relative_patcher_arm64.h
index 9dc289da44..f7f673c1ba 100644
--- a/compiler/linker/arm64/relative_patcher_arm64.h
+++ b/dex2oat/linker/arm64/relative_patcher_arm64.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_COMPILER_LINKER_ARM64_RELATIVE_PATCHER_ARM64_H_
-#define ART_COMPILER_LINKER_ARM64_RELATIVE_PATCHER_ARM64_H_
+#ifndef ART_DEX2OAT_LINKER_ARM64_RELATIVE_PATCHER_ARM64_H_
+#define ART_DEX2OAT_LINKER_ARM64_RELATIVE_PATCHER_ARM64_H_
#include "base/array_ref.h"
#include "linker/arm/relative_patcher_arm_base.h"
@@ -81,4 +81,4 @@ class Arm64RelativePatcher FINAL : public ArmBaseRelativePatcher {
} // namespace linker
} // namespace art
-#endif // ART_COMPILER_LINKER_ARM64_RELATIVE_PATCHER_ARM64_H_
+#endif // ART_DEX2OAT_LINKER_ARM64_RELATIVE_PATCHER_ARM64_H_
diff --git a/compiler/linker/arm64/relative_patcher_arm64_test.cc b/dex2oat/linker/arm64/relative_patcher_arm64_test.cc
index 393733dd0c..393733dd0c 100644
--- a/compiler/linker/arm64/relative_patcher_arm64_test.cc
+++ b/dex2oat/linker/arm64/relative_patcher_arm64_test.cc
diff --git a/compiler/linker/mips/relative_patcher_mips.cc b/dex2oat/linker/mips/relative_patcher_mips.cc
index 69e0846cb7..69e0846cb7 100644
--- a/compiler/linker/mips/relative_patcher_mips.cc
+++ b/dex2oat/linker/mips/relative_patcher_mips.cc
diff --git a/compiler/linker/mips/relative_patcher_mips.h b/dex2oat/linker/mips/relative_patcher_mips.h
index 5714a7d1b0..d3a4c5a14f 100644
--- a/compiler/linker/mips/relative_patcher_mips.h
+++ b/dex2oat/linker/mips/relative_patcher_mips.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_COMPILER_LINKER_MIPS_RELATIVE_PATCHER_MIPS_H_
-#define ART_COMPILER_LINKER_MIPS_RELATIVE_PATCHER_MIPS_H_
+#ifndef ART_DEX2OAT_LINKER_MIPS_RELATIVE_PATCHER_MIPS_H_
+#define ART_DEX2OAT_LINKER_MIPS_RELATIVE_PATCHER_MIPS_H_
#include "arch/mips/instruction_set_features_mips.h"
#include "linker/relative_patcher.h"
@@ -55,4 +55,4 @@ class MipsRelativePatcher FINAL : public RelativePatcher {
} // namespace linker
} // namespace art
-#endif // ART_COMPILER_LINKER_MIPS_RELATIVE_PATCHER_MIPS_H_
+#endif // ART_DEX2OAT_LINKER_MIPS_RELATIVE_PATCHER_MIPS_H_
diff --git a/compiler/linker/mips/relative_patcher_mips32r6_test.cc b/dex2oat/linker/mips/relative_patcher_mips32r6_test.cc
index 629fdd535d..629fdd535d 100644
--- a/compiler/linker/mips/relative_patcher_mips32r6_test.cc
+++ b/dex2oat/linker/mips/relative_patcher_mips32r6_test.cc
diff --git a/compiler/linker/mips/relative_patcher_mips_test.cc b/dex2oat/linker/mips/relative_patcher_mips_test.cc
index d876c76daa..d876c76daa 100644
--- a/compiler/linker/mips/relative_patcher_mips_test.cc
+++ b/dex2oat/linker/mips/relative_patcher_mips_test.cc
diff --git a/compiler/linker/mips64/relative_patcher_mips64.cc b/dex2oat/linker/mips64/relative_patcher_mips64.cc
index aae5746278..aae5746278 100644
--- a/compiler/linker/mips64/relative_patcher_mips64.cc
+++ b/dex2oat/linker/mips64/relative_patcher_mips64.cc
diff --git a/compiler/linker/mips64/relative_patcher_mips64.h b/dex2oat/linker/mips64/relative_patcher_mips64.h
index 183bbedb39..9f5a125408 100644
--- a/compiler/linker/mips64/relative_patcher_mips64.h
+++ b/dex2oat/linker/mips64/relative_patcher_mips64.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_COMPILER_LINKER_MIPS64_RELATIVE_PATCHER_MIPS64_H_
-#define ART_COMPILER_LINKER_MIPS64_RELATIVE_PATCHER_MIPS64_H_
+#ifndef ART_DEX2OAT_LINKER_MIPS64_RELATIVE_PATCHER_MIPS64_H_
+#define ART_DEX2OAT_LINKER_MIPS64_RELATIVE_PATCHER_MIPS64_H_
#include "linker/relative_patcher.h"
@@ -51,4 +51,4 @@ class Mips64RelativePatcher FINAL : public RelativePatcher {
} // namespace linker
} // namespace art
-#endif // ART_COMPILER_LINKER_MIPS64_RELATIVE_PATCHER_MIPS64_H_
+#endif // ART_DEX2OAT_LINKER_MIPS64_RELATIVE_PATCHER_MIPS64_H_
diff --git a/compiler/linker/mips64/relative_patcher_mips64_test.cc b/dex2oat/linker/mips64/relative_patcher_mips64_test.cc
index a02f5005e8..a02f5005e8 100644
--- a/compiler/linker/mips64/relative_patcher_mips64_test.cc
+++ b/dex2oat/linker/mips64/relative_patcher_mips64_test.cc
diff --git a/compiler/linker/relative_patcher.cc b/dex2oat/linker/relative_patcher.cc
index b82d15230d..b6135c9b5f 100644
--- a/compiler/linker/relative_patcher.cc
+++ b/dex2oat/linker/relative_patcher.cc
@@ -35,7 +35,7 @@
#ifdef ART_ENABLE_CODEGEN_x86_64
#include "linker/x86_64/relative_patcher_x86_64.h"
#endif
-#include "output_stream.h"
+#include "linker/output_stream.h"
namespace art {
namespace linker {
diff --git a/compiler/linker/relative_patcher.h b/dex2oat/linker/relative_patcher.h
index 06c7e70d23..d80eaf94f7 100644
--- a/compiler/linker/relative_patcher.h
+++ b/dex2oat/linker/relative_patcher.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_COMPILER_LINKER_RELATIVE_PATCHER_H_
-#define ART_COMPILER_LINKER_RELATIVE_PATCHER_H_
+#ifndef ART_DEX2OAT_LINKER_RELATIVE_PATCHER_H_
+#define ART_DEX2OAT_LINKER_RELATIVE_PATCHER_H_
#include <vector>
@@ -167,4 +167,4 @@ class RelativePatcher {
} // namespace linker
} // namespace art
-#endif // ART_COMPILER_LINKER_RELATIVE_PATCHER_H_
+#endif // ART_DEX2OAT_LINKER_RELATIVE_PATCHER_H_
diff --git a/compiler/linker/relative_patcher_test.h b/dex2oat/linker/relative_patcher_test.h
index af8dc4dbc9..3f7c8556c2 100644
--- a/compiler/linker/relative_patcher_test.h
+++ b/dex2oat/linker/relative_patcher_test.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_COMPILER_LINKER_RELATIVE_PATCHER_TEST_H_
-#define ART_COMPILER_LINKER_RELATIVE_PATCHER_TEST_H_
+#ifndef ART_DEX2OAT_LINKER_RELATIVE_PATCHER_TEST_H_
+#define ART_DEX2OAT_LINKER_RELATIVE_PATCHER_TEST_H_
#include "arch/instruction_set.h"
#include "arch/instruction_set_features.h"
@@ -30,9 +30,9 @@
#include "globals.h"
#include "gtest/gtest.h"
#include "linker/relative_patcher.h"
+#include "linker/vector_output_stream.h"
#include "oat.h"
#include "oat_quick_method_header.h"
-#include "vector_output_stream.h"
namespace art {
namespace linker {
@@ -356,4 +356,4 @@ class RelativePatcherTest : public testing::Test {
} // namespace linker
} // namespace art
-#endif // ART_COMPILER_LINKER_RELATIVE_PATCHER_TEST_H_
+#endif // ART_DEX2OAT_LINKER_RELATIVE_PATCHER_TEST_H_
diff --git a/compiler/linker/x86/relative_patcher_x86.cc b/dex2oat/linker/x86/relative_patcher_x86.cc
index cdd2cef13a..cdd2cef13a 100644
--- a/compiler/linker/x86/relative_patcher_x86.cc
+++ b/dex2oat/linker/x86/relative_patcher_x86.cc
diff --git a/compiler/linker/x86/relative_patcher_x86.h b/dex2oat/linker/x86/relative_patcher_x86.h
index 63a8338722..e723580dae 100644
--- a/compiler/linker/x86/relative_patcher_x86.h
+++ b/dex2oat/linker/x86/relative_patcher_x86.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_COMPILER_LINKER_X86_RELATIVE_PATCHER_X86_H_
-#define ART_COMPILER_LINKER_X86_RELATIVE_PATCHER_X86_H_
+#ifndef ART_DEX2OAT_LINKER_X86_RELATIVE_PATCHER_X86_H_
+#define ART_DEX2OAT_LINKER_X86_RELATIVE_PATCHER_X86_H_
#include "linker/x86/relative_patcher_x86_base.h"
@@ -38,4 +38,4 @@ class X86RelativePatcher FINAL : public X86BaseRelativePatcher {
} // namespace linker
} // namespace art
-#endif // ART_COMPILER_LINKER_X86_RELATIVE_PATCHER_X86_H_
+#endif // ART_DEX2OAT_LINKER_X86_RELATIVE_PATCHER_X86_H_
diff --git a/compiler/linker/x86/relative_patcher_x86_base.cc b/dex2oat/linker/x86/relative_patcher_x86_base.cc
index 6a9690d768..6a9690d768 100644
--- a/compiler/linker/x86/relative_patcher_x86_base.cc
+++ b/dex2oat/linker/x86/relative_patcher_x86_base.cc
diff --git a/compiler/linker/x86/relative_patcher_x86_base.h b/dex2oat/linker/x86/relative_patcher_x86_base.h
index 6097345657..4cc7b07d2d 100644
--- a/compiler/linker/x86/relative_patcher_x86_base.h
+++ b/dex2oat/linker/x86/relative_patcher_x86_base.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_COMPILER_LINKER_X86_RELATIVE_PATCHER_X86_BASE_H_
-#define ART_COMPILER_LINKER_X86_RELATIVE_PATCHER_X86_BASE_H_
+#ifndef ART_DEX2OAT_LINKER_X86_RELATIVE_PATCHER_X86_BASE_H_
+#define ART_DEX2OAT_LINKER_X86_RELATIVE_PATCHER_X86_BASE_H_
#include "linker/relative_patcher.h"
@@ -50,4 +50,4 @@ class X86BaseRelativePatcher : public RelativePatcher {
} // namespace linker
} // namespace art
-#endif // ART_COMPILER_LINKER_X86_RELATIVE_PATCHER_X86_BASE_H_
+#endif // ART_DEX2OAT_LINKER_X86_RELATIVE_PATCHER_X86_BASE_H_
diff --git a/compiler/linker/x86/relative_patcher_x86_test.cc b/dex2oat/linker/x86/relative_patcher_x86_test.cc
index b855dec91d..b855dec91d 100644
--- a/compiler/linker/x86/relative_patcher_x86_test.cc
+++ b/dex2oat/linker/x86/relative_patcher_x86_test.cc
diff --git a/compiler/linker/x86_64/relative_patcher_x86_64.cc b/dex2oat/linker/x86_64/relative_patcher_x86_64.cc
index 9633564999..9633564999 100644
--- a/compiler/linker/x86_64/relative_patcher_x86_64.cc
+++ b/dex2oat/linker/x86_64/relative_patcher_x86_64.cc
diff --git a/compiler/linker/x86_64/relative_patcher_x86_64.h b/dex2oat/linker/x86_64/relative_patcher_x86_64.h
index 4f3ec498cb..a31e1ebfbb 100644
--- a/compiler/linker/x86_64/relative_patcher_x86_64.h
+++ b/dex2oat/linker/x86_64/relative_patcher_x86_64.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_COMPILER_LINKER_X86_64_RELATIVE_PATCHER_X86_64_H_
-#define ART_COMPILER_LINKER_X86_64_RELATIVE_PATCHER_X86_64_H_
+#ifndef ART_DEX2OAT_LINKER_X86_64_RELATIVE_PATCHER_X86_64_H_
+#define ART_DEX2OAT_LINKER_X86_64_RELATIVE_PATCHER_X86_64_H_
#include "linker/x86/relative_patcher_x86_base.h"
@@ -38,4 +38,4 @@ class X86_64RelativePatcher FINAL : public X86BaseRelativePatcher {
} // namespace linker
} // namespace art
-#endif // ART_COMPILER_LINKER_X86_64_RELATIVE_PATCHER_X86_64_H_
+#endif // ART_DEX2OAT_LINKER_X86_64_RELATIVE_PATCHER_X86_64_H_
diff --git a/compiler/linker/x86_64/relative_patcher_x86_64_test.cc b/dex2oat/linker/x86_64/relative_patcher_x86_64_test.cc
index 6baa92de36..6baa92de36 100644
--- a/compiler/linker/x86_64/relative_patcher_x86_64_test.cc
+++ b/dex2oat/linker/x86_64/relative_patcher_x86_64_test.cc