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

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

[Dotgnu-pnet-commits] CVS: pnet/image member.c,1.21,1.22 meta_build.c,1


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/image member.c,1.21,1.22 meta_build.c,1.16,1.17 program.h,1.11,1.12
Date: Thu, 13 Feb 2003 19:48:48 -0500

Update of /cvsroot/dotgnu-pnet/pnet/image
In directory subversions:/tmp/cvs-serv1145/image

Modified Files:
        member.c meta_build.c program.h 
Log Message:


Cache property getters and setters in the ILProperty record rather
than creating an ILMethodSem block, because it reduces the
amount of memory needed at load time.


Index: member.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/member.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** member.c    17 Nov 2002 18:42:46 -0000      1.21
--- member.c    14 Feb 2003 00:48:46 -0000      1.22
***************
*** 1166,1169 ****
--- 1166,1173 ----
  ILMethod *ILPropertyGetGetter(ILProperty *property)
  {
+       if(property->getter)
+       {
+               return property->getter;
+       }
        return ILMethodSemGetByType(&(property->member.programItem),
                                                                
IL_META_METHODSEM_GETTER);
***************
*** 1172,1175 ****
--- 1176,1183 ----
  ILMethod *ILPropertyGetSetter(ILProperty *property)
  {
+       if(property->setter)
+       {
+               return property->setter;
+       }
        return ILMethodSemGetByType(&(property->member.programItem),
                                                                
IL_META_METHODSEM_SETTER);
***************
*** 1463,1466 ****
--- 1471,1487 ----
                }
                sem = sem->next;
+       }
+       if(property != 0)
+       {
+               /* Check the cached getter and setter values, in case
+                  we didn't actually create an ILMethodSem block */
+               if(type == IL_META_METHODSEM_GETTER)
+               {
+                       return property->getter;
+               }
+               if(type == IL_META_METHODSEM_SETTER)
+               {
+                       return property->setter;
+               }
        }
        return 0;

Index: meta_build.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/meta_build.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** meta_build.c        13 Feb 2003 22:31:17 -0000      1.16
--- meta_build.c        14 Feb 2003 00:48:46 -0000      1.17
***************
*** 1547,1550 ****
--- 1547,1551 ----
        ILMethod *method;
        ILProgramItem *owner;
+       ILProperty *property;
  
        /* Find the method */
***************
*** 1565,1570 ****
  
        /* Create the method semantics block and attach it */
!       if(!ILMethodSemCreate(owner, token,
!                                                 
values[IL_OFFSET_METHODSEM_SEMANTICS], method))
        {
                return IL_LOADERR_MEMORY;
--- 1566,1582 ----
  
        /* Create the method semantics block and attach it */
!       property = ILProgramItemToProperty(owner);
!       if(property != 0 &&
!          values[IL_OFFSET_METHODSEM_SEMANTICS] == IL_META_METHODSEM_GETTER)
!       {
!               property->getter = method;
!       }
!       else if(property != 0 &&
!               values[IL_OFFSET_METHODSEM_SEMANTICS] == 
IL_META_METHODSEM_SETTER)
!       {
!               property->setter = method;
!       }
!       else if(!ILMethodSemCreate(owner, token,
!                                                      
values[IL_OFFSET_METHODSEM_SEMANTICS], method))
        {
                return IL_LOADERR_MEMORY;

Index: program.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/program.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** program.h   8 Dec 2002 11:05:06 -0000       1.11
--- program.h   14 Feb 2003 00:48:46 -0000      1.12
***************
*** 353,356 ****
--- 353,358 ----
        ILMember                member;                         /* Common 
member fields */
        ILMethodSem    *semantics;                      /* List of semantic 
methods */
+       ILMethod           *getter;                             /* Cached copy 
of the getter */
+       ILMethod           *setter;                             /* Cached copy 
of the setter */
  
  };





reply via email to

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