Change 27525 by [EMAIL PROTECTED] on 2006/03/16 23:11:11
Add a new per-interpeter variable PL_utf8cache, which will be used to
control the UTF-8 offset caching code. Make this visible as
${^UTF8CACHE}
Affected files ...
... //depot/perl/embedvar.h#220 edit
... //depot/perl/gv.c#312 edit
... //depot/perl/intrpvar.h#183 edit
... //depot/perl/mg.c#420 edit
... //depot/perl/perlapi.h#142 edit
... //depot/perl/pod/perlvar.pod#151 edit
Differences ...
==== //depot/perl/embedvar.h#220 (text+w) ====
Index: perl/embedvar.h
--- perl/embedvar.h#219~27466~ 2006-03-10 13:54:18.000000000 -0800
+++ perl/embedvar.h 2006-03-16 15:11:11.000000000 -0800
@@ -444,6 +444,7 @@
#define PL_utf8_toupper (vTHX->Iutf8_toupper)
#define PL_utf8_upper (vTHX->Iutf8_upper)
#define PL_utf8_xdigit (vTHX->Iutf8_xdigit)
+#define PL_utf8cache (vTHX->Iutf8cache)
#define PL_utf8locale (vTHX->Iutf8locale)
#define PL_uudmap (vTHX->Iuudmap)
#define PL_warnhook (vTHX->Iwarnhook)
@@ -740,6 +741,7 @@
#define PL_Iutf8_toupper PL_utf8_toupper
#define PL_Iutf8_upper PL_utf8_upper
#define PL_Iutf8_xdigit PL_utf8_xdigit
+#define PL_Iutf8cache PL_utf8cache
#define PL_Iutf8locale PL_utf8locale
#define PL_Iuudmap PL_uudmap
#define PL_Iwarnhook PL_warnhook
==== //depot/perl/gv.c#312 (text) ====
Index: perl/gv.c
--- perl/gv.c#311~27456~ 2006-03-09 15:23:19.000000000 -0800
+++ perl/gv.c 2006-03-16 15:11:11.000000000 -0800
@@ -1070,6 +1070,8 @@
goto ro_magicalize;
if (strEQ(name2, "TF8LOCALE"))
goto ro_magicalize;
+ if (strEQ(name2, "TF8CACHE"))
+ goto magicalize;
break;
case '\027': /* $^WARNING_BITS */
if (strEQ(name2, "ARNING_BITS"))
==== //depot/perl/intrpvar.h#183 (text) ====
Index: perl/intrpvar.h
--- perl/intrpvar.h#182~27466~ 2006-03-10 13:54:18.000000000 -0800
+++ perl/intrpvar.h 2006-03-16 15:11:11.000000000 -0800
@@ -553,6 +553,8 @@
PERLVAR(Imemory_debug_header, struct perl_memory_debug_header)
#endif
+PERLVARI(Iutf8cache, signed char, 1) /* Is the utf8 caching code enabled? */
+
/* New variables must be added to the very end, before this comment,
* for binary compatibility (the offsets of the old members must not change).
* (Don't forget to add your variable also to perl_clone()!)
==== //depot/perl/mg.c#420 (text) ====
Index: perl/mg.c
--- perl/mg.c#419~27334~ 2006-02-27 03:06:30.000000000 -0800
+++ perl/mg.c 2006-03-16 15:11:11.000000000 -0800
@@ -790,11 +790,13 @@
? (PL_taint_warn || PL_unsafe ? -1 : 1)
: 0);
break;
- case '\025': /* $^UNICODE, $^UTF8LOCALE */
+ case '\025': /* $^UNICODE, $^UTF8LOCALE, $^UTF8CACHE */
if (strEQ(remaining, "NICODE"))
sv_setuv(sv, (UV) PL_unicode);
else if (strEQ(remaining, "TF8LOCALE"))
sv_setuv(sv, (UV) PL_utf8locale);
+ else if (strEQ(remaining, "TF8CACHE"))
+ sv_setiv(sv, (IV) PL_utf8cache);
break;
case '\027': /* ^W & $^WARNING_BITS */
if (nextchar == '\0')
@@ -2232,6 +2234,11 @@
PL_basetime = (Time_t)(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
#endif
break;
+ case '\025': /* ^UTF8CACHE */
+ if (strEQ(mg->mg_ptr+1, "TF8CACHE")) {
+ PL_utf8cache = (signed char) sv_2iv(sv);
+ }
+ break;
case '\027': /* ^W & $^WARNING_BITS */
if (*(mg->mg_ptr+1) == '\0') {
if ( ! (PL_dowarn & G_WARN_ALL_MASK)) {
==== //depot/perl/perlapi.h#142 (text+w) ====
Index: perl/perlapi.h
--- perl/perlapi.h#141~27466~ 2006-03-10 13:54:18.000000000 -0800
+++ perl/perlapi.h 2006-03-16 15:11:11.000000000 -0800
@@ -686,6 +686,8 @@
#define PL_utf8_upper (*Perl_Iutf8_upper_ptr(aTHX))
#undef PL_utf8_xdigit
#define PL_utf8_xdigit (*Perl_Iutf8_xdigit_ptr(aTHX))
+#undef PL_utf8cache
+#define PL_utf8cache (*Perl_Iutf8cache_ptr(aTHX))
#undef PL_utf8locale
#define PL_utf8locale (*Perl_Iutf8locale_ptr(aTHX))
#undef PL_uudmap
==== //depot/perl/pod/perlvar.pod#151 (text) ====
Index: perl/pod/perlvar.pod
--- perl/pod/perlvar.pod#150~26999~ 2006-01-30 01:52:06.000000000 -0800
+++ perl/pod/perlvar.pod 2006-03-16 15:11:11.000000000 -0800
@@ -1145,6 +1145,10 @@
the possible values. This variable is set during Perl startup
and is thereafter read-only.
+=item ${^UTF8CACHE}
+
+This variable controls the state of the internal UTF-8 offset caching code.
+
=item ${^UTF8LOCALE}
This variable indicates whether an UTF-8 locale was detected by perl at
End of Patch.