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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 ASSERT(state->id() == kInvalidId); | 254 ASSERT(state->id() == kInvalidId); |
255 state->set_id(CurrentId()); | 255 state->set_id(CurrentId()); |
256 ASSERT(state->id() != kInvalidId); | 256 ASSERT(state->id() != kInvalidId); |
257 } | 257 } |
258 | 258 |
259 | 259 |
260 void ThreadManager::EagerlyArchiveThread() { | 260 void ThreadManager::EagerlyArchiveThread() { |
261 ThreadState* state = lazily_archived_thread_state_; | 261 ThreadState* state = lazily_archived_thread_state_; |
262 state->LinkInto(ThreadState::IN_USE_LIST); | 262 state->LinkInto(ThreadState::IN_USE_LIST); |
263 char* to = state->data(); | 263 char* to = state->data(); |
| 264 // Ensure that data containing GC roots are archived first, and handle them |
| 265 // in ThreadManager::Iterate(ObjectVisitor*). |
264 to = HandleScopeImplementer::ArchiveThread(to); | 266 to = HandleScopeImplementer::ArchiveThread(to); |
265 to = Top::ArchiveThread(to); | 267 to = Top::ArchiveThread(to); |
266 #ifdef ENABLE_DEBUGGER_SUPPORT | 268 #ifdef ENABLE_DEBUGGER_SUPPORT |
267 to = Debug::ArchiveDebug(to); | 269 to = Debug::ArchiveDebug(to); |
268 #endif | 270 #endif |
269 to = StackGuard::ArchiveStackGuard(to); | 271 to = StackGuard::ArchiveStackGuard(to); |
270 to = RegExpStack::ArchiveStack(to); | 272 to = RegExpStack::ArchiveStack(to); |
271 to = Bootstrapper::ArchiveState(to); | 273 to = Bootstrapper::ArchiveState(to); |
272 lazily_archived_thread_.Initialize(ThreadHandle::INVALID); | 274 lazily_archived_thread_.Initialize(ThreadHandle::INVALID); |
273 lazily_archived_thread_state_ = NULL; | 275 lazily_archived_thread_state_ = NULL; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 // Acknowledge the preemption by the receiving thread. | 378 // Acknowledge the preemption by the receiving thread. |
377 void ContextSwitcher::PreemptionReceived() { | 379 void ContextSwitcher::PreemptionReceived() { |
378 ASSERT(Locker::IsLocked()); | 380 ASSERT(Locker::IsLocked()); |
379 // There is currently no accounting being done for this. But could be in the | 381 // There is currently no accounting being done for this. But could be in the |
380 // future, which is why we leave this in. | 382 // future, which is why we leave this in. |
381 } | 383 } |
382 | 384 |
383 | 385 |
384 } // namespace internal | 386 } // namespace internal |
385 } // namespace v8 | 387 } // namespace v8 |
OLD | NEW |