바이트코드를 위한 정적 단일 배정문 기반의 정적 타입 추론

Static Type Inference Based on Static Single Assignment for Bytecode

  • 김지민 (인하대학교 컴퓨터정보공학과) ;
  • 김기태 (인하대학교 컴퓨터정보공학과) ;
  • 김제민 (인하대학교 컴퓨터정보공학과) ;
  • 유원희 (인하대학교 컴퓨터정보공학과)
  • 발행 : 2006.09.01

초록

바이트코드는 많은 장점을 가지고 있으나 수행 속도가 느리고 프로그램의 분석과 최적화에 알맞은 표현은 아니다. 분석과 최적화를 위하여 바이트코드를 정적 단일 배정문(SSA Form)으로 변환이 수행되어야 한다. 그러나 바이트코드에서 SSA Form으로 변환 시 어떤 변수는 타입 정보를 상실한다. 이를 해결하기 위하여 본 논문에서는 바이트코드에 대한 확장된 제어 흐름 그래프를 생성한다. 또한 정적으로 분석하기 위해 제어 흐름 그래프를 SSA Form으로 변환한다. SSA Form으로 변환을 위하여 지배자. 직접 지배자. 지배자 경계. ${\phi}$-함수, 재명명 등 많은 정보에 대한 계산을 수행한다. 생성된 SSA Form에 알맞은 타입을 선언하기 위해서 다음과 같은 동작들을 수행한다. 먼저 클래스의 호출그래프와 상속 그래프를 생성한다. 그리고 각 노드에 대한 정보를 수집한다. 수집된 정보를 기반으로 동등한 타입의 노드를 찾고 강 결합 요소로 설정한 후 각 노드에 타입을 효율적으로 설정하는 방법을 제안하였다.

Although bytecode has many good features, it has slow execution speed and it is not an ideal representation for program analysis or optimization. For analysises and optimizations. bytecode must be translated to a Static Single Assignment Form(SSA Form) But when bytecode is translated a SSA Form it has lost type informations of son variables. For resolving these problem in this paper, we create extended control flow graph on bytecode. Also we convert the control flow graph to SSA Form for static analysis. Calculation about many informations such as dominator, immediate dominator. dominance frontier. ${\phi}$-Function. renaming are required to convert to SSA Form. To obtain appropriate type for generated SSA Form, we proceed the followings. First. we construct call graph and derivation graph of classes. And the we collect information associated with each node. After finding equivalence nodes and constructing Strongly Connected Component based on the collected informations. we assign type to each node.

키워드