Changeset 28223 in webkit for trunk/JavaScriptCore/kjs/collector.cpp
- Timestamp:
- Nov 29, 2007, 7:02:08 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/collector.cpp
r28110 r28223 409 409 class Collector::Thread { 410 410 public: 411 Thread(pthread_t pthread, const PlatformThread& platThread) : posixThread(pthread), platformThread(platThread) {} 411 Thread(pthread_t pthread, const PlatformThread& platThread, void* base) 412 : posixThread(pthread), platformThread(platThread), stackBase(base) {} 412 413 Thread* next; 413 414 pthread_t posixThread; 414 415 PlatformThread platformThread; 416 void* stackBase; 415 417 }; 416 418 … … 465 467 #endif 466 468 467 Collector::Thread *thread = new Collector::Thread(pthread_self(), getCurrentPlatformThread() );469 Collector::Thread *thread = new Collector::Thread(pthread_self(), getCurrentPlatformThread(), currentThreadStackBase()); 468 470 469 471 thread->next = registeredThreads; … … 676 678 } 677 679 678 static inline void* otherThreadStackBase(const PlatformThreadRegisters& regs, Collector::Thread* thread)679 {680 #if PLATFORM(DARWIN)681 (void)regs;682 return pthread_get_stackaddr_np(thread->posixThread);683 // end PLATFORM(DARWIN);684 #elif PLATFORM(X86) && PLATFORM(WIN_OS)685 LDT_ENTRY desc;686 NT_TIB* tib;687 GetThreadSelectorEntry(thread->platformThread.handle, regs.SegFs, &desc);688 tib = (NT_TIB*)(uintptr_t)(desc.BaseLow | desc.HighWord.Bytes.BaseMid << 16 | desc.HighWord.Bytes.BaseHi << 24);689 ASSERT(tib == tib->Self);690 return tib->StackBase;691 #else692 #error Need a way to get the stack pointer for another thread on this platform693 #endif694 }695 696 680 void Collector::markOtherThreadConservatively(Thread* thread) 697 681 { … … 705 689 706 690 void* stackPointer = otherThreadStackPointer(regs); 707 void* stackBase = otherThreadStackBase(regs, thread); 708 markStackObjectsConservatively(stackPointer, stackBase); 691 markStackObjectsConservatively(stackPointer, thread->stackBase); 709 692 710 693 resumeThread(thread->platformThread);
Note:
See TracChangeset
for help on using the changeset viewer.