1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00

Reduce the space allocated for the runtime virtual machine stack. (CVS 2428)

FossilOrigin-Name: 7d6818da33a87076d1faf35ffc15a3aada0533b3
This commit is contained in:
danielk1977
2005-03-29 08:26:13 +00:00
parent 53c0f7480b
commit bc04f8529d
8 changed files with 279 additions and 144 deletions

View File

@@ -24,6 +24,7 @@
# the total library smaller.
#
# Remember the TK_ values from the parse.h file
/^#define TK_/ {
tk[$2] = $3
@@ -35,11 +36,16 @@
gsub(/:/,"",name)
gsub("\r","",name)
op[name] = -1
for(i=3; i<NF-2; i++){
for(i=3; i<NF; i++){
if($i=="same" && $(i+1)=="as"){
op[name] = tk[$(i+2)]
sym = $(i+2)
sub(/,/,"",sym)
op[name] = tk[sym]
used[op[name]] = 1
sameas[op[name]] = $(i+2)
sameas[op[name]] = sym
}
if($i=="stack"){
stack[name] = 1
}
}
}
@@ -75,4 +81,31 @@ END {
printf "#define %-25s %15d\n", sprintf( "OP_NotUsed_%-3d", i ), i
}
}
# Generate the 10 16-bit bitmasks used by function opcodeUsesStack()
# in vdbeaux.c. See comments in that function for details.
#
stack[0] = 0 # 0..15
stack[1] = 0 # 16..31
stack[2] = 0 # 32..47
stack[3] = 0 # 48..63
stack[4] = 0 # 64..79
stack[5] = 0 # 80..95
stack[6] = 0 # 96..111
stack[7] = 0 # 112..127
stack[8] = 0 # 128..143
stack[9] = 0 # 144..159
for(name in op){
if( stack[name] ){
n = op[name]
j = n%16
i = ((n - j)/16)
stack[i] = stack[i] + (2^j)
}
}
printf "\n"
for(i=0; i<10; i++){
printf "#define STACK_MASK_%d %d\n", i, stack[i]
}
}