Mercurial > projects > ldc
diff tango/lib/gc/basic/gcx.d @ 242:ab43d1e1bf2a trunk
[svn r259] Enabled ASM for the GC, this closes #45 by saving the registers on the stack.
author | lindquist |
---|---|
date | Mon, 09 Jun 2008 02:05:02 +0200 |
parents | e881c9b1c738 |
children | 23d0d9855cad |
line wrap: on
line diff
--- a/tango/lib/gc/basic/gcx.d Mon Jun 09 00:28:02 2008 +0200 +++ b/tango/lib/gc/basic/gcx.d Mon Jun 09 02:05:02 2008 +0200 @@ -2058,8 +2058,27 @@ size_t result; version(LLVMDC) { - // TODO & BUG: - // should make sure registers are on the stack, maybe some external asm ? + // put registers on the stack + version(D_InlineAsm_X86) + { + uint _eax, _ecx, _edx, _ebx, _esp, _ebp, _esi, _edi; + asm + { + mov _eax, EAX; + mov _ecx, ECX; + mov _edx, EDX; + mov _ebx, EBX; + mov _esp, ESP; + mov _ebp, EBP; + mov _esi, ESI; + mov _edi, EDI; + mov sp, ESP; + } + } + else + { + // FIXME + } } else version (GNU) {