A Study on Control Flow Analysis Using Java Bytecodes in CTOC

CTOC에서 자바 바이트코드를 이용한 제어 흐름 분석에 관한 연구

  • 유원희 (인하대학교 컴퓨터 공학부) ;
  • 김기태 (인하대학교 컴퓨터 공학부)
  • Published : 2006.01.01

Abstract

This paper describes the data structure for program analysis and optimization of bytecode level. First we create an extended CFG(Control Flow Graph). Because of the special properties of bytecode, we must adaptively extend the existing control flow analysis techniques. We build basic blocks to create the CFG and create various data that can be used for optimization. The created CFG can be tested for comprehension and maintenance of Java bytecode, and can also be used for other analyses such as data flow analysis. This paper implements CTOC's CTOC-BR(CTOC-Bytecode tRanslator) for control flow analysis of bytecode level. CTOC(Classes To Optimized Classes) is a Java bytecode framework for optimization and analysis. This paper covers the first part of the CTOC framework. CTOC-BR is a tool that converts the bytecode into tree form for easy optimization and analysis of bytecode in CTOC.

본 논문은 바이트코드(bytecode) 수준에서 프로그램 분석과 최적화를 위한 구조를 서술한다. 바이트코드 수준에서 분석을 수행하기 위해서는 우선 제어 흐름 그래프(CFG : Control Flow Graph)를 생성해야 한다. 바이트코드의 특성 때문에 기존의 제어 흐름 분석 기술을 바이트코드에 적합하게 확장해야 한다. CFG를 작성하기 위해 기본 블록을 생성하고 기본 블록간의 관계를 이용하여 최적화 과정에서 사용되는 각종 정보를 생성한다. 생성된 CFG는 자바 바이트코드의 이해와 유지보수를 위해 테스트되고, 데이터 흐름 분석과 의존성 분석과 같은 다른 분석을 위해서 사용된다. 본 논문에서는 바이트코드 수준의 제어 흐름 분석을 위해 CTOC(Classes To Optimized Classes)의 CTOC-BR(CTOC-Bytecode tRanslator)을 구현한다. CTOC는 자바 바이트코드의 최적화와 분석을 위해 현재 개발 중인 프레임 워크의 이름이고, CTOC에서 CTOC-BR은 스택 기반인 바이트코드의 최적화와 분석을 쉽게 하기 위해 트리 형태로 변환을 수행하는 도구이다.

Keywords