Changeset 153143 in webkit for trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.h
- Timestamp:
- Jul 24, 2013, 8:59:31 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.h
r148696 r153143 36 36 #include <wtf/PassRefPtr.h> 37 37 #include <wtf/SegmentedVector.h> 38 #include <wtf/ThreadingPrimitives.h> 38 39 #include <wtf/text/WTFString.h> 39 40 … … 51 52 void notifyDestruction(CodeBlock*); 52 53 53 PassRefPtr<Compilation> newCompilation(CodeBlock*, CompilationKind); 54 PassRefPtr<Compilation> newCompilation(Bytecodes*, CompilationKind); 54 void addCompilation(PassRefPtr<Compilation>); 55 55 56 56 // Converts the database to a JavaScript object that is suitable for JSON stringification. … … 71 71 72 72 private: 73 // Use a full-blown adaptive mutex because: 74 // - There is only one ProfilerDatabase per VM. The size overhead of the system's 75 // mutex is negligible if you only have one of them. 76 // - It's locked infrequently - once per bytecode generation, compilation, and 77 // code block collection - so the fact that the fast path still requires a 78 // function call is neglible. 79 // - It tends to be held for a while. Currently, we hold it while generating 80 // Profiler::Bytecodes for a CodeBlock. That's uncommon and shouldn't affect 81 // performance, but if we did have contention, we would want a sensible, 82 // power-aware backoff. An adaptive mutex will do this as a matter of course, 83 // but a spinlock won't. 84 typedef Mutex Lock; 85 typedef MutexLocker Locker; 86 73 87 74 88 void addDatabaseToAtExit(); … … 86 100 CString m_atExitSaveFilename; 87 101 Database* m_nextRegisteredDatabase; 102 Lock m_lock; 88 103 }; 89 104
Note:
See TracChangeset
for help on using the changeset viewer.