呼叫和CallvirtCallvirt

2023-09-02 01:39:37 作者:凉城无爱

在CIL指令呼叫之间的区别是什么Callvirt?

What is the difference between the CIL instructions "Call" and "Callvirt"?

推荐答案

通话是调用非虚,静态或超类方法,即的目标电话是不受压倒一切。 callvirt 是调用虚拟方法(因此,如果的一个子类,覆盖方法,子类的版本被称为代替)。

call is for calling non-virtual, static, or superclass methods, i.e., the target of the call is not subject to overriding. callvirt is for calling virtual methods (so that if this is a subclass that overrides the method, the subclass version is called instead).

相关推荐