Do not run the tool/vdbe-compress.tcl script that generates the

vdbeExecUnion object that reduces the size of the sqlite3VdbeExec()
stack frame unless the SQLITE_SMALL_STACK compile-time option is
specified as on of the OPTS in the makefile.  The vdbeExecUnion object
gets in the way of C-compiler optimizer and results in slightly slower code.

FossilOrigin-Name: 4d0781473a465b4ab0a307914014f3d2ddd0ce33
This commit is contained in:
drh 2013-12-11 00:59:10 +00:00
parent 024045fe6e
commit 2dc0648a80
7 changed files with 29 additions and 15 deletions

View File

@ -534,7 +534,7 @@ mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
mkdir tsrc
cp -f $(SRC) tsrc
rm tsrc/sqlite.h.in tsrc/parse.y
$(TCLSH_CMD) $(TOP)/tool/vdbe-compress.tcl <tsrc/vdbe.c >vdbe.new
$(TCLSH_CMD) $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
mv vdbe.new tsrc/vdbe.c
touch .target_source

View File

@ -911,7 +911,7 @@ mptester.exe: $(TOP)\mptest\mptest.c libsqlite3.lib $(LIBRESOBJS) sqlite3.h
-mkdir tsrc
for %i in ($(SRC)) do copy /Y %i tsrc
del /Q tsrc\sqlite.h.in tsrc\parse.y
$(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl < tsrc\vdbe.c > vdbe.new
$(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
move vdbe.new tsrc\vdbe.c
echo > .target_source

View File

@ -402,7 +402,7 @@ target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl
mkdir tsrc
cp -f $(SRC) tsrc
rm tsrc/sqlite.h.in tsrc/parse.y
tclsh $(TOP)/tool/vdbe-compress.tcl <tsrc/vdbe.c >vdbe.new
tclsh $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
mv vdbe.new tsrc/vdbe.c
touch target_source

View File

@ -1,9 +1,9 @@
C Avoid\sunnecessary\scalls\sto\ssqlite3VdbeSerialType()\sfrom\swithin\nsqlite3VdbeSerialPut().
D 2013-12-10T21:38:08.728
C Do\snot\srun\sthe\stool/vdbe-compress.tcl\sscript\sthat\sgenerates\sthe\nvdbeExecUnion\sobject\sthat\sreduces\sthe\ssize\sof\sthe\ssqlite3VdbeExec()\nstack\sframe\sunless\sthe\sSQLITE_SMALL_STACK\scompile-time\soption\sis\nspecified\sas\son\sof\sthe\sOPTS\sin\sthe\smakefile.\s\sThe\svdbeExecUnion\sobject\ngets\sin\sthe\sway\sof\sC-compiler\soptimizer\sand\sresults\sin\sslightly\sslower\scode.
D 2013-12-11T00:59:10.395
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in e1a9b4258bbde53f5636f4e238c65b7e11459e2b
F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F Makefile.msc bb1f271c8ee9773489c89be00f3f8ad7ed7ae8e0
F Makefile.msc 4d4ead6b71d1bf03028fbd61da0ba0ec5e1556e1
F Makefile.vxworks db21ed42a01d5740e656b16f92cb5d8d5e5dd315
F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6
F VERSION 8ed548d87d0a27fd7d7620476f9e25f9fa742d73
@ -142,7 +142,7 @@ F ext/rtree/viewrtree.tcl eea6224b3553599ae665b239bd827e182b466024
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
F magic.txt f439556c5ce01ced70987e5ee86549a45165d9ff
F main.mk 82fd90375561d7b66287ae5a8b09e1e027394019
F main.mk 9f091ea7920f8b15e48c7b6e5b6fb0182577ab2e
F mkdll.sh 7d09b23c05d56532e9d44a50868eb4b12ff4f74a
F mkextu.sh 416f9b7089d80e5590a29692c9d9280a10dbad9f
F mkextw.sh d2a981497b404d6498f5ff3e3b1f3816bdfcb338
@ -280,7 +280,7 @@ F src/update.c d1c2477dcf14d90999d1935af4efb4806553250b
F src/utf.c 6fc6c88d50448c469c5c196acf21617a24f90269
F src/util.c 76ed0519296e3f62e97e57dab1999e34184c8e49
F src/vacuum.c 3728d74919d4fb1356f9e9a13e27773db60b7179
F src/vdbe.c 02fac31f3921b0238d0ca72c90db31eb0c91e358
F src/vdbe.c bdc4a981fb14843e09e0a369b6b5b40b54c92489
F src/vdbe.h c06f0813f853566457ce9cfb1a4a4bc39a5da644
F src/vdbeInt.h e103e9223787cb11e0de48cefb1cdb9fef18e2e8
F src/vdbeapi.c 93a22a9ba2abe292d5c2cf304d7eb2e894dde0ed
@ -1142,11 +1142,11 @@ F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43
F tool/symbols-mingw.sh 4dbcea7e74768305384c9fd2ed2b41bbf9f0414d
F tool/symbols.sh fec58532668296d7c7dc48be9c87f75ccdb5814f
F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
F tool/vdbe-compress.tcl 0cf56e9263a152b84da86e75a5c0cdcdb7a47891
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
P 1c6ee9b85f61e5cdb5d9b7815cddf526dc78aaa7
R 362b67923e10115892fb8388984a2dc3
P 079c04a5013074b68f7d90f1ce8bf8e7092ad8a2
R 97669e12d755118ec7d7d468b1255e81
U drh
Z 43fa988f600d23d399ec0be485c6471b
Z 0e355cefa23a2e0a8bf13198eee4bf26

View File

@ -1 +1 @@
079c04a5013074b68f7d90f1ce8bf8e7092ad8a2
4d0781473a465b4ab0a307914014f3d2ddd0ce33

View File

@ -2694,6 +2694,7 @@ case OP_Count: { /* out2-prerelease */
pCrsr = p->apCsr[pOp->p1]->pCursor;
assert( pCrsr );
nEntry = 0; /* Not needed. Only used to silence a warning. */
rc = sqlite3BtreeCount(pCrsr, &nEntry);
pOut->u.i = nEntry;
break;
@ -4654,6 +4655,7 @@ case OP_IdxRowid: { /* out2-prerelease */
assert( pC->deferredMoveto==0 );
assert( pC->isTable==0 );
if( !pC->nullRow ){
rowid = 0; /* Not needed. Only used to silence a warning. */
rc = sqlite3VdbeIdxRowid(db, pCrsr, &rowid);
if( rc!=SQLITE_OK ){
goto abort_due_to_error;
@ -4717,6 +4719,7 @@ case OP_IdxGE: { /* jump */
#ifdef SQLITE_DEBUG
{ int i; for(i=0; i<r.nField; i++) assert( memIsValid(&r.aMem[i]) ); }
#endif
res = 0; /* Not needed. Only used to silence a warning. */
rc = sqlite3VdbeIdxKeyCompare(pC, &r, &res);
if( pOp->opcode==OP_IdxLT ){
res = -res;
@ -4777,6 +4780,7 @@ case OP_Destroy: { /* out2-prerelease */
iDb = pOp->p3;
assert( iCnt==1 );
assert( (p->btreeMask & (((yDbMask)1)<<iDb))!=0 );
iMoved = 0; /* Not needed. Only to silence a warning. */
rc = sqlite3BtreeDropTable(db->aDb[iDb].pBt, pOp->p1, &iMoved);
pOut->flags = MEM_Int;
pOut->u.i = iMoved;

View File

@ -13,7 +13,7 @@
# Script usage:
#
# mv vdbe.c vdbe.c.template
# tclsh vdbe-compress.tcl <vdbe.c.template >vdbe.c
# tclsh vdbe-compress.tcl $CFLAGS <vdbe.c.template >vdbe.c
#
# Modifications made:
#
@ -42,6 +42,16 @@ set unionDef {} ;# C code of the union
set afterUnion {} ;# C code after the union
set sCtr 0 ;# Context counter
# If the SQLITE_SMALL_STACK compile-time option is missing, then
# this transformation becomes a no-op.
#
if {![regexp {SQLITE_SMALL_STACK} $argv]} {
while {![eof stdin]} {
puts [gets stdin]
}
exit
}
# Read program text up to the spot where the union should be
# inserted.
#