dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/doc c_language_abi.html,1.9,1.10


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/doc c_language_abi.html,1.9,1.10
Date: Fri, 27 Jun 2003 00:42:25 -0400

Update of /cvsroot/dotgnu-pnet/pnet/doc
In directory subversions:/tmp/cvs-serv14716/doc

Modified Files:
        c_language_abi.html 
Log Message:


Update the ABI specification for the C compiler to match the latest changes.


Index: c_language_abi.html
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/doc/c_language_abi.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** c_language_abi.html 23 Aug 2002 00:06:39 -0000      1.9
--- c_language_abi.html 27 Jun 2003 04:42:23 -0000      1.10
***************
*** 9,13 ****
  Last Modified: $Date$<p>
  
! Copyright &copy; 2002 Southern Storm Software, Pty Ltd.<br>
  Permission to distribute copies of this work under the terms of the
  GNU Free Documentation License is hereby granted.<p>
--- 9,13 ----
  Last Modified: $Date$<p>
  
! Copyright &copy; 2002, 2003 Southern Storm Software, Pty Ltd.<br>
  Permission to distribute copies of this work under the terms of the
  GNU Free Documentation License is hereby granted.<p>
***************
*** 516,524 ****
  }</pre></blockquote>
  
! As can be seen, anonymous structures are assigned a unique numeric code,
! and are encoded as nested types.  The code is unique to the surrounding
  structure, so that the same code will be generated each time the program
  is compiled.<p>
  
  <blockquote><font size="-1">Note: It would be desirable to allow the
  runtime engine to perform structure layout dynamically, rather than
--- 516,542 ----
  }</pre></blockquote>
  
! As can be seen, nested anonymous structures are assigned a unique numeric
! code, and are encoded as nested types.  The code is unique to the surrounding
  structure, so that the same code will be generated each time the program
  is compiled.<p>
  
+ Anonymous structures at the outer-most declaration level are assigned a
+ unique value based on hashing the fields within the structure using
+ the MD5 hash algorithm:<p>
+ 
+ <blockquote><pre>.class public explicit sealed serializable ansi
+           'struct (9XdODzujHI7gA0jgpJ72wA)' extends System.ValueType
+ {
+     .size 4
+     .pack 4
+     .field [0] public int32 x
+ }</pre></blockquote>
+ 
+ Hashing ensures that two definitions of the structure in different
+ modules will always evaluate to the same name.  See the function
+ "<code>CreateNewAnonName</code>" in "<code>c_types.c</code>"
+ within the Portable.NET source code for precise details of the hash
+ algorithm to use.<p>
+ 
  <blockquote><font size="-1">Note: It would be desirable to allow the
  runtime engine to perform structure layout dynamically, rather than
***************
*** 562,566 ****
  }</pre></blockquote>
  
! Unions may only contain fields with "fixed" layout.<p>
  
  <h3>4.6. Representation of bit fields</h3>
--- 580,585 ----
  }</pre></blockquote>
  
! Unions may only contain fields with "fixed" layout.  Anonymous unions
! are named in a similar manner to anonymous structures.<p>
  
  <h3>4.6. Representation of bit fields</h3>
***************
*** 591,595 ****
  }</pre></blockquote>
  
! <h3>4.7. Array types</h3>
  
  Array types of the form "<code>A[]</code>" are mapped to a value
--- 610,646 ----
  }</pre></blockquote>
  
! <h3>4.7. Enumerated types</h3>
! 
! Enumerated types are encoded using the same CLI mechanisms as C#.
! That is, enumerated types inherit from "<code>System.Enum</code>"
! and contain literal static fields for each constant value.
! The C type called "<code>enum A</code>" is named "<code>enum A</code>"
! within the final CLI output.<p>
! 
! Anonymous enumerations are not encoded as CLI types.  Instead, every
! instance of the anonymous enumeration is replaced with the underlying
! type (usually <code>int32</code>).  This is necessary because there
! is no way to reliably give an anonymous enumeration the same name
! in every module that uses it.<p>
! 
! <blockquote><pre>enum Color { Red, Green, Blue } x;
! enum { R, G, B } y;
! 
! .field public static valuetype 'enum Color' 'x'
! .field public static int32 'y'
! 
! .class public auto sealed serializable ansi
!               'enum Color' extends System.Enum
! {
!     .field public specialname rtspecialname int32 'value__'
!     .field public static literal valuetype
!               'enum Color' 'Red' = int32(0x00000000)
!     .field public static literal valuetype
!               'enum Color' 'Green' = int32(0x00000001)
!     .field public static literal valuetype
!               'enum Color' 'Blue' = int32(0x00000002)
! }</pre></blockquote>
! 
! <h3>4.8. Array types</h3>
  
  Array types of the form "<code>A[]</code>" are mapped to a value
***************
*** 669,673 ****
  }</pre></blockquote>
  
! <h3>4.8. Native types</h3>
  
  Sometimes it is necessary to access the native type representation of
--- 720,724 ----
  }</pre></blockquote>
  
! <h3>4.9. Native types</h3>
  
  Sometimes it is necessary to access the native type representation of
***************
*** 755,759 ****
  functions.<p>
  
! <h3>4.9. Function pointer types</h3>
  
  CLI metadata uses the same representation for method signatures and
--- 806,810 ----
  functions.<p>
  
! <h3>4.10. Function pointer types</h3>
  
  CLI metadata uses the same representation for method signatures and
***************
*** 767,771 ****
  </pre></blockquote>
  
! <h3>4.10. Argument types</h3>
  
  When arguments are passed to a function, it is sometimes necessary
--- 818,822 ----
  </pre></blockquote>
  
! <h3>4.11. Argument types</h3>
  
  When arguments are passed to a function, it is sometimes necessary
***************
*** 1247,1255 ****
      {
          // Increase the reference count, and check for the first call.
!         ldsfld '.init-count'::count
          dup
          ldc.i4.1
          add
!         stsfld '.init-count'::count
          brtrue L1 
          leave runinit
--- 1298,1306 ----
      {
          // Increase the reference count, and check for the first call.
!         ldsfld int32 '.init-count'::count
          dup
          ldc.i4.1
          add
!         stsfld int32 '.init-count'::count
          brtrue L1 
          leave runinit
***************
*** 1294,1302 ****
      {
          // Decrease the reference count, and check for the last call.
!         ldsfld '.init-count'::count
          ldc.i4.1
          sub
          dup
!         stsfld '.init-count'::count
          brtrue L1 
          leave runfini
--- 1345,1353 ----
      {
          // Decrease the reference count, and check for the last call.
!         ldsfld int32 '.init-count'::count
          ldc.i4.1
          sub
          dup
!         stsfld int32 '.init-count'::count
          brtrue L1 
          leave runfini





reply via email to

[Prev in Thread] Current Thread [Next in Thread]