A Study on Informediated code for Analyzing Bytecodes

바이트코드 분석을 위한 중간코드에 관한 연구

  • 김경수 (인하대학교 컴퓨터공학과) ;
  • 유원희 (인하대학교 전자계산공학과)
  • Published : 2006.03.01

Abstract

Java language creates class files through Java compiler. Class files include informations involved with achievement of program. We can do analysis and optimization for efficient codes by analyzing class files. This paper analyzes bytecodes using informations of Java class files. We translate stack-based Java bytecodes into 3-address codes. Then we translate into static single assignment form using the 3-address codes. Static single assignment form provides a compact representation of a variable's definition-use information. Static single assignment form is often used as an intermediate representation during code optimization. Static sing1e assignment form renames each occurrence of a variable such that each variable is defined only once.

자바 언어는 객체지향 언어이며 다양한 개발 환경과 이식성에 맞는 언어로써 각광을 받고 있다. 하지만 자바 언어는 실행속도가 느리다는 단점을 가지고 있다. 이러한 이유는 자바 프로그래밍 환경에서 자바 가상 기계 코드인 바이트코드가 인터프리터 방식으로 사용되기 때문이다. 따라서 프로그램의 수행에는 실행속도가 현저히 저하되는 단점이 발생하게 된다. 또한 자바 언어는 컴파일러를 통해 생성된 클래스 파일에 프로그램의 수행과 관련된 정보가 숨겨져 있다. 클래스 파일의 분석으로 바이트코드를 위한 효율적인 분석 및 최적화를 할 수 있다. 본 논문에서는 자바 클래스 파일의 정보들을 이용해 자바 바이트코드 분석을 하려한다. 분석을 위해 정적 단일 배정문 형태로 변환하게 되는데 정적 단일 배정문 형태는 정의-사용체인에서 변형된 형태이다. 정적 단일 배정문 형태는 각각의 타입들을 오직 한번만 배정하고 재명명함으로써 프로그램을 정적으로 분석 할 수 있게 한다. 정적 단일 배정문 형태는 최적화와 분석을 위한 효과적인 중간 코드이다.

Keywords