| 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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 } | 595 } |
| 596 } | 596 } |
| 597 | 597 |
| 598 | 598 |
| 599 TEST(Issue51919) { | 599 TEST(Issue51919) { |
| 600 CpuProfilesCollection collection(CcTest::heap()); | 600 CpuProfilesCollection collection(CcTest::heap()); |
| 601 i::EmbeddedVector<char*, | 601 i::EmbeddedVector<char*, |
| 602 CpuProfilesCollection::kMaxSimultaneousProfiles> titles; | 602 CpuProfilesCollection::kMaxSimultaneousProfiles> titles; |
| 603 for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i) { | 603 for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i) { |
| 604 i::Vector<char> title = i::Vector<char>::New(16); | 604 i::Vector<char> title = i::Vector<char>::New(16); |
| 605 i::OS::SNPrintF(title, "%d", i); | 605 i::SNPrintF(title, "%d", i); |
| 606 CHECK(collection.StartProfiling(title.start(), false)); | 606 CHECK(collection.StartProfiling(title.start(), false)); |
| 607 titles[i] = title.start(); | 607 titles[i] = title.start(); |
| 608 } | 608 } |
| 609 CHECK(!collection.StartProfiling("maximum", false)); | 609 CHECK(!collection.StartProfiling("maximum", false)); |
| 610 for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i) | 610 for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i) |
| 611 i::DeleteArray(titles[i]); | 611 i::DeleteArray(titles[i]); |
| 612 } | 612 } |
| 613 | 613 |
| 614 | 614 |
| 615 static const v8::CpuProfileNode* PickChild(const v8::CpuProfileNode* parent, | 615 static const v8::CpuProfileNode* PickChild(const v8::CpuProfileNode* parent, |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); | 767 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); |
| 768 | 768 |
| 769 current = PickChild(current, "TryFinally"); | 769 current = PickChild(current, "TryFinally"); |
| 770 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); | 770 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); |
| 771 CHECK(!strcmp("TryFinallyStatement", current->GetBailoutReason())); | 771 CHECK(!strcmp("TryFinallyStatement", current->GetBailoutReason())); |
| 772 | 772 |
| 773 current = PickChild(current, "TryCatch"); | 773 current = PickChild(current, "TryCatch"); |
| 774 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); | 774 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); |
| 775 CHECK(!strcmp("TryCatchStatement", current->GetBailoutReason())); | 775 CHECK(!strcmp("TryCatchStatement", current->GetBailoutReason())); |
| 776 } | 776 } |
| OLD | NEW |