Translation of Java Bytecode into C code with the JNI

자바 바이트코드로부터 JNI를 사용한 C 코드의 변환

  • 권혜은 (세명대학교 대학원 전산정보학과) ;
  • 김상훈 (세명대학교 소프트웨어학과)
  • Published : 2001.03.01

Abstract

The well-known tradeoff of Java's portability is the inefficiency of its basic execution model, which relies on the interpretation of an virtual machine. Many solutions have been proposed to overcome this problem, such as just-in-time(JIT) and offline bytecode compilers. However, JIT compiler can not avoid the overhead of runtime. since it translate bytecode into native code at runtime. And, pure offline bytecode compiler limits the ability of dynamic class loading. In this paper, we present an approach which preserves the ability to dynamically load bytecode, and is more efficient than JIT. In contrast to existing bytecode-to-C translator using the old NMI, our translator maintain complete compatibility and portability through using the Java Native Interface(JNI) standard. We have designed and implemented an translator for converting bytecode to C code with JNI.. named MyJNItool.

자바 프로그램은 플랫폼 독립적이라는 장점을 갖는 반면에 그의 실행이 가상 기계를 통하여 이루어지기 때문에 실행 시간의 비효율성을 가진다. 이러한 문제를 극복하기 위해 just-in-time(JIT) 컴파일러, 오프라인 바이트코드 컴파일러와 같은 다양한 해결 방법이 제안되어 왔다. 그러나 JIT 컴파일러는 실행시간에 바이트코드로부터 네이티브 코드로의 번역이 일어나므로 실행시간 부담을 가진다. 그리고 순수 오프라인 바이트코드 컴파일러는 동적 클래스 적재(dynamic class loading)의 어려움을 가진다. 본 논문에서는 동적으로 바이트코드를 적재학 수 있는 능력을 유지하면서, JIT 보다 더 효율적 실행이 가능한 방법을 제안한다. 또한 기존의 bytecode-to-C 번역기와는 달리, 우리의 번역기는 자바 네이티브 인터페이스(JNI)를 사용함으로서 JDK 실행 환경과의 완벽한 호환성을 유지한다. 본 연구의 결과로 바이트코드를 JNI를 사용한 C 코드로 변환하기 위한 번역기를 설계하고 구현하였다.

Keywords