summaryrefslogtreecommitdiff
path: root/compiler/utils/assembler_test_base.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2020-02-26 12:46:09 +0000
committer Vladimir Marko <vmarko@google.com> 2020-03-02 12:53:56 +0000
commit662f12ee2f2b886aebcc22d321b2d752227e0b38 (patch)
treeb10edc5ca99d0bae716462580cb025b4b48eb83d /compiler/utils/assembler_test_base.h
parenteedca4a5f72b449df035979f31785dd5eaa46e0e (diff)
Move entry spills determination to JNI compiler.
The calling convention no longer describes entry spills as spilling is the JNI compiler's responsibility. This allows future improvements, such as spilling registers directly to the HandleScope or outgoing stack args. Remove the notion of interprocedural scratch register from calling conventions and let assemblers deal with all scratch register uses. The remaining JNI assembler APIs that take scratch registers are currently unused and can be removed. Also fix a bug in disassembly comparison for tests; the contents of two files were considered identical if the second one just contained additional data. This change fully preserves the generated code and adds TODO comments where doing so results in weird or suboptimal code. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Prebuilt boot image is unchanged. Test: aosp_taimen-userdebug boots. Bug: 12189621 Change-Id: Ic26a670276920313cd907a6eda8d982cf0abfd81
Diffstat (limited to 'compiler/utils/assembler_test_base.h')
-rw-r--r--compiler/utils/assembler_test_base.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/compiler/utils/assembler_test_base.h b/compiler/utils/assembler_test_base.h
index 5fa0b3cd39..0a7cf11ba2 100644
--- a/compiler/utils/assembler_test_base.h
+++ b/compiler/utils/assembler_test_base.h
@@ -364,14 +364,13 @@ class AssemblerTestInfrastructure {
std::ifstream f1_in(f1);
std::ifstream f2_in(f2);
- bool result = std::equal(std::istreambuf_iterator<char>(f1_in),
- std::istreambuf_iterator<char>(),
- std::istreambuf_iterator<char>(f2_in));
-
- f1_in.close();
- f2_in.close();
-
- return result;
+ bool read1_ok, read2_ok;
+ char c1, c2;
+ do {
+ read1_ok = static_cast<bool>(f1_in >> c1);
+ read2_ok = static_cast<bool>(f2_in >> c2);
+ } while (read1_ok && read2_ok && c1 == c2);
+ return !read1_ok && !read2_ok; // Did we reach the end of both streams?
}
// Compile the given assembly code and extract the binary, if possible. Put result into res.