Merge "Add read barrier support to the entrypoints."
diff --git a/build/Android.common_build.mk b/build/Android.common_build.mk
index 2c552e6..05cfc42 100644
--- a/build/Android.common_build.mk
+++ b/build/Android.common_build.mk
@@ -33,7 +33,13 @@
ART_BUILD_TARGET_DEBUG ?= true
ART_BUILD_HOST_NDEBUG ?= true
ART_BUILD_HOST_DEBUG ?= true
-ART_BUILD_HOST_STATIC ?= true
+
+# Enable the static builds only for checkbuilds.
+ifneq (,$(filter checkbuild,$(MAKECMDGOALS)))
+ ART_BUILD_HOST_STATIC ?= true
+else
+ ART_BUILD_HOST_STATIC ?= false
+endif
# Asan does not support static linkage
ifdef SANITIZE_HOST
diff --git a/build/Android.oat.mk b/build/Android.oat.mk
index c70e12d..0c0c3df 100644
--- a/build/Android.oat.mk
+++ b/build/Android.oat.mk
@@ -64,14 +64,14 @@
core_compile_options += --compiler-filter=interpret-only
core_infix := -interpreter
endif
- ifeq ($(1),interpreter-access-checks)
+ ifeq ($(1),interp-ac)
core_compile_options += --compiler-filter=verify-at-runtime --runtime-arg -Xverify:softfail
- core_infix := -interpreter-access-checks
+ core_infix := -interp-ac
endif
ifeq ($(1),default)
# Default has no infix, no compile options.
endif
- ifneq ($(filter-out default interpreter interpreter-access-checks jit optimizing,$(1)),)
+ ifneq ($(filter-out default interpreter interp-ac jit optimizing,$(1)),)
#Technically this test is not precise, but hopefully good enough.
$$(error found $(1) expected default, interpreter, interpreter-access-checks, jit or optimizing)
endif
@@ -147,14 +147,14 @@
$(eval $(call create-core-oat-host-rule-combination,default,,))
$(eval $(call create-core-oat-host-rule-combination,optimizing,,))
$(eval $(call create-core-oat-host-rule-combination,interpreter,,))
-$(eval $(call create-core-oat-host-rule-combination,interpreter-access-checks,,))
+$(eval $(call create-core-oat-host-rule-combination,interp-ac,,))
valgrindHOST_CORE_IMG_OUTS :=
valgrindHOST_CORE_OAT_OUTS :=
$(eval $(call create-core-oat-host-rule-combination,default,valgrind,32))
$(eval $(call create-core-oat-host-rule-combination,optimizing,valgrind,32))
$(eval $(call create-core-oat-host-rule-combination,interpreter,valgrind,32))
-$(eval $(call create-core-oat-host-rule-combination,interpreter-access-checks,valgrind,32))
+$(eval $(call create-core-oat-host-rule-combination,interp-ac,valgrind,32))
valgrind-test-art-host-dex2oat-host: $(valgrindHOST_CORE_IMG_OUTS)
@@ -184,14 +184,14 @@
core_compile_options += --compiler-filter=interpret-only
core_infix := -interpreter
endif
- ifeq ($(1),interpreter-access-checks)
+ ifeq ($(1),interp-ac)
core_compile_options += --compiler-filter=verify-at-runtime --runtime-arg -Xverify:softfail
- core_infix := -interpreter-access-checks
+ core_infix := -interp-ac
endif
ifeq ($(1),default)
# Default has no infix, no compile options.
endif
- ifneq ($(filter-out default interpreter interpreter-access-checks jit optimizing,$(1)),)
+ ifneq ($(filter-out default interpreter interp-ac jit optimizing,$(1)),)
# Technically this test is not precise, but hopefully good enough.
$$(error found $(1) expected default, interpreter, interpreter-access-checks, jit or optimizing)
endif
@@ -272,14 +272,14 @@
$(eval $(call create-core-oat-target-rule-combination,default,,))
$(eval $(call create-core-oat-target-rule-combination,optimizing,,))
$(eval $(call create-core-oat-target-rule-combination,interpreter,,))
-$(eval $(call create-core-oat-target-rule-combination,interpreter-access-checks,,))
+$(eval $(call create-core-oat-target-rule-combination,interp-ac,,))
valgrindTARGET_CORE_IMG_OUTS :=
valgrindTARGET_CORE_OAT_OUTS :=
$(eval $(call create-core-oat-target-rule-combination,default,valgrind,32))
$(eval $(call create-core-oat-target-rule-combination,optimizing,valgrind,32))
$(eval $(call create-core-oat-target-rule-combination,interpreter,valgrind,32))
-$(eval $(call create-core-oat-target-rule-combination,interpreter-access-checks,valgrind,32))
+$(eval $(call create-core-oat-target-rule-combination,interp-ac,valgrind,32))
valgrind-test-art-host-dex2oat-target: $(valgrindTARGET_CORE_IMG_OUTS)
diff --git a/compiler/optimizing/ssa_liveness_analysis.cc b/compiler/optimizing/ssa_liveness_analysis.cc
index 701dbb0..40502c1 100644
--- a/compiler/optimizing/ssa_liveness_analysis.cc
+++ b/compiler/optimizing/ssa_liveness_analysis.cc
@@ -225,7 +225,7 @@
// SsaLivenessAnalysis.
for (size_t i = 0, e = environment->Size(); i < e; ++i) {
HInstruction* instruction = environment->GetInstructionAt(i);
- bool should_be_live = ShouldBeLiveForEnvironment(instruction);
+ bool should_be_live = ShouldBeLiveForEnvironment(current, instruction);
if (should_be_live) {
DCHECK(instruction->HasSsaIndex());
live_in->SetBit(instruction->GetSsaIndex());
diff --git a/compiler/optimizing/ssa_liveness_analysis.h b/compiler/optimizing/ssa_liveness_analysis.h
index 220ee6a..a7044de 100644
--- a/compiler/optimizing/ssa_liveness_analysis.h
+++ b/compiler/optimizing/ssa_liveness_analysis.h
@@ -1201,8 +1201,14 @@
// Update the live_out set of the block and returns whether it has changed.
bool UpdateLiveOut(const HBasicBlock& block);
- static bool ShouldBeLiveForEnvironment(HInstruction* instruction) {
+ // Returns whether `instruction` in an HEnvironment held by `env_holder`
+ // should be kept live by the HEnvironment.
+ static bool ShouldBeLiveForEnvironment(HInstruction* env_holder,
+ HInstruction* instruction) {
if (instruction == nullptr) return false;
+ // A value that's not live in compiled code may still be needed in interpreter,
+ // due to code motion, etc.
+ if (env_holder->IsDeoptimize()) return true;
if (instruction->GetBlock()->GetGraph()->IsDebuggable()) return true;
return instruction->GetType() == Primitive::kPrimNot;
}
diff --git a/compiler/utils/x86/assembler_x86.cc b/compiler/utils/x86/assembler_x86.cc
index fa85ada..44efc65 100644
--- a/compiler/utils/x86/assembler_x86.cc
+++ b/compiler/utils/x86/assembler_x86.cc
@@ -1515,6 +1515,14 @@
}
+void X86Assembler::repe_cmpsw() {
+ AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+ EmitUint8(0x66);
+ EmitUint8(0xF3);
+ EmitUint8(0xA7);
+}
+
+
X86Assembler* X86Assembler::lock() {
AssemblerBuffer::EnsureCapacity ensured(&buffer_);
EmitUint8(0xF0);
diff --git a/compiler/utils/x86/assembler_x86.h b/compiler/utils/x86/assembler_x86.h
index d1b4e1d..e2abcde 100644
--- a/compiler/utils/x86/assembler_x86.h
+++ b/compiler/utils/x86/assembler_x86.h
@@ -465,6 +465,7 @@
void jmp(Label* label);
void repne_scasw();
+ void repe_cmpsw();
X86Assembler* lock();
void cmpxchgl(const Address& address, Register reg);
diff --git a/compiler/utils/x86/assembler_x86_test.cc b/compiler/utils/x86/assembler_x86_test.cc
index aacc57b..0e8c4ae 100644
--- a/compiler/utils/x86/assembler_x86_test.cc
+++ b/compiler/utils/x86/assembler_x86_test.cc
@@ -196,4 +196,10 @@
DriverStr(expected, "Repnescasw");
}
+TEST_F(AssemblerX86Test, Repecmpsw) {
+ GetAssembler()->repe_cmpsw();
+ const char* expected = "repe cmpsw\n";
+ DriverStr(expected, "Repecmpsw");
+}
+
} // namespace art
diff --git a/compiler/utils/x86_64/assembler_x86_64.cc b/compiler/utils/x86_64/assembler_x86_64.cc
index f35f51c..93c90db 100644
--- a/compiler/utils/x86_64/assembler_x86_64.cc
+++ b/compiler/utils/x86_64/assembler_x86_64.cc
@@ -2073,6 +2073,14 @@
}
+void X86_64Assembler::repe_cmpsw() {
+ AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+ EmitUint8(0x66);
+ EmitUint8(0xF3);
+ EmitUint8(0xA7);
+}
+
+
void X86_64Assembler::LoadDoubleConstant(XmmRegister dst, double value) {
// TODO: Need to have a code constants table.
int64_t constant = bit_cast<int64_t, double>(value);
diff --git a/compiler/utils/x86_64/assembler_x86_64.h b/compiler/utils/x86_64/assembler_x86_64.h
index 61ffeab..0cd3197 100644
--- a/compiler/utils/x86_64/assembler_x86_64.h
+++ b/compiler/utils/x86_64/assembler_x86_64.h
@@ -603,6 +603,7 @@
void bswapq(CpuRegister dst);
void repne_scasw();
+ void repe_cmpsw();
//
// Macros for High-level operations.
diff --git a/compiler/utils/x86_64/assembler_x86_64_test.cc b/compiler/utils/x86_64/assembler_x86_64_test.cc
index 6da5c35..422138c 100644
--- a/compiler/utils/x86_64/assembler_x86_64_test.cc
+++ b/compiler/utils/x86_64/assembler_x86_64_test.cc
@@ -1263,4 +1263,10 @@
DriverStr(expected, "Repnescasw");
}
+TEST_F(AssemblerX86_64Test, Repecmpsw) {
+ GetAssembler()->repe_cmpsw();
+ const char* expected = "repe cmpsw\n";
+ DriverStr(expected, "Repecmpsw");
+}
+
} // namespace art
diff --git a/runtime/check_jni.cc b/runtime/check_jni.cc
index 40b3669..38bc818 100644
--- a/runtime/check_jni.cc
+++ b/runtime/check_jni.cc
@@ -16,6 +16,7 @@
#include "check_jni.h"
+#include <iomanip>
#include <sys/mman.h>
#include <zlib.h>
@@ -1083,10 +1084,29 @@
}
const char* errorKind = nullptr;
- uint8_t utf8 = CheckUtfBytes(bytes, &errorKind);
+ const uint8_t* utf8 = CheckUtfBytes(bytes, &errorKind);
if (errorKind != nullptr) {
+ // This is an expensive loop that will resize often, but this isn't supposed to hit in
+ // practice anyways.
+ std::ostringstream oss;
+ oss << std::hex;
+ const uint8_t* tmp = reinterpret_cast<const uint8_t*>(bytes);
+ while (*tmp != 0) {
+ if (tmp == utf8) {
+ oss << "<";
+ }
+ oss << "0x" << std::setfill('0') << std::setw(2) << static_cast<uint32_t>(*tmp);
+ if (tmp == utf8) {
+ oss << '>';
+ }
+ tmp++;
+ if (*tmp != 0) {
+ oss << ' ';
+ }
+ }
+
AbortF("input is not valid Modified UTF-8: illegal %s byte %#x\n"
- " string: '%s'", errorKind, utf8, bytes);
+ " string: '%s'\n input: '%s'", errorKind, *utf8, bytes, oss.str().c_str());
return false;
}
return true;
@@ -1094,11 +1114,11 @@
// Checks whether |bytes| is valid modified UTF-8. We also accept 4 byte UTF
// sequences in place of encoded surrogate pairs.
- static uint8_t CheckUtfBytes(const char* bytes, const char** errorKind) {
+ static const uint8_t* CheckUtfBytes(const char* bytes, const char** errorKind) {
while (*bytes != '\0') {
- uint8_t utf8 = *(bytes++);
+ const uint8_t* utf8 = reinterpret_cast<const uint8_t*>(bytes++);
// Switch on the high four bits.
- switch (utf8 >> 4) {
+ switch (*utf8 >> 4) {
case 0x00:
case 0x01:
case 0x02:
@@ -1118,11 +1138,11 @@
return utf8;
case 0x0f:
// Bit pattern 1111, which might be the start of a 4 byte sequence.
- if ((utf8 & 0x08) == 0) {
+ if ((*utf8 & 0x08) == 0) {
// Bit pattern 1111 0xxx, which is the start of a 4 byte sequence.
// We consume one continuation byte here, and fall through to consume two more.
- utf8 = *(bytes++);
- if ((utf8 & 0xc0) != 0x80) {
+ utf8 = reinterpret_cast<const uint8_t*>(bytes++);
+ if ((*utf8 & 0xc0) != 0x80) {
*errorKind = "continuation";
return utf8;
}
@@ -1135,8 +1155,8 @@
FALLTHROUGH_INTENDED;
case 0x0e:
// Bit pattern 1110, so there are two additional bytes.
- utf8 = *(bytes++);
- if ((utf8 & 0xc0) != 0x80) {
+ utf8 = reinterpret_cast<const uint8_t*>(bytes++);
+ if ((*utf8 & 0xc0) != 0x80) {
*errorKind = "continuation";
return utf8;
}
@@ -1146,8 +1166,8 @@
case 0x0c:
case 0x0d:
// Bit pattern 110x, so there is one additional byte.
- utf8 = *(bytes++);
- if ((utf8 & 0xc0) != 0x80) {
+ utf8 = reinterpret_cast<const uint8_t*>(bytes++);
+ if ((*utf8 & 0xc0) != 0x80) {
*errorKind = "continuation";
return utf8;
}
diff --git a/runtime/gc/accounting/remembered_set.cc b/runtime/gc/accounting/remembered_set.cc
index 251b50d..70704c1 100644
--- a/runtime/gc/accounting/remembered_set.cc
+++ b/runtime/gc/accounting/remembered_set.cc
@@ -95,7 +95,11 @@
void VisitRoot(mirror::CompressedReference<mirror::Object>* root) const
SHARED_REQUIRES(Locks::mutator_lock_) {
- DCHECK(!target_space_->HasAddress(root->AsMirrorPtr()));
+ if (target_space_->HasAddress(root->AsMirrorPtr())) {
+ *contains_reference_to_target_space_ = true;
+ root->Assign(collector_->MarkObject(root->AsMirrorPtr()));
+ DCHECK(!target_space_->HasAddress(root->AsMirrorPtr()));
+ }
}
private:
diff --git a/runtime/native/java_lang_reflect_Field.cc b/runtime/native/java_lang_reflect_Field.cc
index 01faf3c..5bbb0dc 100644
--- a/runtime/native/java_lang_reflect_Field.cc
+++ b/runtime/native/java_lang_reflect_Field.cc
@@ -253,9 +253,9 @@
break;
case Primitive::kPrimChar:
if (is_volatile) {
- o->SetFieldBooleanVolatile<false>(offset, new_value.GetC());
+ o->SetFieldCharVolatile<false>(offset, new_value.GetC());
} else {
- o->SetFieldBoolean<false>(offset, new_value.GetC());
+ o->SetFieldChar<false>(offset, new_value.GetC());
}
break;
case Primitive::kPrimInt:
diff --git a/test/046-reflect/expected.txt b/test/046-reflect/expected.txt
index fa053fb..d657d44 100644
--- a/test/046-reflect/expected.txt
+++ b/test/046-reflect/expected.txt
@@ -24,7 +24,7 @@
SuperTarget constructor ()V
Target constructor ()V
Before, float is 3.1415925
-myMethod: hi there 3.1415925 Q !
+myMethod: hi there 3.1415925 ✔ !
Result of invoke: 7
Calling no-arg void-return method
myNoargMethod ()V
diff --git a/test/046-reflect/src/Main.java b/test/046-reflect/src/Main.java
index 0d8e576..0c90109 100644
--- a/test/046-reflect/src/Main.java
+++ b/test/046-reflect/src/Main.java
@@ -147,7 +147,7 @@
Object[] argList = new Object[] {
new String[] { "hi there" },
new Float(3.1415926f),
- new Character('Q')
+ new Character('\u2714')
};
System.out.println("Before, float is "
+ ((Float)argList[1]).floatValue());
diff --git a/test/100-reflect2/expected.txt b/test/100-reflect2/expected.txt
index 7db61a1..c932761 100644
--- a/test/100-reflect2/expected.txt
+++ b/test/100-reflect2/expected.txt
@@ -1,6 +1,6 @@
true
8
-x
+✔
3.141592653589793
3.14
32
diff --git a/test/100-reflect2/src/Main.java b/test/100-reflect2/src/Main.java
index 72e14b1..bf3a574 100644
--- a/test/100-reflect2/src/Main.java
+++ b/test/100-reflect2/src/Main.java
@@ -20,7 +20,7 @@
class Main {
private static boolean z = true;
private static byte b = 8;
- private static char c = 'x';
+ private static char c = '\u2714';
private static double d = Math.PI;
private static float f = 3.14f;
private static int i = 32;
@@ -144,7 +144,7 @@
/*
private static boolean z = true;
private static byte b = 8;
- private static char c = 'x';
+ private static char c = '\u2714';
private static double d = Math.PI;
private static float f = 3.14f;
private static int i = 32;
@@ -263,7 +263,7 @@
show(ctor.newInstance((Object[]) null));
ctor = String.class.getConstructor(char[].class, int.class, int.class);
- show(ctor.newInstance(new char[] { 'x', 'y', 'z', '!' }, 1, 2));
+ show(ctor.newInstance(new char[] { '\u2714', 'y', 'z', '!' }, 1, 2));
}
private static void testPackagePrivateConstructor() {
diff --git a/test/411-optimizing-arith/expected.txt b/test/411-optimizing-arith-mul/expected.txt
similarity index 100%
rename from test/411-optimizing-arith/expected.txt
rename to test/411-optimizing-arith-mul/expected.txt
diff --git a/test/411-optimizing-arith/info.txt b/test/411-optimizing-arith-mul/info.txt
similarity index 100%
rename from test/411-optimizing-arith/info.txt
rename to test/411-optimizing-arith-mul/info.txt
diff --git a/test/411-optimizing-arith/src/Main.java b/test/411-optimizing-arith-mul/src/Main.java
similarity index 100%
rename from test/411-optimizing-arith/src/Main.java
rename to test/411-optimizing-arith-mul/src/Main.java
diff --git a/test/441-checker-inliner/src/Main.java b/test/441-checker-inliner/src/Main.java
index 3899d7f..4db116a 100644
--- a/test/441-checker-inliner/src/Main.java
+++ b/test/441-checker-inliner/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2014 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
diff --git a/test/442-checker-constant-folding/src/Main.java b/test/442-checker-constant-folding/src/Main.java
index b7863be..20dac42 100644
--- a/test/442-checker-constant-folding/src/Main.java
+++ b/test/442-checker-constant-folding/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2014 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
@@ -46,9 +46,9 @@
}
}
+
/**
- * Tiny three-register program exercising int constant folding
- * on negation.
+ * Exercise constant folding on negation.
*/
/// CHECK-START: int Main.IntNegation() constant_folding (before)
@@ -60,6 +60,9 @@
/// CHECK-DAG: <<ConstN42:i\d+>> IntConstant -42
/// CHECK-DAG: Return [<<ConstN42>>]
+ /// CHECK-START: int Main.IntNegation() constant_folding (after)
+ /// CHECK-NOT: Neg
+
public static int IntNegation() {
int x, y;
x = 42;
@@ -67,9 +70,9 @@
return y;
}
+
/**
- * Tiny three-register program exercising int constant folding
- * on addition.
+ * Exercise constant folding on addition.
*/
/// CHECK-START: int Main.IntAddition1() constant_folding (before)
@@ -82,6 +85,9 @@
/// CHECK-DAG: <<Const3:i\d+>> IntConstant 3
/// CHECK-DAG: Return [<<Const3>>]
+ /// CHECK-START: int Main.IntAddition1() constant_folding (after)
+ /// CHECK-NOT: Add
+
public static int IntAddition1() {
int a, b, c;
a = 1;
@@ -90,11 +96,6 @@
return c;
}
- /**
- * Small three-register program exercising int constant folding
- * on addition.
- */
-
/// CHECK-START: int Main.IntAddition2() constant_folding (before)
/// CHECK-DAG: <<Const1:i\d+>> IntConstant 1
/// CHECK-DAG: <<Const2:i\d+>> IntConstant 2
@@ -109,6 +110,9 @@
/// CHECK-DAG: <<Const14:i\d+>> IntConstant 14
/// CHECK-DAG: Return [<<Const14>>]
+ /// CHECK-START: int Main.IntAddition2() constant_folding (after)
+ /// CHECK-NOT: Add
+
public static int IntAddition2() {
int a, b, c;
a = 1;
@@ -121,9 +125,30 @@
return c;
}
+ /// CHECK-START: long Main.LongAddition() constant_folding (before)
+ /// CHECK-DAG: <<Const1:j\d+>> LongConstant 1
+ /// CHECK-DAG: <<Const2:j\d+>> LongConstant 2
+ /// CHECK-DAG: <<Add:j\d+>> Add [<<Const1>>,<<Const2>>]
+ /// CHECK-DAG: Return [<<Add>>]
+
+ /// CHECK-START: long Main.LongAddition() constant_folding (after)
+ /// CHECK-DAG: <<Const3:j\d+>> LongConstant 3
+ /// CHECK-DAG: Return [<<Const3>>]
+
+ /// CHECK-START: long Main.LongAddition() constant_folding (after)
+ /// CHECK-NOT: Add
+
+ public static long LongAddition() {
+ long a, b, c;
+ a = 1L;
+ b = 2L;
+ c = a + b;
+ return c;
+ }
+
+
/**
- * Tiny three-register program exercising int constant folding
- * on subtraction.
+ * Exercise constant folding on subtraction.
*/
/// CHECK-START: int Main.IntSubtraction() constant_folding (before)
@@ -136,6 +161,9 @@
/// CHECK-DAG: <<Const4:i\d+>> IntConstant 4
/// CHECK-DAG: Return [<<Const4>>]
+ /// CHECK-START: int Main.IntSubtraction() constant_folding (after)
+ /// CHECK-NOT: Sub
+
public static int IntSubtraction() {
int a, b, c;
a = 6;
@@ -144,34 +172,6 @@
return c;
}
- /**
- * Tiny three-register program exercising long constant folding
- * on addition.
- */
-
- /// CHECK-START: long Main.LongAddition() constant_folding (before)
- /// CHECK-DAG: <<Const1:j\d+>> LongConstant 1
- /// CHECK-DAG: <<Const2:j\d+>> LongConstant 2
- /// CHECK-DAG: <<Add:j\d+>> Add [<<Const1>>,<<Const2>>]
- /// CHECK-DAG: Return [<<Add>>]
-
- /// CHECK-START: long Main.LongAddition() constant_folding (after)
- /// CHECK-DAG: <<Const3:j\d+>> LongConstant 3
- /// CHECK-DAG: Return [<<Const3>>]
-
- public static long LongAddition() {
- long a, b, c;
- a = 1L;
- b = 2L;
- c = a + b;
- return c;
- }
-
- /**
- * Tiny three-register program exercising long constant folding
- * on subtraction.
- */
-
/// CHECK-START: long Main.LongSubtraction() constant_folding (before)
/// CHECK-DAG: <<Const6:j\d+>> LongConstant 6
/// CHECK-DAG: <<Const2:j\d+>> LongConstant 2
@@ -182,6 +182,9 @@
/// CHECK-DAG: <<Const4:j\d+>> LongConstant 4
/// CHECK-DAG: Return [<<Const4>>]
+ /// CHECK-START: long Main.LongSubtraction() constant_folding (after)
+ /// CHECK-NOT: Sub
+
public static long LongSubtraction() {
long a, b, c;
a = 6L;
@@ -190,8 +193,158 @@
return c;
}
+
/**
- * Three-register program with a constant (static) condition.
+ * Exercise constant folding on multiplication.
+ */
+
+ /// CHECK-START: int Main.IntMultiplication() constant_folding (before)
+ /// CHECK-DAG: <<Const7:i\d+>> IntConstant 7
+ /// CHECK-DAG: <<Const3:i\d+>> IntConstant 3
+ /// CHECK-DAG: <<Mul:i\d+>> Mul [<<Const7>>,<<Const3>>]
+ /// CHECK-DAG: Return [<<Mul>>]
+
+ /// CHECK-START: int Main.IntMultiplication() constant_folding (after)
+ /// CHECK-DAG: <<Const21:i\d+>> IntConstant 21
+ /// CHECK-DAG: Return [<<Const21>>]
+
+ /// CHECK-START: int Main.IntMultiplication() constant_folding (after)
+ /// CHECK-NOT: Mul
+
+ public static int IntMultiplication() {
+ int a, b, c;
+ a = 7;
+ b = 3;
+ c = a * b;
+ return c;
+ }
+
+ /// CHECK-START: long Main.LongMultiplication() constant_folding (before)
+ /// CHECK-DAG: <<Const7:j\d+>> LongConstant 7
+ /// CHECK-DAG: <<Const3:j\d+>> LongConstant 3
+ /// CHECK-DAG: <<Mul:j\d+>> Mul [<<Const7>>,<<Const3>>]
+ /// CHECK-DAG: Return [<<Mul>>]
+
+ /// CHECK-START: long Main.LongMultiplication() constant_folding (after)
+ /// CHECK-DAG: <<Const21:j\d+>> LongConstant 21
+ /// CHECK-DAG: Return [<<Const21>>]
+
+ /// CHECK-START: long Main.LongMultiplication() constant_folding (after)
+ /// CHECK-NOT: Mul
+
+ public static long LongMultiplication() {
+ long a, b, c;
+ a = 7L;
+ b = 3L;
+ c = a * b;
+ return c;
+ }
+
+
+ /**
+ * Exercise constant folding on division.
+ */
+
+ /// CHECK-START: int Main.IntDivision() constant_folding (before)
+ /// CHECK-DAG: <<Const8:i\d+>> IntConstant 8
+ /// CHECK-DAG: <<Const3:i\d+>> IntConstant 3
+ /// CHECK-DAG: <<Div0Chk:i\d+>> DivZeroCheck [<<Const3>>]
+ /// CHECK-DAG: <<Div:i\d+>> Div [<<Const8>>,<<Div0Chk>>]
+ /// CHECK-DAG: Return [<<Div>>]
+
+ /// CHECK-START: int Main.IntDivision() constant_folding (after)
+ /// CHECK-DAG: <<Const2:i\d+>> IntConstant 2
+ /// CHECK-DAG: Return [<<Const2>>]
+
+ /// CHECK-START: int Main.IntDivision() constant_folding (after)
+ /// CHECK-NOT: DivZeroCheck
+ /// CHECK-NOT: Div
+
+ public static int IntDivision() {
+ int a, b, c;
+ a = 8;
+ b = 3;
+ c = a / b;
+ return c;
+ }
+
+ /// CHECK-START: long Main.LongDivision() constant_folding (before)
+ /// CHECK-DAG: <<Const8:j\d+>> LongConstant 8
+ /// CHECK-DAG: <<Const3:j\d+>> LongConstant 3
+ /// CHECK-DAG: <<Div0Chk:j\d+>> DivZeroCheck [<<Const3>>]
+ /// CHECK-DAG: <<Div:j\d+>> Div [<<Const8>>,<<Div0Chk>>]
+ /// CHECK-DAG: Return [<<Div>>]
+
+ /// CHECK-START: long Main.LongDivision() constant_folding (after)
+ /// CHECK-DAG: <<Const2:j\d+>> LongConstant 2
+ /// CHECK-DAG: Return [<<Const2>>]
+
+ /// CHECK-START: long Main.LongDivision() constant_folding (after)
+ /// CHECK-NOT: DivZeroCheck
+ /// CHECK-NOT: Div
+
+ public static long LongDivision() {
+ long a, b, c;
+ a = 8L;
+ b = 3L;
+ c = a / b;
+ return c;
+ }
+
+
+ /**
+ * Exercise constant folding on remainder.
+ */
+
+ /// CHECK-START: int Main.IntRemainder() constant_folding (before)
+ /// CHECK-DAG: <<Const8:i\d+>> IntConstant 8
+ /// CHECK-DAG: <<Const3:i\d+>> IntConstant 3
+ /// CHECK-DAG: <<Div0Chk:i\d+>> DivZeroCheck [<<Const3>>]
+ /// CHECK-DAG: <<Rem:i\d+>> Rem [<<Const8>>,<<Div0Chk>>]
+ /// CHECK-DAG: Return [<<Rem>>]
+
+ /// CHECK-START: int Main.IntRemainder() constant_folding (after)
+ /// CHECK-DAG: <<Const2:i\d+>> IntConstant 2
+ /// CHECK-DAG: Return [<<Const2>>]
+
+ /// CHECK-START: int Main.IntRemainder() constant_folding (after)
+ /// CHECK-NOT: DivZeroCheck
+ /// CHECK-NOT: Rem
+
+ public static int IntRemainder() {
+ int a, b, c;
+ a = 8;
+ b = 3;
+ c = a % b;
+ return c;
+ }
+
+ /// CHECK-START: long Main.LongRemainder() constant_folding (before)
+ /// CHECK-DAG: <<Const8:j\d+>> LongConstant 8
+ /// CHECK-DAG: <<Const3:j\d+>> LongConstant 3
+ /// CHECK-DAG: <<Div0Chk:j\d+>> DivZeroCheck [<<Const3>>]
+ /// CHECK-DAG: <<Rem:j\d+>> Rem [<<Const8>>,<<Div0Chk>>]
+ /// CHECK-DAG: Return [<<Rem>>]
+
+ /// CHECK-START: long Main.LongRemainder() constant_folding (after)
+ /// CHECK-DAG: <<Const2:j\d+>> LongConstant 2
+ /// CHECK-DAG: Return [<<Const2>>]
+
+ /// CHECK-START: long Main.LongRemainder() constant_folding (after)
+ /// CHECK-NOT: DivZeroCheck
+ /// CHECK-NOT: Rem
+
+ public static long LongRemainder() {
+ long a, b, c;
+ a = 8L;
+ b = 3L;
+ c = a % b;
+ return c;
+ }
+
+
+ /**
+ * Exercise constant folding on constant (static) condition.
*/
/// CHECK-START: int Main.StaticCondition() constant_folding (before)
@@ -204,6 +357,9 @@
/// CHECK-DAG: <<Const1:i\d+>> IntConstant 1
/// CHECK-DAG: If [<<Const1>>]
+ /// CHECK-START: int Main.StaticCondition() constant_folding (after)
+ /// CHECK-NOT: GreaterThanOrEqual
+
public static int StaticCondition() {
int a, b, c;
a = 7;
@@ -215,9 +371,10 @@
return c;
}
+
/**
- * Four-variable program with jumps leading to the creation of many
- * blocks.
+ * Exercise constant folding on a program with condition
+ * (i.e. jumps) leading to the creation of many blocks.
*
* The intent of this test is to ensure that all constant expressions
* are actually evaluated at compile-time, thanks to the reverse
@@ -238,6 +395,10 @@
/// CHECK-DAG: <<Phi:i\d+>> Phi [<<Const7>>,<<Const3>>]
/// CHECK-DAG: Return [<<Phi>>]
+ /// CHECK-START: int Main.JumpsAndConditionals(boolean) constant_folding (after)
+ /// CHECK-NOT: Add
+ /// CHECK-NOT: Sub
+
public static int JumpsAndConditionals(boolean cond) {
int a, b, c;
a = 5;
@@ -249,6 +410,7 @@
return c;
}
+
/**
* Test optimizations of arithmetic identities yielding a constant result.
*/
@@ -262,9 +424,11 @@
/// CHECK-START: int Main.And0(int) constant_folding (after)
/// CHECK-DAG: <<Arg:i\d+>> ParameterValue
/// CHECK-DAG: <<Const0:i\d+>> IntConstant 0
- /// CHECK-NOT: And
/// CHECK-DAG: Return [<<Const0>>]
+ /// CHECK-START: int Main.And0(int) constant_folding (after)
+ /// CHECK-NOT: And
+
public static int And0(int arg) {
return arg & 0;
}
@@ -278,9 +442,11 @@
/// CHECK-START: long Main.Mul0(long) constant_folding (after)
/// CHECK-DAG: <<Arg:j\d+>> ParameterValue
/// CHECK-DAG: <<Const0:j\d+>> LongConstant 0
- /// CHECK-NOT: Mul
/// CHECK-DAG: Return [<<Const0>>]
+ /// CHECK-START: long Main.Mul0(long) constant_folding (after)
+ /// CHECK-NOT: Mul
+
public static long Mul0(long arg) {
return arg * 0;
}
@@ -293,9 +459,11 @@
/// CHECK-START: int Main.OrAllOnes(int) constant_folding (after)
/// CHECK-DAG: <<ConstF:i\d+>> IntConstant -1
- /// CHECK-NOT: Or
/// CHECK-DAG: Return [<<ConstF>>]
+ /// CHECK-START: int Main.OrAllOnes(int) constant_folding (after)
+ /// CHECK-NOT: Or
+
public static int OrAllOnes(int arg) {
return arg | -1;
}
@@ -309,9 +477,11 @@
/// CHECK-START: long Main.Rem0(long) constant_folding (after)
/// CHECK-DAG: <<Const0:j\d+>> LongConstant 0
- /// CHECK-NOT: Rem
/// CHECK-DAG: Return [<<Const0>>]
+ /// CHECK-START: long Main.Rem0(long) constant_folding (after)
+ /// CHECK-NOT: Rem
+
public static long Rem0(long arg) {
return 0 % arg;
}
@@ -324,9 +494,11 @@
/// CHECK-START: int Main.Rem1(int) constant_folding (after)
/// CHECK-DAG: <<Const0:i\d+>> IntConstant 0
- /// CHECK-NOT: Rem
/// CHECK-DAG: Return [<<Const0>>]
+ /// CHECK-START: int Main.Rem1(int) constant_folding (after)
+ /// CHECK-NOT: Rem
+
public static int Rem1(int arg) {
return arg % 1;
}
@@ -340,9 +512,11 @@
/// CHECK-START: long Main.RemN1(long) constant_folding (after)
/// CHECK-DAG: <<Const0:j\d+>> LongConstant 0
- /// CHECK-NOT: Rem
/// CHECK-DAG: Return [<<Const0>>]
+ /// CHECK-START: long Main.RemN1(long) constant_folding (after)
+ /// CHECK-NOT: Rem
+
public static long RemN1(long arg) {
return arg % -1;
}
@@ -356,9 +530,11 @@
/// CHECK-START: int Main.Shl0(int) constant_folding (after)
/// CHECK-DAG: <<Arg:i\d+>> ParameterValue
/// CHECK-DAG: <<Const0:i\d+>> IntConstant 0
- /// CHECK-NOT: Shl
/// CHECK-DAG: Return [<<Const0>>]
+ /// CHECK-START: int Main.Shl0(int) constant_folding (after)
+ /// CHECK-NOT: Shl
+
public static int Shl0(int arg) {
return 0 << arg;
}
@@ -372,9 +548,11 @@
/// CHECK-START: long Main.Shr0(int) constant_folding (after)
/// CHECK-DAG: <<Arg:i\d+>> ParameterValue
/// CHECK-DAG: <<Const0:j\d+>> LongConstant 0
- /// CHECK-NOT: Shr
/// CHECK-DAG: Return [<<Const0>>]
+ /// CHECK-START: long Main.Shr0(int) constant_folding (after)
+ /// CHECK-NOT: Shr
+
public static long Shr0(int arg) {
return (long)0 >> arg;
}
@@ -387,9 +565,11 @@
/// CHECK-START: long Main.SubSameLong(long) constant_folding (after)
/// CHECK-DAG: <<Arg:j\d+>> ParameterValue
/// CHECK-DAG: <<Const0:j\d+>> LongConstant 0
- /// CHECK-NOT: Sub
/// CHECK-DAG: Return [<<Const0>>]
+ /// CHECK-START: long Main.SubSameLong(long) constant_folding (after)
+ /// CHECK-NOT: Sub
+
public static long SubSameLong(long arg) {
return arg - arg;
}
@@ -403,9 +583,11 @@
/// CHECK-START: int Main.UShr0(int) constant_folding (after)
/// CHECK-DAG: <<Arg:i\d+>> ParameterValue
/// CHECK-DAG: <<Const0:i\d+>> IntConstant 0
- /// CHECK-NOT: UShr
/// CHECK-DAG: Return [<<Const0>>]
+ /// CHECK-START: int Main.UShr0(int) constant_folding (after)
+ /// CHECK-NOT: UShr
+
public static int UShr0(int arg) {
return 0 >>> arg;
}
@@ -418,9 +600,11 @@
/// CHECK-START: int Main.XorSameInt(int) constant_folding (after)
/// CHECK-DAG: <<Arg:i\d+>> ParameterValue
/// CHECK-DAG: <<Const0:i\d+>> IntConstant 0
- /// CHECK-NOT: Xor
/// CHECK-DAG: Return [<<Const0>>]
+ /// CHECK-START: int Main.XorSameInt(int) constant_folding (after)
+ /// CHECK-NOT: Xor
+
public static int XorSameInt(int arg) {
return arg ^ arg;
}
@@ -473,6 +657,11 @@
return arg < Double.NaN;
}
+
+ /**
+ * Exercise constant folding on type conversions.
+ */
+
/// CHECK-START: int Main.ReturnInt33() constant_folding (before)
/// CHECK-DAG: <<Const33:j\d+>> LongConstant 33
/// CHECK-DAG: <<Convert:i\d+>> TypeConversion [<<Const33>>]
@@ -482,6 +671,9 @@
/// CHECK-DAG: <<Const33:i\d+>> IntConstant 33
/// CHECK-DAG: Return [<<Const33>>]
+ /// CHECK-START: int Main.ReturnInt33() constant_folding (after)
+ /// CHECK-NOT: TypeConversion
+
public static int ReturnInt33() {
long imm = 33L;
return (int) imm;
@@ -496,6 +688,9 @@
/// CHECK-DAG: <<ConstMax:i\d+>> IntConstant 2147483647
/// CHECK-DAG: Return [<<ConstMax>>]
+ /// CHECK-START: int Main.ReturnIntMax() constant_folding (after)
+ /// CHECK-NOT: TypeConversion
+
public static int ReturnIntMax() {
float imm = 1.0e34f;
return (int) imm;
@@ -510,6 +705,9 @@
/// CHECK-DAG: <<Const0:i\d+>> IntConstant 0
/// CHECK-DAG: Return [<<Const0>>]
+ /// CHECK-START: int Main.ReturnInt0() constant_folding (after)
+ /// CHECK-NOT: TypeConversion
+
public static int ReturnInt0() {
double imm = Double.NaN;
return (int) imm;
@@ -524,6 +722,9 @@
/// CHECK-DAG: <<Const33:j\d+>> LongConstant 33
/// CHECK-DAG: Return [<<Const33>>]
+ /// CHECK-START: long Main.ReturnLong33() constant_folding (after)
+ /// CHECK-NOT: TypeConversion
+
public static long ReturnLong33() {
int imm = 33;
return (long) imm;
@@ -538,6 +739,9 @@
/// CHECK-DAG: <<Const34:j\d+>> LongConstant 34
/// CHECK-DAG: Return [<<Const34>>]
+ /// CHECK-START: long Main.ReturnLong34() constant_folding (after)
+ /// CHECK-NOT: TypeConversion
+
public static long ReturnLong34() {
float imm = 34.0f;
return (long) imm;
@@ -552,6 +756,9 @@
/// CHECK-DAG: <<Const0:j\d+>> LongConstant 0
/// CHECK-DAG: Return [<<Const0>>]
+ /// CHECK-START: long Main.ReturnLong0() constant_folding (after)
+ /// CHECK-NOT: TypeConversion
+
public static long ReturnLong0() {
double imm = -Double.NaN;
return (long) imm;
@@ -566,6 +773,9 @@
/// CHECK-DAG: <<Const33:f\d+>> FloatConstant 33
/// CHECK-DAG: Return [<<Const33>>]
+ /// CHECK-START: float Main.ReturnFloat33() constant_folding (after)
+ /// CHECK-NOT: TypeConversion
+
public static float ReturnFloat33() {
int imm = 33;
return (float) imm;
@@ -580,6 +790,9 @@
/// CHECK-DAG: <<Const34:f\d+>> FloatConstant 34
/// CHECK-DAG: Return [<<Const34>>]
+ /// CHECK-START: float Main.ReturnFloat34() constant_folding (after)
+ /// CHECK-NOT: TypeConversion
+
public static float ReturnFloat34() {
long imm = 34L;
return (float) imm;
@@ -594,6 +807,9 @@
/// CHECK-DAG: <<Const:f\d+>> FloatConstant 99.25
/// CHECK-DAG: Return [<<Const>>]
+ /// CHECK-START: float Main.ReturnFloat99P25() constant_folding (after)
+ /// CHECK-NOT: TypeConversion
+
public static float ReturnFloat99P25() {
double imm = 99.25;
return (float) imm;
@@ -622,6 +838,9 @@
/// CHECK-DAG: <<Const34:d\d+>> DoubleConstant 34
/// CHECK-DAG: Return [<<Const34>>]
+ /// CHECK-START: double Main.ReturnDouble34() constant_folding (after)
+ /// CHECK-NOT: TypeConversion
+
public static double ReturnDouble34() {
long imm = 34L;
return (double) imm;
@@ -636,46 +855,70 @@
/// CHECK-DAG: <<Const:d\d+>> DoubleConstant 99.25
/// CHECK-DAG: Return [<<Const>>]
+ /// CHECK-START: double Main.ReturnDouble99P25() constant_folding (after)
+ /// CHECK-NOT: TypeConversion
+
public static double ReturnDouble99P25() {
float imm = 99.25f;
return (double) imm;
}
+
public static void main(String[] args) {
- assertIntEquals(IntNegation(), -42);
- assertIntEquals(IntAddition1(), 3);
- assertIntEquals(IntAddition2(), 14);
- assertIntEquals(IntSubtraction(), 4);
- assertLongEquals(LongAddition(), 3L);
- assertLongEquals(LongSubtraction(), 4L);
- assertIntEquals(StaticCondition(), 5);
- assertIntEquals(JumpsAndConditionals(true), 7);
- assertIntEquals(JumpsAndConditionals(false), 3);
+ assertIntEquals(-42, IntNegation());
+
+ assertIntEquals(3, IntAddition1());
+ assertIntEquals(14, IntAddition2());
+ assertLongEquals(3L, LongAddition());
+
+ assertIntEquals(4, IntSubtraction());
+ assertLongEquals(4L, LongSubtraction());
+
+ assertIntEquals(21, IntMultiplication());
+ assertLongEquals(21L, LongMultiplication());
+
+ assertIntEquals(2, IntDivision());
+ assertLongEquals(2L, LongDivision());
+
+ assertIntEquals(2, IntRemainder());
+ assertLongEquals(2L, LongRemainder());
+
+ assertIntEquals(5, StaticCondition());
+
+ assertIntEquals(7, JumpsAndConditionals(true));
+ assertIntEquals(3, JumpsAndConditionals(false));
+
int arbitrary = 123456; // Value chosen arbitrarily.
- assertIntEquals(And0(arbitrary), 0);
- assertLongEquals(Mul0(arbitrary), 0);
- assertIntEquals(OrAllOnes(arbitrary), -1);
- assertLongEquals(Rem0(arbitrary), 0);
- assertIntEquals(Rem1(arbitrary), 0);
- assertLongEquals(RemN1(arbitrary), 0);
- assertIntEquals(Shl0(arbitrary), 0);
- assertLongEquals(Shr0(arbitrary), 0);
- assertLongEquals(SubSameLong(arbitrary), 0);
- assertIntEquals(UShr0(arbitrary), 0);
- assertIntEquals(XorSameInt(arbitrary), 0);
+
+ assertIntEquals(0, And0(arbitrary));
+ assertLongEquals(0, Mul0(arbitrary));
+ assertIntEquals(-1, OrAllOnes(arbitrary));
+ assertLongEquals(0, Rem0(arbitrary));
+ assertIntEquals(0, Rem1(arbitrary));
+ assertLongEquals(0, RemN1(arbitrary));
+ assertIntEquals(0, Shl0(arbitrary));
+ assertLongEquals(0, Shr0(arbitrary));
+ assertLongEquals(0, SubSameLong(arbitrary));
+ assertIntEquals(0, UShr0(arbitrary));
+ assertIntEquals(0, XorSameInt(arbitrary));
+
assertFalse(CmpFloatGreaterThanNaN(arbitrary));
assertFalse(CmpDoubleLessThanNaN(arbitrary));
- assertIntEquals(ReturnInt33(), 33);
- assertIntEquals(ReturnIntMax(), 2147483647);
- assertIntEquals(ReturnInt0(), 0);
- assertLongEquals(ReturnLong33(), 33);
- assertLongEquals(ReturnLong34(), 34);
- assertLongEquals(ReturnLong0(), 0);
- assertFloatEquals(ReturnFloat33(), 33);
- assertFloatEquals(ReturnFloat34(), 34);
- assertFloatEquals(ReturnFloat99P25(), 99.25f);
- assertDoubleEquals(ReturnDouble33(), 33);
- assertDoubleEquals(ReturnDouble34(), 34);
- assertDoubleEquals(ReturnDouble99P25(), 99.25);
+
+ assertIntEquals(33, ReturnInt33());
+ assertIntEquals(2147483647, ReturnIntMax());
+ assertIntEquals(0, ReturnInt0());
+
+ assertLongEquals(33, ReturnLong33());
+ assertLongEquals(34, ReturnLong34());
+ assertLongEquals(0, ReturnLong0());
+
+ assertFloatEquals(33, ReturnFloat33());
+ assertFloatEquals(34, ReturnFloat34());
+ assertFloatEquals(99.25f, ReturnFloat99P25());
+
+ assertDoubleEquals(33, ReturnDouble33());
+ assertDoubleEquals(34, ReturnDouble34());
+ assertDoubleEquals(99.25, ReturnDouble99P25());
}
}
diff --git a/test/445-checker-licm/src/Main.java b/test/445-checker-licm/src/Main.java
index 42f9a11..6ee8a4d 100644
--- a/test/445-checker-licm/src/Main.java
+++ b/test/445-checker-licm/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
diff --git a/test/446-checker-inliner2/src/Main.java b/test/446-checker-inliner2/src/Main.java
index de00a09..e8168af 100644
--- a/test/446-checker-inliner2/src/Main.java
+++ b/test/446-checker-inliner2/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2014 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
diff --git a/test/447-checker-inliner3/src/Main.java b/test/447-checker-inliner3/src/Main.java
index e3fdffd..0b980d0 100644
--- a/test/447-checker-inliner3/src/Main.java
+++ b/test/447-checker-inliner3/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2014 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
diff --git a/test/449-checker-bce/expected.txt b/test/449-checker-bce/expected.txt
index e69de29..e114c50 100644
--- a/test/449-checker-bce/expected.txt
+++ b/test/449-checker-bce/expected.txt
@@ -0,0 +1 @@
+java.lang.ArrayIndexOutOfBoundsException: length=5; index=82
diff --git a/test/449-checker-bce/src/Main.java b/test/449-checker-bce/src/Main.java
index ed6fc1e..a746664 100644
--- a/test/449-checker-bce/src/Main.java
+++ b/test/449-checker-bce/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
@@ -1101,6 +1101,28 @@
}
+ public void testExceptionMessage() {
+ short[] B1 = new short[5];
+ int[] B2 = new int[5];
+ Exception err = null;
+ try {
+ testExceptionMessage1(B1, B2, null, -1, 6);
+ } catch (Exception e) {
+ err = e;
+ }
+ System.out.println(err);
+ }
+
+ void testExceptionMessage1(short[] a1, int[] a2, long a3[], int start, int finish) {
+ int j = finish + 77;
+ // Bug: 22665511
+ // A deoptimization will be triggered here right before the loop. Need to make
+ // sure the value of j is preserved for the interpreter.
+ for (int i = start; i <= finish; i++) {
+ a2[j - 1] = a1[i + 1];
+ }
+ }
+
// Make sure this method is compiled with optimizing.
/// CHECK-START: void Main.main(java.lang.String[]) register (after)
/// CHECK: ParallelMove
@@ -1141,6 +1163,7 @@
};
testUnknownBounds();
+ new Main().testExceptionMessage();
}
}
diff --git a/test/450-checker-types/src/Main.java b/test/450-checker-types/src/Main.java
index 9070627..014f59a 100644
--- a/test/450-checker-types/src/Main.java
+++ b/test/450-checker-types/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
interface Interface {
diff --git a/test/451-regression-add-float/src/Main.java b/test/451-regression-add-float/src/Main.java
index 0d4bf06..093c132 100644
--- a/test/451-regression-add-float/src/Main.java
+++ b/test/451-regression-add-float/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
diff --git a/test/458-checker-instruction-simplification/src/Main.java b/test/458-checker-instruction-simplification/src/Main.java
index aa4dda1..a14200e 100644
--- a/test/458-checker-instruction-simplification/src/Main.java
+++ b/test/458-checker-instruction-simplification/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
diff --git a/test/462-checker-inlining-across-dex-files/src-multidex/OtherDex.java b/test/462-checker-inlining-across-dex-files/src-multidex/OtherDex.java
index cee8e0f..171ade8 100644
--- a/test/462-checker-inlining-across-dex-files/src-multidex/OtherDex.java
+++ b/test/462-checker-inlining-across-dex-files/src-multidex/OtherDex.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class OtherDex {
public static void emptyMethod() {
diff --git a/test/462-checker-inlining-across-dex-files/src/Main.java b/test/462-checker-inlining-across-dex-files/src/Main.java
index 64979ca..1fe49a8 100644
--- a/test/462-checker-inlining-across-dex-files/src/Main.java
+++ b/test/462-checker-inlining-across-dex-files/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
// Add a class that will be the first entry in the dex cache, to
// avoid having the OtherDex and Main classes share the same cache index.
diff --git a/test/463-checker-boolean-simplifier/src/Main.java b/test/463-checker-boolean-simplifier/src/Main.java
index dd17e77..61510d8 100644
--- a/test/463-checker-boolean-simplifier/src/Main.java
+++ b/test/463-checker-boolean-simplifier/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
diff --git a/test/464-checker-inline-sharpen-calls/src/Main.java b/test/464-checker-inline-sharpen-calls/src/Main.java
index 876496f..6dce96c 100644
--- a/test/464-checker-inline-sharpen-calls/src/Main.java
+++ b/test/464-checker-inline-sharpen-calls/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public final class Main {
diff --git a/test/465-checker-clinit-gvn/src/Main.java b/test/465-checker-clinit-gvn/src/Main.java
index 704e9fe..9c77acc 100644
--- a/test/465-checker-clinit-gvn/src/Main.java
+++ b/test/465-checker-clinit-gvn/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
class OtherClass {
static {
diff --git a/test/473-checker-inliner-constants/src/Main.java b/test/473-checker-inliner-constants/src/Main.java
index 85f6565..8638514 100644
--- a/test/473-checker-inliner-constants/src/Main.java
+++ b/test/473-checker-inliner-constants/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
diff --git a/test/474-checker-boolean-input/src/Main.java b/test/474-checker-boolean-input/src/Main.java
index 86d0f7c..a2b219d 100644
--- a/test/474-checker-boolean-input/src/Main.java
+++ b/test/474-checker-boolean-input/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
diff --git a/test/475-regression-inliner-ids/src/Main.java b/test/475-regression-inliner-ids/src/Main.java
index bf22062..423c3b5 100644
--- a/test/475-regression-inliner-ids/src/Main.java
+++ b/test/475-regression-inliner-ids/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
import java.lang.reflect.Method;
diff --git a/test/476-checker-ctor-memory-barrier/src/Main.java b/test/476-checker-ctor-memory-barrier/src/Main.java
index e709ba0..41bec05 100644
--- a/test/476-checker-ctor-memory-barrier/src/Main.java
+++ b/test/476-checker-ctor-memory-barrier/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
// TODO: Add more tests after we can inline functions with calls.
diff --git a/test/477-checker-bound-type/src/Main.java b/test/477-checker-bound-type/src/Main.java
index fe52e83..c873702 100644
--- a/test/477-checker-bound-type/src/Main.java
+++ b/test/477-checker-bound-type/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
diff --git a/test/478-checker-inliner-nested-loop/src/Main.java b/test/478-checker-inliner-nested-loop/src/Main.java
index aa02349..86c119f 100644
--- a/test/478-checker-inliner-nested-loop/src/Main.java
+++ b/test/478-checker-inliner-nested-loop/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
diff --git a/test/479-regression-implicit-null-check/src/Main.java b/test/479-regression-implicit-null-check/src/Main.java
index 6b6f2e4..005ba7f 100644
--- a/test/479-regression-implicit-null-check/src/Main.java
+++ b/test/479-regression-implicit-null-check/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
diff --git a/test/480-checker-dead-blocks/src/Main.java b/test/480-checker-dead-blocks/src/Main.java
index 4cc1634..5adafaf 100644
--- a/test/480-checker-dead-blocks/src/Main.java
+++ b/test/480-checker-dead-blocks/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
diff --git a/test/481-regression-phi-cond/src/Main.java b/test/481-regression-phi-cond/src/Main.java
index bad9669..54982f7 100644
--- a/test/481-regression-phi-cond/src/Main.java
+++ b/test/481-regression-phi-cond/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
diff --git a/test/482-checker-loop-back-edge-use/src/Main.java b/test/482-checker-loop-back-edge-use/src/Main.java
index 18125fa..2cfb04d 100644
--- a/test/482-checker-loop-back-edge-use/src/Main.java
+++ b/test/482-checker-loop-back-edge-use/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
diff --git a/test/484-checker-register-hints/src/Main.java b/test/484-checker-register-hints/src/Main.java
index 3715ca2..6e68f7c 100644
--- a/test/484-checker-register-hints/src/Main.java
+++ b/test/484-checker-register-hints/src/Main.java
@@ -16,6 +16,14 @@
public class Main {
+ static class Foo {
+ int field0;
+ int field1;
+ int field2;
+ int field3;
+ int field4;
+ };
+
/// CHECK-START: void Main.test1(boolean, int, int, int, int, int) register (after)
/// CHECK: name "B0"
/// CHECK-NOT: ParallelMove
@@ -25,7 +33,7 @@
/// CHECK-NOT: ParallelMove
/// CHECK: name "B3"
/// CHECK-NOT: end_block
- /// CHECK: ArraySet
+ /// CHECK: InstanceFieldSet
// We could check here that there is a parallel move, but it's only valid
// for some architectures (for example x86), as other architectures may
// not do move at all.
@@ -36,19 +44,19 @@
int e = live1;
int f = live2;
int g = live3;
+ int j = live0;
if (z) {
} else {
// Create enough live instructions to force spilling on x86.
int h = live4;
int i = live5;
- array[2] = e + i + h;
- array[3] = f + i + h;
- array[4] = g + i + h;
- array[0] = h;
- array[1] = i + h;
-
+ foo.field2 = e + i + h;
+ foo.field3 = f + i + h;
+ foo.field4 = g + i + h;
+ foo.field0 = h;
+ foo.field1 = i + h;
}
- live1 = e + f + g;
+ live1 = e + f + g + j;
}
/// CHECK-START: void Main.test2(boolean, int, int, int, int, int) register (after)
@@ -60,7 +68,7 @@
/// CHECK-NOT: ParallelMove
/// CHECK: name "B3"
/// CHECK-NOT: end_block
- /// CHECK: ArraySet
+ /// CHECK: InstanceFieldSet
// We could check here that there is a parallel move, but it's only valid
// for some architectures (for example x86), as other architectures may
// not do move at all.
@@ -71,18 +79,19 @@
int e = live1;
int f = live2;
int g = live3;
+ int j = live0;
if (z) {
if (y) {
int h = live4;
int i = live5;
- array[2] = e + i + h;
- array[3] = f + i + h;
- array[4] = g + i + h;
- array[0] = h;
- array[1] = i + h;
+ foo.field2 = e + i + h;
+ foo.field3 = f + i + h;
+ foo.field4 = g + i + h;
+ foo.field0 = h;
+ foo.field1 = i + h;
}
}
- live1 = e + f + g;
+ live1 = e + f + g + j;
}
/// CHECK-START: void Main.test3(boolean, int, int, int, int, int) register (after)
@@ -94,7 +103,7 @@
/// CHECK-NOT: ParallelMove
/// CHECK: name "B6"
/// CHECK-NOT: end_block
- /// CHECK: ArraySet
+ /// CHECK: InstanceFieldSet
// We could check here that there is a parallel move, but it's only valid
// for some architectures (for example x86), as other architectures may
// not do move at all.
@@ -107,6 +116,7 @@
int e = live1;
int f = live2;
int g = live3;
+ int j = live0;
if (z) {
live1 = e;
} else {
@@ -115,24 +125,25 @@
} else {
int h = live4;
int i = live5;
- array[2] = e + i + h;
- array[3] = f + i + h;
- array[4] = g + i + h;
- array[0] = h;
- array[1] = i + h;
+ foo.field2 = e + i + h;
+ foo.field3 = f + i + h;
+ foo.field4 = g + i + h;
+ foo.field0 = h;
+ foo.field1 = i + h;
}
}
- live1 = e + f + g;
+ live1 = e + f + g + j;
}
public static void main(String[] args) {
}
static boolean y;
+ static int live0;
static int live1;
static int live2;
static int live3;
static int live4;
static int live5;
- static int[] array;
+ static Foo foo;
}
diff --git a/test/491-current-method/src/Main.java b/test/491-current-method/src/Main.java
index 87ef052..51a41a6 100644
--- a/test/491-current-method/src/Main.java
+++ b/test/491-current-method/src/Main.java
@@ -16,7 +16,7 @@
class Main {
- // The code below is written in a way that will crash
+ // The code below is written in a way that would crash
// the generated code at the time of submission of this test.
// Therefore, changes to the register allocator may
// affect the reproducibility of the crash.
@@ -25,8 +25,8 @@
// to put the ART current method.
c = c / 42;
// We use the empty string for forcing the slow path.
- // The slow path for charAt when it is intrinsified, will
- // move the parameter to ECX, and therefore overwrite the ART
+ // The slow path for charAt, when it is intrinsified, will
+ // move the parameter to ECX and therefore overwrite the ART
// current method.
"".charAt(c);
diff --git a/test/508-checker-disassembly/src/Main.java b/test/508-checker-disassembly/src/Main.java
index 29c9374..0805731 100644
--- a/test/508-checker-disassembly/src/Main.java
+++ b/test/508-checker-disassembly/src/Main.java
@@ -1,18 +1,18 @@
/*
-* Copyright (C) 2015 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
public class Main {
// A very simple check that disassembly information has been added to the
diff --git a/test/525-arrays-and-fields/expected.txt b/test/525-checker-arrays-and-fields/expected.txt
similarity index 100%
rename from test/525-arrays-and-fields/expected.txt
rename to test/525-checker-arrays-and-fields/expected.txt
diff --git a/test/525-arrays-and-fields/info.txt b/test/525-checker-arrays-and-fields/info.txt
similarity index 100%
rename from test/525-arrays-and-fields/info.txt
rename to test/525-checker-arrays-and-fields/info.txt
diff --git a/test/525-arrays-and-fields/src/Main.java b/test/525-checker-arrays-and-fields/src/Main.java
similarity index 62%
rename from test/525-arrays-and-fields/src/Main.java
rename to test/525-checker-arrays-and-fields/src/Main.java
index cb1e4af..a635a51 100644
--- a/test/525-arrays-and-fields/src/Main.java
+++ b/test/525-checker-arrays-and-fields/src/Main.java
@@ -80,56 +80,129 @@
//
// Loops on static arrays with invariant static field references.
+ // The checker is used to ensure hoisting occurred.
//
+ /// CHECK-START: void Main.SInvLoopZ() licm (before)
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SInvLoopZ() licm (after)
+ /// CHECK-DAG: StaticFieldGet loop:none
+ /// CHECK-DAG: StaticFieldGet loop:none
+
private static void SInvLoopZ() {
for (int i = 0; i < sArrZ.length; i++) {
sArrZ[i] = sZ;
}
}
+ /// CHECK-START: void Main.SInvLoopB() licm (before)
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SInvLoopB() licm (after)
+ /// CHECK-DAG: StaticFieldGet loop:none
+ /// CHECK-DAG: StaticFieldGet loop:none
+
private static void SInvLoopB() {
for (int i = 0; i < sArrB.length; i++) {
sArrB[i] = sB;
}
}
+ /// CHECK-START: void Main.SInvLoopC() licm (before)
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SInvLoopC() licm (after)
+ /// CHECK-DAG: StaticFieldGet loop:none
+ /// CHECK-DAG: StaticFieldGet loop:none
+
private static void SInvLoopC() {
for (int i = 0; i < sArrC.length; i++) {
sArrC[i] = sC;
}
}
+ /// CHECK-START: void Main.SInvLoopS() licm (before)
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SInvLoopS() licm (after)
+ /// CHECK-DAG: StaticFieldGet loop:none
+ /// CHECK-DAG: StaticFieldGet loop:none
+
private static void SInvLoopS() {
for (int i = 0; i < sArrS.length; i++) {
sArrS[i] = sS;
}
}
+ /// CHECK-START: void Main.SInvLoopI() licm (before)
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SInvLoopI() licm (after)
+ /// CHECK-DAG: StaticFieldGet loop:none
+ /// CHECK-DAG: StaticFieldGet loop:none
+
private static void SInvLoopI() {
for (int i = 0; i < sArrI.length; i++) {
sArrI[i] = sI;
}
}
+ /// CHECK-START: void Main.SInvLoopJ() licm (before)
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SInvLoopJ() licm (after)
+ /// CHECK-DAG: StaticFieldGet loop:none
+ /// CHECK-DAG: StaticFieldGet loop:none
+
private static void SInvLoopJ() {
for (int i = 0; i < sArrJ.length; i++) {
sArrJ[i] = sJ;
}
}
+ /// CHECK-START: void Main.SInvLoopF() licm (before)
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SInvLoopF() licm (after)
+ /// CHECK-DAG: StaticFieldGet loop:none
+ /// CHECK-DAG: StaticFieldGet loop:none
+
private static void SInvLoopF() {
for (int i = 0; i < sArrF.length; i++) {
sArrF[i] = sF;
}
}
+ /// CHECK-START: void Main.SInvLoopD() licm (before)
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SInvLoopD() licm (after)
+ /// CHECK-DAG: StaticFieldGet loop:none
+ /// CHECK-DAG: StaticFieldGet loop:none
+
private static void SInvLoopD() {
for (int i = 0; i < sArrD.length; i++) {
sArrD[i] = sD;
}
}
+ /// CHECK-START: void Main.SInvLoopL() licm (before)
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: StaticFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SInvLoopL() licm (after)
+ /// CHECK-DAG: StaticFieldGet loop:none
+ /// CHECK-DAG: StaticFieldGet loop:none
+
private static void SInvLoopL() {
for (int i = 0; i < sArrL.length; i++) {
sArrL[i] = sL;
@@ -138,6 +211,7 @@
//
// Loops on static arrays with variant static field references.
+ // Incorrect hoisting is detected by incorrect outcome.
//
private static void SVarLoopZ() {
@@ -214,56 +288,130 @@
//
// Loops on static arrays with a cross-over reference.
+ // Incorrect hoisting is detected by incorrect outcome.
+ // In addition, the checker is used to detect no hoisting.
//
+ /// CHECK-START: void Main.SCrossOverLoopZ() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SCrossOverLoopZ() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private static void SCrossOverLoopZ() {
for (int i = 0; i < sArrZ.length; i++) {
sArrZ[i] = !sArrZ[20];
}
}
+ /// CHECK-START: void Main.SCrossOverLoopB() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SCrossOverLoopB() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private static void SCrossOverLoopB() {
for (int i = 0; i < sArrB.length; i++) {
sArrB[i] = (byte)(sArrB[20] + 2);
}
}
+ /// CHECK-START: void Main.SCrossOverLoopC() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SCrossOverLoopC() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private static void SCrossOverLoopC() {
for (int i = 0; i < sArrC.length; i++) {
sArrC[i] = (char)(sArrC[20] + 2);
}
}
+ /// CHECK-START: void Main.SCrossOverLoopS() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SCrossOverLoopS() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private static void SCrossOverLoopS() {
for (int i = 0; i < sArrS.length; i++) {
sArrS[i] = (short)(sArrS[20] + 2);
}
}
+ /// CHECK-START: void Main.SCrossOverLoopI() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SCrossOverLoopI() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private static void SCrossOverLoopI() {
for (int i = 0; i < sArrI.length; i++) {
sArrI[i] = sArrI[20] + 2;
}
}
+ /// CHECK-START: void Main.SCrossOverLoopJ() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SCrossOverLoopJ() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private static void SCrossOverLoopJ() {
for (int i = 0; i < sArrJ.length; i++) {
sArrJ[i] = sArrJ[20] + 2;
}
}
+ /// CHECK-START: void Main.SCrossOverLoopF() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SCrossOverLoopF() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private static void SCrossOverLoopF() {
for (int i = 0; i < sArrF.length; i++) {
sArrF[i] = sArrF[20] + 2;
}
}
+ /// CHECK-START: void Main.SCrossOverLoopD() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SCrossOverLoopD() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private static void SCrossOverLoopD() {
for (int i = 0; i < sArrD.length; i++) {
sArrD[i] = sArrD[20] + 2;
}
}
+ /// CHECK-START: void Main.SCrossOverLoopL() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.SCrossOverLoopL() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private static void SCrossOverLoopL() {
for (int i = 0; i < sArrL.length; i++) {
sArrL[i] = (sArrL[20] == anObject) ? anotherObject : anObject;
@@ -272,56 +420,129 @@
//
// Loops on instance arrays with invariant instance field references.
+ // The checker is used to ensure hoisting occurred.
//
+ /// CHECK-START: void Main.InvLoopZ() licm (before)
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.InvLoopZ() licm (after)
+ /// CHECK-DAG: InstanceFieldGet loop:none
+ /// CHECK-DAG: InstanceFieldGet loop:none
+
private void InvLoopZ() {
for (int i = 0; i < mArrZ.length; i++) {
mArrZ[i] = mZ;
}
}
+ /// CHECK-START: void Main.InvLoopB() licm (before)
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.InvLoopB() licm (after)
+ /// CHECK-DAG: InstanceFieldGet loop:none
+ /// CHECK-DAG: InstanceFieldGet loop:none
+
private void InvLoopB() {
for (int i = 0; i < mArrB.length; i++) {
mArrB[i] = mB;
}
}
+ /// CHECK-START: void Main.InvLoopC() licm (before)
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.InvLoopC() licm (after)
+ /// CHECK-DAG: InstanceFieldGet loop:none
+ /// CHECK-DAG: InstanceFieldGet loop:none
+
private void InvLoopC() {
for (int i = 0; i < mArrC.length; i++) {
mArrC[i] = mC;
}
}
+ /// CHECK-START: void Main.InvLoopS() licm (before)
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.InvLoopS() licm (after)
+ /// CHECK-DAG: InstanceFieldGet loop:none
+ /// CHECK-DAG: InstanceFieldGet loop:none
+
private void InvLoopS() {
for (int i = 0; i < mArrS.length; i++) {
mArrS[i] = mS;
}
}
+ /// CHECK-START: void Main.InvLoopI() licm (before)
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.InvLoopI() licm (after)
+ /// CHECK-DAG: InstanceFieldGet loop:none
+ /// CHECK-DAG: InstanceFieldGet loop:none
+
private void InvLoopI() {
for (int i = 0; i < mArrI.length; i++) {
mArrI[i] = mI;
}
}
+ /// CHECK-START: void Main.InvLoopJ() licm (before)
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.InvLoopJ() licm (after)
+ /// CHECK-DAG: InstanceFieldGet loop:none
+ /// CHECK-DAG: InstanceFieldGet loop:none
+
private void InvLoopJ() {
for (int i = 0; i < mArrJ.length; i++) {
mArrJ[i] = mJ;
}
}
+ /// CHECK-START: void Main.InvLoopF() licm (before)
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.InvLoopF() licm (after)
+ /// CHECK-DAG: InstanceFieldGet loop:none
+ /// CHECK-DAG: InstanceFieldGet loop:none
+
private void InvLoopF() {
for (int i = 0; i < mArrF.length; i++) {
mArrF[i] = mF;
}
}
+ /// CHECK-START: void Main.InvLoopD() licm (before)
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.InvLoopD() licm (after)
+ /// CHECK-DAG: InstanceFieldGet loop:none
+ /// CHECK-DAG: InstanceFieldGet loop:none
+
private void InvLoopD() {
for (int i = 0; i < mArrD.length; i++) {
mArrD[i] = mD;
}
}
+ /// CHECK-START: void Main.InvLoopL() licm (before)
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+ /// CHECK-DAG: InstanceFieldGet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.InvLoopL() licm (after)
+ /// CHECK-DAG: InstanceFieldGet loop:none
+ /// CHECK-DAG: InstanceFieldGet loop:none
+
private void InvLoopL() {
for (int i = 0; i < mArrL.length; i++) {
mArrL[i] = mL;
@@ -330,6 +551,7 @@
//
// Loops on instance arrays with variant instance field references.
+ // Incorrect hoisting is detected by incorrect outcome.
//
private void VarLoopZ() {
@@ -406,56 +628,130 @@
//
// Loops on instance arrays with a cross-over reference.
+ // Incorrect hoisting is detected by incorrect outcome.
+ // In addition, the checker is used to detect no hoisting.
//
+ /// CHECK-START: void Main.CrossOverLoopZ() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.CrossOverLoopZ() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private void CrossOverLoopZ() {
for (int i = 0; i < mArrZ.length; i++) {
mArrZ[i] = !mArrZ[20];
}
}
+ /// CHECK-START: void Main.CrossOverLoopB() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.CrossOverLoopB() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private void CrossOverLoopB() {
for (int i = 0; i < mArrB.length; i++) {
mArrB[i] = (byte)(mArrB[20] + 2);
}
}
+ /// CHECK-START: void Main.CrossOverLoopC() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.CrossOverLoopC() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private void CrossOverLoopC() {
for (int i = 0; i < mArrC.length; i++) {
mArrC[i] = (char)(mArrC[20] + 2);
}
}
+ /// CHECK-START: void Main.CrossOverLoopS() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.CrossOverLoopS() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private void CrossOverLoopS() {
for (int i = 0; i < mArrS.length; i++) {
mArrS[i] = (short)(mArrS[20] + 2);
}
}
+ /// CHECK-START: void Main.CrossOverLoopI() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.CrossOverLoopI() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private void CrossOverLoopI() {
for (int i = 0; i < mArrI.length; i++) {
mArrI[i] = mArrI[20] + 2;
}
}
+ /// CHECK-START: void Main.CrossOverLoopJ() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.CrossOverLoopJ() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private void CrossOverLoopJ() {
for (int i = 0; i < mArrJ.length; i++) {
mArrJ[i] = mArrJ[20] + 2;
}
}
+ /// CHECK-START: void Main.CrossOverLoopF() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.CrossOverLoopF() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private void CrossOverLoopF() {
for (int i = 0; i < mArrF.length; i++) {
mArrF[i] = mArrF[20] + 2;
}
}
+ /// CHECK-START: void Main.CrossOverLoopD() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.CrossOverLoopD() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private void CrossOverLoopD() {
for (int i = 0; i < mArrD.length; i++) {
mArrD[i] = mArrD[20] + 2;
}
}
+ /// CHECK-START: void Main.CrossOverLoopL() licm (before)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
+ /// CHECK-START: void Main.CrossOverLoopL() licm (after)
+ /// CHECK-DAG: ArrayGet loop:{{B\d+}}
+ /// CHECK-DAG: ArraySet loop:{{B\d+}}
+
private void CrossOverLoopL() {
for (int i = 0; i < mArrL.length; i++) {
mArrL[i] = (mArrL[20] == anObject) ? anotherObject : anObject;
diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk
index 3d5c483..3698bc8 100644
--- a/test/Android.run-test.mk
+++ b/test/Android.run-test.mk
@@ -113,7 +113,7 @@
COMPILER_TYPES += default
endif
ifeq ($(ART_TEST_INTERPRETER_ACCESS_CHECKS),true)
- COMPILER_TYPES += interpreter-access-checks
+ COMPILER_TYPES += interp-ac
endif
ifeq ($(ART_TEST_INTERPRETER),true)
COMPILER_TYPES += interpreter
@@ -277,9 +277,9 @@
506-verify-aput \
800-smali
-ifneq (,$(filter interpreter-access-checks,$(COMPILER_TYPES)))
+ifneq (,$(filter interp-ac,$(COMPILER_TYPES)))
ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
- interpreter-access-checks,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
+ interp-ac,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
$(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_INTERPRETER_ACCESS_CHECK_TESTS), $(ALL_ADDRESS_SIZES))
endif
@@ -629,7 +629,7 @@
# Create a rule to build and run a tests following the form:
# test-art-{1: host or target}-run-test-{2: debug ndebug}-{3: prebuild no-prebuild no-dex2oat}-
-# {4: interpreter default optimizing jit interpreter-access-checks}-
+# {4: interpreter default optimizing jit interp-ac}-
# {5: relocate nrelocate relocate-npatchoat}-
# {6: trace or ntrace}-{7: gcstress gcverify cms}-{8: forcecopy checkjni jni}-
# {9: no-image image picimage}-{10: pictest npictest}-
@@ -700,7 +700,7 @@
ifeq ($(4),interpreter)
test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_RULES
run_test_options += --interpreter
- else ifeq ($(4),interpreter-access-checks)
+ else ifeq ($(4),interp-ac)
test_groups += ART_RUN_TEST_$$(uc_host_or_target)_INTERPRETER_ACCESS_CHECKS_RULES
run_test_options += --interpreter --verify-soft-fail
else
diff --git a/test/run-test b/test/run-test
index 56ae480..934329f 100755
--- a/test/run-test
+++ b/test/run-test
@@ -264,7 +264,7 @@
shift
elif [ "x$1" = "x--verify-soft-fail" ]; then
run_args="${run_args} --verify-soft-fail"
- image_suffix="-interpreter-access-checks"
+ image_suffix="-interp-ac"
shift
elif [ "x$1" = "x--no-optimize" ]; then
run_args="${run_args} --no-optimize"
diff --git a/tools/libcore_failures.txt b/tools/libcore_failures.txt
index 992a8a6..d58f034 100644
--- a/tools/libcore_failures.txt
+++ b/tools/libcore_failures.txt
@@ -150,5 +150,12 @@
result: EXEC_FAILED,
modes: [device],
names: ["org.apache.harmony.tests.java.lang.ClassTest#test_forNameLjava_lang_String"]
+},
+{
+ description: "TimeZoneTest.testAllDisplayNames times out, needs investigation",
+ result: EXEC_FAILED,
+ modes: [device],
+ names: ["libcore.java.util.TimeZoneTest.testAllDisplayNames"],
+ bug: 22786792
}
]