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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 state != NULL; | 302 state != NULL; |
303 state = state->Next()) { | 303 state = state->Next()) { |
304 char* data = state->data(); | 304 char* data = state->data(); |
305 data += HandleScopeImplementer::ArchiveSpacePerThread(); | 305 data += HandleScopeImplementer::ArchiveSpacePerThread(); |
306 Top::MarkCompactEpilogue(is_compacting, data); | 306 Top::MarkCompactEpilogue(is_compacting, data); |
307 } | 307 } |
308 } | 308 } |
309 | 309 |
310 | 310 |
311 int ThreadManager::CurrentId() { | 311 int ThreadManager::CurrentId() { |
312 return bit_cast<int, void*>(Thread::GetThreadLocal(thread_id_key)); | 312 return Thread::GetThreadLocalInt(thread_id_key); |
313 } | 313 } |
314 | 314 |
315 | 315 |
316 void ThreadManager::AssignId() { | 316 void ThreadManager::AssignId() { |
317 if (Thread::GetThreadLocal(thread_id_key) == NULL) { | 317 if (!Thread::HasThreadLocal(thread_id_key)) { |
318 Thread::SetThreadLocal(thread_id_key, bit_cast<void*, int>(next_id_++)); | 318 Thread::SetThreadLocalInt(thread_id_key, next_id_++); |
319 } | 319 } |
320 } | 320 } |
321 | 321 |
322 | 322 |
323 // This is the ContextSwitcher singleton. There is at most a single thread | 323 // This is the ContextSwitcher singleton. There is at most a single thread |
324 // running which delivers preemption events to V8 threads. | 324 // running which delivers preemption events to V8 threads. |
325 ContextSwitcher* ContextSwitcher::singleton_ = NULL; | 325 ContextSwitcher* ContextSwitcher::singleton_ = NULL; |
326 | 326 |
327 | 327 |
328 ContextSwitcher::ContextSwitcher(int every_n_ms) | 328 ContextSwitcher::ContextSwitcher(int every_n_ms) |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 // Acknowledge the preemption by the receiving thread. | 376 // Acknowledge the preemption by the receiving thread. |
377 void ContextSwitcher::PreemptionReceived() { | 377 void ContextSwitcher::PreemptionReceived() { |
378 ASSERT(Locker::IsLocked()); | 378 ASSERT(Locker::IsLocked()); |
379 // There is currently no accounting being done for this. But could be in the | 379 // There is currently no accounting being done for this. But could be in the |
380 // future, which is why we leave this in. | 380 // future, which is why we leave this in. |
381 } | 381 } |
382 | 382 |
383 | 383 |
384 } // namespace internal | 384 } // namespace internal |
385 } // namespace v8 | 385 } // namespace v8 |
OLD | NEW |