changeset 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 53568c37cfa7
children 4d006f7b2ada
files llvmdc.kdevelop.filelist tango/lib/gc/basic/gcx.d tango/lib/gc/basic/llvmdc.mak
diffstat 3 files changed, 24 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/llvmdc.kdevelop.filelist	Mon Jun 09 00:28:02 2008 +0200
+++ b/llvmdc.kdevelop.filelist	Mon Jun 09 02:05:02 2008 +0200
@@ -783,6 +783,7 @@
 tangotests/s.d
 tangotests/stdout1.d
 tangotests/stdout2.d
+tangotests/sync1.d
 tangotests/t.d
 tangotests/templ1.d
 tangotests/vararg1.d
--- 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)
         {
--- a/tango/lib/gc/basic/llvmdc.mak	Mon Jun 09 00:28:02 2008 +0200
+++ b/tango/lib/gc/basic/llvmdc.mak	Mon Jun 09 02:05:02 2008 +0200
@@ -24,10 +24,10 @@
 CFLAGS=-g $(ADD_CFLAGS)
 
 #DFLAGS=-release -O3 -inline -w -nofloat $(ADD_DFLAGS)
-DFLAGS=-g -w -nofloat -noasm $(ADD_DFLAGS)
+DFLAGS=-g -w -nofloat $(ADD_DFLAGS)
 
 #TFLAGS=-O3 -inline -w -nofloat $(ADD_DFLAGS)
-TFLAGS=-g -w -nofloat -noasm $(ADD_DFLAGS)
+TFLAGS=-g -w -nofloat $(ADD_DFLAGS)
 
 DOCFLAGS=-version=DDoc