Eliminate ck_lengthconst.
Nicholas Clark [Wed, 20 Feb 2008 22:39:56 +0000 (22:39 +0000)]
p4raw-id: //depot/perl@33338

embed.fnc
embed.h
op.c
opcode.h
opcode.pl
pod/perltodo.pod
pp.sym
pp_proto.h
proto.h

index 8edfea5..186dcee 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1209,7 +1209,6 @@ pR        |OP*    |ck_glob        |NN OP *o
 pR     |OP*    |ck_grep        |NN OP *o
 pR     |OP*    |ck_index       |NN OP *o
 pR     |OP*    |ck_join        |NN OP *o
-pR     |OP*    |ck_lengthconst |NN OP *o
 pR     |OP*    |ck_lfun        |NN OP *o
 pR     |OP*    |ck_listiob     |NN OP *o
 pR     |OP*    |ck_match       |NN OP *o
diff --git a/embed.h b/embed.h
index 3d28f6e..df45cb7 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define ck_grep                        Perl_ck_grep
 #define ck_index               Perl_ck_index
 #define ck_join                        Perl_ck_join
-#define ck_lengthconst         Perl_ck_lengthconst
 #define ck_lfun                        Perl_ck_lfun
 #define ck_listiob             Perl_ck_listiob
 #define ck_match               Perl_ck_match
 #define ck_grep(a)             Perl_ck_grep(aTHX_ a)
 #define ck_index(a)            Perl_ck_index(aTHX_ a)
 #define ck_join(a)             Perl_ck_join(aTHX_ a)
-#define ck_lengthconst(a)      Perl_ck_lengthconst(aTHX_ a)
 #define ck_lfun(a)             Perl_ck_lfun(aTHX_ a)
 #define ck_listiob(a)          Perl_ck_listiob(aTHX_ a)
 #define ck_match(a)            Perl_ck_match(aTHX_ a)
diff --git a/op.c b/op.c
index d9bf346..9c4ce51 100644 (file)
--- a/op.c
+++ b/op.c
@@ -7124,15 +7124,6 @@ Perl_ck_index(pTHX_ OP *o)
 }
 
 OP *
-Perl_ck_lengthconst(pTHX_ OP *o)
-{
-    PERL_ARGS_ASSERT_CK_LENGTHCONST;
-
-    /* XXX length optimization goes here */
-    return ck_fun(o);
-}
-
-OP *
 Perl_ck_lfun(pTHX_ OP *o)
 {
     const OPCODE type = o->op_type;
index 65545a4..d59b962 100644 (file)
--- a/opcode.h
+++ b/opcode.h
@@ -1282,7 +1282,7 @@ EXT Perl_check_t PL_check[] /* or perlvars.h */
        MEMBER_TO_FPTR(Perl_ck_fun),    /* hex */
        MEMBER_TO_FPTR(Perl_ck_fun),    /* oct */
        MEMBER_TO_FPTR(Perl_ck_fun),    /* abs */
-       MEMBER_TO_FPTR(Perl_ck_lengthconst),    /* length */
+       MEMBER_TO_FPTR(Perl_ck_fun),    /* length */
        MEMBER_TO_FPTR(Perl_ck_substr), /* substr */
        MEMBER_TO_FPTR(Perl_ck_fun),    /* vec */
        MEMBER_TO_FPTR(Perl_ck_index),  /* index */
index b59af50..098f83c 100755 (executable)
--- a/opcode.pl
+++ b/opcode.pl
@@ -760,7 +760,7 @@ abs         abs                     ck_fun          fsTu%   S?
 
 # String stuff.
 
-length         length                  ck_lengthconst  ifsTu%  S?
+length         length                  ck_fun          ifsTu%  S?
 substr         substr                  ck_substr       st@     S S S? S?
 vec            vec                     ck_fun          ist@    S S S
 
index bbf2f05..caa1a83 100644 (file)
@@ -386,14 +386,6 @@ macro used can be changed.
 
 =back
 
-=head2
-
-C<Perl_ck_lengthconst> does nothing, but has the comment
-
-    /* XXX length optimization goes here */
-
-It predates 5.003. Investigate what it's about, and then implement it.
-
 =head2 Modernize the order of directories in @INC
 
 The way @INC is laid out by default, one cannot upgrade core (dual-life)
diff --git a/pp.sym b/pp.sym
index c3159c5..74060e3 100644 (file)
--- a/pp.sym
+++ b/pp.sym
@@ -24,7 +24,6 @@ Perl_ck_glob
 Perl_ck_grep
 Perl_ck_index
 Perl_ck_join
-Perl_ck_lengthconst
 Perl_ck_lfun
 Perl_ck_listiob
 Perl_ck_match
index 6a43521..847e4f1 100644 (file)
@@ -23,7 +23,6 @@ PERL_CKDEF(Perl_ck_glob)
 PERL_CKDEF(Perl_ck_grep)
 PERL_CKDEF(Perl_ck_index)
 PERL_CKDEF(Perl_ck_join)
-PERL_CKDEF(Perl_ck_lengthconst)
 PERL_CKDEF(Perl_ck_lfun)
 PERL_CKDEF(Perl_ck_listiob)
 PERL_CKDEF(Perl_ck_match)
diff --git a/proto.h b/proto.h
index 62fbfd9..26ce756 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -4401,12 +4401,6 @@ PERL_CALLCONV OP*        Perl_ck_join(pTHX_ OP *o)
 #define PERL_ARGS_ASSERT_CK_JOIN       \
        assert(o)
 
-PERL_CALLCONV OP*      Perl_ck_lengthconst(pTHX_ OP *o)
-                       __attribute__warn_unused_result__
-                       __attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT_CK_LENGTHCONST        \
-       assert(o)
-
 PERL_CALLCONV OP*      Perl_ck_lfun(pTHX_ OP *o)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);