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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 void Locker::StopPreemption() { | 147 void Locker::StopPreemption() { |
148 v8::internal::ContextSwitcher::StopPreemption(); | 148 v8::internal::ContextSwitcher::StopPreemption(); |
149 } | 149 } |
150 | 150 |
151 | 151 |
152 namespace internal { | 152 namespace internal { |
153 | 153 |
154 | 154 |
155 bool ThreadManager::RestoreThread() { | 155 bool ThreadManager::RestoreThread() { |
156 ASSERT(IsLockedByCurrentThread()); | 156 ASSERT(IsLockedByCurrentThread()); |
157 // First check whether the current thread has been 'lazily archived', ie | 157 // First check whether the current thread has been 'lazily archived', i.e. |
158 // not archived at all. If that is the case we put the state storage we | 158 // not archived at all. If that is the case we put the state storage we |
159 // had prepared back in the free list, since we didn't need it after all. | 159 // had prepared back in the free list, since we didn't need it after all. |
160 if (lazily_archived_thread_.Equals(ThreadId::Current())) { | 160 if (lazily_archived_thread_.Equals(ThreadId::Current())) { |
161 lazily_archived_thread_ = ThreadId::Invalid(); | 161 lazily_archived_thread_ = ThreadId::Invalid(); |
162 Isolate::PerIsolateThreadData* per_thread = | 162 Isolate::PerIsolateThreadData* per_thread = |
163 isolate_->FindPerThreadDataForThisThread(); | 163 isolate_->FindPerThreadDataForThisThread(); |
164 ASSERT(per_thread != NULL); | 164 ASSERT(per_thread != NULL); |
165 ASSERT(per_thread->thread_state() == lazily_archived_thread_state_); | 165 ASSERT(per_thread->thread_state() == lazily_archived_thread_state_); |
166 lazily_archived_thread_state_->set_id(ThreadId::Invalid()); | 166 lazily_archived_thread_state_->set_id(ThreadId::Invalid()); |
167 lazily_archived_thread_state_->LinkInto(ThreadState::FREE_LIST); | 167 lazily_archived_thread_state_->LinkInto(ThreadState::FREE_LIST); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 // Acknowledge the preemption by the receiving thread. | 463 // Acknowledge the preemption by the receiving thread. |
464 void ContextSwitcher::PreemptionReceived() { | 464 void ContextSwitcher::PreemptionReceived() { |
465 ASSERT(Locker::IsLocked()); | 465 ASSERT(Locker::IsLocked()); |
466 // There is currently no accounting being done for this. But could be in the | 466 // There is currently no accounting being done for this. But could be in the |
467 // future, which is why we leave this in. | 467 // future, which is why we leave this in. |
468 } | 468 } |
469 | 469 |
470 | 470 |
471 } // namespace internal | 471 } // namespace internal |
472 } // namespace v8 | 472 } // namespace v8 |
OLD | NEW |