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/call.c engine/engine.h


From: Klaus Treichel
Subject: [dotgnu-pnet-commits] pnet ./ChangeLog engine/call.c engine/engine.h
Date: Wed, 22 Feb 2006 19:50:50 +0000

CVSROOT:        /cvsroot/dotgnu-pnet
Module name:    pnet
Branch:         
Changes by:     Klaus Treichel <address@hidden> 06/02/22 19:50:50

Modified files:
        .              : ChangeLog 
        engine         : call.c engine.h 

Log message:
        2006-02-22  Klaus Treichel  <address@hidden>
        
        * engine/call.c: Pass the size of the type to _ILEngineAlloc and fix a 
bug
        in packing the args.
        
        * engine/engine.h: Adjust the prototypes for the arg packing functions.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/pnet/ChangeLog.diff?tr1=1.3292&tr2=1.3293&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/pnet/engine/call.c.diff?tr1=1.36&tr2=1.37&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/pnet/engine/engine.h.diff?tr1=1.110&tr2=1.111&r1=text&r2=text

Patches:
Index: pnet/ChangeLog
diff -u pnet/ChangeLog:1.3292 pnet/ChangeLog:1.3293
--- pnet/ChangeLog:1.3292       Tue Feb 21 19:33:49 2006
+++ pnet/ChangeLog      Wed Feb 22 19:50:50 2006
@@ -1,6 +1,13 @@
+2006-02-22  Klaus Treichel  <address@hidden>
+
+       * engine/call.c: Pass the size of the type to _ILEngineAlloc and fix a 
bug
+       in packing the args.
+
+       * engine/engine.h: Adjust the prototypes for the arg packing functions.
+
 2006-02-21  Klaus Treichel  <address@hidden>
 
-       * engine/jitc.c: Fix a bug in creting the jit types. Enum types must be
+       * engine/jitc.c: Fix a bug in creating the jit types. Enum types must be
        converted to their underlying type.
 
        * engine/lib_reflect.c: Field- and Method handles are passed by value 
and
Index: pnet/engine/call.c
diff -u pnet/engine/call.c:1.36 pnet/engine/call.c:1.37
--- pnet/engine/call.c:1.36     Sun Feb 12 15:10:10 2006
+++ pnet/engine/call.c  Wed Feb 22 19:50:50 2006
@@ -101,16 +101,35 @@
 
 #ifdef IL_USE_JIT
 int _ILCallPackVaParams(ILExecThread *thread, ILType *signature,
+                                               int isCtor, void *_this,
                                            void *argBuffer, void **jitArgs, 
void *userData)
 {
        VA_LIST va;
-       ILExecValue *args = (ILExecValue *)userData;
        ILUInt32 param, numParams;
        ILType *paramType;
 
        /* Copy the incoming "va_list" value */
        ILMemCpy(&va, userData, sizeof(VA_LIST));
 
+       /* Push the arguments onto the evaluation stack */
+       if(ILType_HasThis(signature) && !isCtor)
+       {
+               /* Push the "this" argument */
+               if(_this)
+               {
+                       /* Use the supplied "this" parameter */
+                       *jitArgs = argBuffer;
+                       *((void **)argBuffer) = _this;
+               }
+               else
+               {
+                       /* Get the "this" parameter from the varargs list */
+                       *jitArgs = argBuffer;
+                       *((void **)argBuffer) = (void *)(VA_ARG(va, ILObject 
*));
+               }
+               argBuffer += sizeof(void *);
+               ++jitArgs;
+       }
        numParams = ILTypeNumParams(signature);
        for(param = 1; param <= numParams; ++param)
        {
@@ -133,7 +152,6 @@
                                        *jitArgs = argBuffer;
                                        *((ILVaInt *)argBuffer) = VA_ARG(va, 
ILVaInt);
                                        argBuffer += sizeof(ILVaInt);
-                                       ++args;
                                        ++jitArgs;
                                }
                                break;
@@ -149,7 +167,6 @@
                                        *jitArgs = argBuffer;
                                        *((ILVaUInt *)argBuffer) = VA_ARG(va, 
ILVaUInt);
                                        argBuffer += sizeof(ILVaUInt);
-                                       ++args;
                                        ++jitArgs;
                                }
                                break;
@@ -162,7 +179,6 @@
                                        *jitArgs = argBuffer;
                                        *((ILInt64 *)argBuffer) = VA_ARG(va, 
ILInt64);
                                        argBuffer += sizeof(ILInt64);
-                                       ++args;
                                        ++jitArgs;
                                }
                                break;
@@ -175,7 +191,6 @@
                                        *jitArgs = argBuffer;
                                        *((ILUInt64 *)argBuffer) = VA_ARG(va, 
ILUInt64);
                                        argBuffer += sizeof(ILUInt64);
-                                       ++args;
                                        ++jitArgs;
                                }
                                break;
@@ -187,7 +202,6 @@
                                        *jitArgs = argBuffer;
                                        *((ILVaDouble *)argBuffer) = VA_ARG(va, 
ILVaDouble);
                                        argBuffer += sizeof(ILUInt64);
