Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Drop old code. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | dgp-switch-compile |
Files: | files | file ages | folders |
SHA1: |
cc7e00bc14ce2cb3747c7db338d0a311 |
User & Date: | dgp 2011-05-02 20:28:53 |
Context
2011-05-02
| ||
20:34 | Rewrite of parts of the switch compiler to better use the powers of TclFindElement() and do less par... check-in: 8bc0f9df3c user: dgp tags: core-8-5-branch | |
20:28 | Drop old code. Closed-Leaf check-in: cc7e00bc14 user: dgp tags: dgp-switch-compile | |
20:13 | Tests for expanded literals quoting detection. check-in: 8e71652744 user: dgp tags: dgp-switch-compile | |
Changes
Changes to generic/tclCompCmds.c.
︙ | ︙ | |||
3903 3904 3905 3906 3907 3908 3909 | * there aren't any. */ int contFixCount; /* Number of continuation bodies pointing to * the current (or next) real body. */ int savedStackDepth = envPtr->currStackDepth; int noCase; /* Has the -nocase flag been given? */ int foundMode = 0; /* Have we seen a mode flag yet? */ | < < < | 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 | * there aren't any. */ int contFixCount; /* Number of continuation bodies pointing to * the current (or next) real body. */ int savedStackDepth = envPtr->currStackDepth; int noCase; /* Has the -nocase flag been given? */ int foundMode = 0; /* Have we seen a mode flag yet? */ int i, valueIndex; DefineLineInformation; /* TIP #280 */ int* clNext = envPtr->clNext; /* * Only handle the following versions: * switch ?--? word {pattern body ...} |
︙ | ︙ | |||
4045 4046 4047 4048 4049 4050 4051 | * that in the case of the quoted bodies, this is tricky as we cannot use * copies of the string from the input token for the generated tokens (it * causes a crash during exception handling). When multiple tokens are * available at this point, this is pretty easy. */ if (numWords == 1) { | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 | * that in the case of the quoted bodies, this is tricky as we cannot use * copies of the string from the input token for the generated tokens (it * causes a crash during exception handling). When multiple tokens are * available at this point, this is pretty easy. */ if (numWords == 1) { CONST char *bytes; int maxLen, numBytes; int bline; /* TIP #280: line of the pattern/action list, * and start of list for when tracking the * location. This list comes immediately after * the value we switch on. */ |
︙ | ︙ | |||
4245 4246 4247 4248 4249 4250 4251 | numBytes -= (bytes - prevBytes); numWords++; } if (numWords % 2) { goto abort; } | < < < | 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 | numBytes -= (bytes - prevBytes); numWords++; } if (numWords % 2) { goto abort; } } else if (numWords % 2 || numWords == 0) { /* * Odd number of words (>1) available, or no words at all available. * Both are error cases, so punt and let the interpreted-version * generate the error message. Note that the second case probably * should get caught earlier, but it's easy to check here again anyway * because it'd cause a nasty crash otherwise. |
︙ | ︙ | |||
4274 4275 4276 4277 4278 4279 4280 | for (i=0 ; i<numWords ; i++) { /* * We only handle the very simplest case. Anything more complex is * a good reason to go to the interpreted case anyway due to * traces, etc. */ | | < < < < | 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 | for (i=0 ; i<numWords ; i++) { /* * We only handle the very simplest case. Anything more complex is * a good reason to go to the interpreted case anyway due to * traces, etc. */ if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) { ckfree((char *) bodyToken); ckfree((char *) bodyLines); ckfree((char *) bodyNext); return TCL_ERROR; } bodyToken[i] = tokenPtr+1; |
︙ | ︙ | |||
4327 4328 4329 4330 4331 4332 4333 | /* * Check if we can generate a jump table, since if so that's faster than * doing an explicit compare with each body. Note that we're definitely * over-conservative with determining whether we can do the jump table, * but it handles the most common case well enough. */ | < < < < | < < < < | 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 | /* * Check if we can generate a jump table, since if so that's faster than * doing an explicit compare with each body. Note that we're definitely * over-conservative with determining whether we can do the jump table, * but it handles the most common case well enough. */ if (mode == Switch_Exact) { JumptableInfo *jtPtr; int infoIndex, isNew, *finalFixups, numRealBodies = 0, jumpLocation; int mustGenerate, jumpToDefault; Tcl_DString buffer; Tcl_HashEntry *hPtr; /* |
︙ | ︙ |