diff options
author | Elijah Taylor <elijahtaylor@google.com> | 2013-02-01 00:48:49 +0400 |
---|---|---|
committer | Zoltan Varga <vargaz@gmail.com> | 2013-03-21 08:16:56 +0400 |
commit | b46a770869089fb92c4c452d9f6102ec5cb4c3e3 (patch) | |
tree | 23f2f73052a75243a1c55407bf2e1eaa0efd7a02 /libgc/pthread_stop_world.c | |
parent | 99f40ae5bb013e1c2f7b341b9ad9719cf2b72d29 (diff) |
NaCl GC improvements
- inline managed code implementation
(add x86 test mem imm8 codegen macro for this as well)
- clean up libgc NaCl code
- centralize mono_nacl_gc into mini.c
Diffstat (limited to 'libgc/pthread_stop_world.c')
-rw-r--r-- | libgc/pthread_stop_world.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/libgc/pthread_stop_world.c b/libgc/pthread_stop_world.c index e6ac64b62a8..05e897fb739 100644 --- a/libgc/pthread_stop_world.c +++ b/libgc/pthread_stop_world.c @@ -27,10 +27,10 @@ int nacl_park_threads_now = 0; pthread_t nacl_thread_parker = -1; -int nacl_thread_parked[MAX_NACL_GC_THREADS]; -int nacl_thread_used[MAX_NACL_GC_THREADS]; -int nacl_thread_parking_inited = 0; -int nacl_num_gc_threads = 0; +volatile int nacl_thread_parked[MAX_NACL_GC_THREADS]; +volatile int nacl_thread_used[MAX_NACL_GC_THREADS]; +volatile int nacl_thread_parking_inited = 0; +volatile int nacl_num_gc_threads = 0; pthread_mutex_t nacl_thread_alloc_lock = PTHREAD_MUTEX_INITIALIZER; __thread int nacl_thread_idx = -1; __thread GC_thread nacl_gc_thread_self = NULL; @@ -513,29 +513,28 @@ static void pthread_stop_world() #define NACL_STORE_REGS() \ do { \ - asm("push %rbx");\ - asm("push %rbp");\ - asm("push %r12");\ - asm("push %r13");\ - asm("push %r14");\ - asm("push %r15");\ - asm("mov %%esp, %0" : "=m" (nacl_gc_thread_self->stop_info.stack_ptr));\ + __asm__ __volatile__ ("push %rbx");\ + __asm__ __volatile__ ("push %rbp");\ + __asm__ __volatile__ ("push %r12");\ + __asm__ __volatile__ ("push %r13");\ + __asm__ __volatile__ ("push %r14");\ + __asm__ __volatile__ ("push %r15");\ + __asm__ __volatile__ ("mov %%esp, %0" : "=m" (nacl_gc_thread_self->stop_info.stack_ptr));\ memcpy(nacl_gc_thread_self->stop_info.reg_storage, nacl_gc_thread_self->stop_info.stack_ptr, NACL_GC_REG_STORAGE_SIZE * sizeof(ptr_t));\ - asm("add $48, %esp");\ - asm("add %r15, %rsp");\ + __asm__ __volatile__ ("naclasp $48, %r15");\ } while (0) #elif __i386__ #define NACL_STORE_REGS() \ do { \ - asm("push %ebx");\ - asm("push %ebp");\ - asm("push %esi");\ - asm("push %edi");\ - asm("mov %%esp, %0" : "=m" (nacl_gc_thread_self->stop_info.stack_ptr));\ + __asm__ __volatile__ ("push %ebx");\ + __asm__ __volatile__ ("push %ebp");\ + __asm__ __volatile__ ("push %esi");\ + __asm__ __volatile__ ("push %edi");\ + __asm__ __volatile__ ("mov %%esp, %0" : "=m" (nacl_gc_thread_self->stop_info.stack_ptr));\ memcpy(nacl_gc_thread_self->stop_info.reg_storage, nacl_gc_thread_self->stop_info.stack_ptr, NACL_GC_REG_STORAGE_SIZE * sizeof(ptr_t));\ - asm("add $16, %esp");\ + __asm__ __volatile__ ("add $16, %esp");\ } while (0) #endif |