OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // | 2 // |
3 // Tests of profiles generator and utilities. | 3 // Tests of profiles generator and utilities. |
4 | 4 |
5 #ifdef ENABLE_LOGGING_AND_PROFILING | 5 #ifdef ENABLE_LOGGING_AND_PROFILING |
6 | 6 |
7 #include "v8.h" | 7 #include "v8.h" |
8 #include "profile-generator-inl.h" | 8 #include "profile-generator-inl.h" |
9 #include "cctest.h" | 9 #include "cctest.h" |
10 #include "../include/v8-profiler.h" | 10 #include "../include/v8-profiler.h" |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 CHECK_NE(NULL, const_cast<ProfileNode*>(current)); | 768 CHECK_NE(NULL, const_cast<ProfileNode*>(current)); |
769 current = PickChild(current, "a"); | 769 current = PickChild(current, "a"); |
770 CHECK_NE(NULL, const_cast<ProfileNode*>(current)); | 770 CHECK_NE(NULL, const_cast<ProfileNode*>(current)); |
771 current = PickChild(current, "b"); | 771 current = PickChild(current, "b"); |
772 CHECK_NE(NULL, const_cast<ProfileNode*>(current)); | 772 CHECK_NE(NULL, const_cast<ProfileNode*>(current)); |
773 current = PickChild(current, "c"); | 773 current = PickChild(current, "c"); |
774 CHECK_NE(NULL, const_cast<ProfileNode*>(current)); | 774 CHECK_NE(NULL, const_cast<ProfileNode*>(current)); |
775 CHECK_EQ(0, current->children()->length()); | 775 CHECK_EQ(0, current->children()->length()); |
776 } | 776 } |
777 | 777 |
| 778 |
| 779 TEST(Issue51919) { |
| 780 CpuProfilesCollection collection; |
| 781 i::EmbeddedVector<char*, |
| 782 CpuProfilesCollection::kMaxSimultaneousProfiles> titles; |
| 783 for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i) { |
| 784 i::Vector<char> title = i::Vector<char>::New(16); |
| 785 i::OS::SNPrintF(title, "%d", i); |
| 786 CHECK(collection.StartProfiling(title.start(), i + 1)); // UID must be > 0. |
| 787 titles[i] = title.start(); |
| 788 } |
| 789 CHECK(!collection.StartProfiling( |
| 790 "maximum", CpuProfilesCollection::kMaxSimultaneousProfiles + 1)); |
| 791 for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i) |
| 792 i::DeleteArray(titles[i]); |
| 793 } |
| 794 |
778 #endif // ENABLE_LOGGING_AND_PROFILING | 795 #endif // ENABLE_LOGGING_AND_PROFILING |
OLD | NEW |