OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 13 matching lines...) Expand all Loading... |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 // | 27 // |
28 // Tests of profiles generator and utilities. | 28 // Tests of profiles generator and utilities. |
29 | 29 |
30 #include "src/v8.h" | 30 #include "src/v8.h" |
31 | 31 |
32 #include "include/v8-profiler.h" | 32 #include "include/v8-profiler.h" |
33 #include "src/base/platform/platform.h" | 33 #include "src/base/platform/platform.h" |
34 #include "src/base/smart-pointers.h" | |
35 #include "src/deoptimizer.h" | 34 #include "src/deoptimizer.h" |
36 #include "src/profiler/cpu-profiler-inl.h" | 35 #include "src/profiler/cpu-profiler-inl.h" |
37 #include "src/utils.h" | 36 #include "src/utils.h" |
38 #include "test/cctest/cctest.h" | 37 #include "test/cctest/cctest.h" |
39 #include "test/cctest/profiler-extension.h" | 38 #include "test/cctest/profiler-extension.h" |
| 39 |
40 using i::CodeEntry; | 40 using i::CodeEntry; |
41 using i::CpuProfile; | 41 using i::CpuProfile; |
42 using i::CpuProfiler; | 42 using i::CpuProfiler; |
43 using i::CpuProfilesCollection; | 43 using i::CpuProfilesCollection; |
44 using i::Heap; | 44 using i::Heap; |
45 using i::ProfileGenerator; | 45 using i::ProfileGenerator; |
46 using i::ProfileNode; | 46 using i::ProfileNode; |
47 using i::ProfilerEventsProcessor; | 47 using i::ProfilerEventsProcessor; |
48 using i::ScopedVector; | 48 using i::ScopedVector; |
49 using i::Vector; | 49 using i::Vector; |
50 using v8::base::SmartPointer; | |
51 | |
52 | 50 |
53 // Helper methods | 51 // Helper methods |
54 static v8::Local<v8::Function> GetFunction(v8::Local<v8::Context> env, | 52 static v8::Local<v8::Function> GetFunction(v8::Local<v8::Context> env, |
55 const char* name) { | 53 const char* name) { |
56 return v8::Local<v8::Function>::Cast( | 54 return v8::Local<v8::Function>::Cast( |
57 env->Global()->Get(env, v8_str(name)).ToLocalChecked()); | 55 env->Global()->Get(env, v8_str(name)).ToLocalChecked()); |
58 } | 56 } |
59 | 57 |
60 | |
61 static size_t offset(const char* src, const char* substring) { | 58 static size_t offset(const char* src, const char* substring) { |
62 const char* it = strstr(src, substring); | 59 const char* it = strstr(src, substring); |
63 CHECK(it); | 60 CHECK(it); |
64 return static_cast<size_t>(it - src); | 61 return static_cast<size_t>(it - src); |
65 } | 62 } |
66 | 63 |
67 | |
68 static const char* reason(const i::Deoptimizer::DeoptReason reason) { | 64 static const char* reason(const i::Deoptimizer::DeoptReason reason) { |
69 return i::Deoptimizer::GetDeoptReason(reason); | 65 return i::Deoptimizer::GetDeoptReason(reason); |
70 } | 66 } |
71 | 67 |
72 | |
73 TEST(StartStop) { | 68 TEST(StartStop) { |
74 i::Isolate* isolate = CcTest::i_isolate(); | 69 CpuProfilesCollection profiles(CcTest::i_isolate()); |
75 CpuProfilesCollection profiles(isolate->heap()); | |
76 ProfileGenerator generator(&profiles); | 70 ProfileGenerator generator(&profiles); |
77 SmartPointer<ProfilerEventsProcessor> processor(new ProfilerEventsProcessor( | 71 std::unique_ptr<ProfilerEventsProcessor> processor( |
78 &generator, NULL, v8::base::TimeDelta::FromMicroseconds(100))); | 72 new ProfilerEventsProcessor(&generator, nullptr, |
| 73 v8::base::TimeDelta::FromMicroseconds(100))); |
79 processor->Start(); | 74 processor->Start(); |
80 processor->StopSynchronously(); | 75 processor->StopSynchronously(); |
81 } | 76 } |
82 | 77 |
83 | |
84 static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc, | 78 static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc, |
85 i::Address frame1, | 79 i::Address frame1, |
86 i::Address frame2 = NULL, | 80 i::Address frame2 = NULL, |
87 i::Address frame3 = NULL) { | 81 i::Address frame3 = NULL) { |
88 i::TickSample* sample = proc->StartTickSample(); | 82 i::TickSample* sample = proc->StartTickSample(); |
89 sample->pc = frame1; | 83 sample->pc = frame1; |
90 sample->tos = frame1; | 84 sample->tos = frame1; |
91 sample->frames_count = 0; | 85 sample->frames_count = 0; |
92 if (frame2 != NULL) { | 86 if (frame2 != NULL) { |
93 sample->stack[0] = frame2; | 87 sample->stack[0] = frame2; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 i::HandleScope scope(isolate); | 144 i::HandleScope scope(isolate); |
151 | 145 |
152 i::AbstractCode* aaa_code = CreateCode(&env); | 146 i::AbstractCode* aaa_code = CreateCode(&env); |
153 i::AbstractCode* comment_code = CreateCode(&env); | 147 i::AbstractCode* comment_code = CreateCode(&env); |
154 i::AbstractCode* args5_code = CreateCode(&env); | 148 i::AbstractCode* args5_code = CreateCode(&env); |
155 i::AbstractCode* comment2_code = CreateCode(&env); | 149 i::AbstractCode* comment2_code = CreateCode(&env); |
156 i::AbstractCode* moved_code = CreateCode(&env); | 150 i::AbstractCode* moved_code = CreateCode(&env); |
157 i::AbstractCode* args3_code = CreateCode(&env); | 151 i::AbstractCode* args3_code = CreateCode(&env); |
158 i::AbstractCode* args4_code = CreateCode(&env); | 152 i::AbstractCode* args4_code = CreateCode(&env); |
159 | 153 |
160 CpuProfilesCollection* profiles = new CpuProfilesCollection(isolate->heap()); | 154 CpuProfilesCollection* profiles = new CpuProfilesCollection(isolate); |
| 155 ProfileGenerator* generator = new ProfileGenerator(profiles); |
| 156 ProfilerEventsProcessor* processor = new ProfilerEventsProcessor( |
| 157 generator, nullptr, v8::base::TimeDelta::FromMicroseconds(100)); |
| 158 CpuProfiler profiler(isolate, profiles, generator, processor); |
161 profiles->StartProfiling("", false); | 159 profiles->StartProfiling("", false); |
162 ProfileGenerator generator(profiles); | |
163 SmartPointer<ProfilerEventsProcessor> processor(new ProfilerEventsProcessor( | |
164 &generator, NULL, v8::base::TimeDelta::FromMicroseconds(100))); | |
165 processor->Start(); | 160 processor->Start(); |
166 CpuProfiler profiler(isolate, profiles, &generator, processor.get()); | |
167 | 161 |
168 // Enqueue code creation events. | 162 // Enqueue code creation events. |
169 const char* aaa_str = "aaa"; | 163 const char* aaa_str = "aaa"; |
170 i::Handle<i::String> aaa_name = factory->NewStringFromAsciiChecked(aaa_str); | 164 i::Handle<i::String> aaa_name = factory->NewStringFromAsciiChecked(aaa_str); |
171 profiler.CodeCreateEvent(i::Logger::FUNCTION_TAG, aaa_code, *aaa_name); | 165 profiler.CodeCreateEvent(i::Logger::FUNCTION_TAG, aaa_code, *aaa_name); |
172 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, comment_code, "comment"); | 166 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, comment_code, "comment"); |
173 profiler.CodeCreateEvent(i::Logger::STUB_TAG, args5_code, 5); | 167 profiler.CodeCreateEvent(i::Logger::STUB_TAG, args5_code, 5); |
174 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, comment2_code, "comment2"); | 168 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, comment2_code, "comment2"); |
175 profiler.CodeMoveEvent(comment2_code, moved_code->address()); | 169 profiler.CodeMoveEvent(comment2_code, moved_code->address()); |
176 profiler.CodeCreateEvent(i::Logger::STUB_TAG, args3_code, 3); | 170 profiler.CodeCreateEvent(i::Logger::STUB_TAG, args3_code, 3); |
177 profiler.CodeCreateEvent(i::Logger::STUB_TAG, args4_code, 4); | 171 profiler.CodeCreateEvent(i::Logger::STUB_TAG, args4_code, 4); |
178 | 172 |
179 // Enqueue a tick event to enable code events processing. | 173 // Enqueue a tick event to enable code events processing. |
180 EnqueueTickSampleEvent(processor.get(), aaa_code->address()); | 174 EnqueueTickSampleEvent(processor, aaa_code->address()); |
181 | 175 |
182 processor->StopSynchronously(); | 176 processor->StopSynchronously(); |
183 | 177 |
184 // Check the state of profile generator. | 178 // Check the state of profile generator. |
185 CodeEntry* aaa = generator.code_map()->FindEntry(aaa_code->address()); | 179 CodeEntry* aaa = generator->code_map()->FindEntry(aaa_code->address()); |
186 CHECK(aaa); | 180 CHECK(aaa); |
187 CHECK_EQ(0, strcmp(aaa_str, aaa->name())); | 181 CHECK_EQ(0, strcmp(aaa_str, aaa->name())); |
188 | 182 |
189 CodeEntry* comment = generator.code_map()->FindEntry(comment_code->address()); | 183 CodeEntry* comment = |
| 184 generator->code_map()->FindEntry(comment_code->address()); |
190 CHECK(comment); | 185 CHECK(comment); |
191 CHECK_EQ(0, strcmp("comment", comment->name())); | 186 CHECK_EQ(0, strcmp("comment", comment->name())); |
192 | 187 |
193 CodeEntry* args5 = generator.code_map()->FindEntry(args5_code->address()); | 188 CodeEntry* args5 = generator->code_map()->FindEntry(args5_code->address()); |
194 CHECK(args5); | 189 CHECK(args5); |
195 CHECK_EQ(0, strcmp("5", args5->name())); | 190 CHECK_EQ(0, strcmp("5", args5->name())); |
196 | 191 |
197 CHECK(!generator.code_map()->FindEntry(comment2_code->address())); | 192 CHECK(!generator->code_map()->FindEntry(comment2_code->address())); |
198 | 193 |
199 CodeEntry* comment2 = generator.code_map()->FindEntry(moved_code->address()); | 194 CodeEntry* comment2 = generator->code_map()->FindEntry(moved_code->address()); |
200 CHECK(comment2); | 195 CHECK(comment2); |
201 CHECK_EQ(0, strcmp("comment2", comment2->name())); | 196 CHECK_EQ(0, strcmp("comment2", comment2->name())); |
202 } | 197 } |
203 | 198 |
204 template<typename T> | 199 template<typename T> |
205 static int CompareProfileNodes(const T* p1, const T* p2) { | 200 static int CompareProfileNodes(const T* p1, const T* p2) { |
206 return strcmp((*p1)->entry()->name(), (*p2)->entry()->name()); | 201 return strcmp((*p1)->entry()->name(), (*p2)->entry()->name()); |
207 } | 202 } |
208 | 203 |
209 TEST(TickEvents) { | 204 TEST(TickEvents) { |
210 TestSetup test_setup; | 205 TestSetup test_setup; |
211 LocalContext env; | 206 LocalContext env; |
212 i::Isolate* isolate = CcTest::i_isolate(); | 207 i::Isolate* isolate = CcTest::i_isolate(); |
213 i::HandleScope scope(isolate); | 208 i::HandleScope scope(isolate); |
214 | 209 |
215 i::AbstractCode* frame1_code = CreateCode(&env); | 210 i::AbstractCode* frame1_code = CreateCode(&env); |
216 i::AbstractCode* frame2_code = CreateCode(&env); | 211 i::AbstractCode* frame2_code = CreateCode(&env); |
217 i::AbstractCode* frame3_code = CreateCode(&env); | 212 i::AbstractCode* frame3_code = CreateCode(&env); |
218 | 213 |
219 CpuProfilesCollection* profiles = new CpuProfilesCollection(isolate->heap()); | 214 CpuProfilesCollection* profiles = new CpuProfilesCollection(isolate); |
| 215 ProfileGenerator* generator = new ProfileGenerator(profiles); |
| 216 ProfilerEventsProcessor* processor = new ProfilerEventsProcessor( |
| 217 generator, nullptr, v8::base::TimeDelta::FromMicroseconds(100)); |
| 218 CpuProfiler profiler(isolate, profiles, generator, processor); |
220 profiles->StartProfiling("", false); | 219 profiles->StartProfiling("", false); |
221 ProfileGenerator generator(profiles); | |
222 SmartPointer<ProfilerEventsProcessor> processor(new ProfilerEventsProcessor( | |
223 &generator, NULL, v8::base::TimeDelta::FromMicroseconds(100))); | |
224 processor->Start(); | 220 processor->Start(); |
225 CpuProfiler profiler(isolate, profiles, &generator, processor.get()); | |
226 | 221 |
227 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, frame1_code, "bbb"); | 222 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, frame1_code, "bbb"); |
228 profiler.CodeCreateEvent(i::Logger::STUB_TAG, frame2_code, 5); | 223 profiler.CodeCreateEvent(i::Logger::STUB_TAG, frame2_code, 5); |
229 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, frame3_code, "ddd"); | 224 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, frame3_code, "ddd"); |
230 | 225 |
231 EnqueueTickSampleEvent(processor.get(), frame1_code->instruction_start()); | 226 EnqueueTickSampleEvent(processor, frame1_code->instruction_start()); |
232 EnqueueTickSampleEvent( | 227 EnqueueTickSampleEvent( |
233 processor.get(), | 228 processor, |
234 frame2_code->instruction_start() + frame2_code->ExecutableSize() / 2, | 229 frame2_code->instruction_start() + frame2_code->ExecutableSize() / 2, |
235 frame1_code->instruction_start() + frame2_code->ExecutableSize() / 2); | 230 frame1_code->instruction_start() + frame2_code->ExecutableSize() / 2); |
236 EnqueueTickSampleEvent( | 231 EnqueueTickSampleEvent(processor, frame3_code->instruction_end() - 1, |
237 processor.get(), | 232 frame2_code->instruction_end() - 1, |
238 frame3_code->instruction_end() - 1, | 233 frame1_code->instruction_end() - 1); |
239 frame2_code->instruction_end() - 1, | |
240 frame1_code->instruction_end() - 1); | |
241 | 234 |
242 processor->StopSynchronously(); | 235 processor->StopSynchronously(); |
243 CpuProfile* profile = profiles->StopProfiling(""); | 236 CpuProfile* profile = profiles->StopProfiling(""); |
244 CHECK(profile); | 237 CHECK(profile); |
245 | 238 |
246 // Check call trees. | 239 // Check call trees. |
247 const i::List<ProfileNode*>* top_down_root_children = | 240 const i::List<ProfileNode*>* top_down_root_children = |
248 profile->top_down()->root()->children(); | 241 profile->top_down()->root()->children(); |
249 CHECK_EQ(1, top_down_root_children->length()); | 242 CHECK_EQ(1, top_down_root_children->length()); |
250 CHECK_EQ(0, strcmp("bbb", top_down_root_children->last()->entry()->name())); | 243 CHECK_EQ(0, strcmp("bbb", top_down_root_children->last()->entry()->name())); |
(...skipping 25 matching lines...) Expand all Loading... |
276 // http://code.google.com/p/v8/issues/detail?id=1398 | 269 // http://code.google.com/p/v8/issues/detail?id=1398 |
277 // Long stacks (exceeding max frames limit) must not be erased. | 270 // Long stacks (exceeding max frames limit) must not be erased. |
278 TEST(Issue1398) { | 271 TEST(Issue1398) { |
279 TestSetup test_setup; | 272 TestSetup test_setup; |
280 LocalContext env; | 273 LocalContext env; |
281 i::Isolate* isolate = CcTest::i_isolate(); | 274 i::Isolate* isolate = CcTest::i_isolate(); |
282 i::HandleScope scope(isolate); | 275 i::HandleScope scope(isolate); |
283 | 276 |
284 i::AbstractCode* code = CreateCode(&env); | 277 i::AbstractCode* code = CreateCode(&env); |
285 | 278 |
286 CpuProfilesCollection* profiles = new CpuProfilesCollection(isolate->heap()); | 279 CpuProfilesCollection* profiles = new CpuProfilesCollection(isolate); |
| 280 ProfileGenerator* generator = new ProfileGenerator(profiles); |
| 281 ProfilerEventsProcessor* processor = new ProfilerEventsProcessor( |
| 282 generator, nullptr, v8::base::TimeDelta::FromMicroseconds(100)); |
| 283 CpuProfiler profiler(isolate, profiles, generator, processor); |
287 profiles->StartProfiling("", false); | 284 profiles->StartProfiling("", false); |
288 ProfileGenerator generator(profiles); | |
289 SmartPointer<ProfilerEventsProcessor> processor(new ProfilerEventsProcessor( | |
290 &generator, NULL, v8::base::TimeDelta::FromMicroseconds(100))); | |
291 processor->Start(); | 285 processor->Start(); |
292 CpuProfiler profiler(isolate, profiles, &generator, processor.get()); | |
293 | 286 |
294 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, code, "bbb"); | 287 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, code, "bbb"); |
295 | 288 |
296 i::TickSample* sample = processor->StartTickSample(); | 289 i::TickSample* sample = processor->StartTickSample(); |
297 sample->pc = code->address(); | 290 sample->pc = code->address(); |
298 sample->tos = 0; | 291 sample->tos = 0; |
299 sample->frames_count = i::TickSample::kMaxFramesCount; | 292 sample->frames_count = i::TickSample::kMaxFramesCount; |
300 for (unsigned i = 0; i < sample->frames_count; ++i) { | 293 for (unsigned i = 0; i < sample->frames_count; ++i) { |
301 sample->stack[i] = code->address(); | 294 sample->stack[i] = code->address(); |
302 } | 295 } |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 | 1007 |
1015 i::Handle<i::JSFunction> func = i::Handle<i::JSFunction>::cast( | 1008 i::Handle<i::JSFunction> func = i::Handle<i::JSFunction>::cast( |
1016 v8::Utils::OpenHandle(*GetFunction(env.local(), func_name))); | 1009 v8::Utils::OpenHandle(*GetFunction(env.local(), func_name))); |
1017 CHECK(func->shared()); | 1010 CHECK(func->shared()); |
1018 CHECK(func->shared()->abstract_code()); | 1011 CHECK(func->shared()->abstract_code()); |
1019 i::AbstractCode* code = func->abstract_code(); | 1012 i::AbstractCode* code = func->abstract_code(); |
1020 CHECK(code); | 1013 CHECK(code); |
1021 i::Address code_address = code->instruction_start(); | 1014 i::Address code_address = code->instruction_start(); |
1022 CHECK(code_address); | 1015 CHECK(code_address); |
1023 | 1016 |
1024 CpuProfilesCollection* profiles = new CpuProfilesCollection(isolate->heap()); | 1017 CpuProfilesCollection* profiles = new CpuProfilesCollection(isolate); |
| 1018 ProfileGenerator* generator = new ProfileGenerator(profiles); |
| 1019 ProfilerEventsProcessor* processor = new ProfilerEventsProcessor( |
| 1020 generator, nullptr, v8::base::TimeDelta::FromMicroseconds(100)); |
| 1021 CpuProfiler profiler(isolate, profiles, generator, processor); |
1025 profiles->StartProfiling("", false); | 1022 profiles->StartProfiling("", false); |
1026 ProfileGenerator generator(profiles); | |
1027 SmartPointer<ProfilerEventsProcessor> processor(new ProfilerEventsProcessor( | |
1028 &generator, NULL, v8::base::TimeDelta::FromMicroseconds(100))); | |
1029 processor->Start(); | 1023 processor->Start(); |
1030 CpuProfiler profiler(isolate, profiles, &generator, processor.get()); | |
1031 | 1024 |
1032 // Enqueue code creation events. | 1025 // Enqueue code creation events. |
1033 i::Handle<i::String> str = factory->NewStringFromAsciiChecked(func_name); | 1026 i::Handle<i::String> str = factory->NewStringFromAsciiChecked(func_name); |
1034 int line = 1; | 1027 int line = 1; |
1035 int column = 1; | 1028 int column = 1; |
1036 profiler.CodeCreateEvent(i::Logger::FUNCTION_TAG, code, func->shared(), *str, | 1029 profiler.CodeCreateEvent(i::Logger::FUNCTION_TAG, code, func->shared(), *str, |
1037 line, column); | 1030 line, column); |
1038 | 1031 |
1039 // Enqueue a tick event to enable code events processing. | 1032 // Enqueue a tick event to enable code events processing. |
1040 EnqueueTickSampleEvent(processor.get(), code_address); | 1033 EnqueueTickSampleEvent(processor, code_address); |
1041 | 1034 |
1042 processor->StopSynchronously(); | 1035 processor->StopSynchronously(); |
1043 | 1036 |
1044 CpuProfile* profile = profiles->StopProfiling(""); | 1037 CpuProfile* profile = profiles->StopProfiling(""); |
1045 CHECK(profile); | 1038 CHECK(profile); |
1046 | 1039 |
1047 // Check the state of profile generator. | 1040 // Check the state of profile generator. |
1048 CodeEntry* func_entry = generator.code_map()->FindEntry(code_address); | 1041 CodeEntry* func_entry = generator->code_map()->FindEntry(code_address); |
1049 CHECK(func_entry); | 1042 CHECK(func_entry); |
1050 CHECK_EQ(0, strcmp(func_name, func_entry->name())); | 1043 CHECK_EQ(0, strcmp(func_name, func_entry->name())); |
1051 const i::JITLineInfoTable* line_info = func_entry->line_info(); | 1044 const i::JITLineInfoTable* line_info = func_entry->line_info(); |
1052 CHECK(line_info); | 1045 CHECK(line_info); |
1053 CHECK(!line_info->empty()); | 1046 CHECK(!line_info->empty()); |
1054 | 1047 |
1055 // Check the hit source lines using V8 Public APIs. | 1048 // Check the hit source lines using V8 Public APIs. |
1056 const i::ProfileTree* tree = profile->top_down(); | 1049 const i::ProfileTree* tree = profile->top_down(); |
1057 ProfileNode* root = tree->root(); | 1050 ProfileNode* root = tree->root(); |
1058 CHECK(root); | 1051 CHECK(root); |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2023 iprofile->Print(); | 2016 iprofile->Print(); |
2024 v8::CpuProfile* profile = reinterpret_cast<v8::CpuProfile*>(iprofile); | 2017 v8::CpuProfile* profile = reinterpret_cast<v8::CpuProfile*>(iprofile); |
2025 | 2018 |
2026 const char* branch[] = {"", "test"}; | 2019 const char* branch[] = {"", "test"}; |
2027 const ProfileNode* itest_node = | 2020 const ProfileNode* itest_node = |
2028 GetSimpleBranch(env, profile, branch, arraysize(branch)); | 2021 GetSimpleBranch(env, profile, branch, arraysize(branch)); |
2029 CHECK_EQ(0U, itest_node->deopt_infos().size()); | 2022 CHECK_EQ(0U, itest_node->deopt_infos().size()); |
2030 | 2023 |
2031 iprofiler->DeleteProfile(iprofile); | 2024 iprofiler->DeleteProfile(iprofile); |
2032 } | 2025 } |
OLD | NEW |