Reflection 如何获取正在执行的已编译方法
如何获取当前正在执行的CompiledMethod实例 i、 eReflection 如何获取正在执行的已编译方法,reflection,pharo,Reflection,Pharo,如何获取当前正在执行的CompiledMethod实例 i、 e 当前正在执行的方法可以通过#Method消息从当前上下文中检索,该消息可以通过thisContext伪变量访问 这样,示例代码将如下所示: someMethod | thisMethod | thisMethod := thisContext method. ^ thisMethod selector someMethod | thisMethod | thisMethod := thisContext me
当前正在执行的方法可以通过
#Method
消息从当前上下文中检索,该消息可以通过thisContext
伪变量访问
这样,示例代码将如下所示:
someMethod
| thisMethod |
thisMethod := thisContext method.
^ thisMethod selector
someMethod
| thisMethod |
thisMethod := thisContext method.
^ thisMethod selector