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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 generator.code_map()->AddCode(ToAddress(0x1500), entry1, 0x200); | 617 generator.code_map()->AddCode(ToAddress(0x1500), entry1, 0x200); |
618 generator.code_map()->AddCode(ToAddress(0x1700), entry2, 0x100); | 618 generator.code_map()->AddCode(ToAddress(0x1700), entry2, 0x100); |
619 generator.code_map()->AddCode(ToAddress(0x1900), entry3, 0x50); | 619 generator.code_map()->AddCode(ToAddress(0x1900), entry3, 0x50); |
620 | 620 |
621 // We are building the following calls tree: | 621 // We are building the following calls tree: |
622 // -> aaa - sample1 | 622 // -> aaa - sample1 |
623 // aaa -> bbb -> ccc - sample2 | 623 // aaa -> bbb -> ccc - sample2 |
624 // -> ccc -> aaa - sample3 | 624 // -> ccc -> aaa - sample3 |
625 TickSample sample1; | 625 TickSample sample1; |
626 sample1.pc = ToAddress(0x1600); | 626 sample1.pc = ToAddress(0x1600); |
627 sample1.tos = ToAddress(0x1500); | |
628 sample1.stack[0] = ToAddress(0x1510); | 627 sample1.stack[0] = ToAddress(0x1510); |
629 sample1.frames_count = 1; | 628 sample1.frames_count = 1; |
630 generator.RecordTickSample(sample1); | 629 generator.RecordTickSample(sample1); |
631 TickSample sample2; | 630 TickSample sample2; |
632 sample2.pc = ToAddress(0x1925); | 631 sample2.pc = ToAddress(0x1925); |
633 sample2.tos = ToAddress(0x1900); | |
634 sample2.stack[0] = ToAddress(0x1780); | 632 sample2.stack[0] = ToAddress(0x1780); |
635 sample2.stack[1] = ToAddress(0x10000); // non-existent. | 633 sample2.stack[1] = ToAddress(0x10000); // non-existent. |
636 sample2.stack[2] = ToAddress(0x1620); | 634 sample2.stack[2] = ToAddress(0x1620); |
637 sample2.frames_count = 3; | 635 sample2.frames_count = 3; |
638 generator.RecordTickSample(sample2); | 636 generator.RecordTickSample(sample2); |
639 TickSample sample3; | 637 TickSample sample3; |
640 sample3.pc = ToAddress(0x1510); | 638 sample3.pc = ToAddress(0x1510); |
641 sample3.tos = ToAddress(0x1500); | |
642 sample3.stack[0] = ToAddress(0x1910); | 639 sample3.stack[0] = ToAddress(0x1910); |
643 sample3.stack[1] = ToAddress(0x1610); | 640 sample3.stack[1] = ToAddress(0x1610); |
644 sample3.frames_count = 2; | 641 sample3.frames_count = 2; |
645 generator.RecordTickSample(sample3); | 642 generator.RecordTickSample(sample3); |
646 | 643 |
647 CpuProfile* profile = | 644 CpuProfile* profile = |
648 profiles.StopProfiling(TokenEnumerator::kNoSecurityToken, "", 1); | 645 profiles.StopProfiling(TokenEnumerator::kNoSecurityToken, "", 1); |
649 CHECK_NE(NULL, profile); | 646 CHECK_NE(NULL, profile); |
650 ProfileTreeTestHelper top_down_test_helper(profile->top_down()); | 647 ProfileTreeTestHelper top_down_test_helper(profile->top_down()); |
651 CHECK_EQ(NULL, top_down_test_helper.Walk(entry2)); | 648 CHECK_EQ(NULL, top_down_test_helper.Walk(entry2)); |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 i::OS::SNPrintF(title, "%d", i); | 923 i::OS::SNPrintF(title, "%d", i); |
927 // UID must be > 0. | 924 // UID must be > 0. |
928 CHECK(collection.StartProfiling(title.start(), i + 1, false)); | 925 CHECK(collection.StartProfiling(title.start(), i + 1, false)); |
929 titles[i] = title.start(); | 926 titles[i] = title.start(); |
930 } | 927 } |
931 CHECK(!collection.StartProfiling( | 928 CHECK(!collection.StartProfiling( |
932 "maximum", CpuProfilesCollection::kMaxSimultaneousProfiles + 1, false)); | 929 "maximum", CpuProfilesCollection::kMaxSimultaneousProfiles + 1, false)); |
933 for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i) | 930 for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i) |
934 i::DeleteArray(titles[i]); | 931 i::DeleteArray(titles[i]); |
935 } | 932 } |
OLD | NEW |