Merge "ART: Change merge(uninitialized, null) to produce conflict"
diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc
index 5e905fc..6ed2c5a 100644
--- a/compiler/optimizing/code_generator_arm64.cc
+++ b/compiler/optimizing/code_generator_arm64.cc
@@ -604,30 +604,13 @@
DCHECK(!instruction_->IsInvoke() ||
(instruction_->IsInvokeStaticOrDirect() &&
instruction_->GetLocations()->Intrinsified()));
+ // The read barrier instrumentation does not support the
+ // HArm64IntermediateAddress instruction yet.
+ DCHECK(!(instruction_->IsArrayGet() &&
+ instruction_->AsArrayGet()->GetArray()->IsArm64IntermediateAddress()));
__ Bind(GetEntryLabel());
- // Note: In the case of a HArrayGet instruction, when the base
- // address is a HArm64IntermediateAddress instruction, it does not
- // point to the array object itself, but to an offset within this
- // object. However, the read barrier entry point needs the array
- // object address to be passed as first argument. So we
- // temporarily set back `obj_` to that address, and restore its
- // initial value later.
- if (instruction_->IsArrayGet() &&
- instruction_->AsArrayGet()->GetArray()->IsArm64IntermediateAddress()) {
- if (kIsDebugBuild) {
- HArm64IntermediateAddress* intermediate_address =
- instruction_->AsArrayGet()->GetArray()->AsArm64IntermediateAddress();
- uint32_t intermediate_address_offset =
- intermediate_address->GetOffset()->AsIntConstant()->GetValueAsUint64();
- DCHECK_EQ(intermediate_address_offset, offset_);
- DCHECK_EQ(mirror::Array::DataOffset(Primitive::ComponentSize(type)).Uint32Value(), offset_);
- }
- Register obj_reg = RegisterFrom(obj_, Primitive::kPrimInt);
- __ Sub(obj_reg, obj_reg, offset_);
- }
-
SaveLiveRegisters(codegen, locations);
// We may have to change the index's value, but as `index_` is a
@@ -728,22 +711,6 @@
RestoreLiveRegisters(codegen, locations);
- // Restore the value of `obj_` when it corresponds to a
- // HArm64IntermediateAddress instruction.
- if (instruction_->IsArrayGet() &&
- instruction_->AsArrayGet()->GetArray()->IsArm64IntermediateAddress()) {
- if (kIsDebugBuild) {
- HArm64IntermediateAddress* intermediate_address =
- instruction_->AsArrayGet()->GetArray()->AsArm64IntermediateAddress();
- uint32_t intermediate_address_offset =
- intermediate_address->GetOffset()->AsIntConstant()->GetValueAsUint64();
- DCHECK_EQ(intermediate_address_offset, offset_);
- DCHECK_EQ(mirror::Array::DataOffset(Primitive::ComponentSize(type)).Uint32Value(), offset_);
- }
- Register obj_reg = RegisterFrom(obj_, Primitive::kPrimInt);
- __ Add(obj_reg, obj_reg, offset_);
- }
-
__ B(GetExitLabel());
}
@@ -1970,6 +1937,9 @@
}
void LocationsBuilderARM64::VisitArm64IntermediateAddress(HArm64IntermediateAddress* instruction) {
+ // The read barrier instrumentation does not support the
+ // HArm64IntermediateAddress instruction yet.
+ DCHECK(!kEmitCompilerReadBarrier);
LocationSummary* locations =
new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kNoCall);
locations->SetInAt(0, Location::RequiresRegister());
@@ -1979,6 +1949,9 @@
void InstructionCodeGeneratorARM64::VisitArm64IntermediateAddress(
HArm64IntermediateAddress* instruction) {
+ // The read barrier instrumentation does not support the
+ // HArm64IntermediateAddress instruction yet.
+ DCHECK(!kEmitCompilerReadBarrier);
__ Add(OutputRegister(instruction),
InputRegisterAt(instruction, 0),
Operand(InputOperandAt(instruction, 1)));
@@ -2067,6 +2040,9 @@
} else {
Register temp = temps.AcquireSameSizeAs(obj);
if (instruction->GetArray()->IsArm64IntermediateAddress()) {
+ // The read barrier instrumentation does not support the
+ // HArm64IntermediateAddress instruction yet.
+ DCHECK(!kEmitCompilerReadBarrier);
// We do not need to compute the intermediate address from the array: the
// input instruction has done it already. See the comment in
// `InstructionSimplifierArm64::TryExtractArrayAccessAddress()`.
@@ -2093,11 +2069,6 @@
if (index.IsConstant()) {
codegen_->MaybeGenerateReadBarrier(instruction, out, out, obj_loc, offset);
} else {
- // Note: when `obj_loc` is a HArm64IntermediateAddress, it does
- // not contain the base address of the array object, which is
- // needed by the read barrier entry point. So the read barrier
- // slow path will temporarily set back `obj_loc` to the right
- // address (see ReadBarrierForHeapReferenceSlowPathARM64::EmitNativeCode).
codegen_->MaybeGenerateReadBarrier(instruction, out, out, obj_loc, offset, index);
}
}
@@ -2161,6 +2132,9 @@
UseScratchRegisterScope temps(masm);
Register temp = temps.AcquireSameSizeAs(array);
if (instruction->GetArray()->IsArm64IntermediateAddress()) {
+ // The read barrier instrumentation does not support the
+ // HArm64IntermediateAddress instruction yet.
+ DCHECK(!kEmitCompilerReadBarrier);
// We do not need to compute the intermediate address from the array: the
// input instruction has done it already. See the comment in
// `InstructionSimplifierArm64::TryExtractArrayAccessAddress()`.
diff --git a/compiler/optimizing/instruction_simplifier_arm64.cc b/compiler/optimizing/instruction_simplifier_arm64.cc
index 6bbc751..4bcfc54 100644
--- a/compiler/optimizing/instruction_simplifier_arm64.cc
+++ b/compiler/optimizing/instruction_simplifier_arm64.cc
@@ -30,6 +30,15 @@
HInstruction* array,
HInstruction* index,
int access_size) {
+ if (kEmitCompilerReadBarrier) {
+ // The read barrier instrumentation does not support the
+ // HArm64IntermediateAddress instruction yet.
+ //
+ // TODO: Handle this case properly in the ARM64 code generator and
+ // re-enable this optimization; otherwise, remove this TODO.
+ // b/26601270
+ return;
+ }
if (index->IsConstant() ||
(index->IsBoundsCheck() && index->AsBoundsCheck()->GetIndex()->IsConstant())) {
// When the index is a constant all the addressing can be fitted in the
diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc
index e89c74d..0ddd4a2 100644
--- a/runtime/native/java_lang_Class.cc
+++ b/runtime/native/java_lang_Class.cc
@@ -16,6 +16,8 @@
#include "java_lang_Class.h"
+#include <iostream>
+
#include "art_field-inl.h"
#include "class_linker.h"
#include "common_throws.h"
@@ -303,7 +305,10 @@
// We log the error for this specific case, as the user might just swallow the exception.
// This helps diagnose crashes when applications rely on the String#value field being
// there.
- LOG(ERROR) << "The String#value field is not present on Android versions >= 6.0";
+ // Also print on the error stream to test it through run-test.
+ std::string message("The String#value field is not present on Android versions >= 6.0");
+ LOG(ERROR) << message;
+ std::cerr << message << std::endl;
}
// We may have a pending exception if we failed to resolve.
if (!soa.Self()->IsExceptionPending()) {
diff --git a/test/143-string-value/check b/test/143-string-value/check
index cdf7b78..92f6e90 100755
--- a/test/143-string-value/check
+++ b/test/143-string-value/check
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Strip run-specific numbers (pid and line number)
-sed -e 's/^art E[ ]\+[0-9]\+[ ]\+[0-9]\+ art\/runtime\/native\/java_lang_Class.cc:[0-9]\+\] //' "$2" > "$2.tmp"
+# Strip error log messages.
+sed -e '/^art E.*\] /d' "$2" > "$2.tmp"
diff --strip-trailing-cr -q "$1" "$2.tmp" >/dev/null
diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk
index 7ec3067..f62d0e9 100644
--- a/test/Android.run-test.mk
+++ b/test/Android.run-test.mk
@@ -270,16 +270,6 @@
TEST_ART_BROKEN_PREBUILD_RUN_TESTS :=
-# 143-string-value tests for a LOG(E) tag, which is only supported on host.
-TEST_ART_BROKEN_TARGET_RUN_TESTS := \
- 143-string-value \
-
-ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
- $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
- $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_TARGET_RUN_TESTS), $(ALL_ADDRESS_SIZES))
-
-TEST_ART_BROKEN_TARGET_RUN_TESTS :=
-
# 554-jit-profile-file is disabled because it needs a primary oat file to know what it should save.
TEST_ART_BROKEN_NO_PREBUILD_TESTS := \
117-nopatchoat \
@@ -546,10 +536,13 @@
# Tests that should fail in the read barrier configuration with the Optimizing compiler.
# 484: Baker's fast path based read barrier compiler instrumentation generates code containing
# more parallel moves on x86, thus some Checker assertions may fail.
+# 527: On ARM64, the read barrier instrumentation does not support the HArm64IntermediateAddress
+# instruction yet (b/26601270).
# 537: Expects an array copy to be intrinsified on x86-64, but calling-on-slowpath intrinsics are
# not yet handled in the read barrier configuration.
TEST_ART_BROKEN_OPTIMIZING_READ_BARRIER_RUN_TESTS := \
484-checker-register-hints \
+ 527-checker-array-access-split \
537-checker-arraycopy
# Tests that should fail in the read barrier configuration with JIT.