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