private void PrepareGlobalValues(QilList globalIterators) {
MethodInfo methGlobal;
IteratorDescriptor iterInfo;
foreach (QilIterator iter in globalIterators) {
Debug.Assert(iter.NodeType == QilNodeType.Let || iter.NodeType == QilNodeType.Parameter);
// Get metadata for method which computes this global's value
methGlobal = XmlILAnnotation.Write(iter).FunctionBinding;
Debug.Assert(methGlobal != null, "Metadata for global value should have already been computed");
// Create an IteratorDescriptor for this global value
iterInfo = new IteratorDescriptor(this.helper);
// Iterator items will be stored in a global location
iterInfo.Storage = StorageDescriptor.Global(methGlobal, GetItemStorageType(iter), !iter.XmlType.IsSingleton);
// Associate IteratorDescriptor with parameter
XmlILAnnotation.Write(iter).CachedIteratorDescriptor = iterInfo;
}
}