From: Jarkko Hietaniemi Date: Tue, 7 Nov 2000 16:04:26 +0000 (+0000) Subject: Too profiler-happy: with optimization the #7590 actually makes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9af0acdbd72c7cf7dd9e593b8f5d51dcf0bfa4f7;p=p5sagit%2Fp5-mst-13.2.git Too profiler-happy: with optimization the #7590 actually makes the test to run 0.5% _slower_. Requires much more instrumentation. Retract #7590. p4raw-id: //depot/perl@7591 --- diff --git a/regcomp.c b/regcomp.c index 83470d7..19b8096 100644 --- a/regcomp.c +++ b/regcomp.c @@ -427,8 +427,11 @@ S_scan_commit(pTHX_ scan_data_t *data) STATIC void S_cl_anything(pTHX_ struct regnode_charclass_class *cl) { + int value; + ANYOF_CLASS_ZERO(cl); - ANYOF_BITMAP_SETALL(cl); + for (value = 0; value < 256; ++value) + ANYOF_BITMAP_SET(cl, value); cl->flags = ANYOF_EOS; if (LOC) cl->flags |= ANYOF_LOCALE; @@ -443,8 +446,8 @@ S_cl_is_anything(pTHX_ struct regnode_charclass_class *cl) for (value = 0; value <= ANYOF_MAX; value += 2) if (ANYOF_CLASS_TEST(cl, value) && ANYOF_CLASS_TEST(cl, value + 1)) return 1; - for (value = 0; value < ANYOF_BITMAP_SIZE; ++value) - if (!ANYOF_BITMAP_BYTE(cl, value)) + for (value = 0; value < 256; ++value) + if (!ANYOF_BITMAP_TEST(cl, value)) return 0; return 1; } diff --git a/regcomp.h b/regcomp.h index b906b52..225ff74 100644 --- a/regcomp.h +++ b/regcomp.h @@ -249,7 +249,6 @@ struct regnode_charclass_class { #define ANYOF_CLASS_ZERO(ret) Zero(((struct regnode_charclass_class*)(ret))->classflags, ANYOF_CLASSBITMAP_SIZE, char) #define ANYOF_BITMAP_ZERO(ret) Zero(((struct regnode_charclass*)(ret))->bitmap, ANYOF_BITMAP_SIZE, char) -#define ANYOF_BITMAP_SETALL(p) (memset(ANYOF_BITMAP(p), 0xff, ANYOF_BITMAP_SIZE)) #define ANYOF_BITMAP(p) (((struct regnode_charclass*)(p))->bitmap) #define ANYOF_BITMAP_BYTE(p, c) (ANYOF_BITMAP(p)[((c) >> 3) & 31])