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_CPP_PROFILES_PROCESSOR | 5 #ifdef ENABLE_CPP_PROFILES_PROCESSOR |
6 | 6 |
7 #include "v8.h" | 7 #include "v8.h" |
8 #include "cpu-profiler-inl.h" | 8 #include "cpu-profiler-inl.h" |
9 #include "cctest.h" | 9 #include "cctest.h" |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 ProfilerEventsProcessor processor(&generator); | 88 ProfilerEventsProcessor processor(&generator); |
89 processor.Start(); | 89 processor.Start(); |
90 while (!processor.running()) { | 90 while (!processor.running()) { |
91 i::Thread::YieldCPU(); | 91 i::Thread::YieldCPU(); |
92 } | 92 } |
93 | 93 |
94 // Enqueue code creation events. | 94 // Enqueue code creation events. |
95 i::HandleScope scope; | 95 i::HandleScope scope; |
96 const char* aaa_str = "aaa"; | 96 const char* aaa_str = "aaa"; |
97 i::Handle<i::String> aaa_name = i::Factory::NewStringFromAscii( | 97 i::Handle<i::String> aaa_name = i::Factory::NewStringFromAscii( |
98 i::Vector<const char>(aaa_str, strlen(aaa_str))); | 98 i::Vector<const char>(aaa_str, i::StrLength(aaa_str))); |
99 processor.CodeCreateEvent(i::Logger::FUNCTION_TAG, | 99 processor.CodeCreateEvent(i::Logger::FUNCTION_TAG, |
100 *aaa_name, | 100 *aaa_name, |
101 i::Heap::empty_string(), | 101 i::Heap::empty_string(), |
102 0, | 102 0, |
103 ToAddress(0x1000), | 103 ToAddress(0x1000), |
104 0x100); | 104 0x100); |
105 processor.CodeCreateEvent(i::Logger::BUILTIN_TAG, | 105 processor.CodeCreateEvent(i::Logger::BUILTIN_TAG, |
106 "bbb", | 106 "bbb", |
107 ToAddress(0x1200), | 107 ToAddress(0x1200), |
108 0x80); | 108 0x80); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 bottom_up_root_children[2]->children(); | 216 bottom_up_root_children[2]->children(); |
217 CHECK_EQ(1, bottom_up_ddd_children->length()); | 217 CHECK_EQ(1, bottom_up_ddd_children->length()); |
218 CHECK_EQ("5", bottom_up_ddd_children->last()->entry()->name()); | 218 CHECK_EQ("5", bottom_up_ddd_children->last()->entry()->name()); |
219 const i::List<ProfileNode*>* bottom_up_ddd_stub_children = | 219 const i::List<ProfileNode*>* bottom_up_ddd_stub_children = |
220 bottom_up_ddd_children->last()->children(); | 220 bottom_up_ddd_children->last()->children(); |
221 CHECK_EQ(1, bottom_up_ddd_stub_children->length()); | 221 CHECK_EQ(1, bottom_up_ddd_stub_children->length()); |
222 CHECK_EQ("bbb", bottom_up_ddd_stub_children->last()->entry()->name()); | 222 CHECK_EQ("bbb", bottom_up_ddd_stub_children->last()->entry()->name()); |
223 } | 223 } |
224 | 224 |
225 #endif // ENABLE_CPP_PROFILES_PROCESSOR | 225 #endif // ENABLE_CPP_PROFILES_PROCESSOR |
OLD | NEW |