我反编译了一个源文件,发现了一些JVM指令,比如JVM INSTR monitorenter和JVM INSTR monitorexit。
这些是什么意思?

public boolean isRunning()
    {
        this;
        JVM INSTR monitorenter ;
        Thread thread = _thread;
        boolean flag;
        if(thread != null)
            flag = true;
        else
            flag = false;
        this;
        JVM INSTR monitorexit ;
        return flag;
        Exception exception;
        exception;
        throw exception;
    }

还有什么是 Exception 异常; , 异常(exception);并抛出异常;吝啬的?

最佳答案

monitorenter monitorexit 与所有其他字节码指令一起记录在 JVM 规范中。基本上它们用于实现 synchronized 块和方法。

听起来你的反编译器不是很好,如果它不能在这里想出合适的 Java ......我们无法说出 Exception 部分是关于什么的,基本上它是坏的反编译器输出。它很可能对应于以下内容:

catch(Exception exception)
{
    throw exception;
}

...但基本上我会找到一个不同的反编译器。 (为什么你需要一个反编译器?)

关于java - JVM INSTR monitorenter 和 JVM INSTR monitorexit,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/9547975/

10-12 00:12
查看更多