| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 CHECK_EQ(1, te.GetTokenId(*v8::Utils::OpenHandle(*token2))); | 49 CHECK_EQ(1, te.GetTokenId(*v8::Utils::OpenHandle(*token2))); |
| 50 CHECK_EQ(0, te.GetTokenId(*v8::Utils::OpenHandle(*token1))); | 50 CHECK_EQ(0, te.GetTokenId(*v8::Utils::OpenHandle(*token1))); |
| 51 { | 51 { |
| 52 v8::HandleScope hs; | 52 v8::HandleScope hs; |
| 53 v8::Local<v8::String> token3(v8::String::New("3")); | 53 v8::Local<v8::String> token3(v8::String::New("3")); |
| 54 CHECK_EQ(2, te.GetTokenId(*v8::Utils::OpenHandle(*token3))); | 54 CHECK_EQ(2, te.GetTokenId(*v8::Utils::OpenHandle(*token3))); |
| 55 CHECK_EQ(1, te.GetTokenId(*v8::Utils::OpenHandle(*token2))); | 55 CHECK_EQ(1, te.GetTokenId(*v8::Utils::OpenHandle(*token2))); |
| 56 CHECK_EQ(0, te.GetTokenId(*v8::Utils::OpenHandle(*token1))); | 56 CHECK_EQ(0, te.GetTokenId(*v8::Utils::OpenHandle(*token1))); |
| 57 } | 57 } |
| 58 CHECK(!i::TokenEnumeratorTester::token_removed(&te)->at(2)); | 58 CHECK(!i::TokenEnumeratorTester::token_removed(&te)->at(2)); |
| 59 i::Heap::CollectAllGarbage(false); | 59 i::Heap::CollectAllGarbage(i::Heap::kNoGCFlags); |
| 60 CHECK(i::TokenEnumeratorTester::token_removed(&te)->at(2)); | 60 CHECK(i::TokenEnumeratorTester::token_removed(&te)->at(2)); |
| 61 CHECK_EQ(1, te.GetTokenId(*v8::Utils::OpenHandle(*token2))); | 61 CHECK_EQ(1, te.GetTokenId(*v8::Utils::OpenHandle(*token2))); |
| 62 CHECK_EQ(0, te.GetTokenId(*v8::Utils::OpenHandle(*token1))); | 62 CHECK_EQ(0, te.GetTokenId(*v8::Utils::OpenHandle(*token1))); |
| 63 } | 63 } |
| 64 | 64 |
| 65 | 65 |
| 66 TEST(ProfileNodeFindOrAddChild) { | 66 TEST(ProfileNodeFindOrAddChild) { |
| 67 ProfileNode node(NULL, NULL); | 67 ProfileNode node(NULL, NULL); |
| 68 CodeEntry entry1(i::Logger::FUNCTION_TAG, "", "aaa", "", 0, | 68 CodeEntry entry1(i::Logger::FUNCTION_TAG, "", "aaa", "", 0, |
| 69 TokenEnumerator::kNoSecurityToken); | 69 TokenEnumerator::kNoSecurityToken); |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 CHECK(collection.StartProfiling(title.start(), i + 1)); // UID must be > 0. | 819 CHECK(collection.StartProfiling(title.start(), i + 1)); // UID must be > 0. |
| 820 titles[i] = title.start(); | 820 titles[i] = title.start(); |
| 821 } | 821 } |
| 822 CHECK(!collection.StartProfiling( | 822 CHECK(!collection.StartProfiling( |
| 823 "maximum", CpuProfilesCollection::kMaxSimultaneousProfiles + 1)); | 823 "maximum", CpuProfilesCollection::kMaxSimultaneousProfiles + 1)); |
| 824 for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i) | 824 for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i) |
| 825 i::DeleteArray(titles[i]); | 825 i::DeleteArray(titles[i]); |
| 826 } | 826 } |
| 827 | 827 |
| 828 #endif // ENABLE_LOGGING_AND_PROFILING | 828 #endif // ENABLE_LOGGING_AND_PROFILING |
| OLD | NEW |