【24h】

ABCD: Eliminating Array Bounds Checks on Demand

机译:ABCD:按需消除阵列边界检查

获取原文
获取原文并翻译 | 示例
       

摘要

To guarantee typesafe execution, Java and other strongly typed languages require bounds checking of array accesses. Because array-bounds checks may raise exceptions, they block code motion of instructions with side effects, thus preventing many useful code optimizations, such as partial redundancy elimination or instruction scheduling of memory operations. Furthermore, because it is not expressible at bytecode level, the elimination of bounds checks can only by performed at run time, after the bytecode program is loaded. Using existing powerful bounds-check optimizers at run time is not feasible, however, because they are too heavyweight for the dynamic compilation setting. ABCD is a light-weight algorithm for elimination of Array Bounds Checks on Demand. Its design emphasizes simplicity and efficiency. In essence, ABCD works by adding a few edges to the SSA value graph and performing a simple traversal of the graph. Despite its simplicity, ABCD is surprisingly powerful. On our benchmarks, ABCD removes on average 45% of dynamic bound check instructions, sometimes achieving near-ideal optimization. The efficiency of ABCD stems from two factors. First, ABCD works on a sparse representation. As a result, it requires on average fewer than 10 simple analysis steps per bounds check. Second, ABCD is demand-driven. It can be applied to a set of frequently executed (hot) bounds checks, which makes it suitable for the dynamic-compilation setting, in which compile-time cost is constrained but hot statements are known.
机译:为了保证类型安全的执行,Java和其他强类型语言要求对数组访问进行边界检查。由于数组边界检查可能会引发异常,因此它们会阻塞具有副作用的指令的代码运动,从而阻止了许多有用的代码优化,例如部分冗余消除或内存操作的指令调度。此外,由于不能在字节码级别上表达,因此消除边界检查只能在加载字节码程序之后的运行时执行。但是,在运行时使用现有功能强大的边界检查优化器是不可行的,因为它们对于动态编译设置而言过于繁重。 ABCD是一种轻量级算法,可消除按需进行阵列边界检查。它的设计强调简单性和效率。本质上,ABCD的工作原理是在SSA值图中添加一些边并执行该图的简单遍历。尽管简单,但ABCD却异常强大。在我们的基准测试中,ABCD平均删除了45%的动态绑定检查指令,有时可以实现接近理想的优化。 ABCD的效率取决于两个因素。首先,ABCD处理稀疏表示。结果,每次边界检查平均需要少于10个简单分析步骤。其次,ABCD是需求驱动的。可以将其应用于一组频繁执行的(热)边界检查,这使其适合于动态编译设置,在动态编译设置中,编译时的开销受到限制,但已知的是热语句。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号