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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 for (ThreadState* state = ThreadState::FirstInUse(); | 335 for (ThreadState* state = ThreadState::FirstInUse(); |
336 state != NULL; | 336 state != NULL; |
337 state = state->Next()) { | 337 state = state->Next()) { |
338 char* data = state->data(); | 338 char* data = state->data(); |
339 data += HandleScopeImplementer::ArchiveSpacePerThread(); | 339 data += HandleScopeImplementer::ArchiveSpacePerThread(); |
340 Top::IterateThread(v, data); | 340 Top::IterateThread(v, data); |
341 } | 341 } |
342 } | 342 } |
343 | 343 |
344 | 344 |
345 void ThreadManager::MarkCompactPrologue(bool is_compacting) { | |
346 for (ThreadState* state = ThreadState::FirstInUse(); | |
347 state != NULL; | |
348 state = state->Next()) { | |
349 char* data = state->data(); | |
350 data += HandleScopeImplementer::ArchiveSpacePerThread(); | |
351 Top::MarkCompactPrologue(is_compacting, data); | |
352 } | |
353 } | |
354 | |
355 | |
356 void ThreadManager::MarkCompactEpilogue(bool is_compacting) { | |
357 for (ThreadState* state = ThreadState::FirstInUse(); | |
358 state != NULL; | |
359 state = state->Next()) { | |
360 char* data = state->data(); | |
361 data += HandleScopeImplementer::ArchiveSpacePerThread(); | |
362 Top::MarkCompactEpilogue(is_compacting, data); | |
363 } | |
364 } | |
365 | |
366 | |
367 int ThreadManager::CurrentId() { | 345 int ThreadManager::CurrentId() { |
368 return Thread::GetThreadLocalInt(thread_id_key); | 346 return Thread::GetThreadLocalInt(thread_id_key); |
369 } | 347 } |
370 | 348 |
371 | 349 |
372 void ThreadManager::AssignId() { | 350 void ThreadManager::AssignId() { |
373 if (!HasId()) { | 351 if (!HasId()) { |
374 ASSERT(Locker::IsLocked()); | 352 ASSERT(Locker::IsLocked()); |
375 int thread_id = ++last_id_; | 353 int thread_id = ++last_id_; |
376 ASSERT(thread_id > 0); // see the comment near last_id_ definition. | 354 ASSERT(thread_id > 0); // see the comment near last_id_ definition. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 // Acknowledge the preemption by the receiving thread. | 430 // Acknowledge the preemption by the receiving thread. |
453 void ContextSwitcher::PreemptionReceived() { | 431 void ContextSwitcher::PreemptionReceived() { |
454 ASSERT(Locker::IsLocked()); | 432 ASSERT(Locker::IsLocked()); |
455 // There is currently no accounting being done for this. But could be in the | 433 // There is currently no accounting being done for this. But could be in the |
456 // future, which is why we leave this in. | 434 // future, which is why we leave this in. |
457 } | 435 } |
458 | 436 |
459 | 437 |
460 } // namespace internal | 438 } // namespace internal |
461 } // namespace v8 | 439 } // namespace v8 |
OLD | NEW |