[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/image marshal.c, 1.11, 1.12 member.c, 1
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/image marshal.c, 1.11, 1.12 member.c, 1.26, 1.27 meta_build.c, 1.28, 1.29 program.h, 1.19, 1.20 |
Date: |
Tue, 15 Jul 2003 06:07:56 -0400 |
Update of /cvsroot/dotgnu-pnet/pnet/image
In directory subversions:/tmp/cvs-serv1308/image
Modified Files:
marshal.c member.c meta_build.c program.h
Log Message:
Load ParamDef records on demand so that we can eventually deprecate the
"-fminimize-parameters" option in cscc.
Index: marshal.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/marshal.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** marshal.c 1 May 2003 10:29:08 -0000 1.11
--- marshal.c 15 Jul 2003 10:07:52 -0000 1.12
***************
*** 90,93 ****
--- 90,97 ----
/* Find the parameter information block */
+ if(!(method->parameters))
+ {
+ _ILMethodLoadParams(method);
+ }
parameter = method->parameters;
while(parameter != 0 && parameter->paramNum != param)
Index: member.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/member.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** member.c 5 Jul 2003 04:06:10 -0000 1.26
--- member.c 15 Jul 2003 10:07:52 -0000 1.27
***************
*** 493,498 ****
--- 493,503 ----
return last->next;
}
+ else if(method->parameters)
+ {
+ return method->parameters;
+ }
else
{
+ _ILMethodLoadParams(method);
return method->parameters;
}
Index: meta_build.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/meta_build.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** meta_build.c 16 Jun 2003 03:46:12 -0000 1.28
--- meta_build.c 15 Jul 2003 10:07:52 -0000 1.29
***************
*** 1699,1702 ****
--- 1699,1756 ----
/*
+ * Load the parameter definitions for a method token on demand.
+ */
+ void _ILMethodLoadParams(ILMethod *method)
+ {
+ ILImage *image = method->member.programItem.image;
+ ILUInt32 values[IL_IMAGE_TOKEN_COLUMNS];
+ ILUInt32 valuesNext[IL_IMAGE_TOKEN_COLUMNS];
+ ILUInt32 *valuesNextPtr;
+ ILUInt32 num;
+
+ /* Bail out if we are building the image or this isn't a MethodDef */
+ if(image->type == IL_IMAGETYPE_BUILDING)
+ {
+ return;
+ }
+ if((method->member.programItem.token & IL_META_TOKEN_MASK)
+ != IL_META_TOKEN_METHOD_DEF)
+ {
+ return;
+ }
+
+ /* Fetch the MethodDef details for this method and the next one */
+ if(!_ILImageRawTokenData(image, method->member.programItem.token,
values))
+ {
+ return;
+ }
+ if((method->member.programItem.token & ~IL_META_TOKEN_MASK) <
+ image->tokenCount[IL_META_TOKEN_METHOD_DEF >> 24])
+ {
+ if(!_ILImageRawTokenData(image,
method->member.programItem.token + 1,
+ valuesNext))
+ {
+ return;
+ }
+ valuesNextPtr = valuesNext;
+ }
+ else
+ {
+ valuesNextPtr = 0;
+ }
+
+ /* Parse the parameter definitions */
+ if(!SizeOfRange(image, IL_META_TOKEN_PARAM_DEF,
+ values, valuesNextPtr,
+ IL_OFFSET_METHODDEF_FIRST_PARAM, &num))
+ {
+ return;
+ }
+ LoadTokenRange(image, IL_META_TOKEN_PARAM_DEF,
+ values[IL_OFFSET_METHODDEF_FIRST_PARAM], num,
+ Load_ParamDef, method);
+ }
+
+ /*
* Load a method definition token.
*/
***************
*** 1706,1711 ****
{
ILMethod *method;
- ILUInt32 num;
- int error;
ILType *signature;
--- 1760,1763 ----
***************
*** 1747,1761 ****
ILMethodSetCallConv(method, ILType_CallConv(signature));
ILMethodSetRVA(method, values[IL_OFFSET_METHODDEF_RVA]);
-
- /* Parse the parameter definitions */
- if(!SizeOfRange(image, IL_META_TOKEN_PARAM_DEF,
- values, valuesNext,
IL_OFFSET_METHODDEF_FIRST_PARAM, &num))
- {
- META_VAL_ERROR("invalid parameter count");
- return IL_LOADERR_BAD_META;
- }
- EXIT_IF_ERROR(LoadTokenRange(image, IL_META_TOKEN_PARAM_DEF,
-
values[IL_OFFSET_METHODDEF_FIRST_PARAM], num,
- Load_ParamDef,
method));
/* Fetch the PInvoke information if necessary */
--- 1799,1802 ----
Index: program.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/program.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** program.h 13 Jun 2003 06:44:04 -0000 1.19
--- program.h 15 Jul 2003 10:07:52 -0000 1.20
***************
*** 357,360 ****
--- 357,365 ----
/*
+ * Load the parameter definitions for a method token on demand.
+ */
+ void _ILMethodLoadParams(ILMethod *method);
+
+ /*
* Information about a parameter.
*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/image marshal.c, 1.11, 1.12 member.c, 1.26, 1.27 meta_build.c, 1.28, 1.29 program.h, 1.19, 1.20,
Rhys Weatherley <address@hidden> <=