예제 #1
0
 public override void VisitInvoke(ASTInvoke n)
 {
     if (SystemMethodManager.IsSystemMethod(n.Method))
     {
         n.Actuals.Visit(this);
         SystemMethod method = SystemMethodManager.Lookup(n.Method);
         method.Emit(_gen);
         //store the return type so we can invoke methods and stuff on it.
         _lastWalkedType = _typeManager.LookupCilType(method.FuncInfo.ReturnType);
     }
     else
     {
         //push who
         n.Object.Visit(this);
         Type who = _lastWalkedType;
         //push actuals
         n.Actuals.Visit(this);
         //find the method to execute on the given class
         MethodBuilderInfo info = _typeManager.GetMethodBuilderInfo(who.Name, n.Method);
         _gen.Emit(OpCodes.Callvirt, info.Builder);
         //store the return type of the method
         _lastWalkedType = info.Builder.ReturnType;
     }
 }
예제 #2
0
 public void WriteSystemMethod(SystemMethod method)
 {
     syncronizer.constant_manager.GetSystemMethodSubManager().WriteConstantReference(method, this);
 }