| 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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 | 601 |
| 602 const v8::CpuProfileNode* root = profile->GetTopDownRoot(); | 602 const v8::CpuProfileNode* root = profile->GetTopDownRoot(); |
| 603 | 603 |
| 604 ScopedVector<v8::Handle<v8::String> > names(3); | 604 ScopedVector<v8::Handle<v8::String> > names(3); |
| 605 names[0] = v8::String::New(ProfileGenerator::kGarbageCollectorEntryName); | 605 names[0] = v8::String::New(ProfileGenerator::kGarbageCollectorEntryName); |
| 606 names[1] = v8::String::New(ProfileGenerator::kProgramEntryName); | 606 names[1] = v8::String::New(ProfileGenerator::kProgramEntryName); |
| 607 names[2] = v8::String::New("start"); | 607 names[2] = v8::String::New("start"); |
| 608 CheckChildrenNames(root, names); | 608 CheckChildrenNames(root, names); |
| 609 | 609 |
| 610 const v8::CpuProfileNode* startNode = FindChild(root, "start"); | 610 const v8::CpuProfileNode* startNode = FindChild(root, "start"); |
| 611 if (startNode->GetChildrenCount() > 0) { | 611 // On slow machines there may be no meaningfull samples at all, skip the |
| 612 // check there. |
| 613 if (startNode && startNode->GetChildrenCount() > 0) { |
| 612 CHECK_EQ(1, startNode->GetChildrenCount()); | 614 CHECK_EQ(1, startNode->GetChildrenCount()); |
| 613 const v8::CpuProfileNode* delayNode = FindChild(startNode, "delay"); | 615 const v8::CpuProfileNode* delayNode = FindChild(startNode, "delay"); |
| 614 if (delayNode->GetChildrenCount() > 0) { | 616 if (delayNode->GetChildrenCount() > 0) { |
| 615 CHECK_EQ(1, delayNode->GetChildrenCount()); | 617 CHECK_EQ(1, delayNode->GetChildrenCount()); |
| 616 FindChild(delayNode, "loop"); | 618 FindChild(delayNode, "loop"); |
| 617 } | 619 } |
| 618 } | 620 } |
| 619 | 621 |
| 620 cpu_profiler->DeleteAllCpuProfiles(); | 622 cpu_profiler->DeleteAllCpuProfiles(); |
| 621 } | 623 } |
| OLD | NEW |