[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dotgnu-pnet-commits] pnet ./ChangeLog engine/jitc_ptr.c
From: |
Klaus Treichel |
Subject: |
[dotgnu-pnet-commits] pnet ./ChangeLog engine/jitc_ptr.c |
Date: |
Mon, 10 Apr 2006 19:40:26 +0000 |
CVSROOT: /cvsroot/dotgnu-pnet
Module name: pnet
Branch:
Changes by: Klaus Treichel <address@hidden> 06/04/10 19:40:26
Modified files:
. : ChangeLog
engine : jitc_ptr.c
Log message:
2006-04-10 Klaus Treichel <address@hidden>
* engine/jitc_ptr.c: Do some optimizations in the array index
verification
(converting the array length and index to unsigned saves one comparision
and jump). Inline the internal call in NewArray.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/pnet/ChangeLog.diff?tr1=1.3312&tr2=1.3313&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/pnet/engine/jitc_ptr.c.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
Patches:
Index: pnet/ChangeLog
diff -u pnet/ChangeLog:1.3312 pnet/ChangeLog:1.3313
--- pnet/ChangeLog:1.3312 Sun Apr 9 16:30:44 2006
+++ pnet/ChangeLog Mon Apr 10 19:40:26 2006
@@ -1,3 +1,9 @@
+2006-04-10 Klaus Treichel <address@hidden>
+
+ * engine/jitc_ptr.c: Do some optimizations in the array index
verification
+ (converting the array length and index to unsigned saves one comparision
+ and jump). Inline the internal call in NewArray.
+
2006-04-09 Klaus Treichel <address@hidden>
* engine/jitc.c, engine/jitc_conv.c: Fix bugs in type conversion.
Index: pnet/engine/jitc_ptr.c
diff -u pnet/engine/jitc_ptr.c:1.7 pnet/engine/jitc_ptr.c:1.8
--- pnet/engine/jitc_ptr.c:1.7 Sun Mar 19 11:29:11 2006
+++ pnet/engine/jitc_ptr.c Mon Apr 10 19:40:26 2006
@@ -46,22 +46,18 @@
static void ValidateArrayIndex(ILJITCoder *coder, ILJitValue length,
ILJitValue index)
{
- jit_label_t label1 = jit_label_undefined;
- jit_label_t label2 = jit_label_undefined;
- ILJitValue constNull =
jit_value_create_nint_constant(coder->jitFunction,
-
_IL_JIT_TYPE_NINT,
-
(jit_nint)0);
- ILJitValue temp = jit_insn_lt(coder->jitFunction, index, constNull);
+ jit_label_t label = jit_label_undefined;
+ ILJitValue temp;
+
+ /* Make both values unsigned. We can save one compare this way. */
+ AdjustSign(coder->jitFunction, &length, 1, 0);
+ AdjustSign(coder->jitFunction, &index, 1, 0);
- jit_insn_branch_if(coder->jitFunction, temp, &label1);
temp = jit_insn_lt(coder->jitFunction, index, length);
- jit_insn_branch_if(coder->jitFunction, temp, &label2);
- jit_insn_label(coder->jitFunction, &label1);
+ jit_insn_branch_if(coder->jitFunction, temp, &label);
/* throw the System.IndexOutOfRange exception. */
_ILJitThrowInternal(coder->jitFunction, JIT_RESULT_OUT_OF_BOUNDS);
- jit_insn_label(coder->jitFunction, &label2);
-
-
+ jit_insn_label(coder->jitFunction, &label);
}
/*
@@ -544,9 +540,7 @@
ILJitFunction jitFunction;
ILJitValue returnValue;
jit_label_t label = jit_label_undefined;
- ILJitValue nullConst =
jit_value_create_nint_constant(jitCoder->jitFunction,
-
_IL_JIT_TYPE_VPTR, 0);
- ILJitValue temp;
+ ILInternalInfo fnInfo;
/* Find the allocation constructor within the array class.
We know that the class only has one method, so it must
@@ -564,15 +558,23 @@
}
jitFunction = ILJitFunctionFromILMethod(ctor);
}
- args[0] = jit_value_get_param(jitCoder->jitFunction, 0);
- args[1] = length;
- JITC_ADJUST(jitCoder, -1);
- _ILJitSetMethodInThread(jitCoder->jitFunction, args[0], ctor);
- /* Output code to call the array type's constructor */
- returnValue = jit_insn_call(jitCoder->jitFunction, 0, jitFunction,
- 0, args, 2, 0);
- temp = jit_insn_ne(jitCoder->jitFunction, returnValue, nullConst);
- jit_insn_branch_if(jitCoder->jitFunction, temp, &label);
+ if(_ILJitFunctionIsInternal(jitCoder, ctor, &fnInfo, 1))
+ {
+ JITC_ADJUST(jitCoder, -1);
+ returnValue = _ILJitCallInternal(jitCoder->jitFunction, ctor,
+
fnInfo.func, 0, &length, 1);
+ }
+ else
+ {
+ args[0] = jit_value_get_param(jitCoder->jitFunction, 0);
+ args[1] = length;
+ JITC_ADJUST(jitCoder, -1);
+ _ILJitSetMethodInThread(jitCoder->jitFunction, args[0], ctor);
+ /* Output code to call the array type's constructor */
+ returnValue = jit_insn_call(jitCoder->jitFunction, 0,
jitFunction,
+ 0,
args, 2, 0);
+ }
+ jit_insn_branch_if(jitCoder->jitFunction, returnValue, &label);
_ILJitThrowCurrentException(jitCoder);
jit_insn_label(jitCoder->jitFunction, &label);
jitCoder->jitStack[jitCoder->stackTop] = returnValue;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [dotgnu-pnet-commits] pnet ./ChangeLog engine/jitc_ptr.c,
Klaus Treichel <=