allocatePatternSlots(slots);
//allocateSlots(new PatternSponsor(match));
KeyManager km = getExecutable().getKeyManager();
KeyDefinition keydef = new KeyDefinition(match, use, collationName, collator);
keydef.setIndexedItemType(useType);
keydef.setStackFrameMap(stackFrameMap);
keydef.setSourceLocator(this);
keydef.setExecutable(getExecutable());
keydef.setBackwardsCompatible(xPath10ModeIsEnabled());
try {
km.addKeyDefinition(keyName, keydef, exec.getConfiguration());
} catch (XPathException err) {
compileError(err);
}