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

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

[dotgnu-pnet-commits] pnet ChangeLog image/program.h image/misc_token.c


From: Klaus Treichel
Subject: [dotgnu-pnet-commits] pnet ChangeLog image/program.h image/misc_token.c
Date: Wed, 15 Aug 2007 18:55:18 +0000

CVSROOT:        /cvsroot/dotgnu-pnet
Module name:    pnet
Changes by:     Klaus Treichel <ktreichel>      07/08/15 18:55:18

Modified files:
        .              : ChangeLog 
        image          : program.h misc_token.c 

Log message:
        Create a wrapper class around TypeSpecs to serve as owner for members.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pnet/ChangeLog?cvsroot=dotgnu-pnet&r1=1.3485&r2=1.3486
http://cvs.savannah.gnu.org/viewcvs/pnet/image/program.h?cvsroot=dotgnu-pnet&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/pnet/image/misc_token.c?cvsroot=dotgnu-pnet&r1=1.11&r2=1.12

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ChangeLog,v
retrieving revision 1.3485
retrieving revision 1.3486
diff -u -b -r1.3485 -r1.3486
--- ChangeLog   13 Aug 2007 17:53:47 -0000      1.3485
+++ ChangeLog   15 Aug 2007 18:55:17 -0000      1.3486
@@ -1,3 +1,13 @@
+2007-08-15  Klaus Treichel  <address@hidden>
+
+       * image/program.h: Add the member refInfo to the ILTypeSpec. The
+       refInfo references the generic type instanciated by the TypeSpec.
+
+       * image/misc_token.c: Create a synthetic wrapper class around a
+       TypeSpec in ILTypeSpecGetClass which is used as owner of members
+       accessed in generic types. Use the refInfo in ILTypeSpecGetClassRef to
+       store the referenced generic class.
+
 2007-08-13  Klaus Treichel  <address@hidden>
 
        * dumpasm/dump_class.c: Add dumping custom attributes for generic

Index: image/program.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/program.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- image/program.h     15 Jul 2007 19:55:24 -0000      1.25
+++ image/program.h     15 Aug 2007 18:55:17 -0000      1.26
@@ -512,6 +512,7 @@
        ILType             *type;                               /* Type 
associated with the TypeSpec */
        ILUInt32                typeBlob;                       /* Index into 
blob heap of the type */
        ILClass            *classInfo;                  /* Class block for the 
TypeSpec */
+       ILClass            *refInfo;                    /* Class referenced by 
the TypeSpec */
 
 };
 

Index: image/misc_token.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/misc_token.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- image/misc_token.c  15 Jul 2007 19:55:24 -0000      1.11
+++ image/misc_token.c  15 Aug 2007 18:55:18 -0000      1.12
@@ -56,6 +56,7 @@
        spec->type = type;
        spec->typeBlob = 0;
        spec->classInfo = 0;
+       spec->refInfo = 0;
 
        /* Assign a token code to the TypeSpec information block */
        if(!_ILImageSetToken(image, &(spec->programItem), token,
@@ -80,26 +81,35 @@
 
 ILClass *ILTypeSpecGetClass(ILTypeSpec *spec)
 {
-       if(spec->classInfo)
+       if(spec)
        {
-               return spec->classInfo;
-       }
-       else
+               if(!(spec->classInfo))
        {
-               /* Make a synthetic class that corresponds to the type */
-               spec->classInfo = ILClassFromType(spec->programItem.image, 0,
-                                                                               
  spec->type, ILClassResolveSystem);
+                       /* Make a wrapper class that corresponds to the type */
+                       spec->classInfo = 
ILClassCreateWrapper(ILToProgramItem(spec),
+                                                                               
                   spec->programItem.token,
+                                                                               
                   spec->type);
+               }
                return spec->classInfo;
        }
+       return 0;
 }
 
 ILClass *ILTypeSpecGetClassRef(ILTypeSpec *spec)
 {
-       ILClass *info = ILTypeSpecGetClass(spec);
+       if(spec)
+       {
+               if(!(spec->refInfo))
+               {
+                       ILClass *info = 
ILClassFromType(spec->programItem.image, 0,
+                                                                               
        spec->type, ILClassResolveSystem);
+
        if(!info || info->programItem.image == spec->programItem.image)
        {
-               return info;
+                               spec->refInfo = info;
        }
+                       else
+                       {
        info = ILClassImport(spec->programItem.image, info);
        if(!info)
        {
@@ -107,7 +117,12 @@
        }
        info->programItem.token = spec->programItem.token;
        info->synthetic = spec->type;
-       return info;
+                               spec->refInfo = info;
+                       }
+               }
+               return spec->refInfo;
+       }
+       return 0;
 }
 
 void _ILTypeSpecSetTypeIndex(ILTypeSpec *spec, ILUInt32 index)




reply via email to

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