|
|
cb67f2 |
From 5c8999dd06c88ec49157f59dab561ce7d5a7c911 Mon Sep 17 00:00:00 2001
|
|
|
cb67f2 |
From: zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>
|
|
|
cb67f2 |
Date: Fri, 15 Nov 2013 12:04:55 +0000
|
|
|
cb67f2 |
Subject: [PATCH 2/2] Add support for PT_PXGRAPH, PT_PXPRINT, and PT_PXPUNCT in
|
|
|
cb67f2 |
JIT.
|
|
|
cb67f2 |
MIME-Version: 1.0
|
|
|
cb67f2 |
Content-Type: text/plain; charset=UTF-8
|
|
|
cb67f2 |
Content-Transfer-Encoding: 8bit
|
|
|
cb67f2 |
|
|
|
cb67f2 |
Petr Pisar: Ported to 8.32:
|
|
|
cb67f2 |
|
|
|
cb67f2 |
commit 9885cc24e4771dbe6daadd2107e4552bb92aafa2
|
|
|
cb67f2 |
Author: zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>
|
|
|
cb67f2 |
Date: Fri Nov 15 12:04:55 2013 +0000
|
|
|
cb67f2 |
|
|
|
cb67f2 |
Add support for PT_PXGRAPH, PT_PXPRINT, and PT_PXPUNCT in JIT.
|
|
|
cb67f2 |
|
|
|
cb67f2 |
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1402 2f5784b3-3f2a-0410-8824-cb99058d5e15
|
|
|
cb67f2 |
|
|
|
cb67f2 |
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
|
cb67f2 |
---
|
|
|
cb67f2 |
pcre_jit_compile.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
cb67f2 |
1 file changed, 65 insertions(+)
|
|
|
cb67f2 |
|
|
|
cb67f2 |
diff --git a/pcre_jit_compile.c b/pcre_jit_compile.c
|
|
|
cb67f2 |
index c61c688..875947a 100644
|
|
|
cb67f2 |
--- a/pcre_jit_compile.c
|
|
|
cb67f2 |
+++ b/pcre_jit_compile.c
|
|
|
cb67f2 |
@@ -3699,6 +3699,7 @@ const pcre_uint32 *other_cases;
|
|
|
cb67f2 |
struct sljit_jump *jump = NULL;
|
|
|
cb67f2 |
pcre_uchar *ccbegin;
|
|
|
cb67f2 |
int compares, invertcmp, numberofcmps;
|
|
|
cb67f2 |
+
|
|
|
cb67f2 |
#ifdef SUPPORT_UCP
|
|
|
cb67f2 |
BOOL needstype = FALSE, needsscript = FALSE, needschar = FALSE;
|
|
|
cb67f2 |
BOOL charsaved = FALSE;
|
|
|
cb67f2 |
@@ -3798,6 +3799,9 @@ while (*cc != XCL_END)
|
|
|
cb67f2 |
case PT_SPACE:
|
|
|
cb67f2 |
case PT_PXSPACE:
|
|
|
cb67f2 |
case PT_WORD:
|
|
|
cb67f2 |
+ case PT_PXGRAPH:
|
|
|
cb67f2 |
+ case PT_PXPRINT:
|
|
|
cb67f2 |
+ case PT_PXPUNCT:
|
|
|
cb67f2 |
needstype = TRUE;
|
|
|
cb67f2 |
needschar = TRUE;
|
|
|
cb67f2 |
break;
|
|
|
cb67f2 |
@@ -4068,6 +4072,67 @@ while (*cc != XCL_END)
|
|
|
cb67f2 |
}
|
|
|
cb67f2 |
jump = JUMP(SLJIT_C_NOT_ZERO ^ invertcmp);
|
|
|
cb67f2 |
break;
|
|
|
cb67f2 |
+
|
|
|
cb67f2 |
+ case PT_PXGRAPH:
|
|
|
cb67f2 |
+ /* C and Z groups are the farthest two groups. */
|
|
|
cb67f2 |
+ SET_TYPE_OFFSET(ucp_Ll);
|
|
|
cb67f2 |
+ OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_So - ucp_Ll);
|
|
|
cb67f2 |
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_C_GREATER);
|
|
|
cb67f2 |
+
|
|
|
cb67f2 |
+ jump = CMP(SLJIT_C_NOT_EQUAL, typereg, 0, SLJIT_IMM, ucp_Cf - ucp_Ll);
|
|
|
cb67f2 |
+
|
|
|
cb67f2 |
+ /* In case of ucp_Cf, we overwrite the result. */
|
|
|
cb67f2 |
+ SET_CHAR_OFFSET(0x2066);
|
|
|
cb67f2 |
+ OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x2069 - 0x2066);
|
|
|
cb67f2 |
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_C_LESS_EQUAL);
|
|
|
cb67f2 |
+
|
|
|
cb67f2 |
+ OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x061c - 0x2066);
|
|
|
cb67f2 |
+ OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_C_EQUAL);
|
|
|
cb67f2 |
+
|
|
|
cb67f2 |
+ OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x180e - 0x2066);
|
|
|
cb67f2 |
+ OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_C_EQUAL);
|
|
|
cb67f2 |
+
|
|
|
cb67f2 |
+ JUMPHERE(jump);
|
|
|
cb67f2 |
+ jump = CMP(SLJIT_C_ZERO ^ invertcmp, TMP2, 0, SLJIT_IMM, 0);
|
|
|
cb67f2 |
+ break;
|
|
|
cb67f2 |
+
|
|
|
cb67f2 |
+ case PT_PXPRINT:
|
|
|
cb67f2 |
+ /* C and Z groups are the farthest two groups. */
|
|
|
cb67f2 |
+ SET_TYPE_OFFSET(ucp_Ll);
|
|
|
cb67f2 |
+ OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_So - ucp_Ll);
|
|
|
cb67f2 |
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_C_GREATER);
|
|
|
cb67f2 |
+
|
|
|
cb67f2 |
+ OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_Zs - ucp_Ll);
|
|
|
cb67f2 |
+ OP_FLAGS(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_C_NOT_EQUAL);
|
|
|
cb67f2 |
+
|
|
|
cb67f2 |
+ jump = CMP(SLJIT_C_NOT_EQUAL, typereg, 0, SLJIT_IMM, ucp_Cf - ucp_Ll);
|
|
|
cb67f2 |
+
|
|
|
cb67f2 |
+ /* In case of ucp_Cf, we overwrite the result. */
|
|
|
cb67f2 |
+ SET_CHAR_OFFSET(0x2066);
|
|
|
cb67f2 |
+ OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x2069 - 0x2066);
|
|
|
cb67f2 |
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_C_LESS_EQUAL);
|
|
|
cb67f2 |
+
|
|
|
cb67f2 |
+ OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x061c - 0x2066);
|
|
|
cb67f2 |
+ OP_FLAGS(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_C_EQUAL);
|
|
|
cb67f2 |
+
|
|
|
cb67f2 |
+ JUMPHERE(jump);
|
|
|
cb67f2 |
+ jump = CMP(SLJIT_C_ZERO ^ invertcmp, TMP2, 0, SLJIT_IMM, 0);
|
|
|
cb67f2 |
+ break;
|
|
|
cb67f2 |
+
|
|
|
cb67f2 |
+ case PT_PXPUNCT:
|
|
|
cb67f2 |
+ SET_TYPE_OFFSET(ucp_Sc);
|
|
|
cb67f2 |
+ OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_So - ucp_Sc);
|
|
|
cb67f2 |
+ OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_C_LESS_EQUAL);
|
|
|
cb67f2 |
+
|
|
|
cb67f2 |
+ SET_CHAR_OFFSET(0);
|
|
|
cb67f2 |
+ OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xff);
|
|
|
cb67f2 |
+ OP_FLAGS(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_C_LESS_EQUAL);
|
|
|
cb67f2 |
+
|
|
|
cb67f2 |
+ SET_TYPE_OFFSET(ucp_Pc);
|
|
|
cb67f2 |
+ OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, typereg, 0, SLJIT_IMM, ucp_Ps - ucp_Pc);
|
|
|
cb67f2 |
+ OP_FLAGS(SLJIT_OR | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_C_LESS_EQUAL);
|
|
|
cb67f2 |
+ jump = JUMP(SLJIT_C_NOT_ZERO ^ invertcmp);
|
|
|
cb67f2 |
+ break;
|
|
|
cb67f2 |
}
|
|
|
cb67f2 |
cc += 2;
|
|
|
cb67f2 |
}
|
|
|
cb67f2 |
--
|
|
|
cb67f2 |
2.7.4
|
|
|
cb67f2 |
|