[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/engine cvm.h,1.41,1.42 cvm_dasm.c,1.47,
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/engine cvm.h,1.41,1.42 cvm_dasm.c,1.47,1.48 cvm_inline.c,1.11,1.12 cvm_lengths.c,1.10,1.11 cvmc_call.c,1.23,1.24 verify_call.c,1.33,1.34 |
Date: |
Sun, 23 Feb 2003 19:46:02 -0500 |
Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv6337/engine
Modified Files:
cvm.h cvm_dasm.c cvm_inline.c cvm_lengths.c cvmc_call.c
verify_call.c
Log Message:
Inline calls to "Char.IsWhiteSpace", because it is used heavily
in text processing code.
Index: cvm.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/cvm.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -r1.41 -r1.42
*** cvm.h 23 Feb 2003 04:24:11 -0000 1.41
--- cvm.h 24 Feb 2003 00:45:59 -0000 1.42
***************
*** 484,508 ****
#define COP_PREFIX_MONITOR_EXIT 0x50
#define COP_PREFIX_APPEND_CHAR 0x51
/*
* Binary value fixups.
*/
! #define COP_PREFIX_FIX_I4_I 0x52
! #define COP_PREFIX_FIX_I4_U 0x53
/*
* Trigger method unrolling.
*/
! #define COP_PREFIX_UNROLL_METHOD 0x54
/*
* Allocate local stack space.
*/
! #define COP_PREFIX_LOCAL_ALLOC 0x55
/*
* Method profiling.
*/
! #define COP_PREFIX_PROFILE_COUNT 0x56
/*
--- 484,509 ----
#define COP_PREFIX_MONITOR_EXIT 0x50
#define COP_PREFIX_APPEND_CHAR 0x51
+ #define COP_PREFIX_IS_WHITE_SPACE 0x52
/*
* Binary value fixups.
*/
! #define COP_PREFIX_FIX_I4_I 0x53
! #define COP_PREFIX_FIX_I4_U 0x54
/*
* Trigger method unrolling.
*/
! #define COP_PREFIX_UNROLL_METHOD 0x55
/*
* Allocate local stack space.
*/
! #define COP_PREFIX_LOCAL_ALLOC 0x56
/*
* Method profiling.
*/
! #define COP_PREFIX_PROFILE_COUNT 0x57
/*
Index: cvm_dasm.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/cvm_dasm.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -r1.47 -r1.48
*** cvm_dasm.c 23 Feb 2003 04:24:11 -0000 1.47
--- cvm_dasm.c 24 Feb 2003 00:45:59 -0000 1.48
***************
*** 544,547 ****
--- 544,548 ----
{"monitor_exit", CVM_OPER_NONE},
{"append_char", CVM_OPER_METHOD},
+ {"is_white_space", CVM_OPER_NONE},
/*
***************
*** 569,573 ****
* Reserved opcodes.
*/
- {"preserved_57", CVM_OPER_NONE},
{"preserved_58", CVM_OPER_NONE},
{"preserved_59", CVM_OPER_NONE},
--- 570,573 ----
Index: cvm_inline.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/cvm_inline.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** cvm_inline.c 23 Feb 2003 04:24:11 -0000 1.11
--- cvm_inline.c 24 Feb 2003 00:45:59 -0000 1.12
***************
*** 448,450 ****
--- 448,496 ----
VMBREAK(COP_PREFIX_APPEND_CHAR);
+ /**
+ * <opcode name="is_white_space" group="Inline methods">
+ * <operation>Determine if a character is white space</operation>
+ *
+ * <format>prefix<fsep/>is_white_space</format>
+ * <dformat>{is_white_space}</dformat>
+ *
+ * <form name="is_white_space" code="COP_PREFIX_IS_WHITE_SPACE"/>
+ *
+ * <before>..., ch</before>
+ * <after>..., result</after>
+ *
+ * <description>The <i>ch</i> is popped from the stack as the
+ * type <code>int32</code>. If it is a white space character,
+ * then the <code>int32</code> <i>result</i> 1 is pushed onto
+ * the stack; otherwise 0 is pushed.</description>
+ *
+ * <notes>This instruction is used to inline calls to the
+ * <code>Char.IsWhiteSpace(char)</code> method, which is used
+ * heavily in text processing code.</notes>
+ * </opcode>
+ */
+ VMCASE(COP_PREFIX_IS_WHITE_SPACE):
+ {
+ /* Determine if a character is white space */
+ position = stacktop[-1].intValue;
+ if(position == 0x0009 || position == 0x0020 || position == 0x000a ||
+ position == 0x000b || position == 0x000c || position == 0x000d ||
+ position == 0x0085 || position == 0x2028 || position == 0x2029)
+ {
+ stacktop[-1].intValue = 1;
+ }
+ else if(position < 0x0080)
+ {
+ stacktop[-1].intValue = 0;
+ }
+ else
+ {
+ stacktop[-1].intValue =
+ (ILGetUnicodeCategory((unsigned)position) ==
+ ILUnicode_SpaceSeparator);
+ }
+ MODIFY_PC_AND_STACK(CVMP_LEN_NONE, 0);
+ }
+ VMBREAK(COP_PREFIX_IS_WHITE_SPACE);
+
#endif /* IL_CVM_PREFIX */
Index: cvm_lengths.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/cvm_lengths.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** cvm_lengths.c 23 Feb 2003 04:24:11 -0000 1.10
--- cvm_lengths.c 24 Feb 2003 00:45:59 -0000 1.11
***************
*** 502,505 ****
--- 502,506 ----
/* monitor_exit */ CVMP_LEN_NONE,
/* append_char */ CVMP_LEN_PTR,
+ /* is_white_space */ CVMP_LEN_NONE,
/*
***************
*** 527,531 ****
* Reserved opcodes.
*/
- /* preserved_57 */ CVMP_LEN_NONE,
/* preserved_58 */ CVMP_LEN_NONE,
/* preserved_59 */ CVMP_LEN_NONE,
--- 528,531 ----
Index: cvmc_call.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/cvmc_call.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** cvmc_call.c 23 Feb 2003 04:24:11 -0000 1.23
--- cvmc_call.c 24 Feb 2003 00:45:59 -0000 1.24
***************
*** 360,363 ****
--- 360,371 ----
}
/* Not reached */
+
+ case IL_INLINEMETHOD_IS_WHITE_SPACE:
+ {
+ /* Check a character to see if it is white space */
+ CVMP_OUT_NONE(COP_PREFIX_IS_WHITE_SPACE);
+ return 1;
+ }
+ /* Not reached */
}
Index: verify_call.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/verify_call.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -r1.33 -r1.34
*** verify_call.c 23 Feb 2003 11:56:38 -0000 1.33
--- verify_call.c 24 Feb 2003 00:45:59 -0000 1.34
***************
*** 860,863 ****
--- 860,865 ----
{"StringBuilder", "System.Text", "Append",
"(Tc)oSystem.Text.StringBuilder;",
IL_INLINEMETHOD_BUILDER_APPEND_CHAR},
+
+ {"Char", "System", "IsWhiteSpace", "(c)Z",
IL_INLINEMETHOD_IS_WHITE_SPACE},
};
#define NumInlineMethods (sizeof(InlineMethods) /
sizeof(InlineMethodInfo))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/engine cvm.h,1.41,1.42 cvm_dasm.c,1.47,1.48 cvm_inline.c,1.11,1.12 cvm_lengths.c,1.10,1.11 cvmc_call.c,1.23,1.24 verify_call.c,1.33,1.34,
Rhys Weatherley <address@hidden> <=