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

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

[dotgnu-pnet-commits] pnet ChangeLog engine/cvm_stack.c engine/verify...


From: Ivan de Jesus Deras Tabora
Subject: [dotgnu-pnet-commits] pnet ChangeLog engine/cvm_stack.c engine/verify...
Date: Thu, 13 Sep 2007 18:47:46 +0000

CVSROOT:        /sources/dotgnu-pnet
Module name:    pnet
Changes by:     Ivan de Jesus Deras Tabora <iderashn>   07/09/13 18:47:46

Modified files:
        .              : ChangeLog 
        engine         : cvm_stack.c verify_call.c verify_obj.c 
                         verify_ptr.c 
        image          : generic.c image.h meta_types.c synthetic.c 

Log message:
        BUG fixing

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pnet/ChangeLog?cvsroot=dotgnu-pnet&r1=1.3494&r2=1.3495
http://cvs.savannah.gnu.org/viewcvs/pnet/engine/cvm_stack.c?cvsroot=dotgnu-pnet&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/pnet/engine/verify_call.c?cvsroot=dotgnu-pnet&r1=1.57&r2=1.58
http://cvs.savannah.gnu.org/viewcvs/pnet/engine/verify_obj.c?cvsroot=dotgnu-pnet&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/pnet/engine/verify_ptr.c?cvsroot=dotgnu-pnet&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/pnet/image/generic.c?cvsroot=dotgnu-pnet&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/pnet/image/image.h?cvsroot=dotgnu-pnet&r1=1.38&r2=1.39
http://cvs.savannah.gnu.org/viewcvs/pnet/image/meta_types.c?cvsroot=dotgnu-pnet&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/pnet/image/synthetic.c?cvsroot=dotgnu-pnet&r1=1.12&r2=1.13

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/dotgnu-pnet/pnet/ChangeLog,v
retrieving revision 1.3494
retrieving revision 1.3495
diff -u -b -r1.3494 -r1.3495
--- ChangeLog   10 Sep 2007 19:33:50 -0000      1.3494
+++ ChangeLog   13 Sep 2007 18:47:45 -0000      1.3495
@@ -1,3 +1,19 @@
+2007-09-11  Ivan de Jesus Deras Tabora  <address@hidden>
+       * engine/cvm_stack.c Fixed CVM documentation for COP_PREFIX_REPL_WORD_N.
+       * engine/verify_call.c Constrained callvirt for value types should be 
handled as
+       a normal call (non virtual).
+       * engine/verify_obj.c Fixed INITOBJ CIL opcode to be ECMA compliant.  
Now it can
+       be applied to ref types.
+       * engine/verify_ptr.c Fixed IL_OP_LDELEM for value types. Also added a 
missing break
+       when handling LDSFLDA.
+       * image/generic.c _ILTypeToSyntheticInstantiation now receive an extra 
parameters, the 
+       method type parameters.
+       * image/image.h _ILTypeToSyntheticInstantiation now receive an extra 
parameters, the 
+       method type parameters.
+       * image/meta_types.c ILTypeToName now handle BYREF types and Method 
Type Parameters.
+       * image/synthetic.c _ILTypeToSyntheticInstantiation now receive an 
extra parameters, the 
+       method type parameters.
+
 2007-09-10  Klaus Treichel  <address@hidden>
 
        * image/misc_token.c, include/il_program.h: Revert the changes in

Index: engine/cvm_stack.c
===================================================================
RCS file: /sources/dotgnu-pnet/pnet/engine/cvm_stack.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- engine/cvm_stack.c  18 Aug 2007 11:34:39 -0000      1.14
+++ engine/cvm_stack.c  13 Sep 2007 18:47:45 -0000      1.15
@@ -444,7 +444,7 @@
  *   <format>prefix<fsep/>repl_word_n</format>
  *   <dformat>{repl_word_n}</dformat>
  *
- *   <form name="repl_word_n" code="COP_REPL_WORD_N"/>
+ *   <form name="repl_word_n" code="COP_PREFIX_REPL_WORD_N"/>
  *
  *   <before>..., value, word1, ..., wordN-1, wordN</before>
  *   <after>..., wordN, word1, ..., wordN-1</after>

