Make killThread# cmm primop use local stack allocation
authorDuncan Coutts <duncan@well-typed.com>
Wed, 10 Jun 2009 17:22:15 +0000 (17:22 +0000)
committerDuncan Coutts <duncan@well-typed.com>
Wed, 10 Jun 2009 17:22:15 +0000 (17:22 +0000)
It using the mp_tmp_w register/global as a convenient temporary
variable. This is naughty because those vars are supposed to be
for gmp. Also, we want to remove the gmp temp vars so we must
now use a local stack slot instead.

rts/Exception.cmm

index 43f53c7..cf24ef5 100644 (file)
@@ -187,6 +187,7 @@ killThreadzh_fast
     target = R1;
     exception = R2;
     
+    /* Needs 3 words because throwToSingleThreaded uses some stack */
     STK_CHK_GEN( WDS(3), R1_PTR & R2_PTR, killThreadzh_fast);
 
     /* 
@@ -215,8 +216,8 @@ killThreadzh_fast
     } else {
        W_ out;
        W_ retcode;
-       out = BaseReg + OFFSET_StgRegTable_rmp_tmp_w;
-       
+       out = Sp - WDS(1); /* ok to re-use stack space here */
+
        (retcode) = foreign "C" throwTo(MyCapability() "ptr",
                                      CurrentTSO "ptr",
                                      target "ptr",