OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 processor->StopSynchronously(); | 163 processor->StopSynchronously(); |
164 | 164 |
165 // Check the state of profile generator. | 165 // Check the state of profile generator. |
166 CodeEntry* aaa = generator.code_map()->FindEntry(aaa_code->address()); | 166 CodeEntry* aaa = generator.code_map()->FindEntry(aaa_code->address()); |
167 CHECK(aaa); | 167 CHECK(aaa); |
168 CHECK_EQ(aaa_str, aaa->name()); | 168 CHECK_EQ(aaa_str, aaa->name()); |
169 | 169 |
170 CodeEntry* comment = generator.code_map()->FindEntry(comment_code->address()); | 170 CodeEntry* comment = generator.code_map()->FindEntry(comment_code->address()); |
171 CHECK(comment); | 171 CHECK(comment); |
172 CHECK_EQ("comment", comment->name()); | 172 CHECK_EQ(0, strcmp("comment", comment->name())); |
173 | 173 |
174 CodeEntry* args5 = generator.code_map()->FindEntry(args5_code->address()); | 174 CodeEntry* args5 = generator.code_map()->FindEntry(args5_code->address()); |
175 CHECK(args5); | 175 CHECK(args5); |
176 CHECK_EQ("5", args5->name()); | 176 CHECK_EQ(0, strcmp("5", args5->name())); |
177 | 177 |
178 CHECK(!generator.code_map()->FindEntry(comment2_code->address())); | 178 CHECK(!generator.code_map()->FindEntry(comment2_code->address())); |
179 | 179 |
180 CodeEntry* comment2 = generator.code_map()->FindEntry(moved_code->address()); | 180 CodeEntry* comment2 = generator.code_map()->FindEntry(moved_code->address()); |
181 CHECK(comment2); | 181 CHECK(comment2); |
182 CHECK_EQ("comment2", comment2->name()); | 182 CHECK_EQ(0, strcmp("comment2", comment2->name())); |
183 } | 183 } |
184 | 184 |
185 | 185 |
186 template<typename T> | 186 template<typename T> |
187 static int CompareProfileNodes(const T* p1, const T* p2) { | 187 static int CompareProfileNodes(const T* p1, const T* p2) { |
188 return strcmp((*p1)->entry()->name(), (*p2)->entry()->name()); | 188 return strcmp((*p1)->entry()->name(), (*p2)->entry()->name()); |
189 } | 189 } |
190 | 190 |
191 | 191 |
192 TEST(TickEvents) { | 192 TEST(TickEvents) { |
(...skipping 30 matching lines...) Expand all Loading... |
223 frame1_code->instruction_end() - 1); | 223 frame1_code->instruction_end() - 1); |
224 | 224 |
225 processor->StopSynchronously(); | 225 processor->StopSynchronously(); |
226 CpuProfile* profile = profiles->StopProfiling(""); | 226 CpuProfile* profile = profiles->StopProfiling(""); |
227 CHECK(profile); | 227 CHECK(profile); |
228 | 228 |
229 // Check call trees. | 229 // Check call trees. |
230 const i::List<ProfileNode*>* top_down_root_children = | 230 const i::List<ProfileNode*>* top_down_root_children = |
231 profile->top_down()->root()->children(); | 231 profile->top_down()->root()->children(); |
232 CHECK_EQ(1, top_down_root_children->length()); | 232 CHECK_EQ(1, top_down_root_children->length()); |
233 CHECK_EQ("bbb", top_down_root_children->last()->entry()->name()); | 233 CHECK_EQ(0, strcmp("bbb", top_down_root_children->last()->entry()->name())); |
234 const i::List<ProfileNode*>* top_down_bbb_children = | 234 const i::List<ProfileNode*>* top_down_bbb_children = |
235 top_down_root_children->last()->children(); | 235 top_down_root_children->last()->children(); |
236 CHECK_EQ(1, top_down_bbb_children->length()); | 236 CHECK_EQ(1, top_down_bbb_children->length()); |
237 CHECK_EQ("5", top_down_bbb_children->last()->entry()->name()); | 237 CHECK_EQ(0, strcmp("5", top_down_bbb_children->last()->entry()->name())); |
238 const i::List<ProfileNode*>* top_down_stub_children = | 238 const i::List<ProfileNode*>* top_down_stub_children = |
239 top_down_bbb_children->last()->children(); | 239 top_down_bbb_children->last()->children(); |
240 CHECK_EQ(1, top_down_stub_children->length()); | 240 CHECK_EQ(1, top_down_stub_children->length()); |
241 CHECK_EQ("ddd", top_down_stub_children->last()->entry()->name()); | 241 CHECK_EQ(0, strcmp("ddd", top_down_stub_children->last()->entry()->name())); |
242 const i::List<ProfileNode*>* top_down_ddd_children = | 242 const i::List<ProfileNode*>* top_down_ddd_children = |
243 top_down_stub_children->last()->children(); | 243 top_down_stub_children->last()->children(); |
244 CHECK_EQ(0, top_down_ddd_children->length()); | 244 CHECK_EQ(0, top_down_ddd_children->length()); |
245 } | 245 } |
246 | 246 |
247 | 247 |
248 // http://crbug/51594 | 248 // http://crbug/51594 |
249 // This test must not crash. | 249 // This test must not crash. |
250 TEST(CrashIfStoppingLastNonExistentProfile) { | 250 TEST(CrashIfStoppingLastNonExistentProfile) { |
251 CcTest::InitializeVM(); | 251 CcTest::InitializeVM(); |
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1772 inner_profile = NULL; | 1772 inner_profile = NULL; |
1773 CHECK_EQ(0, iprofiler->GetProfilesCount()); | 1773 CHECK_EQ(0, iprofiler->GetProfilesCount()); |
1774 | 1774 |
1775 v8::CpuProfile* outer_profile = profiler->StopProfiling(outer); | 1775 v8::CpuProfile* outer_profile = profiler->StopProfiling(outer); |
1776 CHECK(outer_profile); | 1776 CHECK(outer_profile); |
1777 CHECK_EQ(1, iprofiler->GetProfilesCount()); | 1777 CHECK_EQ(1, iprofiler->GetProfilesCount()); |
1778 outer_profile->Delete(); | 1778 outer_profile->Delete(); |
1779 outer_profile = NULL; | 1779 outer_profile = NULL; |
1780 CHECK_EQ(0, iprofiler->GetProfilesCount()); | 1780 CHECK_EQ(0, iprofiler->GetProfilesCount()); |
1781 } | 1781 } |
OLD | NEW |