[jit] Introduce has_indirection flag in MonoCompile to signal that LDADDR was generated.
[mono.git] / mono / mini / tasklets.c
index 73d71fe074a8f9db5793922f31147d2369dc96dc..d94448ab5f1f11152b3e9f1fc0d8d8c4b1deb39f 100644 (file)
@@ -19,7 +19,7 @@ internal_init (void)
 {
        if (keepalive_stacks)
                return;
-       MONO_GC_REGISTER_ROOT (keepalive_stacks);
+       MONO_GC_REGISTER_ROOT_PINNING (keepalive_stacks);
        keepalive_stacks = mono_g_hash_table_new (NULL, NULL);
 }
 
@@ -54,7 +54,7 @@ continuation_mark_frame (MonoContinuation *cont)
        if (cont->domain)
                return mono_get_exception_argument ("cont", "Already marked");
 
-       jit_tls = TlsGetValue (mono_jit_tls_id);
+       jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
        lmf = mono_get_lmf();
        cont->domain = mono_domain_get ();
        cont->thread_id = GetCurrentThreadId ();
@@ -69,12 +69,12 @@ continuation_mark_frame (MonoContinuation *cont)
                ctx = new_ctx;
                if (endloop)
                        break;
-               if (strcmp (ji->method->name, "Mark") == 0)
+               if (strcmp (jinfo_get_method (ji)->name, "Mark") == 0)
                        endloop = TRUE;
        } while (1);
 
        cont->top_sp = MONO_CONTEXT_GET_SP (&ctx);
-       /*g_print ("method: %s, sp: %p\n", ji->method->name, cont->top_sp);*/
+       /*g_print ("method: %s, sp: %p\n", jinfo_get_method (ji)->name, cont->top_sp);*/
 
        return NULL;
 }
@@ -104,8 +104,10 @@ continuation_store (MonoContinuation *cont, int state, MonoException **e)
 
        if (cont->saved_stack && num_bytes <= cont->stack_alloc_size) {
                /* clear to avoid GC retention */
-               if (num_bytes < cont->stack_used_size)
+               if (num_bytes < cont->stack_used_size) {
                        memset ((char*)cont->saved_stack + num_bytes, 0, cont->stack_used_size - num_bytes);
+               }
+               cont->stack_used_size = num_bytes;
        } else {
                tasklets_lock ();
                internal_init ();