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


From: Klaus Treichel
Subject: [dotgnu-pnet-commits] pnet ChangeLog engine/jitc.c engine/jitc.h engi...
Date: Tue, 28 Nov 2006 19:15:23 +0000

CVSROOT:        /cvsroot/dotgnu-pnet
Module name:    pnet
Changes by:     Klaus Treichel <ktreichel>      06/11/28 19:15:23

Modified files:
        .              : ChangeLog 
        engine         : jitc.c jitc.h jitc_array.c jitc_call.c 

Log message:
        2006-11-28  Klaus Treichel  <address@hidden>
        
                * engine/jitc.h: Add System.Array and System.Math to the 
classes handled
                internal.
        
                * engine/jitc.c: Change the prototype for inlineing 
internalcalls.
        
                * engine/jitc_array.c: Handle the changed prototype for 
inlineing and do
                more errorchecking.
        
                * engine/jitc_call.c: Handle the changed prototype for inlineing
                internalcalls.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pnet/ChangeLog?cvsroot=dotgnu-pnet&r1=1.3392&r2=1.3393
http://cvs.savannah.gnu.org/viewcvs/pnet/engine/jitc.c?cvsroot=dotgnu-pnet&r1=1.59&r2=1.60
http://cvs.savannah.gnu.org/viewcvs/pnet/engine/jitc.h?cvsroot=dotgnu-pnet&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/pnet/engine/jitc_array.c?cvsroot=dotgnu-pnet&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/pnet/engine/jitc_call.c?cvsroot=dotgnu-pnet&r1=1.30&r2=1.31

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ChangeLog,v
retrieving revision 1.3392
retrieving revision 1.3393
diff -u -b -r1.3392 -r1.3393
--- ChangeLog   27 Nov 2006 19:14:02 -0000      1.3392
+++ ChangeLog   28 Nov 2006 19:15:23 -0000      1.3393
@@ -1,3 +1,16 @@
+2006-11-28  Klaus Treichel  <address@hidden>
+
+       * engine/jitc.h: Add System.Array and System.Math to the classes handled
+       internal.
+
+       * engine/jitc.c: Change the prototype for inlineing internalcalls.
+
+       * engine/jitc_array.c: Handle the changed prototype for inlineing and do
+       more errorchecking.
+
+       * engine/jitc_call.c: Handle the changed prototype for inlineing
+       internalcalls.
+
 2006-11-27  Klaus Treichel  <address@hidden>
 
        * engine/jitc_arith.c: Use the jit_insn_rem instead of jit_insn_rem_ieee

Index: engine/jitc.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/jitc.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- engine/jitc.c       20 Oct 2006 19:30:54 -0000      1.59
+++ engine/jitc.c       28 Nov 2006 19:15:23 -0000      1.60
@@ -316,9 +316,18 @@
 /*
  * Prototype for inlining functioncalls.
  *
- * ILJitValue func(ILJITCoder *, ILMethod *, ILCoderMethodInfo *, 
ILJitStackItem *, ILInt32)
+ * On entry of the function the args are allready popped off the evaluation
+ * stack. The args pointer points to the first arg (the one at the lowest
+ * stack position).
+ * The function is responsible to push the result value on the stack if the
+ * return type is not void.
+ *
+ * The function has to return 0 on failure. Any other value will be treated as
+ * success.
+ *
+ * int func(ILJITCoder *, ILMethod *, ILCoderMethodInfo *, ILJitStackItem *, 
ILInt32)
  */
