[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/ilasm ilasm_grammar.y,1.26,1.27 ilasm_s
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/ilasm ilasm_grammar.y,1.26,1.27 ilasm_scanner.l,1.9,1.10 |
Date: |
Mon, 13 Jan 2003 04:14:29 -0500 |
Update of /cvsroot/dotgnu-pnet/pnet/ilasm
In directory subversions:/tmp/cvs-serv23630/ilasm
Modified Files:
ilasm_grammar.y ilasm_scanner.l
Log Message:
Force the argument to "callvirt", "newobj", and "ldvirtfn" to use
the "hasthis" flag on the method signature.
Index: ilasm_grammar.y
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ilasm/ilasm_grammar.y,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** ilasm_grammar.y 12 Jan 2003 15:51:24 -0000 1.26
--- ilasm_grammar.y 13 Jan 2003 09:14:25 -0000 1.27
***************
*** 824,828 ****
* Instruction types.
*/
! %token I_NONE I_VAR I_INT I_FLOAT I_BRANCH I_METHOD I_FIELD I_TYPE
%token I_STRING I_SIGNATURE I_RVA I_TOKEN I_SSA I_SWITCH I_CONST
%token I_IINC I_LSWITCH I_IMETHOD I_NEWARRAY I_MULTINEWARRAY
--- 824,828 ----
* Instruction types.
*/
! %token I_NONE I_VAR I_INT I_FLOAT I_BRANCH I_METHOD I_IMETHOD I_FIELD I_TYPE
%token I_STRING I_SIGNATURE I_RVA I_TOKEN I_SSA I_SWITCH I_CONST
%token I_IINC I_LSWITCH I_IMETHOD I_NEWARRAY I_MULTINEWARRAY
***************
*** 857,861 ****
%type <fieldAttrs> FieldAttributes FieldAttributeList FieldAttributeName
%type <methodAttrs> MethodAttributes MethodAttributeList MethodAttributeName
! %type <opcode> I_NONE I_VAR I_BRANCH I_METHOD I_FIELD I_TYPE
%type <opcode> I_INT I_FLOAT I_STRING I_SIGNATURE I_RVA I_TOKEN
%type <opcode> I_SSA I_SWITCH I_CONST I_IINC I_LSWITCH
I_IMETHOD
--- 857,861 ----
%type <fieldAttrs> FieldAttributes FieldAttributeList FieldAttributeName
%type <methodAttrs> MethodAttributes MethodAttributeList MethodAttributeName
! %type <opcode> I_NONE I_VAR I_BRANCH I_METHOD I_IMETHOD
I_FIELD I_TYPE
%type <opcode> I_INT I_FLOAT I_STRING I_SIGNATURE I_RVA I_TOKEN
%type <opcode> I_SSA I_SWITCH I_CONST I_IINC I_LSWITCH
I_IMETHOD
***************
*** 874,878 ****
%type <exception> ExceptionClause ExceptionClauses
%type <exception> JavaExceptionClause JavaExceptionClauses
! %type <token> MethodReference
%type <integer> DataItemCount
--- 874,878 ----
%type <exception> ExceptionClause ExceptionClauses
%type <exception> JavaExceptionClause JavaExceptionClauses
! %type <token> MethodReference InstanceMethodReference
%type <integer> DataItemCount
***************
*** 2244,2252 ****
MethodName '(' OptSignatureArguments ')' {
ILType *sig;
- if(!strcmp($5.string,".ctor"))
- {
- /* Note: constructors are always
instance methods */
- $1 = $1 | IL_META_CALLCONV_HASTHIS;
- }
sig = CreateMethodSig($1, $2, $7.paramFirst, 1);
$$ = ILAsmResolveMember($3.item, $5.string, sig,
--- 2244,2247 ----
***************
*** 2262,2265 ****
--- 2257,2279 ----
;
+ InstanceMethodReference
+ : CallingConventions Type TypeSpecification COLON_COLON
+ MethodName '(' OptSignatureArguments ')' {
+ ILType *sig;
+ sig = CreateMethodSig($1 |
IL_META_CALLCONV_HASTHIS,
+ $2,
$7.paramFirst, 1);
+ $$ = ILAsmResolveMember($3.item, $5.string, sig,
+
IL_META_MEMBERKIND_METHOD);
+ }
+ | CallingConventions Type MethodName '(' OptSignatureArguments ')' {
+ /* Reference a method in the global module
class */
+ ILType *sig = CreateMethodSig($1 |
IL_META_CALLCONV_HASTHIS,
+
$2, $5.paramFirst, 1);
+ $$ =
ILAsmResolveMember(ILToProgramItem(ILAsmModuleClass),
+
$3.string, sig,
+
IL_META_MEMBERKIND_METHOD);
+ }
+ ;
+
/*
* Property declaration.
***************
*** 3537,3540 ****
--- 3551,3555 ----
| I_BRANCH Identifier { ILAsmOutBranch($1, $2.string); }
| I_METHOD MethodReference { ILAsmOutToken($1, $2); }
+ | I_IMETHOD InstanceMethodReference { ILAsmOutToken($1, $2); }
| I_FIELD Type TypeSpecification COLON_COLON Identifier {
/* Refer to a field in some other class */
Index: ilasm_scanner.l
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ilasm/ilasm_scanner.l,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** ilasm_scanner.l 28 Nov 2002 00:06:56 -0000 1.9
--- ilasm_scanner.l 13 Jan 2003 09:14:25 -0000 1.10
***************
*** 212,215 ****
--- 212,219 ----
#define OPCODE_METHOD_P(name) yylval.opcode = 0xFE00 |
IL_PREFIX_OP_##name; \
return I_METHOD
+ #define OPCODE_IMETHOD(name) yylval.opcode = IL_OP_##name; \
+ return I_IMETHOD
+ #define OPCODE_IMETHOD_P(name) yylval.opcode = 0xFE00 |
IL_PREFIX_OP_##name; \
+ return I_IMETHOD
#define OPCODE_FIELD(name) yylval.opcode = IL_OP_##name; \
return I_FIELD
***************
*** 735,743 ****
"ann.hoisted_call" { OPCODE_METHOD(ANN_HOISTED_CALL); }
"call" { OPCODE_METHOD(CALL); }
- "callvirt" { OPCODE_METHOD(CALLVIRT); }
"jmp" { OPCODE_METHOD(JMP); }
"ldftn" { OPCODE_METHOD_P(LDFTN); }
! "ldvirtftn" { OPCODE_METHOD_P(LDVIRTFTN); }
! "newobj" { OPCODE_METHOD(NEWOBJ); }
"ldfld" { OPCODE_FIELD(LDFLD); }
/* Field opcodes */
--- 739,748 ----
"ann.hoisted_call" { OPCODE_METHOD(ANN_HOISTED_CALL); }
"call" { OPCODE_METHOD(CALL); }
"jmp" { OPCODE_METHOD(JMP); }
"ldftn" { OPCODE_METHOD_P(LDFTN); }
!
! "callvirt" { OPCODE_IMETHOD(CALLVIRT); }
! "ldvirtftn" { OPCODE_IMETHOD_P(LDVIRTFTN); }
! "newobj" { OPCODE_IMETHOD(NEWOBJ); }
"ldfld" { OPCODE_FIELD(LDFLD); }
/* Field opcodes */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/ilasm ilasm_grammar.y,1.26,1.27 ilasm_scanner.l,1.9,1.10,
Rhys Weatherley <address@hidden> <=