[vmkit-commits] [vmkit] r82044 - /vmkit/trunk/include/mvm/Threads/Thread.h

Nicolas Geoffray nicolas.geoffray at lip6.fr
Wed Sep 16 06:13:06 PDT 2009


Author: geoffray
Date: Wed Sep 16 08:13:05 2009
New Revision: 82044

URL: http://llvm.org/viewvc/llvm-project?rev=82044&view=rev
Log:
When entering uncooperative mode, set the lastSP as a "living" lastSP:
the data it points to won't be replaced while the thread is
executing uncooperative code.


Modified:
    vmkit/trunk/include/mvm/Threads/Thread.h

Modified: vmkit/trunk/include/mvm/Threads/Thread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Thread.h?rev=82044&r1=82043&r2=82044&view=diff

==============================================================================
--- vmkit/trunk/include/mvm/Threads/Thread.h (original)
+++ vmkit/trunk/include/mvm/Threads/Thread.h Wed Sep 16 08:13:05 2009
@@ -197,9 +197,10 @@
   void* getLastSP() { return lastSP; }
   void  setLastSP(void* V) { lastSP = V; }
 
-  void enterUncooperativeCode() {
+  void enterUncooperativeCode(unsigned level = 0) {
     if (isMvmThread()) {
       lastSP = __builtin_frame_address(0);
+      while (level--) lastSP = ((void**)lastSP)[0];
       if (doYield && !inGC) joinCollection();
     }
   }





More information about the vmkit-commits mailing list