-typedef ILJitValue (*ILJitInlineFunc)(ILJITCoder *jitCoder,
+typedef int (*ILJitInlineFunc)(ILJITCoder *jitCoder,
                                                                          
ILMethod *method,
                                                                          
ILCoderMethodInfo *methodInfo,
                                                                          
ILJitStackItem *args,

Index: engine/jitc.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/jitc.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- engine/jitc.h       4 Oct 2006 14:33:33 -0000       1.20
+++ engine/jitc.h       28 Nov 2006 19:15:23 -0000      1.21
@@ -120,6 +120,8 @@
 #define IL_JIT_TYPEKIND_DELEGATE                       0x00000001
 #define IL_JIT_TYPEKIND_MULTICASTDELEGATE      0x00000002
 #define IL_JIT_TYPEKIND_ARRAY                          0x00000010
+#define IL_JIT_TYPEKIND_SYSTEM_ARRAY           0x00000020
+#define IL_JIT_TYPEKIND_SYSTEM_MATH                    0x00000040
 
 /*
  * Initialize a ILJitTypes structure 

Index: engine/jitc_array.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/jitc_array.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- engine/jitc_array.c 18 Oct 2006 11:06:09 -0000      1.4
+++ engine/jitc_array.c 28 Nov 2006 19:15:23 -0000      1.5
@@ -72,28 +72,30 @@
                                                                                
   ILUInt32 numElements);
 
 /*
- * Get an array element at the specified indexes from a complex array.
+ * Inline function to get an array element at the specified indexes from a
+ * complex array.
  */
-static ILJitValue _ILJitMArrayGet(ILJITCoder *jitCoder,
+static int _ILJitMArrayGet(ILJITCoder *jitCoder,
                                                                  ILMethod 
*method,
                                                                  
ILCoderMethodInfo *methodInfo,
                                                                  
ILJitStackItem *args,
                                                                  ILInt32 
numArgs);
 
 /*
- * Get the address of an array element at the specified indexes in a complex
- * array.
+ * Inline function to get the address of an array element at the specified
+ * indexes in a complex array.
  */
-static ILJitValue _ILJitMArrayAddress(ILJITCoder *jitCoder,
+static int _ILJitMArrayAddress(ILJITCoder *jitCoder,
                                                                          
ILMethod *method,
                                                                          
ILCoderMethodInfo *methodInfo,
                                                                          
ILJitStackItem *args,
                                                                          
ILInt32 numArgs);
 
 /*
- * Set an array element at the specified indexes in a complex array.
+ * Inline function to set an array element at the specified indexes in a
+ * complex array.
  */
-static ILJitValue _ILJitMArraySet(ILJITCoder *jitCoder,
+static int _ILJitMArraySet(ILJITCoder *jitCoder,
                                                                  ILMethod 
*method,
                                                                  
ILCoderMethodInfo *methodInfo,
                                                                  
ILJitStackItem *args,
@@ -526,7 +528,7 @@
 /*
  * Get an array element at the specified indexes from a complex array.
  */
-static ILJitValue _ILJitMArrayGet(ILJITCoder *jitCoder,
+static int _ILJitMArrayGet(ILJITCoder *jitCoder,
                                                                  ILMethod 
*method,
                                                                  
ILCoderMethodInfo *methodInfo,
                                                                  
ILJitStackItem *args,
@@ -535,6 +537,7 @@
        ILJitFunction jitFunction = ILJitFunctionFromILMethod(method);
        ILJitValue array = _ILJitStackItemValue(args[0]);
        ILJitValue arrayBase;
+       ILJitValue returnValue;
        ILJitType signature;
        ILJitType arrayType;
        ILJitValue index;
@@ -546,21 +549,29 @@
                {
                        return 0;
                }
-               jitFunction = ILJitFunctionFromILMethod(method);
+               if(!(jitFunction = ILJitFunctionFromILMethod(method)))
+               {
+                       return 0;
+               }
        }
 
-       signature = jit_function_get_signature(jitFunction);
+       if(!(signature = jit_function_get_signature(jitFunction)))
+       {
+               return 0;
+       }
        arrayType = jit_type_get_return(signature);
        index = _ILJitMArrayCalcIndex(jitCoder, array, &(args[1]), numArgs - 1);
        arrayBase = _ILJitMarrayGetBase(jitCoder, array);
-       return jit_insn_load_elem(jitCoder->jitFunction, arrayBase, index, 
arrayType);
+       returnValue = jit_insn_load_elem(jitCoder->jitFunction, arrayBase, 
index, arrayType);
+       _ILJitStackPushValue(jitCoder, returnValue);
+       return 1;
 }
 
 /*
  * Get the address of an array element at the specified indexes in a complex
  * array.
  */
-static ILJitValue _ILJitMArrayAddress(ILJITCoder *jitCoder,
+static int _ILJitMArrayAddress(ILJITCoder *jitCoder,
                                                                          
ILMethod *method,
                                                                          
ILCoderMethodInfo *methodInfo,
                                                                          
ILJitStackItem *args,
@@ -574,6 +585,7 @@
        ILJitType signature;
        ILJitType arrayType;
        ILJitValue index;
+       ILJitValue returnValue;
 
        if(!jitFunction)
        {
@@ -582,24 +594,32 @@
                {
                        return 0;
                }
-               jitFunction = ILJitFunctionFromILMethod(method);
+               if(!(jitFunction = ILJitFunctionFromILMethod(method)))
+               {
+                       return 0;
+               }
        }
 
-       signature = jit_function_get_signature(jitFunction);
+       if(!(signature = jit_function_get_signature(jitFunction)))
+       {
+               return 0;
+       }
        arrayType = _ILJitGetReturnType(elementType, 
                                                                        
((ILClassPrivate *)arrayClass->userData)->process);
        index = _ILJitMArrayCalcIndex(jitCoder, array, &(args[1]), numArgs - 1);
        arrayBase = _ILJitMarrayGetBase(jitCoder, array);
-       return jit_insn_load_elem_address(jitCoder->jitFunction,
+       returnValue = jit_insn_load_elem_address(jitCoder->jitFunction,
                                                                          
arrayBase,
                                                                          index,
                                                                          
arrayType);
+       _ILJitStackPushNotNullValue(jitCoder, returnValue);
+       return 1;
 }
 
 /*
  * Set an array element at the specified indexes in a complex array.
  */
-static ILJitValue _ILJitMArraySet(ILJITCoder *jitCoder,
+static int _ILJitMArraySet(ILJITCoder *jitCoder,
                                                                  ILMethod 
*method,
                                                                  
ILCoderMethodInfo *methodInfo,
                                                                  
ILJitStackItem *args,
@@ -620,10 +640,16 @@
                {
                        return 0;
                }
-               jitFunction = ILJitFunctionFromILMethod(method);
+               if(!(jitFunction = ILJitFunctionFromILMethod(method)))
+               {
+                       return 0;
+               }
        }
 
-       signature = jit_function_get_signature(jitFunction);
+       if(!(signature = jit_function_get_signature(jitFunction)))
+       {
+               return 0;
+       }
 #ifdef IL_JIT_THREAD_IN_SIGNATURE
        arrayType = jit_type_get_param(signature, numArgs);
 #else
@@ -634,7 +660,7 @@
        value = _ILJitValueConvertImplicit(jitCoder->jitFunction, value, 
arrayType);
        jit_insn_store_elem(jitCoder->jitFunction, arrayBase, index, value);
        /* We have no return value in this case. */
-       return 0;
+       return 1;
 }
 
 /*

Index: engine/jitc_call.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/jitc_call.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- engine/jitc_call.c  17 Oct 2006 12:24:18 -0000      1.30
+++ engine/jitc_call.c  28 Nov 2006 19:15:23 -0000      1.31
@@ -490,11 +490,10 @@
        {
                ILJitStackItem *args = _ILJitStackItemGetAndPop(jitCoder, 
argCount);
 
-               returnValue = (*inlineFunc)(jitCoder, methodInfo, info, args, 
argCount);
-
-               if(returnItem && returnItem->engineType != ILEngineType_Invalid)
+               if(!((*inlineFunc)(jitCoder, methodInfo, info, args, argCount)))
                {
-                       _ILJitStackPushValue(jitCoder, returnValue);
+                       /* Failure on inlining the function. */
+                       /* TODO: we have to handle this somehow. */
                }
                return;
        }




reply via email to

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