summaryrefslogtreecommitdiff
path: root/compiler/optimizing/intrinsics_arm.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2017-03-08 13:11:50 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2017-05-16 01:58:03 +0100
commit365719c23d809e595cf320bfba40e76bb4e87940 (patch)
tree0939f0d8dc47723978a665fa11dd637f6976d521 /compiler/optimizing/intrinsics_arm.cc
parentd6705a0586377f1b0d7d14d3abe2b270bb0adb18 (diff)
No need to lock when calling Thread.interrupted.
Also intrinsify the Thread.interrupted call. The rationale behind this optimization is that the flag can only have two values, and only self can set it to false. Test: libcore, jdwp, run-tests, 050-sync-test Change-Id: I5c2b43bf872ba0bfafcb54b2cfcd19181864bc4c
Diffstat (limited to 'compiler/optimizing/intrinsics_arm.cc')
-rw-r--r--compiler/optimizing/intrinsics_arm.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/compiler/optimizing/intrinsics_arm.cc b/compiler/optimizing/intrinsics_arm.cc
index 69cf9a126f..1df884e551 100644
--- a/compiler/optimizing/intrinsics_arm.cc
+++ b/compiler/optimizing/intrinsics_arm.cc
@@ -2753,6 +2753,27 @@ void IntrinsicCodeGeneratorARM::VisitIntegerValueOf(HInvoke* invoke) {
}
}
+void IntrinsicLocationsBuilderARM::VisitThreadInterrupted(HInvoke* invoke) {
+ LocationSummary* locations = new (arena_) LocationSummary(invoke,
+ LocationSummary::kNoCall,
+ kIntrinsified);
+ locations->SetOut(Location::RequiresRegister());
+}
+
+void IntrinsicCodeGeneratorARM::VisitThreadInterrupted(HInvoke* invoke) {
+ ArmAssembler* assembler = GetAssembler();
+ Register out = invoke->GetLocations()->Out().AsRegister<Register>();
+ int32_t offset = Thread::InterruptedOffset<kArmPointerSize>().Int32Value();
+ __ LoadFromOffset(kLoadWord, out, TR, offset);
+ Label done;
+ __ CompareAndBranchIfZero(out, &done);
+ __ dmb(ISH);
+ __ LoadImmediate(IP, 0);
+ __ StoreToOffset(kStoreWord, IP, TR, offset);
+ __ dmb(ISH);
+ __ Bind(&done);
+}
+
UNIMPLEMENTED_INTRINSIC(ARM, MathMinDoubleDouble)
UNIMPLEMENTED_INTRINSIC(ARM, MathMinFloatFloat)
UNIMPLEMENTED_INTRINSIC(ARM, MathMaxDoubleDouble)