Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Changeset 640:c2a342b5d8e5

Show
Ignore:
Timestamp:
10/02/08 18:42:17 (3 months ago)
Author:
Christian Kamm <kamm incasoftware de>
branch:
default
Message:

Made Fibers work with LLVMDC on x86 Posix.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • runtime/llvmdc.diff

    r636 r640  
    11Index: object.di 
    22=================================================================== 
    3 --- object.di   (revision 3950
     3--- object.di   (revision 3954
    44+++ object.di   (working copy) 
    55@@ -150,6 +150,9 @@ 
     
    1515Index: lib/common/tango/core/BitManip.d 
    1616=================================================================== 
    17 --- lib/common/tango/core/BitManip.d    (revision 3950
     17--- lib/common/tango/core/BitManip.d    (revision 3954
    1818+++ lib/common/tango/core/BitManip.d    (working copy) 
    1919@@ -171,6 +171,10 @@ 
     
    3030Index: lib/common/tango/core/Thread.d 
    3131=================================================================== 
    32 --- lib/common/tango/core/Thread.d  (revision 3950
     32--- lib/common/tango/core/Thread.d  (revision 3954
    3333+++ lib/common/tango/core/Thread.d  (working copy) 
    3434@@ -244,8 +244,29 @@ 
     
    7777                 { 
    7878                     popad; 
    79 @@ -2306,10 +2331,10 @@ 
     79@@ -2286,6 +2311,13 @@ 
     80             version = AsmPPC_Posix; 
     81     } 
     82  
     83+    version( LLVM_InlineAsm_X86 ) 
     84+    { 
     85+        version( Win32 ) 
     86+            version = LLVM_AsmX86_Win32; 
     87+        else version( Posix ) 
     88+            version = LLVM_AsmX86_Posix; 
     89+    } 
     90  
     91     version( Posix ) 
     92     { 
     93@@ -2296,6 +2328,8 @@ 
     94         version( AsmX86_Win32 ) {} else 
     95         version( AsmX86_Posix ) {} else 
     96         version( AsmPPC_Posix ) {} else 
     97+        version( LLVM_AsmX86_Win32 ) {} else 
     98+        version( LLVM_AsmX86_Posix ) {} else 
     99         { 
     100             // NOTE: The ucontext implementation requires architecture specific 
     101             //       data definitions to operate so testing for it must be done 
     102@@ -2306,10 +2340,10 @@ 
    80103             import tango.stdc.posix.ucontext; 
    81104         } 
     
    90113 static this() 
    91114 { 
     115@@ -2336,7 +2370,7 @@ 
     116     } 
     117 } 
     118  
     119- 
     120+extern(C) int printf(char*, ...); 
     121 //////////////////////////////////////////////////////////////////////////////// 
     122 // Fiber Entry Point and Context Switch 
     123 //////////////////////////////////////////////////////////////////////////////// 
     124@@ -2450,6 +2484,17 @@ 
     125                 ret; 
     126             } 
     127         } 
     128+        else version( LLVM_AsmX86_Posix ) 
     129+        { 
     130+            asm 
     131+            { 
     132+                // store oldp again with more accurate address 
     133+                mov EAX, oldp; 
     134+                mov [EAX], ESP; 
     135+                // load newp to begin context switch 
     136+                mov ESP, newp; 
     137+            } 
     138+        } 
     139         else static if( is( ucontext_t ) ) 
     140         { 
     141             Fiber   cfib = Fiber.getThis(); 
     142@@ -3115,6 +3160,13 @@ 
     143             push( 0x00000000 );                                     // ESI 
     144             push( 0x00000000 );                                     // EDI 
     145         } 
     146+        else version( LLVM_AsmX86_Posix ) 
     147+        { 
     148+            push( cast(size_t) &fiber_entryPoint );                 // EIP 
     149+            push( 0x00000000 );                                     // EBP 
     150+            push( 0x00000000 );                                     // newp 
     151+            push( 0x00000000 );                                     // oldp 
     152+        } 
     153         else version( AsmPPC_Posix ) 
     154         { 
     155             version( StackGrowsDown ) 
    92156Index: lib/unittest.sh 
    93157=================================================================== 
    94 --- lib/unittest.sh (revision 3950
     158--- lib/unittest.sh (revision 3954
    95159+++ lib/unittest.sh (working copy) 
    96160@@ -18,8 +18,9 @@ 
     
    149213Index: lib/gc/basic/gcx.d 
    150214=================================================================== 
    151 --- lib/gc/basic/gcx.d  (revision 3950
     215--- lib/gc/basic/gcx.d  (revision 3954
    152216+++ lib/gc/basic/gcx.d  (working copy) 
    153217@@ -65,6 +65,13 @@ 
     
    221285Index: lib/gc/basic/gcbits.d 
    222286=================================================================== 
    223 --- lib/gc/basic/gcbits.d   (revision 3950
     287--- lib/gc/basic/gcbits.d   (revision 3954
    224288+++ lib/gc/basic/gcbits.d   (working copy) 
    225289@@ -39,6 +39,10 @@ 
     
    236300Index: tango/text/convert/Layout.d 
    237301=================================================================== 
    238 --- tango/text/convert/Layout.d (revision 3950
     302--- tango/text/convert/Layout.d (revision 3954
    239303+++ tango/text/convert/Layout.d (working copy) 
    240304@@ -47,6 +47,12 @@ 
     
    271335                         byte[64] byteargs = void; 
    272336                         long[64] longargs = void; 
    273 Index: tango/text/xml/Document.d 
    274 =================================================================== 
    275 --- tango/text/xml/Document.d   (revision 3950) 
    276 +++ tango/text/xml/Document.d   (working copy) 
    277 @@ -1243,7 +1243,8 @@ 
    278                     freeIndex = 0; 
    279                     } 
    280   
    281 -                NodeSet set = {this}; 
    282 +                NodeSet set; 
    283 +                set.host = this; 
    284                  auto mark = freeIndex; 
    285                  allocate(root); 
    286                  return set.assign (mark); 
    287 @@ -1273,7 +1274,8 @@ 
    288           
    289                  NodeSet dup () 
    290                  { 
    291 -                        NodeSet copy = {host}; 
    292 +                        NodeSet copy; 
    293 +                        copy.host = host; 
    294                          copy.nodes = nodes.dup; 
    295                          return copy; 
    296                  } 
    297 @@ -1337,7 +1339,7 @@ 
    298           
    299                  NodeSet nth (uint index) 
    300                  { 
    301 -                        NodeSet set = {host}; 
    302 +                        NodeSet set; set.host = host; 
    303                          auto mark = host.mark; 
    304                          if (index < nodes.length) 
    305                              host.allocate (nodes [index]); 
    306 @@ -1495,7 +1497,7 @@ 
    307           
    308                  NodeSet filter (bool delegate(Node) filter) 
    309                  { 
    310 -                        NodeSet set = {host}; 
    311 +                        NodeSet set; set.host = host; 
    312                          auto mark = host.mark; 
    313   
    314                          foreach (node; nodes) 
    315 @@ -1514,7 +1516,7 @@ 
    316                  NodeSet child (bool delegate(Node) filter,  
    317                                 XmlNodeType type = XmlNodeType.Element) 
    318                  { 
    319 -                        NodeSet set = {host}; 
    320 +                        NodeSet set; set.host = host; 
    321                          auto mark = host.mark; 
    322   
    323                          foreach (parent; nodes) 
    324 @@ -1534,7 +1536,7 @@ 
    325           
    326                  NodeSet attribute (bool delegate(Node) filter) 
    327                  { 
    328 -                        NodeSet set = {host}; 
    329 +                        NodeSet set; set.host = host; 
    330                          auto mark = host.mark; 
    331   
    332                          foreach (node; nodes) 
    333 @@ -1565,7 +1567,7 @@ 
    334                                           }                                                 
    335                          } 
    336   
    337 -                        NodeSet set = {host}; 
    338 +                        NodeSet set; set.host = host; 
    339                          auto mark = host.mark; 
    340   
    341                          foreach (node; nodes) 
    342 @@ -1583,7 +1585,7 @@ 
    343           
    344                  NodeSet parent (bool delegate(Node) filter) 
    345                  { 
    346 -                        NodeSet set = {host}; 
    347 +                        NodeSet set; set.host = host; 
    348                          auto mark = host.mark; 
    349   
    350                          foreach (node; nodes) 
    351 @@ -1613,7 +1615,7 @@ 
    352           
    353                  NodeSet ancestor (bool delegate(Node) filter) 
    354                  { 
    355 -                        NodeSet set = {host}; 
    356 +                        NodeSet set; set.host = host; 
    357                          auto mark = host.mark; 
    358   
    359                          void traverse (Node child) 
    360 @@ -1648,7 +1650,7 @@ 
    361                  NodeSet next (bool delegate(Node) filter,  
    362                                XmlNodeType type = XmlNodeType.Element) 
    363                  { 
    364 -                        NodeSet set = {host}; 
    365 +                        NodeSet set; set.host = host; 
    366                          auto mark = host.mark; 
    367   
    368                          foreach (node; nodes) 
    369 @@ -1675,7 +1677,7 @@ 
    370                  NodeSet prev (bool delegate(Node) filter,  
    371                                XmlNodeType type = XmlNodeType.Element) 
    372                  { 
    373 -                        NodeSet set = {host}; 
    374 +                        NodeSet set; set.host = host; 
    375                          auto mark = host.mark; 
    376   
    377                          foreach (node; nodes) 
    378337Index: tango/core/Vararg.d 
    379338=================================================================== 
    380 --- tango/core/Vararg.d (revision 3950
     339--- tango/core/Vararg.d (revision 3954
    381340+++ tango/core/Vararg.d (working copy) 
    382341@@ -15,6 +15,10 @@ 
     
    393352Index: tango/core/Atomic.d 
    394353=================================================================== 
    395 --- tango/core/Atomic.d (revision 3950
     354--- tango/core/Atomic.d (revision 3954
    396355+++ tango/core/Atomic.d (working copy) 
    397356@@ -270,6 +270,167 @@ 
     
    565524Index: tango/math/Math.d 
    566525=================================================================== 
    567 --- tango/math/Math.d   (revision 3950
     526--- tango/math/Math.d   (revision 3954
    568527+++ tango/math/Math.d   (working copy) 
    569528@@ -76,6 +76,14 @@ 
     
    714673Index: tango/math/internal/BignumX86.d 
    715674=================================================================== 
    716 --- tango/math/internal/BignumX86.d (revision 3950
     675--- tango/math/internal/BignumX86.d (revision 3954
    717676+++ tango/math/internal/BignumX86.d (working copy) 
    718 @@ -53,6 +53,8 @@ 
     677@@ -56,6 +56,8 @@ 
    719678 private: 
    720679 version(GNU) { 
     
    727686Index: tango/stdc/stdlib.d 
    728687=================================================================== 
    729 --- tango/stdc/stdlib.d (revision 3950
     688--- tango/stdc/stdlib.d (revision 3954
    730689+++ tango/stdc/stdlib.d (working copy) 
    731690@@ -94,6 +94,11 @@ 
     
    743702Index: tango/stdc/stdarg.d 
    744703=================================================================== 
    745 --- tango/stdc/stdarg.d (revision 3950
     704--- tango/stdc/stdarg.d (revision 3954
    746705+++ tango/stdc/stdarg.d (working copy) 
    747706@@ -13,6 +13,10 @@ 
Copyright © 2008, LDC Development Team.