[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/image meta_build.c,1.12,1.13 writer.c,1
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/image meta_build.c,1.12,1.13 writer.c,1.8,1.9 |
Date: |
Tue, 07 Jan 2003 06:57:22 -0500 |
Update of /cvsroot/dotgnu-pnet/pnet/image
In directory subversions:/tmp/cvs-serv5456/image
Modified Files:
meta_build.c writer.c
Log Message:
Create the PropertyMap and EventMap tables very late in the process to
ensure that there is only one property or event entry per class.
Index: meta_build.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/meta_build.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** meta_build.c 16 Aug 2002 00:54:33 -0000 1.12
--- meta_build.c 7 Jan 2003 11:57:18 -0000 1.13
***************
*** 1462,1466 ****
ILUInt32 num;
int error;
- ILEventMap *map;
/* Find the type that owns the event */
--- 1462,1465 ----
***************
*** 1483,1494 ****
Load_Event,
info));
- /* Create an EventMap item for the first event in the range */
- map = ILEventMapCreate(image, token, info,
- ILEvent_FromToken(image,
values[IL_OFFSET_EVENTMAP_EVENT]));
- if(!map)
- {
- return IL_LOADERR_MEMORY;
- }
-
/* Done */
return 0;
--- 1482,1485 ----
***************
*** 1544,1548 ****
ILUInt32 num;
int error;
- ILPropertyMap *map;
/* Find the type that owns the property */
--- 1535,1538 ----
***************
*** 1564,1575 ****
values[IL_OFFSET_PROPMAP_PROPERTY], num,
Load_Property,
info));
-
- /* Create a PropertyMap item for the first property in the range */
- map = ILPropertyMapCreate(image, token, info,
- ILProperty_FromToken(image,
values[IL_OFFSET_PROPMAP_PROPERTY]));
- if(!map)
- {
- return IL_LOADERR_MEMORY;
- }
/* Done */
--- 1554,1557 ----
Index: writer.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/writer.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** writer.c 5 Oct 2002 04:25:40 -0000 1.8
--- writer.c 7 Jan 2003 11:57:18 -0000 1.9
***************
*** 188,196 ****
}
! static void AssignMemberTokens(ILClass *info, ILToken *nextField,
! ILToken *nextMethod,
ILToken *nextParam)
{
ILMember *member;
ILParameter *param;
/* Scan the members of this class */
--- 188,200 ----
}
! static void AssignMemberTokens(ILImage *image, ILClass *info,
! ILToken *nextField,
ILToken *nextMethod,
! ILToken *nextParam,
ILToken *nextProperty,
! ILToken *nextEvent)
{
ILMember *member;
ILParameter *param;
+ ILToken firstProperty = *nextProperty;
+ ILToken firstEvent = *nextEvent;
/* Scan the members of this class */
***************
*** 231,236 ****
--- 235,269 ----
*nextField += 1;
}
+ else if(member->kind == IL_META_MEMBERKIND_PROPERTY)
+ {
+ member->programItem.token = *nextProperty;
+ member->programItem.image->tokenData
+ [IL_META_TOKEN_PROPERTY >> 24]
+ [(*nextProperty & ~IL_META_TOKEN_MASK) - 1] =
(void *)member;
+ *nextProperty += 1;
+ }
+ else if(member->kind == IL_META_MEMBERKIND_EVENT)
+ {
+ member->programItem.token = *nextEvent;
+ member->programItem.image->tokenData
+ [IL_META_TOKEN_EVENT >> 24]
+ [(*nextEvent & ~IL_META_TOKEN_MASK) - 1] =
(void *)member;
+ *nextEvent += 1;
+ }
member = member->nextMember;
}
+
+ /* Create PropertyMap and EventMap entries if necessary */
+ if(firstProperty < *nextProperty)
+ {
+ ILPropertyMapCreate(image, 0, info,
+ (ILProperty
*)ILProperty_FromToken
+ (image,
firstProperty));
+ }
+ if(firstEvent < *nextEvent)
+ {
+ ILEventMapCreate(image, 0, info,
+ (ILEvent
*)ILEvent_FromToken(image, firstEvent));
+ }
}
***************
*** 247,250 ****
--- 280,285 ----
ILToken nextMethod;
ILToken nextParam;
+ ILToken nextProperty;
+ ILToken nextEvent;
ILClass *info;
***************
*** 253,256 ****
--- 288,293 ----
nextMethod = IL_META_TOKEN_METHOD_DEF | 1;
nextParam = IL_META_TOKEN_PARAM_DEF | 1;
+ nextProperty = IL_META_TOKEN_PROPERTY | 1;
+ nextEvent = IL_META_TOKEN_EVENT | 1;
/* Assign token codes to all classes in the correct order */
***************
*** 259,263 ****
(image, IL_META_TOKEN_TYPE_DEF, info)) != 0)
{
! AssignMemberTokens(info, &nextField, &nextMethod, &nextParam);
}
}
--- 296,301 ----
(image, IL_META_TOKEN_TYPE_DEF, info)) != 0)
{
! AssignMemberTokens(image, info, &nextField, &nextMethod,
! &nextParam, &nextProperty,
&nextEvent);
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/image meta_build.c,1.12,1.13 writer.c,1.8,1.9,
Rhys Weatherley <address@hidden> <=