Dalvik VM的JIT编译器的资料堆积(dumping...work in progress)

本文介绍了Android Dalvik VM的JIT编译器,它旨在提高ARM架构设备上Java程序的性能。JIT采用了 trace-based 策略,仅编译热点代码,以减少内存和电池使用。开发者可以通过启用WITH_JIT标志来编译原型。文中还讨论了JIT的优化、开关机制、性能影响和与解释器的切换,以及未来计划。
摘要由CSDN通过智能技术生成

Android的Dalvik VM 在去年下半年新增了JIT编译器,应该能提高Android上的Java程序的性能。暂时只支持armv5te、armv5te-vfp和armv7-a这三种CPU。
去年11月在android-platform 上的一帖提到:
Nov 17 2009, 6:53 am
From: Bill Buzbee <buz...@android.com>
Date: Mon, 16 Nov 2009 14:53:50 -0800 (PST)
Local: Tues, Nov 17 2009 6:53 am
Subject: Dalvik JIT Compiler

As some of you have noticed, the latest Android Open Source Project tree (eclair) includes source code for a Dalvik JIT compiler.  The Dalvik team has been actively investigating what kind of JIT would work best over a wide range of memory- and power-constrained portable Android devices, and the code in AOSP master is an old snapshot of what we consider a promising proof-of-concept.  It is a trace-based JIT, compiling only hot code traces rather than method-at-a-time strategy typically found on server-class JITs.  It attempts to minimize heap usage, and it requires no persistent storage.  The goal is to give a quick performance boost using very little heap and battery.

The JIT has progressed significantly since the snapshot in AOSP eclair, and we're working on pushing out a more current version. Meanwhile, if you'd like to play with the prototype, you can build it by creating a buildspec.mk file in your AOSP root which includes the line "WITH_JIT := true".

Note that the prototype JIT had not been extensively tested at the time the snapshot was taken, so you can expect some breakage.  Also, it contains few optimizations other than the basic elimination of the interpreter's fetch/decode cycle.  We're looking forward to getting a newer version into the AOSP tree.

Bill Buzbee, Ben Cheng & the rest of the Dalvik team



Nov 21 2009, 3:34 am
From: Ben Cheng <bcch...@android.com>
Date: Fri, 20 Nov 2009 11:34:09 -0800
Local: Sat, Nov 21 2009 3:34 am
Subject: Re: Dalvik JIT Compiler

Hi Tomei,

Please see my replies inline:

On Fri, Nov 20, 2009 at 10:05 AM, Tomei <tomei.ninge...@gmail.com> wrote:
> Hi Ben,

> For "switchable between JIT and interpreter at bytecode level" -- is
> this a just convenience way for developing/debugging the JIT, or part
> of a fundamental design (i.e., to support single-stepping inside the
> debugger). I hope it's the former, or else it seems performance gain
> will be quite limited.

It is just a convenient way to develop/debug the JIT. Once a trace is cut for compilation, the JIT'ed instructions are allowed to move across the original bytecode boundaries. For example, we have implemented ld/st scheduling to aggressively hoist loads and sink stores until inserted scheduling barriers or memory instructions that cannot be disambiguated. Similarly, redundant stores to the Dalvik registers can also be eliminated so that not all computed results are written back to memory.

We use the "easy switch" feature to handle heavy bytecode instructions like array initializations. Instead of inflating the codegen routine to handle it inline, we issue a single-step instruction so that all compiled instructions prior to that are optimized as usual but mem

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值