aboutsummaryrefslogtreecommitdiff
path: root/src/wherecode.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2018-12-29 02:26:59 +0000
committerdrh <drh@noemail.net>2018-12-29 02:26:59 +0000
commitec4ccdbcb1bd9d129888b38f209ed36bbe38a5d8 (patch)
treeaff455cde56406dac489f5097da7ff4eaa480ebb /src/wherecode.c
parent81f9159b5ec0e19d9aafee9c03a13bc4e7735cd8 (diff)
downloadsqlite-ec4ccdbcb1bd9d129888b38f209ed36bbe38a5d8.tar.gz
sqlite-ec4ccdbcb1bd9d129888b38f209ed36bbe38a5d8.zip
A new implementation of sqlite3VdbeMakeLabel() is faster and makes fewer
memory allocations by deferring memory allocation until sqlite3VdbeResolveLabel() is called, at which point the code generator has a better idea of how big the relocation table needs to be. The sqlite3VdbeMakeLabel() routine now takes a Parse* parameter instead of Vdbe*. FossilOrigin-Name: 4a0929ac76d8aa5dd65eac3b83d6bbf41e505e01d175ca0fb2b19ba02d439415
Diffstat (limited to 'src/wherecode.c')
-rw-r--r--src/wherecode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wherecode.c b/src/wherecode.c
index acd72a955..4c68fe5a9 100644
--- a/src/wherecode.c
+++ b/src/wherecode.c
@@ -565,7 +565,7 @@ static int codeEqualityTerm(
pLoop->wsFlags |= WHERE_IN_ABLE;
if( pLevel->u.in.nIn==0 ){
- pLevel->addrNxt = sqlite3VdbeMakeLabel(v);
+ pLevel->addrNxt = sqlite3VdbeMakeLabel(pParse);
}
i = pLevel->u.in.nIn;
@@ -1213,8 +1213,8 @@ Bitmask sqlite3WhereCodeOneLoopStart(
** there are no IN operators in the constraints, the "addrNxt" label
** is the same as "addrBrk".
*/
- addrBrk = pLevel->addrBrk = pLevel->addrNxt = sqlite3VdbeMakeLabel(v);
- addrCont = pLevel->addrCont = sqlite3VdbeMakeLabel(v);
+ addrBrk = pLevel->addrBrk = pLevel->addrNxt = sqlite3VdbeMakeLabel(pParse);
+ addrCont = pLevel->addrCont = sqlite3VdbeMakeLabel(pParse);
/* If this is the right table of a LEFT OUTER JOIN, allocate and
** initialize a memory cell that records if this table matches any
@@ -1835,7 +1835,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
int regReturn = ++pParse->nMem; /* Register used with OP_Gosub */
int regRowset = 0; /* Register for RowSet object */
int regRowid = 0; /* Register holding rowid */
- int iLoopBody = sqlite3VdbeMakeLabel(v); /* Start of loop body */
+ int iLoopBody = sqlite3VdbeMakeLabel(pParse);/* Start of loop body */
int iRetInit; /* Address of regReturn init */
int untestedTerms = 0; /* Some terms not completely tested */
int ii; /* Loop counter */