<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Native - 标签 - Victor's Code Journey</title><link>http://www.victorchu.info/tags/native/</link><description>Native - 标签 - Victor's Code Journey</description><generator>Hugo -- gohugo.io</generator><language>zh-cn</language><managingEditor>victorchu0610@outlook.com (victorchutian)</managingEditor><webMaster>victorchu0610@outlook.com (victorchutian)</webMaster><lastBuildDate>Fri, 28 Apr 2017 15:09:14 +0800</lastBuildDate><atom:link href="http://www.victorchu.info/tags/native/" rel="self" type="application/rss+xml"/><item><title>Java虚拟机-Instrumentation</title><link>http://www.victorchu.info/posts/2017/04/f4a2ef10/</link><pubDate>Fri, 28 Apr 2017 15:09:14 +0800</pubDate><author><name>victorchutian</name></author><guid>http://www.victorchu.info/posts/2017/04/f4a2ef10/</guid><description><![CDATA[<div class="featured-image">
                <img src="/feature-images/jvm.webp" referrerpolicy="no-referrer">
            </div><p>java Instrumentation(插桩)指的是可以用独立于应用程序之外的代理（agent）程序来监测和协助运行在JVM上的应用程序。这种监测和协助包括但不限于获取JVM运行时状态，替换和修改类定义等。</p>
<p>从Java SE5开始使用JVM TI替代了JVM PI和JVM DI。提供一套代理机制，支持独立于JVM应用程序之外的程序以代理的方式连接和访问JVM。java.lang.instrument是在JVM TI的基础上提供的Java版本的实现。</p>
<p>Instrument 设计的目的是将字节码添加到方法中，收集工具使用的数据。出于这个目的，更改纯粹是附加的，因此这些工具不会修改应用程序状态或行为。此类良性工具的示例包括监控代理、分析器、覆盖分析器和事件记录器。</p>
<p>当然，由于这种检测机制提供了修改现有已编译 Java 类的字节码或添加字节码的能力，所以我们也可以用来动态修改运行的程序代码。</p>]]></description></item><item><title>Java虚拟机-字节码指令</title><link>http://www.victorchu.info/posts/2017/02/d8f512db/</link><pubDate>Mon, 20 Feb 2017 16:12:36 +0800</pubDate><author><name>victorchutian</name></author><guid>http://www.victorchu.info/posts/2017/02/d8f512db/</guid><description><![CDATA[<div class="featured-image">
                <img src="/feature-images/jvm.webp" referrerpolicy="no-referrer">
            </div><p>Java源码在运行之前都要编译成为字节码格式(如.class文件)，然后由ClassLoader将字节码载入运行。在字节码文件中，指令代码只是其中的一部分，里面还记录了字节码文件的编译版本、常量池、访问权限、所有成员变量和成员方法等信息<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>。本文主要简单介绍不同Java指令的功能。</p>]]></description></item><item><title>Java虚拟机-查看本机代码</title><link>http://www.victorchu.info/posts/2017/02/73b3c4c7/</link><pubDate>Sun, 19 Feb 2017 20:05:19 +0800</pubDate><author><name>victorchutian</name></author><guid>http://www.victorchu.info/posts/2017/02/73b3c4c7/</guid><description><![CDATA[<div class="featured-image">
                <img src="/feature-images/jvm.webp" referrerpolicy="no-referrer">
            </div><p>JVM支持使用PrintAssembly选项来检查JIT编译器生成的代码。对了解代码是如何执行的，以及JIT编译器如何工作和优化代码有很大帮助。</p>]]></description></item></channel></rss>