首页> 外国专利> Method for eliminating common subexpressions from java byte codes

Method for eliminating common subexpressions from java byte codes

机译:从Java字节码中消除常见子表达式的方法

摘要

Compilers are tools that generate efficient mappings from programs to machines. A Java "Just-In-Time" runs as part of an application, and as such, it must be fast and efficient in its use of memory. To achieve good performance and further optimize code generation, the present invention introduces a method for eliminating common subexpressions from Java bytecodes. The method of the present invention first loads a code stream containing sequences of computer code into computer memory. The expression value for a first expression of a first code sequence is computed and stored in a memory location. A tag is assigned to the memory location holding this expression value for tracking which expression sequences' values are held in memory locations. As code compilation continues, the code selector looks ahead in the code stream to see if any upcoming expression sequences already have expression values stored in a memory location. The code selector compares the expression of a second code sequence with the code sequences annotated by the tags of expression values currently stored in memory. If the second code sequence matches a sequence already associated with a memory location, then the value of the matched sequence is pushed from the memory location onto a stack, and the computations of the expression of the second code sequence is skipped. If the second expression does not match any of the expressions represented by the tags, the expression value of the second expression is calculated and stored in a memory location. This memory location is then annotated with its own expression tag for future comparisons with upcoming expressions in the code stream.
机译:编译器是生成从程序到计算机的有效映射的工具。 Java“即时”作为应用程序的一部分运行,因此,它必须快速,高效地使用内存。为了获得良好的性能并进一步优化代码生成,本发明引入了一种用于从Java字节码中消除公共子表达式的方法。本发明的方法首先将包含计算机代码序列的代码流加载到计算机存储器中。计算用于第一代码序列的第一表达式的表达式值并将其存储在存储器位置中。将标签分配给保存该表达值的存储位置,以跟踪哪些表达序列的值保存在存储位置中。随着代码编译的继续,代码选择器将在代码流中向前看,以查看是否有任何即将到来的表达式序列已将表达式值存储在内存中。代码选择器将第二代码序列的表达式与当前存储在存储器中的表达式值的标签所注释的代码序列进行比较。如果第二代码序列与已经与存储器位置相关联的序列匹配,则将匹配序列的值从存储器位置推入堆栈,并且跳过第二代码序列的表达式的计算。如果第二表达式与标签表示的任何表达式都不匹配,则计算第二表达式的表达式值并将其存储在存储位置中。然后,使用自己的表达式标签对该存储位置进行注释,以便将来与代码流中即将出现的表达式进行比较。

著录项

  • 公开/公告号US6158048A

    专利类型

  • 公开/公告日2000-12-05

    原文格式PDF

  • 申请/专利权人 INTEL CORPORATION;

    申请/专利号US19980087349

  • 发明设计人 GUEI-YUAN LUEH;ALI-REZA ADL-TABATABAI;

    申请日1998-05-29

  • 分类号G06F9/45;

  • 国家 US

  • 入库时间 2022-08-22 01:06:17

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号