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

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

[Dotgnu-pnet-commits] CVS: pnet/engine cvm.h,1.45,1.46 cvm_call.c,1.66,


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/engine cvm.h,1.45,1.46 cvm_call.c,1.66,1.67 cvm_dasm.c,1.52,1.53 cvmc_setup.c,1.33,1.34
Date: Sun, 15 Jun 2003 20:05:17 -0400

Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv25771/engine

Modified Files:
        cvm.h cvm_call.c cvm_dasm.c cvmc_setup.c 
Log Message:


Increase the maximum PInvoke argument count from 8 to 32 when used in
non-raw libffi modes; needed to run Xsharp on non-x86 platforms.


Index: cvm.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/cvm.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -r1.45 -r1.46
*** cvm.h       1 May 2003 10:29:08 -0000       1.45
--- cvm.h       16 Jun 2003 00:05:15 -0000      1.46
***************
*** 516,519 ****
--- 516,524 ----
  
  /*
+  * Argument packing for native calls.
+  */
+ #define       COP_PREFIX_WADDR_NATIVE_N       0x5B
+ 
+ /*
   * Definition of a CVM stack word which can hold
   * either 32-bit quantities or pointers.
***************
*** 557,561 ****
   * Maximum number of arguments that can be packed for a native call.
   */
! #define       CVM_MAX_NATIVE_ARGS             8
  
  #ifdef        __cplusplus
--- 562,566 ----
   * Maximum number of arguments that can be packed for a native call.
   */
! #define       CVM_MAX_NATIVE_ARGS             32
  
  #ifdef        __cplusplus

Index: cvm_call.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/cvm_call.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -r1.66 -r1.67
*** cvm_call.c  2 Jun 2003 06:55:16 -0000       1.66
--- cvm_call.c  16 Jun 2003 00:05:15 -0000      1.67
***************
*** 1642,1644 ****
--- 1642,1668 ----
  VMBREAK(COP_PREFIX_PROFILE_COUNT);
  
+ /**
+  * <opcode name="waddr_native_n" group="Call management instructions">
+  *   <operation>Set position <i>n</i> of the native argument buffer
+  *              to the address of a local variable</operation>
+  *
+  *   <format>prefix<fsep/>waddr_native_n<fsep/>N[4]<fsep/>V[4]</format>
+  *   <dformat>{waddr_native_n}<fsep/>N<fsep/>V</dformat>
+  *
+  *   <form name="waddr_native_n" code="COP_PREFIX_WADDR_NATIVE_N"/>
+  *
+  *   <description>Set position <i>N</i> of the native argument buffer
+  *   to the address of local variable <i>V</i>.  For an "InternalCall"
+  *   method, 0 is the first argument.  For a "PInvoke" method,
+  *   -1 (<i>m1</i>) is the first argument.</description>
+  * </opcode>
+  */
+ VMCASE(COP_PREFIX_WADDR_NATIVE_N):
+ {
+       /* Set a value within the native argument stack */
+       nativeArgs[CVMP_ARG_WORD + 1] = (void *)(&(frame[CVMP_ARG_WORD2]));
+       MODIFY_PC_AND_STACK(CVMP_LEN_WORD2, 0);
+ }
+ VMBREAK(COP_PREFIX_WADDR_NATIVE_N);
+ 
  #endif /* IL_CVM_PREFIX */

Index: cvm_dasm.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/cvm_dasm.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -r1.52 -r1.53
*** cvm_dasm.c  15 May 2003 06:02:07 -0000      1.52
--- cvm_dasm.c  16 Jun 2003 00:05:15 -0000      1.53
***************
*** 574,580 ****
  
        /*
         * Reserved opcodes.
         */
-       {"preserved_5B",        CVM_OPER_NONE},
        {"preserved_5C",        CVM_OPER_NONE},
        {"preserved_5D",        CVM_OPER_NONE},
--- 574,584 ----
  
        /*
+        * Argument packing for native calls.
+        */
+       {"waddr_native_n",      CVM_OPER_TWO_UINT32},
+ 
+       /*
         * Reserved opcodes.
         */
        {"preserved_5C",        CVM_OPER_NONE},
        {"preserved_5D",        CVM_OPER_NONE},

Index: cvmc_setup.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/cvmc_setup.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -r1.33 -r1.34
*** cvmc_setup.c        1 May 2003 10:29:08 -0000       1.33
--- cvmc_setup.c        16 Jun 2003 00:05:15 -0000      1.34
***************
*** 802,812 ****
                                }
                                CVM_ADJUST(-1);
!                               CVM_OUT_WIDE(COP_WADDR_NATIVE_0 + 
ctx->nativeArg, offset);
                        }
                        else
                        {
                                /* Push a pointer to the actual arg onto the 
native stack */
!                               CVM_OUT_WIDE(COP_WADDR_NATIVE_0 + 
ctx->nativeArg,
!                                                        
coder->argOffsets[param - thisAdjust]);
                        }
                        ++(ctx->nativeArg);
--- 802,830 ----
                                }
                                CVM_ADJUST(-1);
!                               if(ctx->nativeArg < 8)
!                               {
!                                       CVM_OUT_WIDE(COP_WADDR_NATIVE_0 + 
ctx->nativeArg, offset);
!                               }
!                               else
!                               {
!                                       
CVMP_OUT_WORD2(COP_PREFIX_WADDR_NATIVE_N,
!                                                                  
(ILUInt32)(ILInt32)(ctx->nativeArg),
!                                                                  offset);
!                               }
                        }
                        else
                        {
                                /* Push a pointer to the actual arg onto the 
native stack */
!                               if(ctx->nativeArg < 8)
!                               {
!                                       CVM_OUT_WIDE(COP_WADDR_NATIVE_0 + 
ctx->nativeArg,
!                                                                
coder->argOffsets[param - thisAdjust]);
!                               }
!                               else
!                               {
!                                       
CVMP_OUT_WORD2(COP_PREFIX_WADDR_NATIVE_N,
!                                                                  
(ILUInt32)(ILInt32)(ctx->nativeArg),
!                                                                  
coder->argOffsets[param - thisAdjust]);
!                               }
                        }
                        ++(ctx->nativeArg);





reply via email to

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