Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: src/v8threads.cc

Issue 113030: X64: Fixed conversion between tread_id (int) and void*. (Closed)
Patch Set: Addressed review comments Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/platform.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/platform.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698