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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 &generator, NULL, TimeDelta::FromMicroseconds(100))); | 276 &generator, NULL, TimeDelta::FromMicroseconds(100))); |
277 processor->Start(); | 277 processor->Start(); |
278 CpuProfiler profiler(isolate, profiles, &generator, processor.get()); | 278 CpuProfiler profiler(isolate, profiles, &generator, processor.get()); |
279 | 279 |
280 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, code, "bbb"); | 280 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, code, "bbb"); |
281 | 281 |
282 i::TickSample* sample = processor->StartTickSample(); | 282 i::TickSample* sample = processor->StartTickSample(); |
283 sample->pc = code->address(); | 283 sample->pc = code->address(); |
284 sample->tos = 0; | 284 sample->tos = 0; |
285 sample->frames_count = i::TickSample::kMaxFramesCount; | 285 sample->frames_count = i::TickSample::kMaxFramesCount; |
286 for (int i = 0; i < sample->frames_count; ++i) { | 286 for (unsigned i = 0; i < sample->frames_count; ++i) { |
287 sample->stack[i] = code->address(); | 287 sample->stack[i] = code->address(); |
288 } | 288 } |
289 processor->FinishTickSample(); | 289 processor->FinishTickSample(); |
290 | 290 |
291 processor->StopSynchronously(); | 291 processor->StopSynchronously(); |
292 CpuProfile* profile = profiles->StopProfiling(""); | 292 CpuProfile* profile = profiles->StopProfiling(""); |
293 CHECK_NE(NULL, profile); | 293 CHECK_NE(NULL, profile); |
294 | 294 |
295 int actual_depth = 0; | 295 int actual_depth = 0; |
296 const ProfileNode* node = profile->top_down()->root(); | 296 const ProfileNode* node = profile->top_down()->root(); |
(...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1661 inner_profile = NULL; | 1661 inner_profile = NULL; |
1662 CHECK_EQ(0, iprofiler->GetProfilesCount()); | 1662 CHECK_EQ(0, iprofiler->GetProfilesCount()); |
1663 | 1663 |
1664 v8::CpuProfile* outer_profile = profiler->StopProfiling(outer); | 1664 v8::CpuProfile* outer_profile = profiler->StopProfiling(outer); |
1665 CHECK(outer_profile); | 1665 CHECK(outer_profile); |
1666 CHECK_EQ(1, iprofiler->GetProfilesCount()); | 1666 CHECK_EQ(1, iprofiler->GetProfilesCount()); |
1667 outer_profile->Delete(); | 1667 outer_profile->Delete(); |
1668 outer_profile = NULL; | 1668 outer_profile = NULL; |
1669 CHECK_EQ(0, iprofiler->GetProfilesCount()); | 1669 CHECK_EQ(0, iprofiler->GetProfilesCount()); |
1670 } | 1670 } |
OLD | NEW |