diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2014-11-06 17:43:39 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2014-11-06 17:43:39 -0800 |
commit | 88af00a788002196e6f98acd3748f3f4956032bf (patch) | |
tree | 08da0f91b45f9c11758f240a99938a8ebc0e9077 | |
parent | 0006f29d646f75727f792c031fc6499b7e28f153 (diff) | |
parent | ec520ef96ae9581b2036e14b255c0c5fde153eb2 (diff) | |
download | art-88af00a788002196e6f98acd3748f3f4956032bf.zip art-88af00a788002196e6f98acd3748f3f4956032bf.tar.gz art-88af00a788002196e6f98acd3748f3f4956032bf.tar.bz2 |
Merge remote-tracking branch 'goog/stage-aosp-master' into HEAD
-rw-r--r-- | compiler/dex/quick/arm64/int_arm64.cc | 1 | ||||
-rw-r--r-- | compiler/dex/quick/arm64/utility_arm64.cc | 6 | ||||
-rw-r--r-- | runtime/jni_internal.cc | 1 | ||||
-rw-r--r-- | runtime/monitor.cc | 9 | ||||
-rw-r--r-- | test/083-compiler-regressions/expected.txt | 1 | ||||
-rw-r--r-- | test/083-compiler-regressions/src/Main.java | 13 |
6 files changed, 27 insertions, 4 deletions
diff --git a/compiler/dex/quick/arm64/int_arm64.cc b/compiler/dex/quick/arm64/int_arm64.cc index 965759b..fc72e02 100644 --- a/compiler/dex/quick/arm64/int_arm64.cc +++ b/compiler/dex/quick/arm64/int_arm64.cc @@ -483,7 +483,6 @@ bool Arm64Mir2Lir::SmallLiteralDivRem64(Instruction::Code dalvik_opcode, bool is } else { reconstructed_imm = base + 1; } - DCHECK_EQ(reconstructed_imm, magic_table[lit].magic64) << " for literal " << lit; } // Load the magic constant in two instructions. diff --git a/compiler/dex/quick/arm64/utility_arm64.cc b/compiler/dex/quick/arm64/utility_arm64.cc index 47ccc46..fcd69ec 100644 --- a/compiler/dex/quick/arm64/utility_arm64.cc +++ b/compiler/dex/quick/arm64/utility_arm64.cc @@ -345,7 +345,7 @@ bool Arm64Mir2Lir::InexpensiveConstantInt(int32_t value, Instruction::Code opcod case Instruction::SUB_INT_2ADDR: // The code below is consistent with the implementation of OpRegRegImm(). { - int32_t abs_value = std::abs(value); + uint32_t abs_value = (value == INT_MIN) ? value : std::abs(value); if (abs_value < 0x1000) { return true; } else if ((abs_value & UINT64_C(0xfff)) == 0 && ((abs_value >> 12) < 0x1000)) { @@ -810,7 +810,7 @@ LIR* Arm64Mir2Lir::OpRegRegImm(OpKind op, RegStorage r_dest, RegStorage r_src1, LIR* Arm64Mir2Lir::OpRegRegImm64(OpKind op, RegStorage r_dest, RegStorage r_src1, int64_t value) { LIR* res; bool neg = (value < 0); - int64_t abs_value = (neg) ? -value : value; + uint64_t abs_value = (neg & !(value == LLONG_MIN)) ? -value : value; A64Opcode opcode = kA64Brk1d; A64Opcode alt_opcode = kA64Brk1d; bool is_logical = false; @@ -943,7 +943,7 @@ LIR* Arm64Mir2Lir::OpRegImm64(OpKind op, RegStorage r_dest_src1, int64_t value) A64Opcode neg_opcode = kA64Brk1d; bool shift; bool neg = (value < 0); - uint64_t abs_value = (neg) ? -value : value; + uint64_t abs_value = (neg & !(value == LLONG_MIN)) ? -value : value; if (LIKELY(abs_value < 0x1000)) { // abs_value is a 12-bit immediate. diff --git a/runtime/jni_internal.cc b/runtime/jni_internal.cc index 67e52cb..3b0656e 100644 --- a/runtime/jni_internal.cc +++ b/runtime/jni_internal.cc @@ -45,6 +45,7 @@ #include "mirror/object_array-inl.h" #include "mirror/string-inl.h" #include "mirror/throwable.h" +#include "nativebridge/native_bridge.h" #include "parsed_options.h" #include "reflection.h" #include "runtime.h" diff --git a/runtime/monitor.cc b/runtime/monitor.cc index 0439428..6445b88 100644 --- a/runtime/monitor.cc +++ b/runtime/monitor.cc @@ -36,6 +36,8 @@ namespace art { +static constexpr uint64_t kLongWaitMs = 100; + /* * Every Object has a monitor associated with it, but not every Object is actually locked. Even * the ones that are locked do not need a full-fledged monitor until a) there is actual contention @@ -242,6 +244,7 @@ void Monitor::Lock(Thread* self) { mirror::ArtMethod* owners_method = locking_method_; uint32_t owners_dex_pc = locking_dex_pc_; // Do this before releasing the lock so that we don't get deflated. + size_t num_waiters = num_waiters_; ++num_waiters_; monitor_lock_.Unlock(self); // Let go of locks in order. self->SetMonitorEnterObject(GetObject()); @@ -263,6 +266,12 @@ void Monitor::Lock(Thread* self) { const char* owners_filename; uint32_t owners_line_number; TranslateLocation(owners_method, owners_dex_pc, &owners_filename, &owners_line_number); + if (wait_ms > kLongWaitMs && owners_method != nullptr) { + LOG(WARNING) << "Long monitor contention event with owner method=" + << PrettyMethod(owners_method) << " from " << owners_filename << ":" + << owners_line_number << " waiters=" << num_waiters << " for " + << PrettyDuration(MsToNs(wait_ms)); + } LogContentionEvent(self, wait_ms, sample_percent, owners_filename, owners_line_number); } } diff --git a/test/083-compiler-regressions/expected.txt b/test/083-compiler-regressions/expected.txt index c43d1f7..51bf847 100644 --- a/test/083-compiler-regressions/expected.txt +++ b/test/083-compiler-regressions/expected.txt @@ -1,3 +1,4 @@ +b17630605 passes b17411468 passes b2296099 passes b2302318 passes diff --git a/test/083-compiler-regressions/src/Main.java b/test/083-compiler-regressions/src/Main.java index 9c772b9..9ad8ea7 100644 --- a/test/083-compiler-regressions/src/Main.java +++ b/test/083-compiler-regressions/src/Main.java @@ -30,6 +30,7 @@ public class Main { } public static void main(String args[]) throws Exception { + b17630605(); b17411468(); b2296099Test(); b2302318Test(); @@ -63,6 +64,18 @@ public class Main { minDoubleWith3ConstsTest(); } + public static void b17630605() { + // b/17630605 - failure to properly handle min long immediates. + long a1 = 40455547223404749L; + long a2 = Long.MIN_VALUE; + long answer = a1 + a2; + if (answer == -9182916489631371059L) { + System.out.println("b17630605 passes"); + } else { + System.out.println("b17630605 fails: " + answer); + } + } + public static void b17411468() { // b/17411468 - inline Math.round failure. double d1 = 1.0; |