summaryrefslogtreecommitdiff
path: root/compiler/common_compiler_test.cc
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2017-02-13 19:03:47 -0800
committerCalin Juravle <calin@google.com>2017-03-03 13:12:31 -0800
commite0ac1151b360be7147fa20320c0b427688b1424f (patch)
treec33419b00c47b731075bcfd7b75b81f366beda91 /compiler/common_compiler_test.cc
parent425b5d23e2c60d295471817a75b1b554481c5334 (diff)
Extend profman to generate profiles with inline caches
Extend profman logic to generate profiles based on a simple textual respresentation. This will help writing tests for profile guided compilation. Before this CL, profman was able to generate profiles based on a list of classes like: java.lang.Comparable java.lang.Math java.lang.Object This CL, enables profman to understand methods and classes alike. The new format is: # Classes Ljava/lang/Comparable; Ljava/lang/Math; # Methods with inline caches LTestInline;->inlinePolymorhic(LSuper;)I+LSubA;,LSubB;,LSubC; LTestInline;->noInlineCache(LSuper;)I "LTestInline;->inlinePolymorhic(LSuper;)I+LSubA;,LSubB;,LSubC;" means that method `int inlineMonomorphicSubA(Super)` from class Main will be added to the profile with the inline cache (SubA,SubB) for its one and only invoke virtual. @Main#noInlineCache:(LSuper;)I+; meaning that method `int noInlineCache' from class Main will be added to the profile with no inline cache. Note that the methods are allowed to have a single invoke virtual in their dex bytecode. That is to keep the parsing the file format simple and easy to use. Also, add a few more tests for profiles and fix an issue caused by writing the dex files in a possibly wrong order. Test: m run-test-host-gtest-profile_assistant_test Bug: 32434870 Change-Id: I6b7340cf613007117d9818be206ccb3a27b815bf
Diffstat (limited to 'compiler/common_compiler_test.cc')
-rw-r--r--compiler/common_compiler_test.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc
index d89cdbabf8..9a45379a05 100644
--- a/compiler/common_compiler_test.cc
+++ b/compiler/common_compiler_test.cc
@@ -52,10 +52,10 @@ void CommonCompilerTest::MakeExecutable(ArtMethod* method) {
compiler_driver_->GetCompiledMethod(MethodReference(&dex_file,
method->GetDexMethodIndex()));
}
- if (compiled_method != nullptr) {
+ // If the code size is 0 it means the method was skipped due to profile guided compilation.
+ if (compiled_method != nullptr && compiled_method->GetQuickCode().size() != 0u) {
ArrayRef<const uint8_t> code = compiled_method->GetQuickCode();
uint32_t code_size = code.size();
- CHECK_NE(0u, code_size);
ArrayRef<const uint8_t> vmap_table = compiled_method->GetVmapTable();
uint32_t vmap_table_offset = vmap_table.empty() ? 0u
: sizeof(OatQuickMethodHeader) + vmap_table.size();