| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 class ThreadManager : public AllStatic { | 68 class ThreadManager : public AllStatic { |
| 69 public: | 69 public: |
| 70 static void Lock(); | 70 static void Lock(); |
| 71 static void Unlock(); | 71 static void Unlock(); |
| 72 | 72 |
| 73 static void ArchiveThread(); | 73 static void ArchiveThread(); |
| 74 static bool RestoreThread(); | 74 static bool RestoreThread(); |
| 75 | 75 |
| 76 static void Iterate(ObjectVisitor* v); | 76 static void Iterate(ObjectVisitor* v); |
| 77 static void MarkCompactPrologue(); | 77 static void MarkCompactPrologue(bool is_compacting); |
| 78 static void MarkCompactEpilogue(); | 78 static void MarkCompactEpilogue(bool is_compacting); |
| 79 static bool IsLockedByCurrentThread() { return mutex_owner_.IsSelf(); } | 79 static bool IsLockedByCurrentThread() { return mutex_owner_.IsSelf(); } |
| 80 private: | 80 private: |
| 81 static void EagerlyArchiveThread(); | 81 static void EagerlyArchiveThread(); |
| 82 | 82 |
| 83 static Mutex* mutex_; | 83 static Mutex* mutex_; |
| 84 static ThreadHandle mutex_owner_; | 84 static ThreadHandle mutex_owner_; |
| 85 static ThreadHandle lazily_archived_thread_; | 85 static ThreadHandle lazily_archived_thread_; |
| 86 static ThreadState* lazily_archived_thread_state_; | 86 static ThreadState* lazily_archived_thread_state_; |
| 87 }; | 87 }; |
| 88 | 88 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 110 | 110 |
| 111 bool keep_going_; | 111 bool keep_going_; |
| 112 int sleep_ms_; | 112 int sleep_ms_; |
| 113 | 113 |
| 114 static ContextSwitcher* singleton_; | 114 static ContextSwitcher* singleton_; |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 } } // namespace v8::internal | 117 } } // namespace v8::internal |
| 118 | 118 |
| 119 #endif // V8_V8THREADS_H_ | 119 #endif // V8_V8THREADS_H_ |
| OLD | NEW |