Giter Site home page Giter Site logo

Comments (6)

hengyunabc avatar hengyunabc commented on June 7, 2024

这个确实有点奇怪,可以下个字节码查看工具,看下哪里不一样的了。 或者自己用 javap 看下具体哪里不一样。

或者试下比较新的jvm。

from dumpclass.

yaokuku123 avatar yaokuku123 commented on June 7, 2024

image

上方是得到的class字节码对比图,我之后又直接使用sa-jdi工具dump这个class,结果和dumpclass工具是一致的。均和javac编译得到的class字节码存在差异。

from dumpclass.

yaokuku123 avatar yaokuku123 commented on June 7, 2024

image

我使用jdk11的 hsdb dump得到的结果依旧证明了javac和dump得到的class字节码存在差异,与java8得到的结果一致

from dumpclass.

yaokuku123 avatar yaokuku123 commented on June 7, 2024

我使用arthas dump测试一下结果,发现arthas没问题,dump得到的class字节码和javac编译得到的class字节码是一致的。nb。。

from dumpclass.

hengyunabc avatar hengyunabc commented on June 7, 2024

可能就是 jvm 里处理了一下。

arthas用的是 ClassFileTransformer 来 dump的。可能jvm只保证了这里返回的 byte[] 和 getResource 获取的是一样的。

然后 jvm 真正把 byte[] 加载处理之后,可能据实际情况做一些变换,或者把一些无用数据清理掉都是有可能的。 hsdb dump 下来的,是这个阶段真正运行的字节码。

需要进jvm源码里看下。

from dumpclass.

yaokuku123 avatar yaokuku123 commented on June 7, 2024

get~,感谢解惑

from dumpclass.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.