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 #include "v8.h" | 5 #include "v8.h" |
6 #include "cpu-profiler-inl.h" | 6 #include "cpu-profiler-inl.h" |
7 #include "cctest.h" | 7 #include "cctest.h" |
8 #include "../include/v8-profiler.h" | 8 #include "../include/v8-profiler.h" |
9 | 9 |
10 using i::CodeEntry; | 10 using i::CodeEntry; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 "bbb", | 100 "bbb", |
101 ToAddress(0x1200), | 101 ToAddress(0x1200), |
102 0x80); | 102 0x80); |
103 processor.CodeCreateEvent(i::Logger::STUB_TAG, 5, ToAddress(0x1300), 0x10); | 103 processor.CodeCreateEvent(i::Logger::STUB_TAG, 5, ToAddress(0x1300), 0x10); |
104 processor.CodeCreateEvent(i::Logger::BUILTIN_TAG, | 104 processor.CodeCreateEvent(i::Logger::BUILTIN_TAG, |
105 "ddd", | 105 "ddd", |
106 ToAddress(0x1400), | 106 ToAddress(0x1400), |
107 0x80); | 107 0x80); |
108 processor.CodeMoveEvent(ToAddress(0x1400), ToAddress(0x1500)); | 108 processor.CodeMoveEvent(ToAddress(0x1400), ToAddress(0x1500)); |
109 processor.CodeCreateEvent(i::Logger::STUB_TAG, 3, ToAddress(0x1600), 0x10); | 109 processor.CodeCreateEvent(i::Logger::STUB_TAG, 3, ToAddress(0x1600), 0x10); |
110 processor.CodeDeleteEvent(ToAddress(0x1600)); | 110 processor.CodeCreateEvent(i::Logger::STUB_TAG, 4, ToAddress(0x1605), 0x10); |
111 // Enqueue a tick event to enable code events processing. | 111 // Enqueue a tick event to enable code events processing. |
112 EnqueueTickSampleEvent(&processor, ToAddress(0x1000)); | 112 EnqueueTickSampleEvent(&processor, ToAddress(0x1000)); |
113 | 113 |
114 processor.Stop(); | 114 processor.Stop(); |
115 processor.Join(); | 115 processor.Join(); |
116 | 116 |
117 // Check the state of profile generator. | 117 // Check the state of profile generator. |
118 CodeEntry* entry1 = generator.code_map()->FindEntry(ToAddress(0x1000)); | 118 CodeEntry* entry1 = generator.code_map()->FindEntry(ToAddress(0x1000)); |
119 CHECK_NE(NULL, entry1); | 119 CHECK_NE(NULL, entry1); |
120 CHECK_EQ(aaa_str, entry1->name()); | 120 CHECK_EQ(aaa_str, entry1->name()); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 CHECK_EQ(NULL, v8::CpuProfiler::FindProfile(uid2)); | 390 CHECK_EQ(NULL, v8::CpuProfiler::FindProfile(uid2)); |
391 CHECK_EQ(p3, v8::CpuProfiler::FindProfile(uid3)); | 391 CHECK_EQ(p3, v8::CpuProfiler::FindProfile(uid3)); |
392 const_cast<v8::CpuProfile*>(p2)->Delete(); | 392 const_cast<v8::CpuProfile*>(p2)->Delete(); |
393 CHECK_EQ(1, v8::CpuProfiler::GetProfilesCount()); | 393 CHECK_EQ(1, v8::CpuProfiler::GetProfilesCount()); |
394 CHECK_EQ(NULL, v8::CpuProfiler::FindProfile(uid2)); | 394 CHECK_EQ(NULL, v8::CpuProfiler::FindProfile(uid2)); |
395 CHECK_EQ(p3, v8::CpuProfiler::FindProfile(uid3)); | 395 CHECK_EQ(p3, v8::CpuProfiler::FindProfile(uid3)); |
396 const_cast<v8::CpuProfile*>(p3)->Delete(); | 396 const_cast<v8::CpuProfile*>(p3)->Delete(); |
397 CHECK_EQ(0, CpuProfiler::GetProfilesCount()); | 397 CHECK_EQ(0, CpuProfiler::GetProfilesCount()); |
398 CHECK_EQ(NULL, v8::CpuProfiler::FindProfile(uid3)); | 398 CHECK_EQ(NULL, v8::CpuProfiler::FindProfile(uid3)); |
399 } | 399 } |
OLD | NEW |