xref: /aosp_15_r20/art/runtime/jit/profiling_info_test.cc (revision 795d594fd825385562da6b089ea9b2033f3abf5a)
1*795d594fSAndroid Build Coastguard Worker /*
2*795d594fSAndroid Build Coastguard Worker  * Copyright (C) 2016 The Android Open Source Project
3*795d594fSAndroid Build Coastguard Worker  *
4*795d594fSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
5*795d594fSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
6*795d594fSAndroid Build Coastguard Worker  * You may obtain a copy of the License at
7*795d594fSAndroid Build Coastguard Worker  *
8*795d594fSAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
9*795d594fSAndroid Build Coastguard Worker  *
10*795d594fSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
11*795d594fSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
12*795d594fSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*795d594fSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
14*795d594fSAndroid Build Coastguard Worker  * limitations under the License.
15*795d594fSAndroid Build Coastguard Worker  */
16*795d594fSAndroid Build Coastguard Worker 
17*795d594fSAndroid Build Coastguard Worker #include "profiling_info.h"
18*795d594fSAndroid Build Coastguard Worker 
19*795d594fSAndroid Build Coastguard Worker #include <gtest/gtest.h>
20*795d594fSAndroid Build Coastguard Worker #include <stdio.h>
21*795d594fSAndroid Build Coastguard Worker 
22*795d594fSAndroid Build Coastguard Worker #include "art_method-inl.h"
23*795d594fSAndroid Build Coastguard Worker #include "base/unix_file/fd_file.h"
24*795d594fSAndroid Build Coastguard Worker #include "class_linker-inl.h"
25*795d594fSAndroid Build Coastguard Worker #include "common_runtime_test.h"
26*795d594fSAndroid Build Coastguard Worker #include "dex/dex_file.h"
27*795d594fSAndroid Build Coastguard Worker #include "dex/dex_file_loader.h"
28*795d594fSAndroid Build Coastguard Worker #include "dex/method_reference.h"
29*795d594fSAndroid Build Coastguard Worker #include "dex/type_reference.h"
30*795d594fSAndroid Build Coastguard Worker #include "handle_scope-inl.h"
31*795d594fSAndroid Build Coastguard Worker #include "linear_alloc.h"
32*795d594fSAndroid Build Coastguard Worker #include "mirror/class-inl.h"
33*795d594fSAndroid Build Coastguard Worker #include "mirror/class_loader.h"
34*795d594fSAndroid Build Coastguard Worker #include "profile/profile_compilation_info.h"
35*795d594fSAndroid Build Coastguard Worker #include "profile/profile_test_helper.h"
36*795d594fSAndroid Build Coastguard Worker #include "scoped_thread_state_change-inl.h"
37*795d594fSAndroid Build Coastguard Worker 
38*795d594fSAndroid Build Coastguard Worker namespace art HIDDEN {
39*795d594fSAndroid Build Coastguard Worker 
40*795d594fSAndroid Build Coastguard Worker using Hotness = ProfileCompilationInfo::MethodHotness;
41*795d594fSAndroid Build Coastguard Worker 
42*795d594fSAndroid Build Coastguard Worker class ProfileCompilationInfoTest : public CommonRuntimeTest {
43*795d594fSAndroid Build Coastguard Worker  public:
PostRuntimeCreate()44*795d594fSAndroid Build Coastguard Worker   void PostRuntimeCreate() override {
45*795d594fSAndroid Build Coastguard Worker     allocator_.reset(new ArenaAllocator(Runtime::Current()->GetArenaPool()));
46*795d594fSAndroid Build Coastguard Worker   }
47*795d594fSAndroid Build Coastguard Worker 
48*795d594fSAndroid Build Coastguard Worker  protected:
GetVirtualMethods(jobject class_loader,const char * clazz)49*795d594fSAndroid Build Coastguard Worker   std::vector<ArtMethod*> GetVirtualMethods(jobject class_loader, const char* clazz) {
50*795d594fSAndroid Build Coastguard Worker     ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
51*795d594fSAndroid Build Coastguard Worker     Thread* self = Thread::Current();
52*795d594fSAndroid Build Coastguard Worker     ScopedObjectAccess soa(self);
53*795d594fSAndroid Build Coastguard Worker     StackHandleScope<1> hs(self);
54*795d594fSAndroid Build Coastguard Worker     Handle<mirror::ClassLoader> h_loader(
55*795d594fSAndroid Build Coastguard Worker         hs.NewHandle(self->DecodeJObject(class_loader)->AsClassLoader()));
56*795d594fSAndroid Build Coastguard Worker     ObjPtr<mirror::Class> klass = FindClass(clazz, h_loader);
57*795d594fSAndroid Build Coastguard Worker 
58*795d594fSAndroid Build Coastguard Worker     const auto pointer_size = class_linker->GetImagePointerSize();
59*795d594fSAndroid Build Coastguard Worker     std::vector<ArtMethod*> methods;
60*795d594fSAndroid Build Coastguard Worker     for (auto& m : klass->GetVirtualMethods(pointer_size)) {
61*795d594fSAndroid Build Coastguard Worker       methods.push_back(&m);
62*795d594fSAndroid Build Coastguard Worker     }
63*795d594fSAndroid Build Coastguard Worker     return methods;
64*795d594fSAndroid Build Coastguard Worker   }
65*795d594fSAndroid Build Coastguard Worker 
GetFd(const ScratchFile & file)66*795d594fSAndroid Build Coastguard Worker   uint32_t GetFd(const ScratchFile& file) {
67*795d594fSAndroid Build Coastguard Worker     return static_cast<uint32_t>(file.GetFd());
68*795d594fSAndroid Build Coastguard Worker   }
69*795d594fSAndroid Build Coastguard Worker 
SaveProfilingInfo(const std::string & filename,const std::vector<ArtMethod * > & methods,Hotness::Flag flags)70*795d594fSAndroid Build Coastguard Worker   bool SaveProfilingInfo(
71*795d594fSAndroid Build Coastguard Worker       const std::string& filename,
72*795d594fSAndroid Build Coastguard Worker       const std::vector<ArtMethod*>& methods,
73*795d594fSAndroid Build Coastguard Worker       Hotness::Flag flags) {
74*795d594fSAndroid Build Coastguard Worker     ProfileCompilationInfo info;
75*795d594fSAndroid Build Coastguard Worker     std::vector<ProfileMethodInfo> profile_methods;
76*795d594fSAndroid Build Coastguard Worker     profile_methods.reserve(methods.size());
77*795d594fSAndroid Build Coastguard Worker     ScopedObjectAccess soa(Thread::Current());
78*795d594fSAndroid Build Coastguard Worker     for (ArtMethod* method : methods) {
79*795d594fSAndroid Build Coastguard Worker       profile_methods.emplace_back(
80*795d594fSAndroid Build Coastguard Worker           MethodReference(method->GetDexFile(), method->GetDexMethodIndex()));
81*795d594fSAndroid Build Coastguard Worker     }
82*795d594fSAndroid Build Coastguard Worker     if (!info.AddMethods(profile_methods, flags)) {
83*795d594fSAndroid Build Coastguard Worker       return false;
84*795d594fSAndroid Build Coastguard Worker     }
85*795d594fSAndroid Build Coastguard Worker     if (info.GetNumberOfMethods() != profile_methods.size()) {
86*795d594fSAndroid Build Coastguard Worker       return false;
87*795d594fSAndroid Build Coastguard Worker     }
88*795d594fSAndroid Build Coastguard Worker     ProfileCompilationInfo file_profile;
89*795d594fSAndroid Build Coastguard Worker     if (!file_profile.Load(filename, false)) {
90*795d594fSAndroid Build Coastguard Worker       return false;
91*795d594fSAndroid Build Coastguard Worker     }
92*795d594fSAndroid Build Coastguard Worker     if (!info.MergeWith(file_profile)) {
93*795d594fSAndroid Build Coastguard Worker       return false;
94*795d594fSAndroid Build Coastguard Worker     }
95*795d594fSAndroid Build Coastguard Worker 
96*795d594fSAndroid Build Coastguard Worker     return info.Save(filename, nullptr);
97*795d594fSAndroid Build Coastguard Worker   }
98*795d594fSAndroid Build Coastguard Worker 
99*795d594fSAndroid Build Coastguard Worker   // Saves the given art methods to a profile backed by 'filename' and adds
100*795d594fSAndroid Build Coastguard Worker   // some fake inline caches to it. The added inline caches are returned in
101*795d594fSAndroid Build Coastguard Worker   // the out map `profile_methods_map`.
SaveProfilingInfoWithFakeInlineCaches(const std::string & filename,const std::vector<ArtMethod * > & methods,Hotness::Flag flags,SafeMap<ArtMethod *,ProfileMethodInfo> * profile_methods_map)102*795d594fSAndroid Build Coastguard Worker   bool SaveProfilingInfoWithFakeInlineCaches(
103*795d594fSAndroid Build Coastguard Worker       const std::string& filename,
104*795d594fSAndroid Build Coastguard Worker       const std::vector<ArtMethod*>& methods,
105*795d594fSAndroid Build Coastguard Worker       Hotness::Flag flags,
106*795d594fSAndroid Build Coastguard Worker       /*out*/ SafeMap<ArtMethod*, ProfileMethodInfo>* profile_methods_map) {
107*795d594fSAndroid Build Coastguard Worker     ProfileCompilationInfo info;
108*795d594fSAndroid Build Coastguard Worker     std::vector<ProfileMethodInfo> profile_methods;
109*795d594fSAndroid Build Coastguard Worker     ScopedObjectAccess soa(Thread::Current());
110*795d594fSAndroid Build Coastguard Worker     for (ArtMethod* method : methods) {
111*795d594fSAndroid Build Coastguard Worker       std::vector<ProfileMethodInfo::ProfileInlineCache> caches;
112*795d594fSAndroid Build Coastguard Worker       // Monomorphic
113*795d594fSAndroid Build Coastguard Worker       for (uint16_t dex_pc = 0; dex_pc < 11; dex_pc++) {
114*795d594fSAndroid Build Coastguard Worker         std::vector<TypeReference> classes;
115*795d594fSAndroid Build Coastguard Worker         classes.emplace_back(method->GetDexFile(), dex::TypeIndex(0));
116*795d594fSAndroid Build Coastguard Worker         caches.emplace_back(dex_pc, /*is_missing_types*/false, classes);
117*795d594fSAndroid Build Coastguard Worker       }
118*795d594fSAndroid Build Coastguard Worker       // Polymorphic
119*795d594fSAndroid Build Coastguard Worker       for (uint16_t dex_pc = 11; dex_pc < 22; dex_pc++) {
120*795d594fSAndroid Build Coastguard Worker         std::vector<TypeReference> classes;
121*795d594fSAndroid Build Coastguard Worker         for (uint16_t k = 0; k < InlineCache::kIndividualCacheSize / 2; k++) {
122*795d594fSAndroid Build Coastguard Worker           classes.emplace_back(method->GetDexFile(), dex::TypeIndex(k));
123*795d594fSAndroid Build Coastguard Worker         }
124*795d594fSAndroid Build Coastguard Worker         caches.emplace_back(dex_pc, /*is_missing_types*/false, classes);
125*795d594fSAndroid Build Coastguard Worker       }
126*795d594fSAndroid Build Coastguard Worker       // Megamorphic
127*795d594fSAndroid Build Coastguard Worker       for (uint16_t dex_pc = 22; dex_pc < 33; dex_pc++) {
128*795d594fSAndroid Build Coastguard Worker         std::vector<TypeReference> classes;
129*795d594fSAndroid Build Coastguard Worker         for (uint16_t k = 0; k < 2 * InlineCache::kIndividualCacheSize; k++) {
130*795d594fSAndroid Build Coastguard Worker           classes.emplace_back(method->GetDexFile(), dex::TypeIndex(k));
131*795d594fSAndroid Build Coastguard Worker         }
132*795d594fSAndroid Build Coastguard Worker         caches.emplace_back(dex_pc, /*is_missing_types*/false, classes);
133*795d594fSAndroid Build Coastguard Worker       }
134*795d594fSAndroid Build Coastguard Worker       // Missing types
135*795d594fSAndroid Build Coastguard Worker       for (uint16_t dex_pc = 33; dex_pc < 44; dex_pc++) {
136*795d594fSAndroid Build Coastguard Worker         std::vector<TypeReference> classes;
137*795d594fSAndroid Build Coastguard Worker         caches.emplace_back(dex_pc, /*is_missing_types*/true, classes);
138*795d594fSAndroid Build Coastguard Worker       }
139*795d594fSAndroid Build Coastguard Worker       ProfileMethodInfo pmi(MethodReference(method->GetDexFile(),
140*795d594fSAndroid Build Coastguard Worker                                             method->GetDexMethodIndex()),
141*795d594fSAndroid Build Coastguard Worker                             caches);
142*795d594fSAndroid Build Coastguard Worker       profile_methods.push_back(pmi);
143*795d594fSAndroid Build Coastguard Worker       profile_methods_map->Put(method, pmi);
144*795d594fSAndroid Build Coastguard Worker     }
145*795d594fSAndroid Build Coastguard Worker 
146*795d594fSAndroid Build Coastguard Worker     if (!info.AddMethods(profile_methods,
147*795d594fSAndroid Build Coastguard Worker                          flags,
148*795d594fSAndroid Build Coastguard Worker                          ProfileCompilationInfo::ProfileSampleAnnotation::kNone,
149*795d594fSAndroid Build Coastguard Worker                          /*is_test=*/ true)
150*795d594fSAndroid Build Coastguard Worker         || info.GetNumberOfMethods() != profile_methods.size()) {
151*795d594fSAndroid Build Coastguard Worker       return false;
152*795d594fSAndroid Build Coastguard Worker     }
153*795d594fSAndroid Build Coastguard Worker     return info.Save(filename, nullptr);
154*795d594fSAndroid Build Coastguard Worker   }
155*795d594fSAndroid Build Coastguard Worker 
156*795d594fSAndroid Build Coastguard Worker   // Creates an inline cache which will be destructed at the end of the test.
CreateInlineCacheMap()157*795d594fSAndroid Build Coastguard Worker   ProfileCompilationInfo::InlineCacheMap* CreateInlineCacheMap() {
158*795d594fSAndroid Build Coastguard Worker     used_inline_caches.emplace_back(new ProfileCompilationInfo::InlineCacheMap(
159*795d594fSAndroid Build Coastguard Worker         std::less<uint16_t>(), allocator_->Adapter(kArenaAllocProfile)));
160*795d594fSAndroid Build Coastguard Worker     return used_inline_caches.back().get();
161*795d594fSAndroid Build Coastguard Worker   }
162*795d594fSAndroid Build Coastguard Worker 
163*795d594fSAndroid Build Coastguard Worker   // Cannot sizeof the actual arrays so hard code the values here.
164*795d594fSAndroid Build Coastguard Worker   // They should not change anyway.
165*795d594fSAndroid Build Coastguard Worker   static constexpr int kProfileMagicSize = 4;
166*795d594fSAndroid Build Coastguard Worker   static constexpr int kProfileVersionSize = 4;
167*795d594fSAndroid Build Coastguard Worker 
168*795d594fSAndroid Build Coastguard Worker   std::unique_ptr<ArenaAllocator> allocator_;
169*795d594fSAndroid Build Coastguard Worker 
170*795d594fSAndroid Build Coastguard Worker   // Cache of inline caches generated during tests.
171*795d594fSAndroid Build Coastguard Worker   // This makes it easier to pass data between different utilities and ensure that
172*795d594fSAndroid Build Coastguard Worker   // caches are destructed at the end of the test.
173*795d594fSAndroid Build Coastguard Worker   std::vector<std::unique_ptr<ProfileCompilationInfo::InlineCacheMap>> used_inline_caches;
174*795d594fSAndroid Build Coastguard Worker };
175*795d594fSAndroid Build Coastguard Worker 
TEST_F(ProfileCompilationInfoTest,SaveArtMethods)176*795d594fSAndroid Build Coastguard Worker TEST_F(ProfileCompilationInfoTest, SaveArtMethods) {
177*795d594fSAndroid Build Coastguard Worker   ScratchFile profile;
178*795d594fSAndroid Build Coastguard Worker 
179*795d594fSAndroid Build Coastguard Worker   Thread* self = Thread::Current();
180*795d594fSAndroid Build Coastguard Worker   jobject class_loader;
181*795d594fSAndroid Build Coastguard Worker   {
182*795d594fSAndroid Build Coastguard Worker     ScopedObjectAccess soa(self);
183*795d594fSAndroid Build Coastguard Worker     class_loader = LoadDex("ProfileTestMultiDex");
184*795d594fSAndroid Build Coastguard Worker   }
185*795d594fSAndroid Build Coastguard Worker   ASSERT_NE(class_loader, nullptr);
186*795d594fSAndroid Build Coastguard Worker 
187*795d594fSAndroid Build Coastguard Worker   // Save virtual methods from Main.
188*795d594fSAndroid Build Coastguard Worker   std::vector<ArtMethod*> main_methods = GetVirtualMethods(class_loader, "LMain;");
189*795d594fSAndroid Build Coastguard Worker   ASSERT_TRUE(SaveProfilingInfo(
190*795d594fSAndroid Build Coastguard Worker       profile.GetFilename(),
191*795d594fSAndroid Build Coastguard Worker       main_methods,
192*795d594fSAndroid Build Coastguard Worker       static_cast<Hotness::Flag>(Hotness::kFlagHot | Hotness::kFlagPostStartup)));
193*795d594fSAndroid Build Coastguard Worker 
194*795d594fSAndroid Build Coastguard Worker   // Check that what we saved is in the profile.
195*795d594fSAndroid Build Coastguard Worker   ProfileCompilationInfo info1;
196*795d594fSAndroid Build Coastguard Worker   ASSERT_TRUE(info1.Load(profile.GetFilename(), /*clear_if_invalid=*/false));
197*795d594fSAndroid Build Coastguard Worker   ASSERT_EQ(info1.GetNumberOfMethods(), main_methods.size());
198*795d594fSAndroid Build Coastguard Worker   {
199*795d594fSAndroid Build Coastguard Worker     ScopedObjectAccess soa(self);
200*795d594fSAndroid Build Coastguard Worker     for (ArtMethod* m : main_methods) {
201*795d594fSAndroid Build Coastguard Worker       Hotness h = info1.GetMethodHotness(MethodReference(m->GetDexFile(), m->GetDexMethodIndex()));
202*795d594fSAndroid Build Coastguard Worker       ASSERT_TRUE(h.IsHot());
203*795d594fSAndroid Build Coastguard Worker       ASSERT_TRUE(h.IsPostStartup());
204*795d594fSAndroid Build Coastguard Worker     }
205*795d594fSAndroid Build Coastguard Worker   }
206*795d594fSAndroid Build Coastguard Worker 
207*795d594fSAndroid Build Coastguard Worker   // Save virtual methods from Second.
208*795d594fSAndroid Build Coastguard Worker   std::vector<ArtMethod*> second_methods = GetVirtualMethods(class_loader, "LSecond;");
209*795d594fSAndroid Build Coastguard Worker   ASSERT_TRUE(SaveProfilingInfo(
210*795d594fSAndroid Build Coastguard Worker     profile.GetFilename(),
211*795d594fSAndroid Build Coastguard Worker     second_methods,
212*795d594fSAndroid Build Coastguard Worker     static_cast<Hotness::Flag>(Hotness::kFlagHot | Hotness::kFlagStartup)));
213*795d594fSAndroid Build Coastguard Worker 
214*795d594fSAndroid Build Coastguard Worker   // Check that what we saved is in the profile (methods form Main and Second).
215*795d594fSAndroid Build Coastguard Worker   ProfileCompilationInfo info2;
216*795d594fSAndroid Build Coastguard Worker   ASSERT_TRUE(info2.Load(profile.GetFilename(), /*clear_if_invalid=*/false));
217*795d594fSAndroid Build Coastguard Worker   ASSERT_EQ(info2.GetNumberOfMethods(), main_methods.size() + second_methods.size());
218*795d594fSAndroid Build Coastguard Worker   {
219*795d594fSAndroid Build Coastguard Worker     ScopedObjectAccess soa(self);
220*795d594fSAndroid Build Coastguard Worker     for (ArtMethod* m : main_methods) {
221*795d594fSAndroid Build Coastguard Worker       Hotness h = info2.GetMethodHotness(MethodReference(m->GetDexFile(), m->GetDexMethodIndex()));
222*795d594fSAndroid Build Coastguard Worker       ASSERT_TRUE(h.IsHot());
223*795d594fSAndroid Build Coastguard Worker       ASSERT_TRUE(h.IsPostStartup());
224*795d594fSAndroid Build Coastguard Worker     }
225*795d594fSAndroid Build Coastguard Worker     for (ArtMethod* m : second_methods) {
226*795d594fSAndroid Build Coastguard Worker       Hotness h = info2.GetMethodHotness(MethodReference(m->GetDexFile(), m->GetDexMethodIndex()));
227*795d594fSAndroid Build Coastguard Worker       ASSERT_TRUE(h.IsHot());
228*795d594fSAndroid Build Coastguard Worker       ASSERT_TRUE(h.IsStartup());
229*795d594fSAndroid Build Coastguard Worker     }
230*795d594fSAndroid Build Coastguard Worker   }
231*795d594fSAndroid Build Coastguard Worker }
232*795d594fSAndroid Build Coastguard Worker 
TEST_F(ProfileCompilationInfoTest,SaveArtMethodsWithInlineCaches)233*795d594fSAndroid Build Coastguard Worker TEST_F(ProfileCompilationInfoTest, SaveArtMethodsWithInlineCaches) {
234*795d594fSAndroid Build Coastguard Worker   ScratchFile profile;
235*795d594fSAndroid Build Coastguard Worker 
236*795d594fSAndroid Build Coastguard Worker   Thread* self = Thread::Current();
237*795d594fSAndroid Build Coastguard Worker   jobject class_loader;
238*795d594fSAndroid Build Coastguard Worker   {
239*795d594fSAndroid Build Coastguard Worker     ScopedObjectAccess soa(self);
240*795d594fSAndroid Build Coastguard Worker     class_loader = LoadDex("ProfileTestMultiDex");
241*795d594fSAndroid Build Coastguard Worker   }
242*795d594fSAndroid Build Coastguard Worker   ASSERT_NE(class_loader, nullptr);
243*795d594fSAndroid Build Coastguard Worker 
244*795d594fSAndroid Build Coastguard Worker   // Save virtual methods from Main.
245*795d594fSAndroid Build Coastguard Worker   std::vector<ArtMethod*> main_methods = GetVirtualMethods(class_loader, "LMain;");
246*795d594fSAndroid Build Coastguard Worker 
247*795d594fSAndroid Build Coastguard Worker   SafeMap<ArtMethod*, ProfileMethodInfo> profile_methods_map;
248*795d594fSAndroid Build Coastguard Worker   ASSERT_TRUE(SaveProfilingInfoWithFakeInlineCaches(
249*795d594fSAndroid Build Coastguard Worker       profile.GetFilename(),
250*795d594fSAndroid Build Coastguard Worker       main_methods,
251*795d594fSAndroid Build Coastguard Worker       static_cast<Hotness::Flag>(Hotness::kFlagHot | Hotness::kFlagStartup),
252*795d594fSAndroid Build Coastguard Worker       &profile_methods_map));
253*795d594fSAndroid Build Coastguard Worker 
254*795d594fSAndroid Build Coastguard Worker   // Check that what we saved is in the profile.
255*795d594fSAndroid Build Coastguard Worker   ProfileCompilationInfo info;
256*795d594fSAndroid Build Coastguard Worker   ASSERT_TRUE(info.Load(profile.GetFilename(), /*clear_if_invalid=*/false));
257*795d594fSAndroid Build Coastguard Worker   ASSERT_EQ(info.GetNumberOfMethods(), main_methods.size());
258*795d594fSAndroid Build Coastguard Worker   {
259*795d594fSAndroid Build Coastguard Worker     ScopedObjectAccess soa(self);
260*795d594fSAndroid Build Coastguard Worker     for (ArtMethod* m : main_methods) {
261*795d594fSAndroid Build Coastguard Worker       MethodReference method_ref(m->GetDexFile(), m->GetDexMethodIndex());
262*795d594fSAndroid Build Coastguard Worker       Hotness h = info.GetMethodHotness(method_ref);
263*795d594fSAndroid Build Coastguard Worker       ASSERT_TRUE(h.IsHot());
264*795d594fSAndroid Build Coastguard Worker       ASSERT_TRUE(h.IsStartup());
265*795d594fSAndroid Build Coastguard Worker       const ProfileMethodInfo& pmi = profile_methods_map.find(m)->second;
266*795d594fSAndroid Build Coastguard Worker       ProfileCompilationInfo::MethodHotness offline_hotness = info.GetMethodHotness(method_ref);
267*795d594fSAndroid Build Coastguard Worker       ASSERT_TRUE(offline_hotness.IsHot());
268*795d594fSAndroid Build Coastguard Worker       ASSERT_TRUE(ProfileTestHelper::EqualInlineCaches(
269*795d594fSAndroid Build Coastguard Worker                       pmi.inline_caches, method_ref.dex_file, offline_hotness, info));
270*795d594fSAndroid Build Coastguard Worker     }
271*795d594fSAndroid Build Coastguard Worker   }
272*795d594fSAndroid Build Coastguard Worker }
273*795d594fSAndroid Build Coastguard Worker 
274*795d594fSAndroid Build Coastguard Worker }  // namespace art
275