示例#1
0
        List <OpCodeHandler> CreateOtherHandlers(CsvmInfo csvmInfo, IList <OpCodeHandlerInfo> handlerInfos)
        {
            var list = new List <OpCodeHandler>(NUM_HANDLERS);

            foreach (var type in GetVmHandlerTypes(csvmInfo.VmHandlerBaseType))
            {
                if (list.Count == NUM_HANDLERS)
                {
                    break;
                }

                var execHandler = new PrimitiveHandlerMethod(GetExecMethod(type));
                execHandler.Sig = CreateMethodSigInfoCreator(csvmInfo).Create(execHandler.Blocks);

                var finder  = new MethodFinder(handlerInfos, execHandler);
                var handler = finder.FindHandler();
                if (handler == null)
                {
                    continue;
                }

                list.Add(handler);
            }

            list.Sort((a, b) => a.OpCodeHandlerInfo.Name.ToUpperInvariant().CompareTo(b.OpCodeHandlerInfo.Name.ToUpperInvariant()));

            return(list);
        }
 public MethodFinder(IList <OpCodeHandlerInfo> handlerInfos, PrimitiveHandlerMethod handlerMethod)
 {
     this.handlerInfos  = handlerInfos;
     this.handlerMethod = handlerMethod;
 }
 public SigState(PrimitiveHandlerMethod handlerMethod)
 {
     this.SigInfo = handlerMethod.Sig;
 }
		List<OpCodeHandler> CreateOtherHandlers(CsvmInfo csvmInfo, IList<OpCodeHandlerInfo> handlerInfos) {
			var list = new List<OpCodeHandler>(NUM_HANDLERS);

			foreach (var type in GetVmHandlerTypes(csvmInfo.VmHandlerBaseType)) {
				if (list.Count == NUM_HANDLERS)
					break;

				var execHandler = new PrimitiveHandlerMethod(GetExecMethod(type));
				execHandler.Sig = CreateMethodSigInfoCreator(csvmInfo).Create(execHandler.Blocks);

				var finder = new MethodFinder(handlerInfos, execHandler);
				var handler = finder.FindHandler();
				if (handler == null)
					continue;

				list.Add(handler);
			}

			list.Sort((a, b) => a.OpCodeHandlerInfo.Name.ToUpperInvariant().CompareTo(b.OpCodeHandlerInfo.Name.ToUpperInvariant()));

			return list;
		}
		public MethodFinder(IList<OpCodeHandlerInfo> handlerInfos, PrimitiveHandlerMethod handlerMethod) {
			this.handlerInfos = handlerInfos;
			this.handlerMethod = handlerMethod;
		}
			public SigState(PrimitiveHandlerMethod handlerMethod) {
				this.SigInfo = handlerMethod.Sig;
			}