发明名称 METHOD AND APPARATUS FOR COMPUTER CODE PROCESSING IN A CODE TRANSLATOR
摘要 A code translator, constructed similar to a compiler, accepts as an input to be translated the assembly code written for one architecture (e.g., VAX), and produces as an output object code for a different machine architecture (e.g., RISC). The input code is converted into an intermediate language, and a flow graph is constructed. The flow graph is referenced by a flow analyzer for recognizing certain architecture-specific and calling standard-specific coding pratices or idioms that cannot be automatically converted, particularly relating to stack usage, register usage, condition codes, and passing arguments for procedure calls. By tracking stack usage within routines, the compiler can distinguish up-level stack and return address references from valid local references. Also, it can inform the user of stack misalignment, which has a severe performance penalty, and can detect code segments where different flow paths may result in different stack depths at runtime, which may indicated a source code error. Register usage is likewise trackted to determine which registers are destroyed by a routine, and generate routine prologue and epilogue code which performs register saves, as well as provide register "hints" to aid the user in adding an entry point declaration or documentation for the routine. The usage of condition codes is likewise trackted, by a backward walk through the flow graph, so that code to fabricate needed values is generated. In addition, all argument pointer base memory references in the input code is tracked to determine how the same argument reference may be made in the target environment. <IMAGE>
申请公布号 AU1560092(A) 申请公布日期 1992.10.06
申请号 AU19920015600 申请日期 1992.03.04
申请人 DIGITAL EQUIPMENT CORPORATION 发明人 THOMAS R BENSON
分类号 G06F9/45;G06F11/28 主分类号 G06F9/45
代理机构 代理人
主权项
地址