about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2010-06-25 21:20:32 -0700
committerGraydon Hoare <graydon@mozilla.com>2010-06-25 21:20:32 -0700
commit0cf3c2ad935be699281ed20fb3d2f29554e6229b (patch)
treea7f11b7c13b5d55a3332a3d4842e4b507504ad7e
parent37180552769b316e7239d047008f187127e630e6 (diff)
Pass type parameters to free function called from sweep loop.
-rw-r--r--src/boot/be/x86.ml25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/boot/be/x86.ml b/src/boot/be/x86.ml
index 64eaea22a56..9d671c1b457 100644
--- a/src/boot/be/x86.ml
+++ b/src/boot/be/x86.ml
@@ -853,11 +853,6 @@ let gc_glue
       (Il.jmp Il.JNE
          (codefix skip_jmp_fix));               (* if unmarked (garbage)  *)
 
-    (* NB: ecx is a type descriptor now. *)
-    mov (rc eax)                                (* Load glue tydesc-off.  *)
-      (c (ecx_n Abi.tydesc_field_free_glue));
-    add eax ecx;                                (* Add to tydesc*         *)
-
     (* FIXME: this path is all wrong
      *
      * It actually needs to walk in two full passes over the chain:
@@ -878,11 +873,23 @@ let gc_glue
      *
      *)
 
-    push (ro edx);                      (* gc_val to drop                 *)
-    push (c task_ptr);                  (* form usual call to glue        *)
-    push (immi 0L);                     (* outptr                         *)
+    push (ro edx);                              (* Push gc_val to drop.   *)
+
+    (* NB: ecx is a type descriptor now. *)
+
+    mov (rc eax)                                (* Load typarams ptr.     *)
+      (c (ecx_n Abi.tydesc_field_first_param));
+    push (ro eax);                              (* Push typarams ptr.     *)
+
+    push (c task_ptr);                          (* Push task ptr.         *)
+    push (immi 0L);                             (* Push null outptr.      *)
+
+    mov (rc eax)                                (* Load glue tydesc-off.  *)
+      (c (ecx_n Abi.tydesc_field_free_glue));
+    add eax ecx;                                (* Add to tydesc*         *)
     emit (Il.call (rc eax)
-            (reg_codeptr (h eax)));     (* call glue_fn, trashing eax.    *)
+            (reg_codeptr (h eax)));             (* Call free glue.        *)
+    pop (rc eax);
     pop (rc eax);
     pop (rc eax);
     pop (rc eax);