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

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

[Dotgnu-pnet-commits] pnet/cscc/csharp cs_oper.tc,1.44,1.45


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] pnet/cscc/csharp cs_oper.tc,1.44,1.45
Date: Fri, 21 Nov 2003 00:25:28 +0000

Update of /cvsroot/dotgnu-pnet/pnet/cscc/csharp
In directory subversions:/tmp/cvs-serv20266/cscc/csharp

Modified Files:
        cs_oper.tc 
Log Message:


Implement a short-cut in the "==" and "!=" operators for "IntPtr"
arguments, to avoid a runtime call to the user-defined operator methods.


Index: cs_oper.tc
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/csharp/cs_oper.tc,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** cs_oper.tc  20 Jul 2003 15:33:05 -0000      1.44
--- cs_oper.tc  21 Nov 2003 00:25:26 -0000      1.45
***************
*** 1805,1808 ****
--- 1805,1817 ----
        }
  
+       /* If the two types are IntPtr, then we take a shortcut, avoiding
+          the call to the user-defined operators in "IntPtr" */
+       if(CSSemGetType(value1) == ILType_Int &&
+          CSSemGetType(value2) == ILType_Int)
+       {
+               CSSemSetRValue(value1, ILType_Boolean);
+               return value1;
+       }
+ 
        /* Look for a user-specified operator */
        method = FindUserBinaryOperator(info, name, &(value1), node->expr1,





reply via email to

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