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 meta_build.c,1.17,1.18


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/image meta_build.c,1.17,1.18
Date: Thu, 13 Feb 2003 23:03:30 -0500

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

Modified Files:
        meta_build.c 
Log Message:


Load StandAloneSig, Constant, FieldRVA, FieldLayout, FieldMarshal, and
ClassLayout tokens on-demand, to reduce the initial memory hit of
loading an image.


Index: meta_build.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/meta_build.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** meta_build.c        14 Feb 2003 00:48:46 -0000      1.17
--- meta_build.c        14 Feb 2003 04:03:28 -0000      1.18
***************
*** 2373,2399 ****
                                                         Load_CustomAttr, 0));
  
!       /* Load the stand-alone signatures */
!       EXIT_IF_ERROR(LoadTokens(image, IL_META_TOKEN_STAND_ALONE_SIG,
!                                                        Load_StandAloneSig, 
0));
! 
!       /* Load constants */
!       EXIT_IF_ERROR(LoadTokens(image, IL_META_TOKEN_CONSTANT,
!                                                        Load_Constant, 0));
! 
!       /* Load field RVA declarations */
!       EXIT_IF_ERROR(LoadTokens(image, IL_META_TOKEN_FIELD_RVA,
!                                                        Load_FieldRVA, 0));
! 
!       /* Load field layout declarations */
!       EXIT_IF_ERROR(LoadTokens(image, IL_META_TOKEN_FIELD_LAYOUT,
!                                                        Load_FieldLayout, 0));
! 
!       /* Load field marshal declarations */
!       EXIT_IF_ERROR(LoadTokens(image, IL_META_TOKEN_FIELD_MARSHAL,
!                                                        Load_FieldMarshal, 0));
! 
!       /* Load class layout declarations */
!       EXIT_IF_ERROR(LoadTokens(image, IL_META_TOKEN_CLASS_LAYOUT,
!                                                        Load_ClassLayout, 0));
  
        /* Load security declarations */
--- 2373,2403 ----
                                                         Load_CustomAttr, 0));
  
!       /* Only do the following if we are pre-validating */
!       if((loadFlags & IL_LOADFLAG_PRE_VALIDATE) != 0)
!       {
!               /* Load the stand-alone signatures */
!               EXIT_IF_ERROR(LoadTokens(image, IL_META_TOKEN_STAND_ALONE_SIG,
!                                                                
Load_StandAloneSig, 0));
! 
!               /* Load constants */
!               EXIT_IF_ERROR(LoadTokens(image, IL_META_TOKEN_CONSTANT,
!                                                                Load_Constant, 
0));
! 
!               /* Load field RVA declarations */
!               EXIT_IF_ERROR(LoadTokens(image, IL_META_TOKEN_FIELD_RVA,
!                                                                Load_FieldRVA, 
0));
! 
!               /* Load field layout declarations */
!               EXIT_IF_ERROR(LoadTokens(image, IL_META_TOKEN_FIELD_LAYOUT,
!                                                                
Load_FieldLayout, 0));
! 
!               /* Load field marshal declarations */
!               EXIT_IF_ERROR(LoadTokens(image, IL_META_TOKEN_FIELD_MARSHAL,
!                                                                
Load_FieldMarshal, 0));
! 
!               /* Load class layout declarations */
!               EXIT_IF_ERROR(LoadTokens(image, IL_META_TOKEN_CLASS_LAYOUT,
!                                                                
Load_ClassLayout, 0));
!       }
  
        /* Load security declarations */
***************
*** 2417,2468 ****
  }
  
- #if 0
- 
  /*
!  * Table of all token loading functions.
   */
  static TokenLoadFunc const TokenLoadFunctions[] = {
!       Load_Module,                            /* 00 */
!       0, /*Load_TypeRef,*/
!       Load_TypeDef,
        0,
!       Load_FieldDef,
        0,
-       Load_MethodDef,
        0,
-       Load_ParamDef,                          /* 08 */
-       Load_InterfaceImpl,
-       Load_MemberRef,
        Load_Constant,
!       Load_CustomAttr,
        Load_FieldMarshal,
!       Load_DeclSecurity,
        Load_ClassLayout,
        Load_FieldLayout,                       /* 10 */
        Load_StandAloneSig,
-       0, /*Load_EventMap,*/
        0,
-       Load_Event,
-       0, /*Load_PropertyMap,*/
        0,
!       Load_Property,
!       0, /*Load_MethodSemantics,*/            /* 18 */
!       0, /*Load_MethodImpl,*/
!       Load_ModuleRef,
!       Load_TypeSpec,
!       0, /*Load_ImplMap,*/
        Load_FieldRVA,
        0,
        0,
!       Load_Assembly,                          /* 20 */
!       Load_ProcessorDef,
!       Load_OSDef,
!       Load_AssemblyRef,
!       Load_ProcessorRef,
!       Load_OSRef,
!       Load_File,
!       Load_ExportedType,
!       0, /*Load_ManifestResource,*/           /* 28 */
!       0, /*Load_NestedClass,*/
        0,
        0,
--- 2421,2471 ----
  }
  
  /*
!  * Table of token loading functions that can be used
!  * for on-demand loading of token blocks.
   */
  static TokenLoadFunc const TokenLoadFunctions[] = {
!       0,                                                      /* 00 */
!       0,
!       0,
!       0,
!       0,
!       0,
!       0,
        0,
!       0,                                                      /* 08 */
        0,
        0,
        Load_Constant,
!       0,
        Load_FieldMarshal,
!       0,
        Load_ClassLayout,
        Load_FieldLayout,                       /* 10 */
        Load_StandAloneSig,
        0,
        0,
!       0,
!       0,
!       0,
!       0,
!       0,                                                      /* 18 */
!       0,
!       0,
!       0,
!       0,
        Load_FieldRVA,
        0,
        0,
!       0,                                                      /* 20 */
!       0,
!       0,
!       0,
!       0,
!       0,
!       0,
!       0,
!       0,                                                      /* 28 */
!       0,
        0,
        0,
***************
*** 2540,2552 ****
        return 0;
  }
- 
- #else
- 
- void *_ILImageLoadOnDemand(ILImage *image, ILToken token)
- {
-       return 0;
- }
- 
- #endif
  
  #ifdef        __cplusplus
--- 2543,2546 ----





reply via email to

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