Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(549)

Side by Side Diff: src/profile-generator.cc

Issue 17875002: Revert "CPUProfiler: Simplify CodeEntry constructor calls." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/profile-generator.h ('k') | src/profile-generator-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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, "", "(root)"), 299 : root_entry_(Logger::FUNCTION_TAG,
300 "",
301 "(root)",
302 "",
303 0,
304 TokenEnumerator::kNoSecurityToken),
300 next_node_id_(1), 305 next_node_id_(1),
301 root_(new ProfileNode(this, &root_entry_)) { 306 root_(new ProfileNode(this, &root_entry_)) {
302 } 307 }
303 308
304 309
305 ProfileTree::~ProfileTree() { 310 ProfileTree::~ProfileTree() {
306 DeleteNodesCallback cb; 311 DeleteNodesCallback cb;
307 TraverseDepthFirst(&cb); 312 TraverseDepthFirst(&cb);
308 } 313 }
309 314
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 } 790 }
786 791
787 792
788 CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag, 793 CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag,
789 Name* name, 794 Name* name,
790 String* resource_name, 795 String* resource_name,
791 int line_number) { 796 int line_number) {
792 CodeEntry* entry = new CodeEntry(tag, 797 CodeEntry* entry = new CodeEntry(tag,
793 CodeEntry::kEmptyNamePrefix, 798 CodeEntry::kEmptyNamePrefix,
794 GetFunctionName(name), 799 GetFunctionName(name),
795 TokenEnumerator::kNoSecurityToken,
796 GetName(resource_name), 800 GetName(resource_name),
797 line_number); 801 line_number,
802 TokenEnumerator::kNoSecurityToken);
798 code_entries_.Add(entry); 803 code_entries_.Add(entry);
799 return entry; 804 return entry;
800 } 805 }
801 806
802 807
803 CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag, 808 CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag,
804 const char* name) { 809 const char* name) {
805 CodeEntry* entry = new CodeEntry(tag, 810 CodeEntry* entry = new CodeEntry(tag,
806 CodeEntry::kEmptyNamePrefix, 811 CodeEntry::kEmptyNamePrefix,
807 GetFunctionName(name)); 812 GetFunctionName(name),
813 "",
814 v8::CpuProfileNode::kNoLineNumberInfo,
815 TokenEnumerator::kNoSecurityToken);
808 code_entries_.Add(entry); 816 code_entries_.Add(entry);
809 return entry; 817 return entry;
810 } 818 }
811 819
812 820
813 CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag, 821 CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag,
814 const char* name_prefix, 822 const char* name_prefix,
815 Name* name) { 823 Name* name) {
816 CodeEntry* entry = new CodeEntry(tag, 824 CodeEntry* entry = new CodeEntry(tag,
817 name_prefix, 825 name_prefix,
818 GetName(name), 826 GetName(name),
827 "",
828 v8::CpuProfileNode::kNoLineNumberInfo,
819 TokenEnumerator::kInheritsSecurityToken); 829 TokenEnumerator::kInheritsSecurityToken);
820 code_entries_.Add(entry); 830 code_entries_.Add(entry);
821 return entry; 831 return entry;
822 } 832 }
823 833
824 834
825 CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag, 835 CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag,
826 int args_count) { 836 int args_count) {
827 CodeEntry* entry = new CodeEntry(tag, 837 CodeEntry* entry = new CodeEntry(tag,
828 "args_count: ", 838 "args_count: ",
829 GetName(args_count), 839 GetName(args_count),
840 "",
841 v8::CpuProfileNode::kNoLineNumberInfo,
830 TokenEnumerator::kInheritsSecurityToken); 842 TokenEnumerator::kInheritsSecurityToken);
831 code_entries_.Add(entry); 843 code_entries_.Add(entry);
832 return entry; 844 return entry;
833 } 845 }
834 846
835 847
836 void CpuProfilesCollection::AddPathToCurrentProfiles( 848 void CpuProfilesCollection::AddPathToCurrentProfiles(
837 const Vector<CodeEntry*>& path) { 849 const Vector<CodeEntry*>& path) {
838 // As starting / stopping profiles is rare relatively to this 850 // As starting / stopping profiles is rare relatively to this
839 // method, we don't bother minimizing the duration of lock holding, 851 // method, we don't bother minimizing the duration of lock holding,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 if (no_symbolized_entries) { 956 if (no_symbolized_entries) {
945 *entry++ = EntryForVMState(sample.state); 957 *entry++ = EntryForVMState(sample.state);
946 } 958 }
947 } 959 }
948 960
949 profiles_->AddPathToCurrentProfiles(entries); 961 profiles_->AddPathToCurrentProfiles(entries);
950 } 962 }
951 963
952 964
953 } } // namespace v8::internal 965 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/profile-generator.h ('k') | src/profile-generator-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698