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

Side by Side Diff: src/profile-generator-inl.h

Issue 3108004: Fix CPU profiler crash in start / stop sequence when non-existent name is passed (Closed)
Patch Set: Created 10 years, 4 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
« no previous file with comments | « src/profile-generator.cc ('k') | test/cctest/test-cpu-profiler.cc » ('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 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 void CodeMap::MoveCode(Address from, Address to) { 91 void CodeMap::MoveCode(Address from, Address to) {
92 tree_.Move(from, to); 92 tree_.Move(from, to);
93 } 93 }
94 94
95 void CodeMap::DeleteCode(Address addr) { 95 void CodeMap::DeleteCode(Address addr) {
96 tree_.Remove(addr); 96 tree_.Remove(addr);
97 } 97 }
98 98
99 99
100 bool CpuProfilesCollection::is_last_profile() {
101 // Called from VM thread, and only it can mutate the list,
102 // so no locking is needed here.
103 return current_profiles_.length() == 1;
104 }
105
106
107 const char* CpuProfilesCollection::GetFunctionName(String* name) { 100 const char* CpuProfilesCollection::GetFunctionName(String* name) {
108 return GetFunctionName(GetName(name)); 101 return GetFunctionName(GetName(name));
109 } 102 }
110 103
111 104
112 const char* CpuProfilesCollection::GetFunctionName(const char* name) { 105 const char* CpuProfilesCollection::GetFunctionName(const char* name) {
113 return strlen(name) > 0 ? name : ProfileGenerator::kAnonymousFunctionName; 106 return strlen(name) > 0 ? name : ProfileGenerator::kAnonymousFunctionName;
114 } 107 }
115 108
116 109
(...skipping 11 matching lines...) Expand all
128 return program_entry_; 121 return program_entry_;
129 default: return NULL; 122 default: return NULL;
130 } 123 }
131 } 124 }
132 125
133 } } // namespace v8::internal 126 } } // namespace v8::internal
134 127
135 #endif // ENABLE_LOGGING_AND_PROFILING 128 #endif // ENABLE_LOGGING_AND_PROFILING
136 129
137 #endif // V8_PROFILE_GENERATOR_INL_H_ 130 #endif // V8_PROFILE_GENERATOR_INL_H_
OLDNEW
« no previous file with comments | « src/profile-generator.cc ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698