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