Changeset 10713 in webkit for trunk/JavaScriptCore/kjs/collector.cpp
- Timestamp:
- Oct 3, 2005, 6:43:58 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/collector.cpp
r10701 r10713 32 32 #include <algorithm> 33 33 34 #if !WIN3234 #if __APPLE__ 35 35 36 36 #include <CoreFoundation/CoreFoundation.h> … … 40 40 #include <mach/thread_act.h> 41 41 42 #elif WIN32 43 44 #include <windows.h> 45 42 46 #else 43 47 44 #include < windows.h>48 #include <pthread.h> 45 49 46 50 #endif … … 292 296 setjmp(registers); 293 297 294 #if !WIN32298 #if __APPLE__ 295 299 pthread_t thread = pthread_self(); 296 300 void *stackBase = pthread_get_stackaddr_np(thread); 297 #el se301 #elif WIN32 298 302 NT_TIB *pTib; 299 303 __asm { … … 302 306 } 303 307 void *stackBase = (void *)pTib->StackBase; 308 #else 309 void *stackBase = 0; 310 pthread_attr_t sattr; 311 // FIXME: this function is non-portable; other POSIX systems may have different np alternatives 312 pthread_getattr_np(pthread_self(), &sattr); 313 // Should work but fails on Linux (?) 314 // pthread_attr_getstack(&sattr, &stackBase, &stackSize); 315 pthread_attr_getstackaddr(&sattr, &stackBase); 316 assert(stackBase); 304 317 #endif 305 318 … … 318 331 thread_suspend(thread->machThread); 319 332 320 #if defined(__i386__)333 #if __i386__ 321 334 i386_thread_state_t regs; 322 335 unsigned user_count = sizeof(regs)/sizeof(int); 323 336 thread_state_flavor_t flavor = i386_THREAD_STATE; 324 #elif defined(__ppc__)337 #elif __ppc__ 325 338 ppc_thread_state_t regs; 326 339 unsigned user_count = PPC_THREAD_STATE_COUNT; 327 340 thread_state_flavor_t flavor = PPC_THREAD_STATE; 328 #elif defined(__ppc64__)341 #elif __ppc64__ 329 342 ppc_thread_state64_t regs; 330 343 unsigned user_count = PPC_THREAD_STATE64_COUNT; … … 340 353 341 354 // scan the stack 342 #if defined(__i386__)355 #if __i386__ 343 356 markStackObjectsConservatively((void *)regs.esp, pthread_get_stackaddr_np(thread->posixThread)); 344 357 #elif defined(__ppc__) || defined(__ppc64__)
Note:
See TracChangeset
for help on using the changeset viewer.