Translating Java Bytecode to SPARC Code using Retargetable Code Generating Techniques

재목적 코드 생성 기법을 이용한 자바 Bytecode에서 SPARC 코드로의 번역

  • 오세만 (동국대학교 컴퓨터공학과) ;
  • 정찬성 (동국대학교 컴퓨터공학과)
  • Published : 2000.06.30

Abstract

Java programming language is designed to run effectively on internet and distributed network environments. However, because it has a deficit to be executed by the interpreter method on each platform, to execute Java programs efficiently the code generation system which transforms Bytecode into SPARC code as target machine code must be developed. In this paper, we implement a code generation system which translates Bytecode into SPARC code using the retargetable code generating techniques. For the sake of code expander, we wrote a Bytecode table describing a rule of SPARC code generation from Bytecode, and implemented the information extractor transforming Bytecode to suitable form during expanding of source code from class file. The information extractor determines constant pool entry of each Bytecode instruction operand and then the code expander translates the Bytecode into SPARC code accoring to the Bytecode table. Also, the retargetable code generation system can be systematically reconfigured to generate code for a variety of distinct target computers.

자바 프로그래밍 언어는 인터넷 및 분산 네트워크 환경에서 효과적으로 수행될 수 있도록 설계된 언어이다. 그러나 각 플랫폼에서 인터프리터 방식으로 실행된다는 단점을 가지고 있기 때문에, 자바 프로그램을 효율적으로 실행하기 위해서는 Bytecode를 목적 기계 코드인 SPARC 코드로 변환하는 코드 생성 시스템이 개발되어야 한다. 본 논문에서는 재목적 코드 생성 기법을 이용하여 Bytecode를 SPARC 코드로 변환하는 코드 생성 시스템을 구현하였다. 이를 위해 Bytecode로부터 SPARC 코드 생성 규칙을 기술한 Bytecode 테이블을 작성하였고, 클래스 파일을 입력으로 받아 Bytecoed를 코드 확장시에 적합한 형태로 변환하는 정보추출기를 구현하였다. 정보추출기가 Bytecode 명령어의 피연산자에 대한 상수 기억장소의 엔트리를 결정한 후, 코드 확장기가 변경된 Bytecode를 Bytecode 테이블에 따라 SPARC 코드로 변환한다. 또한, 재목적 코드 생성 시스템은 다양한 목적 기계 코드를 생성하기 위해 체계적으로 재구성될 수 있다.

Keywords

References

  1. Andrew S. Tanenbaum, Hans van Staveren, Ed G. Keiser and Johan W. Stevenson, 'Description of a machine architecture for use with block structured language,' Dept. of mathmetics and Computer Science, Vrije Universiteit, 1983
  2. Chow F. and Hennessy J. 'Register allocation by priority-based coloring,' Proceedings of the ACM SIGPLAN 84 Symposium on Compiler Construction, ACM, pp.222-232, 1984 https://doi.org/10.1145/502874.502896
  3. Franckassshoek, Koen Langendoen, 'The Code Expander Generator,' Dept. of Mathmetics and Computer Science, Vrije Universiteit, 1990
  4. Hans van Staverren, 'The table driven code generator from ACK 2nd. Revision,' report 81, netherlands Vrije Universiteit, 1989
  5. Jon Meyer, Troy Downing, 'Java Virtual Machine,' O'REILLY, 1997
  6. Peter van der Linden, 'just JAVA,' Prentice-Hall, 1996
  7. Richard P. Paul, 'SPARC ARCHITECTURE, ASSEMBLY LANGUAGE PROGRAMMING AND C,' Prentice-Hall, 1994
  8. The SPARC Architecture Manual, SUN Micro., 1987
  9. Tim Lindholm, Frank Yellin, 'The Java Virtual Machine Specification' Addison-Wesley, 1996
  10. 윤영식, 고광만, 오세만, '속성 EM 트리를 이용한 SPARC 코드 확장기의 설계 및 구현', 한국정보과학회 '96년 봄 학술 발표 논문집, 제23권 1 호, pp.377-380, 1996
  11. 정찬성, 황순명, 오세만, 'Bytecode에서 SPARC 코드로의 확장', 한국정보과학회 '97년 가을 학술 발표 논문집, 제24권 2호, pp.367-370, 1997