| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 289 |
| 290 void AfterAllChildrenTraversed(ProfileNode* node) { | 290 void AfterAllChildrenTraversed(ProfileNode* node) { |
| 291 delete node; | 291 delete node; |
| 292 } | 292 } |
| 293 | 293 |
| 294 void AfterChildTraversed(ProfileNode*, ProfileNode*) { } | 294 void AfterChildTraversed(ProfileNode*, ProfileNode*) { } |
| 295 }; | 295 }; |
| 296 | 296 |
| 297 | 297 |
| 298 ProfileTree::ProfileTree() | 298 ProfileTree::ProfileTree() |
| 299 : root_entry_(Logger::FUNCTION_TAG, | 299 : root_entry_(Logger::FUNCTION_TAG, "", "(root)"), |
| 300 "", | |
| 301 "(root)", | |
| 302 "", | |
| 303 0, | |
| 304 TokenEnumerator::kNoSecurityToken), | |
| 305 next_node_id_(1), | 300 next_node_id_(1), |
| 306 root_(new ProfileNode(this, &root_entry_)) { | 301 root_(new ProfileNode(this, &root_entry_)) { |
| 307 } | 302 } |
| 308 | 303 |
| 309 | 304 |
| 310 ProfileTree::~ProfileTree() { | 305 ProfileTree::~ProfileTree() { |
| 311 DeleteNodesCallback cb; | 306 DeleteNodesCallback cb; |
| 312 TraverseDepthFirst(&cb); | 307 TraverseDepthFirst(&cb); |
| 313 } | 308 } |
| 314 | 309 |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 } | 785 } |
| 791 | 786 |
| 792 | 787 |
| 793 CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag, | 788 CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag, |
| 794 Name* name, | 789 Name* name, |
| 795 String* resource_name, | 790 String* resource_name, |
| 796 int line_number) { | 791 int line_number) { |
| 797 CodeEntry* entry = new CodeEntry(tag, | 792 CodeEntry* entry = new CodeEntry(tag, |
| 798 CodeEntry::kEmptyNamePrefix, | 793 CodeEntry::kEmptyNamePrefix, |
| 799 GetFunctionName(name), | 794 GetFunctionName(name), |
| 795 TokenEnumerator::kNoSecurityToken, |
| 800 GetName(resource_name), | 796 GetName(resource_name), |
| 801 line_number, | 797 line_number); |
| 802 TokenEnumerator::kNoSecurityToken); | |
| 803 code_entries_.Add(entry); | 798 code_entries_.Add(entry); |
| 804 return entry; | 799 return entry; |
| 805 } | 800 } |
| 806 | 801 |
| 807 | 802 |
| 808 CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag, | 803 CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag, |
| 809 const char* name) { | 804 const char* name) { |
| 810 CodeEntry* entry = new CodeEntry(tag, | 805 CodeEntry* entry = new CodeEntry(tag, |
| 811 CodeEntry::kEmptyNamePrefix, | 806 CodeEntry::kEmptyNamePrefix, |
| 812 GetFunctionName(name), | 807 GetFunctionName(name)); |
| 813 "", | |
| 814 v8::CpuProfileNode::kNoLineNumberInfo, | |
| 815 TokenEnumerator::kNoSecurityToken); | |
| 816 code_entries_.Add(entry); | 808 code_entries_.Add(entry); |
| 817 return entry; | 809 return entry; |
| 818 } | 810 } |
| 819 | 811 |
| 820 | 812 |
| 821 CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag, | 813 CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag, |
| 822 const char* name_prefix, | 814 const char* name_prefix, |
| 823 Name* name) { | 815 Name* name) { |
| 824 CodeEntry* entry = new CodeEntry(tag, | 816 CodeEntry* entry = new CodeEntry(tag, |
| 825 name_prefix, | 817 name_prefix, |
| 826 GetName(name), | 818 GetName(name), |
| 827 "", | |
| 828 v8::CpuProfileNode::kNoLineNumberInfo, | |
| 829 TokenEnumerator::kInheritsSecurityToken); | 819 TokenEnumerator::kInheritsSecurityToken); |
| 830 code_entries_.Add(entry); | 820 code_entries_.Add(entry); |
| 831 return entry; | 821 return entry; |
| 832 } | 822 } |
| 833 | 823 |
| 834 | 824 |
| 835 CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag, | 825 CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag, |
| 836 int args_count) { | 826 int args_count) { |
| 837 CodeEntry* entry = new CodeEntry(tag, | 827 CodeEntry* entry = new CodeEntry(tag, |
| 838 "args_count: ", | 828 "args_count: ", |
| 839 GetName(args_count), | 829 GetName(args_count), |
| 840 "", | |
| 841 v8::CpuProfileNode::kNoLineNumberInfo, | |
| 842 TokenEnumerator::kInheritsSecurityToken); | 830 TokenEnumerator::kInheritsSecurityToken); |
| 843 code_entries_.Add(entry); | 831 code_entries_.Add(entry); |
| 844 return entry; | 832 return entry; |
| 845 } | 833 } |
| 846 | 834 |
| 847 | 835 |
| 848 void CpuProfilesCollection::AddPathToCurrentProfiles( | 836 void CpuProfilesCollection::AddPathToCurrentProfiles( |
| 849 const Vector<CodeEntry*>& path) { | 837 const Vector<CodeEntry*>& path) { |
| 850 // As starting / stopping profiles is rare relatively to this | 838 // As starting / stopping profiles is rare relatively to this |
| 851 // method, we don't bother minimizing the duration of lock holding, | 839 // method, we don't bother minimizing the duration of lock holding, |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 if (no_symbolized_entries) { | 944 if (no_symbolized_entries) { |
| 957 *entry++ = EntryForVMState(sample.state); | 945 *entry++ = EntryForVMState(sample.state); |
| 958 } | 946 } |
| 959 } | 947 } |
| 960 | 948 |
| 961 profiles_->AddPathToCurrentProfiles(entries); | 949 profiles_->AddPathToCurrentProfiles(entries); |
| 962 } | 950 } |
| 963 | 951 |
| 964 | 952 |
| 965 } } // namespace v8::internal | 953 } } // namespace v8::internal |
| OLD | NEW |