diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-05-15 13:21:09 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-06-11 10:39:59 +0200 |
commit | 6f83ef0e5a45c465f83de3304c5818ba44492250 (patch) | |
tree | 6b5a754cde4ee86baf633e6415f18b5fd8e721ff /win32 | |
parent | 546efe9fbd6c3c651c39b369e97d0835230a0f9f (diff) | |
download | perl-6f83ef0e5a45c465f83de3304c5818ba44492250.tar.gz |
Create a lookup table for magic vtables from magic type, PL_magic_data.
Use it to eliminate the large switch statement in Perl_sv_magic().
As the table needs to be keyed on magic type, which is expressed as C character
constants, the order depends on the compiler's character set. Frustratingly,
EBCDIC variants don't agree on the code points for '~' and ']', which we use
here. Instead of having (at least) 4 tables, get the local runtime to sort the
table for us. Hence the regen script writes out the (unsorted) mg_raw.h, which
generate_uudmap sorts to generate mg_data.h
Diffstat (limited to 'win32')
-rw-r--r-- | win32/Makefile | 11 | ||||
-rw-r--r-- | win32/makefile.mk | 11 |
2 files changed, 14 insertions, 8 deletions
diff --git a/win32/Makefile b/win32/Makefile index eea0545e88..2619992f1d 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -726,6 +726,7 @@ CORE_H = $(CORE_NOCFG_H) .\config.h ..\git_version.h UUDMAP_H = ..\uudmap.h BITCOUNT_H = ..\bitcount.h +MG_DATA_H = ..\mg_data.h MICROCORE_OBJ = $(MICROCORE_SRC:.c=.obj) CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:.c=.obj) @@ -947,12 +948,14 @@ $(X2P) : $(MINIPERL) $(X2P_OBJ) Extensions << $(EMBED_EXE_MANI) -$(MINIDIR)\globals$(o) : $(UUDMAP_H) $(BITCOUNT_H) +$(MINIDIR)\globals$(o) : $(UUDMAP_H) $(BITCOUNT_H) $(MG_DATA_H) -$(UUDMAP_H) : $(BITCOUNT_H) +$(UUDMAP_H) $(MG_DATA_H) : $(BITCOUNT_H) $(BITCOUNT_H) : $(GENUUDMAP) - $(GENUUDMAP) $(UUDMAP_H) $(BITCOUNT_H) + $(GENUUDMAP) $(UUDMAP_H) $(BITCOUNT_H) $(MG_DATA_H) + +$(GENUUDMAP_OBJ) : ..\mg_raw.h $(GENUUDMAP) : $(GENUUDMAP_OBJ) $(LINK32) -subsystem:console -out:$@ @<< @@ -1279,7 +1282,7 @@ _clean : -@$(DEL) $(PERLSTATICLIB) -@$(DEL) $(PERLDLL) -@$(DEL) $(CORE_OBJ) - -@$(DEL) $(GENUUDMAP) $(GENUUDMAP_OBJ) $(UUDMAP_H) $(BITCOUNT_H) + -@$(DEL) $(GENUUDMAP) $(GENUUDMAP_OBJ) $(UUDMAP_H) $(BITCOUNT_H) $(MG_DATA_H) -if exist $(MINIDIR) rmdir /s /q $(MINIDIR) -if exist $(UNIDATADIR1) rmdir /s /q $(UNIDATADIR1) -if exist $(UNIDATADIR2) rmdir /s /q $(UNIDATADIR2) diff --git a/win32/makefile.mk b/win32/makefile.mk index 2cbcdeaa76..4acac4c4d5 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -921,6 +921,7 @@ CORE_H = $(CORE_NOCFG_H) .\config.h ..\git_version.h UUDMAP_H = ..\uudmap.h BITCOUNT_H = ..\bitcount.h +MG_DATA_H = ..\mg_data.h MICROCORE_OBJ = $(MICROCORE_SRC:db:+$(o)) CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:db:+$(o)) @@ -1292,12 +1293,14 @@ $(X2P) : $(MINIPERL) $(X2P_OBJ) Extensions $(EMBED_EXE_MANI) .ENDIF -$(MINIDIR)\globals$(o) : $(UUDMAP_H) $(BITCOUNT_H) +$(MINIDIR)\globals$(o) : $(UUDMAP_H) $(BITCOUNT_H) $(MG_DATA_H) -$(UUDMAP_H) : $(BITCOUNT_H) +$(UUDMAP_H) $(MG_DATA_H) : $(BITCOUNT_H) $(BITCOUNT_H) : $(GENUUDMAP) - $(GENUUDMAP) $(UUDMAP_H) $(BITCOUNT_H) + $(GENUUDMAP) $(UUDMAP_H) $(BITCOUNT_H) $(MG_DATA_H) + +$(GENUUDMAP_OBJ) : ..\mg_raw.h $(GENUUDMAP) : $(GENUUDMAP_OBJ) .IF "$(CCTYPE)" == "BORLAND" @@ -1669,7 +1672,7 @@ _clean : -@erase $(PERLSTATICLIB) -@erase $(PERLDLL) -@erase $(CORE_OBJ) - -@erase $(GENUUDMAP) $(GENUUDMAP_OBJ) $(UUDMAP_H) $(BITCOUNT_H) + -@erase $(GENUUDMAP) $(GENUUDMAP_OBJ) $(UUDMAP_H) $(BITCOUNT_H) $(MG_DATA_H) -if exist $(MINIDIR) rmdir /s /q $(MINIDIR) -if exist $(UNIDATADIR1) rmdir /s /q $(UNIDATADIR1) -if exist $(UNIDATADIR2) rmdir /s /q $(UNIDATADIR2) |