gpt4 book ai didi

java - javap 本地表输出中的 "bogus"条目

转载 作者:搜寻专家 更新时间:2023-10-31 20:30:24 25 4
gpt4 key购买 nike

我正在使用 javap 研究为我的一个类(class)生成的代码并注意到以下输出:

...
frame_type = 255 /* full_frame */
offset_delta = 11
locals = [ class Test, double, int, double, double, bogus, bogus, int, int, class "[D" ]
stack = []
...

locals 表中那些“虚假”类型/变量条目的含义是什么?它们是如何引起的?它们对生成的代码有何影响?

类文件是使用 Eclipse 3.7 编译器生成的,javap 来自 OpenJDK-1.6b22。

最佳答案

我遇到了 this little gem在浏览 Javassist 时文档:

BOGUS

public static final Type BOGUS

Represents a non-accessible value. Code cannot access the value this type represents. It occurs when bytecode reuses a local variable table position with non-mergable types. An example would be compiled code which uses the same position for a primitive type in one branch, and a reference type in another branch.

我认为这种歧义也是导致 locals 表中出现“伪造”条目的原因...

关于java - javap 本地表输出中的 "bogus"条目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7938448/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com