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

Changeset 775:0375841e3175

Show
Ignore:
Timestamp:
11/20/08 11:03:18 (2 months ago)
Author:
tomas@myhost
branch:
default
Message:

Updated Tango patch for latest trunk

Files:

Legend:

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

    r755 r775  
    11Index: object.di 
    22=================================================================== 
    3 --- object.di   (revision 4071
     3--- object.di   (revision 4097
    44+++ object.di   (working copy) 
    55@@ -150,6 +150,9 @@ 
     
    1313 } 
    1414  
    15 Index: lib/unittest.sh 
    16 =================================================================== 
    17 --- lib/unittest.sh (revision 4071) 
    18 +++ lib/unittest.sh (working copy) 
    19 @@ -18,8 +18,9 @@ 
    20    --help: This message 
    21    --run-all: Reports result instead of breaking. Do not use this if you want to 
    22           run unittest runner through a debugger. 
    23 -  dmd: Builds unittests for dmd 
    24 -  gdc: Builds unittests for gdc 
    25 +  dmd:    Builds unittests for dmd 
    26 +  gdc:    Builds unittests for gdc 
    27 +  ldc: Builds unittests for ldc 
    28   
    29    <none>: Builds unittests for all known compilers.' 
    30    exit 0 
    31 @@ -86,7 +87,7 @@ 
    32  void main() {} 
    33  EOF 
    34   
    35 -        rebuild -w -d -g -L-ldl -L-lz -L-lbz2 -debug=UnitTest -debug -full -clean -unittest \ 
    36 +        rebuild -w -d -L-ldl -L-lz -L-lbz2 -debug=UnitTest -debug -full -clean -unittest \ 
    37          -version=UnitTest $EXE.d tango/core/*.d tango/core/sync/*.d tango/io/digest/*.d \ 
    38          tango/io/model/*.d tango/io/protocol/*.d tango/io/selector/*.d tango/io/*.d \ 
    39          tango/io/vfs/*.d tango/io/vfs/model/*.d \ 
    40 @@ -125,6 +126,9 @@ 
    41          gdc) 
    42              GDC=1 
    43              ;; 
    44 +        ldc) 
    45 +            LDC=1 
    46 +            ;; 
    47          *) 
    48              usage 
    49              ;; 
    50 @@ -132,10 +136,11 @@ 
    51      shift 
    52  done 
    53   
    54 -if [ ! "$DMD" -a ! "$GDC" ] 
    55 +if [ ! "$DMD" -a ! "$GDC" -a ! "$LDC" ] 
    56  then 
    57      DMD=1 
    58      GDC=1 
    59 +    LDC=1 
    60  fi 
    61   
    62  if [ "$DMD" = "1" ] 
    63 @@ -146,4 +151,7 @@ 
    64  then 
    65      compile gdc runUnitTest_gdc 
    66  fi 
    67 - 
    68 +if [ "$LDC" = "1" ] 
    69 +then 
    70 +    compile ldc runUnitTest_ldc 
    71 +fi 
    7215Index: lib/common/tango/core/BitManip.d 
    7316=================================================================== 
    74 --- lib/common/tango/core/BitManip.d    (revision 4071
     17--- lib/common/tango/core/BitManip.d    (revision 4097
    7518+++ lib/common/tango/core/BitManip.d    (working copy) 
    7619@@ -171,6 +171,10 @@ 
     
    8730Index: lib/common/tango/core/Thread.d 
    8831=================================================================== 
    89 --- lib/common/tango/core/Thread.d  (revision 4071
     32--- lib/common/tango/core/Thread.d  (revision 4097
    9033+++ lib/common/tango/core/Thread.d  (working copy) 
    91 @@ -247,6 +247,7 @@ 
    92          // used to track the number of suspended threads 
    93          // 
    94          sem_t   suspendCount; 
    95 +        sem_t*  suspendCountPtr; 
    96   
    97   
    98          extern (C) void thread_suspendHandler( int sig ) 
    99 @@ -256,8 +257,50 @@ 
     34@@ -273,8 +273,50 @@ 
    10035         } 
    10136         body 
     
    14984                 { 
    15085                     pushad; 
    151 @@ -298,7 +341,7 @@ 
    152                  status = sigdelset( &sigres, SIGUSR2 ); 
    153                  assert( status == 0 ); 
    154   
    155 -                status = sem_post( &suspendCount ); 
    156 +                status = sem_post( suspendCountPtr ); 
    157                  assert( status == 0 ); 
    158   
    159                  sigsuspend( &sigres ); 
    160 @@ -309,8 +352,12 @@ 
     86@@ -330,8 +372,12 @@ 
    16187                 } 
    16288             } 
     
    17298                 { 
    17399                     popad; 
    174 @@ -1584,8 +1631,14 @@ 
    175          status = sigaction( SIGUSR2, &sigusr2, null ); 
    176          assert( status == 0 ); 
    177   
    178 -        status = sem_init( &suspendCount, 0, 0 ); 
    179 -        assert( status == 0 ); 
    180 +        version(darwin){ 
    181 +            suspendCountPtr = sem_open( "/thread_init/sem\0".ptr, 0 ); 
    182 +            assert( suspendCountPtr !is null ); 
    183 +        }else { 
    184 +            status=sem_init(&suspendCount,0,0); 
    185 +            suspendCountPtr=&suspendCount; 
    186 +            assert(status==0); 
    187 +        } 
    188   
    189          status = pthread_key_create( &Thread.sm_this, null ); 
    190          assert( status == 0 ); 
    191 @@ -1793,7 +1846,7 @@ 
    192                  //       to simply loop on sem_wait at the end, but I'm not 
    193                  //       convinced that this would be much faster than the 
    194                  //       current approach. 
    195 -                sem_wait( &suspendCount ); 
    196 +                sem_wait( suspendCountPtr ); 
    197              } 
    198              else if( !t.m_lock ) 
    199              { 
    200 @@ -2298,7 +2351,20 @@ 
    201              version = AsmPPC_Posix; 
    202      } 
    203   
    204 +    version( LLVM_InlineAsm_X86 ) 
    205 +    { 
    206 +        version( Win32 ) 
    207 +            version = LLVM_AsmX86_Win32; 
    208 +        else version( Posix ) 
    209 +            version = LLVM_AsmX86_Posix; 
    210 +    } 
    211 +    else version( LLVM_InlineAsm_X86_64 ) 
    212 +    { 
    213 +        version( Posix ) 
    214 +            version = LLVM_AsmX86_64_Posix; 
    215 +    } 
    216   
    217 
    218      version( Posix ) 
    219      { 
    220          import tango.stdc.posix.unistd;   // for sysconf 
    221 @@ -2308,6 +2374,10 @@ 
     100@@ -2357,6 +2403,10 @@ 
    222101         version( AsmX86_Win32 ) {} else 
    223102         version( AsmX86_Posix ) {} else 
     
    230109             // NOTE: The ucontext implementation requires architecture specific 
    231110             //       data definitions to operate so testing for it must be done 
    232 @@ -2318,10 +2388,10 @@ 
    233              import tango.stdc.posix.ucontext; 
    234          } 
    235      } 
    236 
    237 -    const size_t PAGESIZE; 
    238  } 
    239   
    240 +// this can't be private since it's used as default argument to a public function 
    241 +const size_t PAGESIZE; 
    242   
    243  static this() 
    244  { 
    245 @@ -2348,7 +2418,7 @@ 
     111@@ -2522,7 +2572,7 @@ 
    246112     } 
    247113 } 
     
    250116+extern(C) int printf(char*, ...); 
    251117 //////////////////////////////////////////////////////////////////////////////// 
    252  // Fiber Entry Point and Context Switch 
     118 // Fiber 
    253119 //////////////////////////////////////////////////////////////////////////////// 
    254 @@ -2462,6 +2532,28 @@ 
    255                  ret; 
    256              } 
     120@@ -3204,6 +3254,28 @@ 
     121  
     122             assert( cast(uint) pstack & 0x0f == 0 ); 
    257123         } 
    258124+        else version( LLVM_AsmX86_Posix ) 
     
    280146         else static if( is( ucontext_t ) ) 
    281147         { 
    282              Fiber   cfib = Fiber.getThis(); 
    283 @@ -2980,16 +3072,25 @@ 
    284              m_size = sz; 
    285          } 
    286          else 
    287 -        {   static if( is( typeof( mmap ) ) ) 
    288 +        { 
    289 +            static if( is( typeof( mmap ) ) ) 
    290              { 
    291 -                m_pmem = mmap( null, 
    292 +                //TODO: This seems a bit dubious. 
    293 +                version (X86_64) 
    294 +                { 
    295 +                    m_pmem = malloc( sz ); 
    296 +                } 
    297 +                else 
    298 +                { 
    299 +                    m_pmem = mmap( null, 
    300                                 sz, 
    301                                 PROT_READ | PROT_WRITE, 
    302                                 MAP_PRIVATE | MAP_ANON, 
    303                                 -1, 
    304                                 0 ); 
    305 -                if( m_pmem == MAP_FAILED ) 
    306 -                    m_pmem = null; 
    307 +                    if( m_pmem == MAP_FAILED ) 
    308 +                        m_pmem = null; 
    309 +                } 
    310              } 
    311              else static if( is( typeof( valloc ) ) ) 
    312              { 
    313 @@ -3127,6 +3228,22 @@ 
    314              push( 0x00000000 );                                     // ESI 
    315              push( 0x00000000 );                                     // EDI 
    316          } 
    317 +        else version( LLVM_AsmX86_Posix ) 
    318 +        { 
    319 +            push( cast(size_t) &fiber_entryPoint );                 // EIP 
    320 +            push( 0x00000000 );                                     // newp 
    321 +            push( 0x00000000 );                                     // oldp 
    322 +            push( 0x00000000 );                                     // EBP 
    323 +            push( 0x00000000 );                                     // EBX 
    324 +            push( 0x00000000 );                                     // ESI 
    325 +            push( 0x00000000 );                                     // EDI 
    326 +        } 
    327 +//TODO: Implement x86-64 fibers 
    328 +/+ 
    329 +        else version( LLVM_AsmX86_Posix ) 
    330 +        { 
    331 +        } 
    332 ++/ 
    333          else version( AsmPPC_Posix ) 
    334          { 
    335              version( StackGrowsDown ) 
     148             getcontext( &m_utxt ); 
     149Index: lib/unittest.sh 
     150=================================================================== 
     151--- lib/unittest.sh (revision 4097) 
     152+++ lib/unittest.sh (working copy) 
     153@@ -18,8 +18,9 @@ 
     154   --help: This message 
     155   --run-all: Reports result instead of breaking. Do not use this if you want to 
     156          run unittest runner through a debugger. 
     157-  dmd: Builds unittests for dmd 
     158-  gdc: Builds unittests for gdc 
     159+  dmd:    Builds unittests for dmd 
     160+  gdc:    Builds unittests for gdc 
     161+  ldc: Builds unittests for ldc 
     162  
     163   <none>: Builds unittests for all known compilers.' 
     164   exit 0 
     165@@ -86,7 +87,7 @@ 
     166 void main() {} 
     167 EOF 
     168  
     169-        rebuild -w -d -g -L-ldl -L-lz -L-lbz2 -debug=UnitTest -debug -full -clean -unittest \ 
     170+        rebuild -w -d -L-ldl -L-lz -L-lbz2 -debug=UnitTest -debug -full -clean -unittest \ 
     171         -version=UnitTest $EXE.d tango/core/*.d tango/core/sync/*.d tango/io/digest/*.d \ 
     172         tango/io/model/*.d tango/io/protocol/*.d tango/io/selector/*.d tango/io/*.d \ 
     173         tango/io/vfs/*.d tango/io/vfs/model/*.d \ 
     174@@ -125,6 +126,9 @@ 
     175         gdc) 
     176             GDC=1 
     177             ;; 
     178+        ldc) 
     179+            LDC=1 
     180+            ;; 
     181         *) 
     182             usage 
     183             ;; 
     184@@ -132,10 +136,11 @@ 
     185     shift 
     186 done 
     187  
     188-if [ ! "$DMD" -a ! "$GDC" ] 
     189+if [ ! "$DMD" -a ! "$GDC" -a ! "$LDC" ] 
     190 then 
     191     DMD=1 
     192     GDC=1 
     193+    LDC=1 
     194 fi 
     195  
     196 if [ "$DMD" = "1" ] 
     197@@ -146,4 +151,7 @@ 
     198 then 
     199     compile gdc runUnitTest_gdc 
     200 fi 
     201
     202+if [ "$LDC" = "1" ] 
     203+then 
     204+    compile ldc runUnitTest_ldc 
     205+fi 
    336206Index: lib/gc/basic/gcx.d 
    337207=================================================================== 
    338 --- lib/gc/basic/gcx.d  (revision 4071
     208--- lib/gc/basic/gcx.d  (revision 4097
    339209+++ lib/gc/basic/gcx.d  (working copy) 
    340210@@ -65,6 +65,13 @@ 
     
    429299Index: lib/gc/basic/gcbits.d 
    430300=================================================================== 
    431 --- lib/gc/basic/gcbits.d   (revision 4071
     301--- lib/gc/basic/gcbits.d   (revision 4097
    432302+++ lib/gc/basic/gcbits.d   (working copy) 
    433303@@ -39,6 +39,10 @@ 
     
    444314Index: lib/build-tango.sh 
    445315=================================================================== 
    446 --- lib/build-tango.sh  (revision 4071
     316--- lib/build-tango.sh  (revision 4097
    447317+++ lib/build-tango.sh  (working copy) 
    448318@@ -23,7 +23,7 @@ 
     
    476346Index: tango/text/convert/Layout.d 
    477347=================================================================== 
    478 --- tango/text/convert/Layout.d (revision 4071
     348--- tango/text/convert/Layout.d (revision 4097
    479349+++ tango/text/convert/Layout.d (working copy) 
    480350@@ -47,6 +47,12 @@ 
     
    502372Index: tango/net/cluster/CacheInvalidator.d 
    503373=================================================================== 
    504 --- tango/net/cluster/CacheInvalidator.d    (revision 4071
     374--- tango/net/cluster/CacheInvalidator.d    (revision 4097
    505375+++ tango/net/cluster/CacheInvalidator.d    (working copy) 
    506376@@ -79,7 +79,7 @@ 
     
    515385Index: tango/core/Vararg.d 
    516386=================================================================== 
    517 --- tango/core/Vararg.d (revision 4071
     387--- tango/core/Vararg.d (revision 4097
    518388+++ tango/core/Vararg.d (working copy) 
    519389@@ -15,6 +15,10 @@ 
     
    530400Index: tango/core/sync/Semaphore.d 
    531401=================================================================== 
    532 --- tango/core/sync/Semaphore.d (revision 4071
     402--- tango/core/sync/Semaphore.d (revision 4097
    533403+++ tango/core/sync/Semaphore.d (working copy) 
    534 @@ -329,7 +329,8 @@ 
     404@@ -376,7 +376,8 @@ 
    535405             { 
    536406                 synchronized( synComplete ) 
     
    542412                 } 
    543413                 Thread.yield(); 
    544 @@ -337,9 +338,9 @@ 
     414@@ -384,9 +385,9 @@ 
    545415  
    546416             synchronized( synComplete ) 
     
    554424             { 
    555425                 assert( numConsumed == numToProduce ); 
    556 @@ -400,7 +401,8 @@ 
     426@@ -447,7 +448,8 @@ 
    557427  
    558428     unittest 
     
    566436Index: tango/core/sync/Condition.d 
    567437=================================================================== 
    568 --- tango/core/sync/Condition.d (revision 4071
     438--- tango/core/sync/Condition.d (revision 4097
    569439+++ tango/core/sync/Condition.d (working copy) 
    570440@@ -553,8 +553,11 @@ 
     
    582452Index: tango/core/Atomic.d 
    583453=================================================================== 
    584 --- tango/core/Atomic.d (revision 4071
     454--- tango/core/Atomic.d (revision 4097
    585455+++ tango/core/Atomic.d (working copy) 
    586456@@ -270,6 +270,167 @@ 
     
    766636Index: tango/math/IEEE.d 
    767637=================================================================== 
    768 --- tango/math/IEEE.d   (revision 4071
     638--- tango/math/IEEE.d   (revision 4097
    769639+++ tango/math/IEEE.d   (working copy) 
    770640@@ -1543,7 +1543,12 @@ 
     
    784654Index: tango/math/Math.d 
    785655=================================================================== 
    786 --- tango/math/Math.d   (revision 4071
     656--- tango/math/Math.d   (revision 4097
    787657+++ tango/math/Math.d   (working copy) 
    788658@@ -76,6 +76,14 @@ 
     
    933803Index: tango/stdc/posix/sys/types.d 
    934804=================================================================== 
    935 --- tango/stdc/posix/sys/types.d    (revision 4071
     805--- tango/stdc/posix/sys/types.d    (revision 4097
    936806+++ tango/stdc/posix/sys/types.d    (working copy) 
    937807@@ -422,7 +422,11 @@ 
     
    950820Index: tango/stdc/stdlib.d 
    951821=================================================================== 
    952 --- tango/stdc/stdlib.d (revision 4071
     822--- tango/stdc/stdlib.d (revision 4097
    953823+++ tango/stdc/stdlib.d (working copy) 
    954824@@ -94,6 +94,11 @@ 
     
    966836Index: tango/stdc/stdarg.d 
    967837=================================================================== 
    968 --- tango/stdc/stdarg.d (revision 4071
     838--- tango/stdc/stdarg.d (revision 4097
    969839+++ tango/stdc/stdarg.d (working copy) 
    970840@@ -13,6 +13,10 @@ 
Copyright © 2008, LDC Development Team.