summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-03-02 18:04:15 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-03-02 18:04:15 +0000
commit3ccd4cf596f633edbe379fc3600e07a5b9302357 (patch)
treee696aa20e6df03fbca92dde302a9d3b0673aaf57 /runtime
parent3d96f56f203c51c793befcc17619ad86e3b0a08e (diff)
parent579885a26d761f5ba9550f2a1cd7f0f598c2e1e3 (diff)
downloadart-3ccd4cf596f633edbe379fc3600e07a5b9302357.tar.gz
art-3ccd4cf596f633edbe379fc3600e07a5b9302357.tar.bz2
art-3ccd4cf596f633edbe379fc3600e07a5b9302357.zip
Merge "Opt Compiler: ARM64: Enable explicit memory barriers over acquire/release"
Diffstat (limited to 'runtime')
-rw-r--r--runtime/arch/arm64/instruction_set_features_arm64.h9
-rw-r--r--runtime/arch/arm64/instruction_set_features_arm64_test.cc2
2 files changed, 11 insertions, 0 deletions
diff --git a/runtime/arch/arm64/instruction_set_features_arm64.h b/runtime/arch/arm64/instruction_set_features_arm64.h
index b0c66b3272..f6bfee7e63 100644
--- a/runtime/arch/arm64/instruction_set_features_arm64.h
+++ b/runtime/arch/arm64/instruction_set_features_arm64.h
@@ -61,6 +61,15 @@ class Arm64InstructionSetFeatures FINAL : public InstructionSetFeatures {
return fix_cortex_a53_835769_;
}
+ // TODO: Tune this on a per CPU basis. For now, we pessimistically assume
+ // that all ARM64 CPUs prefer explicit memory barriers over acquire-release.
+ //
+ // NOTE: This should not be the case! However we want to exercise the
+ // explicit memory barriers code paths in the Optimizing Compiler.
+ bool PreferAcquireRelease() const {
+ return false;
+ }
+
virtual ~Arm64InstructionSetFeatures() {}
protected:
diff --git a/runtime/arch/arm64/instruction_set_features_arm64_test.cc b/runtime/arch/arm64/instruction_set_features_arm64_test.cc
index 027e59c57a..753107baa8 100644
--- a/runtime/arch/arm64/instruction_set_features_arm64_test.cc
+++ b/runtime/arch/arm64/instruction_set_features_arm64_test.cc
@@ -30,6 +30,8 @@ TEST(Arm64InstructionSetFeaturesTest, Arm64Features) {
EXPECT_TRUE(arm64_features->Equals(arm64_features.get()));
EXPECT_STREQ("smp,a53", arm64_features->GetFeatureString().c_str());
EXPECT_EQ(arm64_features->AsBitmap(), 3U);
+ // See the comments in instruction_set_features_arm64.h.
+ EXPECT_FALSE(arm64_features->AsArm64InstructionSetFeatures()->PreferAcquireRelease());
}
} // namespace art