diff options
| author | Graydon Hoare <[email protected]> | 2010-06-25 21:20:32 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-06-25 21:20:32 -0700 |
| commit | 0cf3c2ad935be699281ed20fb3d2f29554e6229b (patch) | |
| tree | a7f11b7c13b5d55a3332a3d4842e4b507504ad7e /src/boot/be | |
| parent | Align emitted DATA_* elements -- tydescs in particular -- to 16 byte boundari... (diff) | |
| download | rust-0cf3c2ad935be699281ed20fb3d2f29554e6229b.tar.xz rust-0cf3c2ad935be699281ed20fb3d2f29554e6229b.zip | |
Pass type parameters to free function called from sweep loop.
Diffstat (limited to 'src/boot/be')
| -rw-r--r-- | src/boot/be/x86.ml | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/boot/be/x86.ml b/src/boot/be/x86.ml index 64eaea22..9d671c1b 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); |