-                                       ++args;
                                        ++jitArgs;
                                }
                                break;
@@ -199,7 +213,6 @@
                                        *jitArgs = argBuffer;
                                        *((void **)argBuffer) = VA_ARG(va, void 
*);
                                        argBuffer += sizeof(void *);
-                                       ++args;
                                        ++jitArgs;
                                }
                                break;
@@ -211,7 +224,6 @@
                        *jitArgs = argBuffer;
                        *((ILObject **)argBuffer) = VA_ARG(va, ILObject *);
                        argBuffer += sizeof(ILObject *);
-                       ++args;
                        ++jitArgs;
                }
                else if(ILType_IsValueType(paramType))
@@ -220,7 +232,6 @@
                           put the value into a temporary location and then
                           passed a pointer to the temporary to us */
                        *jitArgs = (void *)(VA_ARG(va, void *));
-                       ++args;
                        ++jitArgs;
                }
                else if(paramType != 0 && ILType_IsComplex(paramType) &&
@@ -230,7 +241,6 @@
                        *jitArgs = argBuffer;
                        *((void **)argBuffer) = VA_ARG(va, void *);
                        argBuffer += sizeof(void *);
-                       ++args;
                        ++jitArgs;
                }
                else
@@ -239,7 +249,6 @@
                        *jitArgs = argBuffer;
                        *((ILObject **)argBuffer) = VA_ARG(va, ILObject *);
                        argBuffer += sizeof(ILObject *);
-                       ++args;
                        ++jitArgs;
                }
        }
@@ -404,6 +413,7 @@
 
 #ifdef IL_USE_JIT
 int _ILCallPackVParams(ILExecThread *thread, ILType *signature,
+                                          int isCtor, void *_this,
                                           void *argBuffer, void **jitArgs, 
void *userData)
 {
        ILExecValue *args = (ILExecValue *)userData;
@@ -411,6 +421,24 @@
        ILType *paramType;
 
        /* Store pointers to the args in the jitArgs Array. */
+       if(ILType_HasThis(signature) && !isCtor)
+       {
+               /* Push the "this" argument */
+               if(_this)
+               {
+                       /* Use the supplied "this" parameter */
+                       *jitArgs = argBuffer;
+                       *((void **)argBuffer) = _this;
+                       argBuffer += sizeof(void *);
+               }
+               else
+               {
+                       /* Get the "this" parameter from the argument list */
+                       *jitArgs = &(args->objValue);
+                       ++args;
+               }
+               ++jitArgs;
+       }
        numParams = ILTypeNumParams(signature);
        for(param = 1; param <= numParams; ++param)
        {
@@ -978,7 +1006,9 @@
                        if(!isArrayOrString)
                        {
                                /* We need to allocate the Object. */
-                               if(!(_this = _ILEngineAlloc(thread, 
ILMethod_Owner(method), 0)))
+                               ILUInt32 size = ILSizeOfType(thread, 
ILClassToType(info));
+
+                               if(!(_this = _ILEngineAlloc(thread, 
ILMethod_Owner(method), size)))
                                {
                                        return 1;
                                }
@@ -986,14 +1016,10 @@
                                current++;
                        }
                }
-               else
-               {
-                       jitArgs[1] = &_this;
-                       current++;
-               }
        }
 
-       if((*pack)(thread, signature, &(jitArgsBuffer[0]), &(jitArgs[current]), 
userData))
+       if((*pack)(thread, signature, isCtor, _this, 
+                          &(jitArgsBuffer[0]), &(jitArgs[current]), userData))
        {
                return 1;
        }
Index: pnet/engine/engine.h
diff -u pnet/engine/engine.h:1.110 pnet/engine/engine.h:1.111
--- pnet/engine/engine.h:1.110  Mon Jan  9 20:49:47 2006
+++ pnet/engine/engine.h        Wed Feb 22 19:50:50 2006
@@ -602,6 +602,7 @@
  */
 #ifdef IL_USE_JIT
 int _ILCallPackVaParams(ILExecThread *thread, ILType *signature,
+                                               int isCtor, void *_this,
                                            void *argBuffer, void **jitArgs, 
void *userData);
 #else
 int _ILCallPackVaParams(ILExecThread *thread, ILMethod *method,
@@ -614,6 +615,7 @@
  */
 #ifdef IL_USE_JIT
 int _ILCallPackVParams(ILExecThread *thread, ILType *signature,
+                                          int isCtor, void *_this,
                                           void *argBuffer, void **jitArgs, 
void *userData);
 #else
 int _ILCallPackVParams(ILExecThread *thread, ILMethod *method,
@@ -639,6 +641,7 @@
  */
 #ifdef IL_USE_JIT
 typedef int (*ILCallPackFunc)(ILExecThread *thread, ILType *signature,
+                                                         int isCtor, void 
*_this,
                                                  void *argBuffer, void 
**jitArgs, void *userData);
 #else
 typedef int (*ILCallPackFunc)(ILExecThread *thread, ILMethod *method,




reply via email to

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