Index: engine/verify_call.c
===================================================================
RCS file: /sources/dotgnu-pnet/pnet/engine/verify_call.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- engine/verify_call.c        18 Aug 2007 12:29:32 -0000      1.57
+++ engine/verify_call.c        13 Sep 2007 18:47:45 -0000      1.58
@@ -2006,6 +2006,7 @@
        if(methodInfo)
        {
                ILType *_constraintType = constraintType;
+               int callNonVirtual = 0;
                
                constraintType = 0;
                classInfo = ILMethod_Owner(method);
@@ -2014,10 +2015,12 @@
                        if(_constraintType)
                        {
                                ILEngineStackItem *item;
+
                                numParams = ILTypeNumParams(methodSignature);
                                item = &(stack[stackSize - numParams - 1]);
-                               if ((item->engineType == ILEngineType_M ||
-                                       item->engineType == ILEngineType_T) &&
+                               if (((item->engineType == ILEngineType_M) ||
+                                        (item->engineType == ILEngineType_CM) 
||
+                                        (item->engineType == ILEngineType_T)) 
&&
                                        ILTypeIdentical(_constraintType, 
item->typeInfo))
                                {
                                        ILClass *thisClass = 
ILClassFromType(ILProgramItem_Image(method),
@@ -2040,6 +2043,7 @@
                                                        methodInfo = (ILMethod 
*)member;
                                                        item->engineType = 
ILEngineType_M;
                                                        item->typeInfo = 
_constraintType;
+                                                       callNonVirtual = 1;
                                                }
                                                else
                                                {
@@ -2077,8 +2081,7 @@
                                {
                                        stack[stackSize].engineType = 
ILEngineType_Invalid;
                                }
-                               if(!ILMethod_IsVirtual(methodInfo) ||
-                                  (_constraintType && 
ILType_IsPrimitive(_constraintType)))
+                               if(!ILMethod_IsVirtual(methodInfo) || 
callNonVirtual)
                                {
                                        goto callNonvirtualFromVirtual;
                                }

Index: engine/verify_obj.c
===================================================================
RCS file: /sources/dotgnu-pnet/pnet/engine/verify_obj.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- engine/verify_obj.c 22 Aug 2007 19:21:28 -0000      1.30
+++ engine/verify_obj.c 13 Sep 2007 18:47:45 -0000      1.31
@@ -969,13 +969,27 @@
 case IL_OP_PREFIX + IL_PREFIX_OP_INITOBJ:
 {
        /* Initialize a value type */
-       classInfo = GetValueTypeToken(method, pc);
-       if(classInfo &&
+       classInfo = GetClassToken(method, pc);
+       if(classInfo)
+       {
+               if (ILClassIsValueType(classInfo) &&
           IsCPPointer(STK_UNARY, stack[stackSize - 1].typeInfo, classInfo))
        {
                ILCoderInitObject(coder, STK_UNARY, classInfo);
                --stackSize;
        }
+               else if (STK_UNARY == ILEngineType_M || STK_UNARY == 
ILEngineType_T)
+               {
+                       /* Let's do a ldnull followed by stind.ref */
+                       ILCoderConstant(coder, IL_OP_LDNULL, pc + 1);
+                       ILCoderPtrAccess(coder, IL_OP_STIND_REF);
+                       --stackSize;
+               }
+               else
+               {
+                       VERIFY_TYPE_ERROR();
+               }
+       }
        else
        {
                VERIFY_TYPE_ERROR();

Index: engine/verify_ptr.c
===================================================================
RCS file: /sources/dotgnu-pnet/pnet/engine/verify_ptr.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- engine/verify_ptr.c 22 Aug 2007 19:21:28 -0000      1.21
+++ engine/verify_ptr.c 13 Sep 2007 18:47:46 -0000      1.22
@@ -418,6 +418,11 @@
                        if(opcode != IL_OP_NOP)
                        {
                                ILCoderArrayAccess(coder, opcode, STK_BINARY_2, 
elemType);
+                               if(opcode == IL_OP_LDELEMA)
+                               {
+                                       ILClass *classInfo = 
ILClassFromType(ILProgramItem_Image(method), 0, classType, 0);
+                                       ILCoderPtrAccessManaged(coder, 
IL_OP_LDOBJ, classInfo);
+                               }
                                STK_BINARY_1 = TypeToEngineType(elemType);
                                STK_TYPEINFO_1 = elemType;
                                --stackSize;
@@ -785,6 +790,7 @@
                VERIFY_INSN_ERROR();
        }
 }
+break;
 
 case IL_OP_NEWARR:
 {

Index: image/generic.c
===================================================================
RCS file: /sources/dotgnu-pnet/pnet/image/generic.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- image/generic.c     19 Aug 2007 00:41:14 -0000      1.8
+++ image/generic.c     13 Sep 2007 18:47:46 -0000      1.9
@@ -751,7 +751,7 @@
           form of the class type, in case we already instantiated
           this class previously.  We do this in such a way that we
           won't need to call "ILTypeInstantiate" unless necessary */
-       classInfo = _ILTypeToSyntheticInstantiation(image, classType, 
classParams);
+       classInfo = _ILTypeToSyntheticInstantiation(image, classType, 
classParams, 0);
        if(classInfo)
        {
                if((classInfo->attributes & IL_META_TYPEDEF_CLASS_EXPANDED) == 
0)

Index: image/image.h
===================================================================
RCS file: /sources/dotgnu-pnet/pnet/image/image.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- image/image.h       2 Aug 2004 11:58:24 -0000       1.38
+++ image/image.h       13 Sep 2007 18:47:46 -0000      1.39
@@ -607,7 +607,7 @@
  * Returns NULL if not possible, or out of memory.
  */
 ILClass *_ILTypeToSyntheticInstantiation
-               (ILImage *image, ILType *type, ILType *classParams);
+               (ILImage *image, ILType *type, ILType *classArgs, ILType 
*methodArgs);
 
 #ifdef IL_USE_WRITER
 

Index: image/meta_types.c
===================================================================
RCS file: /sources/dotgnu-pnet/pnet/image/meta_types.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- image/meta_types.c  19 Aug 2007 00:41:14 -0000      1.18
+++ image/meta_types.c  13 Sep 2007 18:47:46 -0000      1.19
@@ -815,6 +815,13 @@
                        }
                        /* Not reached */
 
+                       case IL_TYPE_COMPLEX_BYREF:
+                       {
+                               name = ILTypeToName(type->un.refType__);
+                               return AppendString(name, " &");
+                       }
+                       /* Not reached */
+
                        case IL_TYPE_COMPLEX_ARRAY:
                        case IL_TYPE_COMPLEX_ARRAY_CONTINUE:
                        {
@@ -880,7 +887,16 @@
 
                        case IL_TYPE_COMPLEX_METHOD:
                        {
-                               name = ILTypeToName(ILTypeGetReturn(type));
+                               ILType *returnType = ILTypeGetReturn(type);
+
+                               if(returnType == ILType_Invalid)
+                               {
+                                       name = ILDupString("");
+                               }
+                               else
+                               {
+                                       name = ILTypeToName(returnType);
+                               }
                                if(ILType_HasThis(type))
                                {
                                        name = AppendString(name, " * instance 
(");

Index: image/synthetic.c
===================================================================
RCS file: /sources/dotgnu-pnet/pnet/image/synthetic.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- image/synthetic.c   20 Jul 2003 04:59:09 -0000      1.12
+++ image/synthetic.c   13 Sep 2007 18:47:46 -0000      1.13
@@ -540,10 +540,10 @@
 }
 
 ILClass *_ILTypeToSyntheticInstantiation
-               (ILImage *image, ILType *type, ILType *classParams)
+               (ILImage *image, ILType *type, ILType *classArgs, ILType 
*methodArgs)
 {
        /* TODO: do this without calling ILTypeInstantiate */
-       type = ILTypeInstantiate(image->context, type, classParams, 0);
+       type = ILTypeInstantiate(image->context, type, classArgs, methodArgs);
        if(!type)
        {
                return 0;




reply via email to

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