| 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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 const char* name) { | 750 const char* name) { |
| 751 for (int i = 0; i < parent->children()->length(); ++i) { | 751 for (int i = 0; i < parent->children()->length(); ++i) { |
| 752 const ProfileNode* child = parent->children()->at(i); | 752 const ProfileNode* child = parent->children()->at(i); |
| 753 if (strcmp(child->entry()->name(), name) == 0) return child; | 753 if (strcmp(child->entry()->name(), name) == 0) return child; |
| 754 } | 754 } |
| 755 return NULL; | 755 return NULL; |
| 756 } | 756 } |
| 757 | 757 |
| 758 | 758 |
| 759 TEST(RecordStackTraceAtStartProfiling) { | 759 TEST(RecordStackTraceAtStartProfiling) { |
| 760 // This test does not pass with inlining enabled since inlined functions |
| 761 // don't appear in the stack trace. |
| 762 i::FLAG_use_inlining = false; |
| 763 |
| 760 if (env.IsEmpty()) { | 764 if (env.IsEmpty()) { |
| 761 v8::HandleScope scope; | 765 v8::HandleScope scope; |
| 762 const char* extensions[] = { "v8/profiler" }; | 766 const char* extensions[] = { "v8/profiler" }; |
| 763 v8::ExtensionConfiguration config(1, extensions); | 767 v8::ExtensionConfiguration config(1, extensions); |
| 764 env = v8::Context::New(&config); | 768 env = v8::Context::New(&config); |
| 765 } | 769 } |
| 766 v8::HandleScope scope; | 770 v8::HandleScope scope; |
| 767 env->Enter(); | 771 env->Enter(); |
| 768 | 772 |
| 769 CHECK_EQ(0, CpuProfiler::GetProfilesCount()); | 773 CHECK_EQ(0, CpuProfiler::GetProfilesCount()); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 CHECK(collection.StartProfiling(title.start(), i + 1)); // UID must be > 0. | 810 CHECK(collection.StartProfiling(title.start(), i + 1)); // UID must be > 0. |
| 807 titles[i] = title.start(); | 811 titles[i] = title.start(); |
| 808 } | 812 } |
| 809 CHECK(!collection.StartProfiling( | 813 CHECK(!collection.StartProfiling( |
| 810 "maximum", CpuProfilesCollection::kMaxSimultaneousProfiles + 1)); | 814 "maximum", CpuProfilesCollection::kMaxSimultaneousProfiles + 1)); |
| 811 for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i) | 815 for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i) |
| 812 i::DeleteArray(titles[i]); | 816 i::DeleteArray(titles[i]); |
| 813 } | 817 } |
| 814 | 818 |
| 815 #endif // ENABLE_LOGGING_AND_PROFILING | 819 #endif // ENABLE_LOGGING_AND_PROFILING |
| OLD | NEW |