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

Side by Side Diff: src/cpu-profiler.h

Issue 12340052: Use boolean instead of Atomic32 for is_profiling_ flag (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 10 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 | « no previous file | src/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 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 static void CodeCreateEvent(Logger::LogEventsAndTags tag, 238 static void CodeCreateEvent(Logger::LogEventsAndTags tag,
239 Code* code, int args_count); 239 Code* code, int args_count);
240 static void CodeMovingGCEvent() {} 240 static void CodeMovingGCEvent() {}
241 static void CodeMoveEvent(Address from, Address to); 241 static void CodeMoveEvent(Address from, Address to);
242 static void CodeDeleteEvent(Address from); 242 static void CodeDeleteEvent(Address from);
243 static void GetterCallbackEvent(String* name, Address entry_point); 243 static void GetterCallbackEvent(String* name, Address entry_point);
244 static void RegExpCodeCreateEvent(Code* code, String* source); 244 static void RegExpCodeCreateEvent(Code* code, String* source);
245 static void SetterCallbackEvent(String* name, Address entry_point); 245 static void SetterCallbackEvent(String* name, Address entry_point);
246 static void SharedFunctionInfoMoveEvent(Address from, Address to); 246 static void SharedFunctionInfoMoveEvent(Address from, Address to);
247 247
248 // TODO(isolates): this doesn't have to use atomics anymore.
249
250 static INLINE(bool is_profiling(Isolate* isolate)) { 248 static INLINE(bool is_profiling(Isolate* isolate)) {
251 CpuProfiler* profiler = isolate->cpu_profiler(); 249 CpuProfiler* profiler = isolate->cpu_profiler();
252 return profiler != NULL && NoBarrier_Load(&profiler->is_profiling_); 250 return profiler != NULL && profiler->is_profiling_;
253 } 251 }
254 252
255 private: 253 private:
256 CpuProfiler(); 254 CpuProfiler();
257 ~CpuProfiler(); 255 ~CpuProfiler();
258 void StartCollectingProfile(const char* title); 256 void StartCollectingProfile(const char* title);
259 void StartCollectingProfile(String* title); 257 void StartCollectingProfile(String* title);
260 void StartProcessorIfNotStarted(); 258 void StartProcessorIfNotStarted();
261 CpuProfile* StopCollectingProfile(const char* title); 259 CpuProfile* StopCollectingProfile(const char* title);
262 CpuProfile* StopCollectingProfile(Object* security_token, String* title); 260 CpuProfile* StopCollectingProfile(Object* security_token, String* title);
263 void StopProcessorIfLastProfile(const char* title); 261 void StopProcessorIfLastProfile(const char* title);
264 void StopProcessor(); 262 void StopProcessor();
265 void ResetProfiles(); 263 void ResetProfiles();
266 264
267 CpuProfilesCollection* profiles_; 265 CpuProfilesCollection* profiles_;
268 unsigned next_profile_uid_; 266 unsigned next_profile_uid_;
269 TokenEnumerator* token_enumerator_; 267 TokenEnumerator* token_enumerator_;
270 ProfileGenerator* generator_; 268 ProfileGenerator* generator_;
271 ProfilerEventsProcessor* processor_; 269 ProfilerEventsProcessor* processor_;
272 int saved_logging_nesting_; 270 int saved_logging_nesting_;
273 bool need_to_stop_sampler_; 271 bool need_to_stop_sampler_;
274 Atomic32 is_profiling_; 272 bool is_profiling_;
275 273
276 private: 274 private:
277 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); 275 DISALLOW_COPY_AND_ASSIGN(CpuProfiler);
278 }; 276 };
279 277
280 } } // namespace v8::internal 278 } } // namespace v8::internal
281 279
282 280
283 #endif // V8_CPU_PROFILER_H_ 281 #endif // V8_CPU_PROFILER_H_
OLDNEW
« no previous file with comments | « no previous file | src/cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698