KR101088515B1 - Computer readable recording medium having install-time compiler program for embedded system - Google Patents

Computer readable recording medium having install-time compiler program for embedded system Download PDF

Info

Publication number
KR101088515B1
KR101088515B1 KR1020100002022A KR20100002022A KR101088515B1 KR 101088515 B1 KR101088515 B1 KR 101088515B1 KR 1020100002022 A KR1020100002022 A KR 1020100002022A KR 20100002022 A KR20100002022 A KR 20100002022A KR 101088515 B1 KR101088515 B1 KR 101088515B1
Authority
KR
South Korea
Prior art keywords
memory
class
unit
file
app
Prior art date
Application number
KR1020100002022A
Other languages
Korean (ko)
Other versions
KR20110081719A (en
Inventor
김수현
문수묵
최형규
Original Assignee
한국과학기술연구원
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 한국과학기술연구원 filed Critical 한국과학기술연구원
Priority to KR1020100002022A priority Critical patent/KR101088515B1/en
Publication of KR20110081719A publication Critical patent/KR20110081719A/en
Application granted granted Critical
Publication of KR101088515B1 publication Critical patent/KR101088515B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45516Runtime code conversion or optimisation

Abstract

본 발명은 내장형 자바시스템을 위한 인스톨-타임 컴파일러에 관한 것으로서, 보다 구체적으로는 (1) 응용프로그램 메모리(Mapp)만을 사용하며, 외부로부터 입력되는 입력 Jar 파일에 포함되어 있는 클래스 파일 및 리소스 파일 목록을 읽어 들이는 응용프로그램 리더부; (2) 응용프로그램 메모리(Mclass)만을 사용하며, 클래스 파일들을 읽어 들이고 바이트코드를 검증하는 클래스 파일 리더/바이트코드 검증부; (3) 메소드 메모리(Mmethod)를 사용하여 변환 작업을 수행하되, 변환 중 최적화할 참조를 접근하는 바이트코드를 만나게 되면 상기 응용프로그램 메모리(Mapp)에 참조 리스트를 만들고, 상기 응용프로그램 메모리(Mapp)의 참조 리스트를 참조하여 코드를 생성하는 바이트코드 변환부; (4) 클래스 메모리(Mclass)만을 사용하며, 상기 파일 리더/바이트코드 검증부로부터 검증된 클래스 데이터 구조 및 런타임 함수들을 저장하는 클래스 데이터구조/런타임 함수부; (5) 응용프로그램 메모리(Mapp)만을 사용하며, 상기 생성된 코드를 플랫폼 상에서 실행 가능하도록 바인딩 및 재배치 처리를 통하여 수정하는 바인딩/재배치부; (6)응용프로그램 메모리(Mapp)만을 사용하며, 상기 바인딩/재배치부로부터 전송된 클래스 파일을 이진 파일로 생성하는 이진 파일 생성부; 및 (7) 응용프로그램 메모리(Mapp)만을 사용하며, 상기 이진 파일 생성부에서 생성된 이진 파일을 출력 Jar 파일로 압축하여 자바 가상머신으로 전송하는 Jar 압축부를 포함하는 것을 그 구성상의 특징으로 한다.
본 발명에서 제안하고 있는, 내장형 시스템을 위한 인스톨-타임 컴파일러에 따르면, 응용프로그램 분석에 기초하여, 인스톨-타임 컴파일러를 참조 접근 최적화 및 메모리 사용량을 고려한 최적화를 통해 최적화시킴으로써, 구현하기 어려운 최적화의 구현을 가능하게 하며, 특히 메모리가 적은 내장형 시스템의 메모리 효율성을 높일 수 있게 한다.
The present invention relates to an install-time compiler for an embedded Java system, and more specifically, (1) a class file and a resource file that uses only application memory (M app ) and is included in an input Jar file input from the outside. An application program reader for reading the list; (2) a class file reader / byte code verification unit which uses only application program memory (M class ) and reads class files and verifies byte codes; (3) Perform a conversion operation using a method memory (M method ), and if a byte code that accesses a reference to be optimized is encountered during conversion, a reference list is created in the application memory (M app ), and the application memory ( A bytecode conversion unit generating a code by referring to a reference list of M app ); (4) a class data structure / runtime function unit using only class memory (M class ) and storing class data structures and runtime functions verified from the file reader / bytecode verification unit; (5) a binding / relocation unit that uses only application program memory M app and modifies the generated code through a binding and relocation process to be executed on a platform; (6) a binary file generation unit using only an application memory M app and generating a class file transmitted from the binding / relocation unit as a binary file; And (7) using only an application program memory (M app ), and including a jar compressing unit for compressing the binary file generated by the binary file generating unit into an output Jar file and transmitting it to a Java virtual machine. .
According to the install-time compiler for the embedded system proposed in the present invention, the optimization of the install-time compiler based on the analysis of the application through the optimization of the reference access optimization and the memory usage, thereby implementing an optimization that is difficult to implement. This enables high memory efficiency, especially for embedded systems with low memory.

Description

내장형 자바시스템을 위한 인스톨-타임 컴파일러 프로그램을 기록한 컴퓨터 판독가능한 기록매체{COMPUTER READABLE RECORDING MEDIUM HAVING INSTALL-TIME COMPILER PROGRAM FOR EMBEDDED SYSTEM}COMPUTER READABLE RECORDING MEDIUM HAVING INSTALL-TIME COMPILER PROGRAM FOR EMBEDDED SYSTEM}

본 발명은 내장형 자바시스템을 위한 인스톨-타임 컴파일러에 관한 것으로서, 특히 참조 접근 최적화와 메모리 사용량의 효율을 증대시킬 수 있는 내장형 자바시스템을 위한 인스톨-타임 컴파일에 관한 것이다.The present invention relates to an install-time compiler for an embedded Java system, and more particularly to an install-time compilation for an embedded Java system that can increase the efficiency of reference access optimization and memory usage.

최근 다양한 내장형 시스템(Embedded System)에서 자바(Java) 실행 장치가 사용되고 있다. 자바 실행 장치는 널리 사용되는 핸드폰에 채택되었을 뿐만 아니라, 대표적으로 디지털 텔레비전(Television)과 블루레이에서도 자바를 표준화 규격으로 채택하고 있다.
Recently, a Java execution device has been used in various embedded systems. Java enabled devices are not only adopted by popular mobile phones, but are also widely adopted as standardization standards for digital television (Television) and Blu-ray.

이와 같은, 내장형 시스템에서의 자바는 성능이 느리다는 문제점이 있는바, 이를 해결하려는 연구들이 진행되고 있다. 대표적으로 자바 즉시 컴파일러(Just-In-Time compiler; JIT compiler)가 있다. 하지만 내장형 시스템의 한정된 하드웨어 자원 때문에 이 기법만으로는 만족스러운 성능을 얻기 어려워 추가적인 최적화 기법들이 제안되고 있다.
As such, there is a problem that Java in a built-in system is slow in performance. There is a Java just-in-time compiler (JIT compiler). However, due to the limited hardware resources of embedded systems, it is difficult to achieve satisfactory performance with this technique alone, and additional optimization techniques have been proposed.

JIT 컴파일러 이외의 추가적인 최적화 기법들에는, 내장형 기기 외부에서 미리 컴파일링을 수행하는 어헤드-오브-타임 컴파일러(Ahead-Of-Time Compiler; AOTC)와, 내장형 기기에 자바 실행 장치가 인스톨 되는 시점에서, 즉 응용프로그램을 수행하기 이전에 미리 컴파일링을 수행하는, 자바 인스톨-타임 컴파일러(Install-Time Compiler)가 있다. 각각의 기법들은 서로 다른 장단점을 가지고 상호 보완적인 관계를 가지고 있다.
Additional optimization techniques other than the JIT compiler include the Ahead-Of-Time Compiler (AOTC), which precompiles outside of the embedded device, and at the time the Java executable is installed on the embedded device. In other words, there is a Java Install-Time Compiler that precompiles before running the application. Each technique has different advantages and disadvantages and complements each other.

도 1은 내장형 시스템을 위한 3가지 컴파일러(컴파일링 방식)의 구성을 비교하여 나타내는 도면이다.
1 is a view showing a comparison of the configuration of three compilers (compile method) for an embedded system.

먼저, 자바 JIT 컴파일러(컴파일링 방식)는, 도 1에 도시된 바와 같이 클라이언트 측에서 자바 응용프로그램을 수행하는 중에 해당 플랫폼에 최적화된 코드로 변환하기에 런타임 정보를 이용해서 수행환경에 적절한 최적화를 수행할 수 있지만, 자바의 수행 중 자바 JIT 컴파일러가 동작하기에 수행시간이 낭비되는 경우가 있으면 많은 시간을 최적화에 사용하지 못한다는 문제점이 있다. 또한, 자바 JIT 컴파일러는 응용프로그램 수행 중 코드 변환 작업이 수행되기 때문에 반응시간(response time)이 예측 불가능하다는 문제점도 있다.
First, the Java JIT compiler (compile method) uses runtime information to convert the code optimized for the platform while executing a Java application on the client side, as shown in FIG. Although it can be done, if the execution time is wasted because the Java JIT compiler is running during the execution of Java, there is a problem that much time cannot be used for optimization. In addition, the Java JIT compiler also has a problem in that response time is unpredictable because code conversion is performed while an application is running.

다음으로, 자바 AOT 컴파일러(컴파일링 방식)는, 도 1에 도시된 바와 같이 클라이언트 측이 아닌 서버 측에서 미리 컴파일링을 수행하기에 자바 JIT 컴파일러와 같은 수행시간 문제는 전혀 없지만, 변환된 결과물인 이진(Binary) 파일이 플랫폼에 의존적이 되어 자바의 장점 중 하나인 플랫폼 독립성(Platform independency)을 유지하지 못하게 되어 몇몇 제한된 환경에서만 사용되고 있다.
Next, the Java AOT compiler (compilation method) does not have any runtime problem like the Java JIT compiler because it is precompiled on the server side rather than the client side as shown in FIG. Binary files are platform-dependent and can't maintain platform independency, one of Java's strengths, and are only used in some limited environments.

끝으로, 자바 인스톨-타임 컴파일러(컴파일링 방식)의 경우, 도 1에 도시된 바와 같이 자바 JIT 컴파일러와 마찬가지로 클라이언트 측에서 변환 작업을 수행하지만 응용프로그램을 수행하기 전에 미리 변환 작업을 수행하기 때문에, 플랫폼 독립성을 유지하면서도, 수행시간 낭비를 걱정하지 않고 많은 최적화를 수행할 수 있게 되며, 응용프로그램 수행 중 반응시간도 예측 가능하게 된다. 하지만 인스톨-타임 컴파일러에 의해 변환된 결과물인 이진 파일을 저장하는 공간이 추가로 필요하게 되며 런타임 정보를 이용한 최적화는 적용하지 못하게 된다는 문제점이 여전히 있다.Finally, in the case of the Java install-time compiler (compile method), as shown in Fig. 1, the conversion is performed on the client side like the Java JIT compiler, but before the application is executed, the conversion is performed in advance. While maintaining platform independence, many optimizations can be performed without worrying about wasting execution time, and response time during application execution is predictable. However, there is still a problem that an additional space for storing the binary file, which is the result of the conversion by the install-time compiler, is needed, and optimization using runtime information is not applicable.

본 발명은 기존에 제안된 방법들의 상기와 같은 문제점들을 해결하기 위해 제안된 것으로서, 응용프로그램 분석에 기초하여, 인스톨-타임 컴파일러를 참조 접근 최적화 및 메모리 사용량을 고려한 최적화를 통해 최적화시킴으로써, 구현하기 어려운 최적화의 구현을 가능하게 하며, 특히 메모리가 적은 내장형 시스템의 메모리 효율성을 높일 수 있게 한 인스톨-타임 컴파일러를 제공하는 것을 그 목적으로 한다.The present invention is proposed to solve the above problems of the conventionally proposed methods, and it is difficult to implement by optimizing the install-time compiler through the optimization considering the reference access and the memory usage based on the application analysis. Its purpose is to provide an install-time compiler that enables the implementation of optimizations and, in particular, improves the memory efficiency of low-memory embedded systems.

상기한 목적을 달성하기 위한 본 발명의 특징에 따른, 내장형 자바시스템을 위한 인스톨-타임 컴파일러는,According to a feature of the present invention for achieving the above object, an install-time compiler for an embedded Java system,

(1) 응용프로그램 메모리(Mapp)만을 사용하며, 외부로부터 입력되는 입력 Jar 파일에 포함되어 있는 클래스 파일 및 리소스 파일 목록을 읽어 들이는 응용프로그램 리더부;(1) an application program reader unit using only an application program memory M app and reading a list of class files and resource files included in an input Jar file input from the outside;

(2) 응용프로그램 메모리(Mclass)만을 사용하며, 클래스 파일들을 읽어 들이고 바이트코드를 검증하는 클래스 파일 리더/바이트코드 검증부;(2) a class file reader / byte code verification unit which uses only application program memory (M class ) and reads class files and verifies byte codes;

(3) 메소드 메모리(Mmethod)를 사용하여 변환 작업을 수행하되, 변환 중 최적화할 참조를 접근하는 바이트코드를 만나게 되면 상기 응용프로그램 메모리(Mapp)에 참조 리스트를 만들고, 상기 응용프로그램 메모리(Mapp)의 참조 리스트를 참조하여 코드를 생성하는 바이트코드 변환부;(3) Perform a conversion operation using a method memory (M method ), and if a byte code that accesses a reference to be optimized is encountered during conversion, a reference list is created in the application memory (M app ), and the application memory ( A bytecode conversion unit generating a code by referring to a reference list of M app );

(4) 클래스 메모리(Mclass)만을 사용하며, 상기 파일 리더/바이트코드 검증부로부터 검증된 클래스 데이터 구조 및 런타임 함수들을 저장하는 클래스 데이터구조/런타임 함수부;(4) a class data structure / runtime function unit using only class memory (M class ) and storing class data structures and runtime functions verified from the file reader / bytecode verification unit;

(5) 응용프로그램 메모리(Mapp)만을 사용하며, 상기 생성된 코드를 플랫폼 상에서 실행 가능하도록 바인딩 및 재배치 처리를 통하여 수정하는 바인딩/재배치부;(5) a binding / relocation unit that uses only application program memory M app and modifies the generated code through a binding and relocation process to be executed on a platform;

(6)응용프로그램 메모리(Mapp)만을 사용하며, 상기 바인딩/재배치부로부터 전송된 클래스 파일을 이진 파일로 생성하는 이진 파일 생성부; 및(6) a binary file generation unit using only an application memory M app and generating a class file transmitted from the binding / relocation unit as a binary file; And

(7) 응용프로그램 메모리(Mapp)만을 사용하며, 상기 이진 파일 생성부에서 생성된 이진 파일을 출력 Jar 파일로 압축하여 자바 가상머신으로 전송하는 Jar 압축부를 포함하는 것을 그 구성상의 특징으로 한다.
(7) It uses the application program memory (M app ) only, and comprises a Jar compression unit for compressing the binary file generated by the binary file generating unit to an output Jar file to transmit to the Java virtual machine.

바람직하게는, 상기 바이트코드 변환부는,Preferably, the bytecode conversion unit,

상기 응용프로그램 메모리(Mapp)의 참조 리스트에 없는 새로운 참조 접근이 나오게 되면, 상기 응용프로그램 메모리(Mapp)에 상기 새로운 참조를 추가
The application memory (M app) if the reference is a new reference access is not in the list out, the application memory add the new reference (M app) of

바람직하게는, 상기 바이트코드 변환부는,Preferably, the bytecode conversion unit,

상기 파일 리더/바이트코드 검증부로부터 입력되는 바이트코드를 IR로 변환하고 최적화를 수행하는 IR 생성/최적화부;An IR generation / optimizer for converting byte codes inputted from the file reader / byte code verification unit into IR and performing optimization;

상기 IR 생성/최적화부의 후단에 배치되어, 레지스터를 할당하는 레지스터 할당부; 및A register allocating unit arranged at a rear end of the IR generation / optimizing unit to allocate a register; And

상기 레지스터 할당부의 후단에 배치되어, 코드를 생성하는 코드 생성부를 포함할 수 있다.It may be disposed after the register allocation unit, and may include a code generation unit for generating a code.

본 발명에서 제안하고 있는, 내장형 시스템을 위한 인스톨-타임 컴파일러에 따르면, 응용프로그램 분석에 기초하여, 인스톨-타임 컴파일러를 참조 접근 최적화 및 메모리 사용량을 고려한 최적화를 통해 최적화시킴으로써, 구현하기 어려운 최적화의 구현을 가능하게 하며, 특히 메모리가 적은 내장형 시스템의 메모리 효율성을 높일 수 있게 한다.According to the install-time compiler for the embedded system proposed by the present invention, the optimization of the install-time compiler based on the analysis of the application through the optimization of the reference access optimization and the memory usage, thereby implementing an optimization that is difficult to implement. This enables high memory efficiency, especially for embedded systems with low memory.

도 1은 내장형 시스템을 위한 3가지 컴파일러(컴파일링 방식)의 구성을 비교하여 나타내는 도면.
도 2는 본 발명의 일 실시예에 따른, 내장형 시스템을 위한 인스톨-타임 컴파일러의 구성을 나타내는 도면.
도 3은 본 발명의 일 실시예에 따른 인스톨-타임 컴파일러(컴파일러 방식)에서 참조를 공유하기 전과 후의 성능 차이를 비교한 그래프.
도 4는 본 발명의 일 실시예에 따른 인스톨-타임 컴파일러(컴파일러 방식)에서 참조 접근을 위한 자료구조가 생성되는 파일의 크기를 증가시키는 비율을, 참조의 중복을 제거하기 전과 후를 비교하여 나타낸 그래프.
도 5는 응용프로그램 수행 시 최대 메모리 사용량 대비 본 발명에서 제안하고 있는 인스톨-타임 컴파일러의 최대 메모리 사용량의 비율을 나타내는 그래프.
BRIEF DESCRIPTION OF THE DRAWINGS The figure which compares and shows the structure of three compilers (compile method) for embedded systems.
2 illustrates the configuration of an install-time compiler for an embedded system, in accordance with an embodiment of the present invention.
3 is a graph comparing performance differences before and after sharing a reference in an install-time compiler (compiler method) according to an embodiment of the present invention.
FIG. 4 illustrates a ratio of increasing a size of a file in which a data structure for reference access is generated in an install-time compiler (compiler method) according to an embodiment of the present invention, compared with before and after removing duplicate references. graph.
5 is a graph showing the ratio of the maximum memory usage of the install-time compiler proposed in the present invention to the maximum memory usage when running the application program.

이하에서는 첨부된 도면들을 참조하여, 본 발명에 따른 실시예에 대하여 상세하게 설명하기로 한다.
Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 2는 본 발명의 일 실시예에 따른, 내장형 시스템을 위한 인스톨-타임 컴파일러의 구성을 나타내는 도면이다. 도 2에 도시된 바와 같이, 본 발명의 일 실시예에 따른 내장형 시스템을 위한 인스톨-타임 컴파일러(200)는, 응용프로그램 리더부(205),클래스 파일 리더/바이트코드 검증부(210), 바이트코드 변환부(220), 클래스 데이터구조/런타임 함수부(260), 바인딩/재배치부(230), 이진 파일 생성부(240), 및 Jar 압축부(250)를 포함하여 구성될 수 있다.
2 is a diagram illustrating a configuration of an install-time compiler for an embedded system according to an exemplary embodiment of the present invention. As shown in FIG. 2, the install-time compiler 200 for an embedded system according to an exemplary embodiment of the present invention may include an application program reader 205, a class file reader / byte code verifier 210, and a byte. The code conversion unit 220, the class data structure / runtime function unit 260, the binding / relocation unit 230, the binary file generation unit 240, and the Jar compression unit 250 may be configured.

응용프로그램 리더부(205)는, 외부로부터 입력되는 입력 Jar 파일에 포함되어 있는 클래스 파일 및 리소스 파일 목록을 읽어 들인다.
The application program reader 205 reads a list of class files and resource files included in an input Jar file input from the outside.

클래스 파일 리더/바이트코드 검증부(210)는, 외부로부터 입력되는 입력 Jar 파일 중에서 클래스 파일들을 읽어 들이고, 바이트코드를 검증한다. 본 발명의 일 실시예에 따른 인스톨-타임 컴파일러(200)에서 외부 입력 파일은 Jar 파일을 가정하고 있지만, 이것으로 제한되는 것은 아니다. Jar 파일은, 응용프로그램과 클래스 파일, 및 기타 이미지 등 각종 자원(리소스 파일)을 포함한다.
The class file reader / byte code verification unit 210 reads class files from an input Jar file input from the outside and verifies the byte code. In the install-time compiler 200 according to an embodiment of the present invention, the external input file assumes a Jar file, but is not limited thereto. Jar files contain various resources (resource files) such as application programs, class files, and other images.

바이트코드 변환부(220)는, 클래스 파일 리더/바이트코드 검증부(210)로부터 입력된 바이트코드에 대하여 IR 변환 및 최적화를 수행하고, 레지스터를 할당하며 코드를 생성한다. 이때, 본 발명에서 바이트코드 변환부(220)는, 메소드 메모리(Mmethod)를 사용하는데, 변환 중 참조에 접근하는 바이트코드를 만나게 되면 응용프로그램 메모리(Mapp)의 참조 리스트를 참조하여 코드를 생성하며, 응용프로그램 메모리(Mapp)의 참조 리스트에 없는 새로운 참조 접근이 나오게 되면, 응용프로그램 메모리(Mapp)에 새로운 참조를 추가한다. 즉, 바이트코드 변환부(220)에서 참조 접근을 위해 메소드 메모리(Mmethod)를 이용하는 것이 아니라, 응용프로그램 메모리(Mapp)의 참조 리스트를 참조하여, 메소드나 클래스 파일마다 별도의 참조 리스트를 만들지 않는다는 점이 본 발명의 중요한 특징 중 하나이다.
The bytecode converter 220 performs IR conversion and optimization on the bytecode input from the class file reader / bytecode verifier 210, allocates a register, and generates a code. At this time, when the bytecode conversion unit 220 in the present invention is to use the method memory (M method), to meet the bytecodes that access to the reference of the transformation refer to the list of application memory (M app) by the code and generating, when a new access is not referenced in the reference list of the application memory (M app) come out, and add a new reference to an application memory (M app). That is, instead of using the method memory (M method ) for reference access in the bytecode conversion unit 220, do not create a separate reference list for each method or class file by referring to the reference list of the application memory (M app ). Is not an important feature of the present invention.

이와 같은 바이트코드 변환부(220)는, 도 2에 도시된 바와 같이, 파일 리더/바이트코드 검증부(210)로부터 입력되는 바이트코드를 IR로 변환하고 최적화를 수행하는 IR 생성/최적화부(222), IR 생성/최적화부(222)의 후단에 배치되어, 레지스터를 할당하는 레지스터 할당부(224), 및 레지스터 할당부(224)의 후단에 배치되어, 코드를 생성하는 코드 생성부(226)로 구성될 수 있다.
As shown in FIG. 2, the bytecode conversion unit 220 converts the bytecode input from the file reader / bytecode verification unit 210 into an IR and performs an optimization of the IR generation / optimization unit 222. ), A register allocating unit 224 disposed at the rear end of the IR generation / optimizing unit 222 to allocate a register, and a code generating unit 226 arranged at the rear end of the register allocating unit 224 to generate a code. It can be configured as.

클래스 데이터구조/런타임 함수부(260)는, 파일 리더/바이트코드 검증부(210)로부터 검증된 클래스 데이터 구조 및 런타임 함수들을 저장한다. 이때, 클래스 데이터구조/런타임 함수부(260)는, 클래스 메모리(Mclass)만을 사용한다. 즉, 본 발명에서는, 클래스 데이터구조 및 런타임 함수는 메소드 메모리(Mmethod)나 응용프로그램 메모리(Mapp)를 이용하여 저장되는 것이 아니라, 클래스 메모리(Mclass)만을 이용하여 저장된다.
The class data structure / runtime function unit 260 stores class data structures and runtime functions verified from the file reader / byte code verifier 210. At this time, the class data structure / runtime function unit 260 uses only class memory (M class ). That is, in the present invention, the class data structure and the runtime function are not stored using the method memory (M method ) or the application program memory (M app ), but only using the class memory (M class ).

바인딩/재배치부(230)는, 바이트코드 변환부(220)에서 생성된 코드를, 클래스 데이터구조/런타임 함수부(260)를 참조하여 바인딩하고 재배치하여 클래스 파일이 플랫폼상에서 실행 가능하도록 한다. 이때, 바인딩/재배치부(230)는 응용프로그램 메모리(Mapp)만을 이용한다.
The binding / relocation unit 230 binds and rearranges the code generated by the bytecode conversion unit 220 with reference to the class data structure / runtime function unit 260 so that the class file is executable on the platform. In this case, the binding / relocating unit 230 uses only the application program memory M app .

이진 파일 생성부(240)는, 바인딩/재배치부(230)로부터 전송된 클래스 파일을 이진 파일로 생성하며, 이렇게 이진 파일 생성부(240)에서 생성된 이진 파일은 Jar 압축부(250)에서 출력 Jar 파일로 압축되어 자바 가상머신으로 전송된다. 이진 파일 생성부(240) 및 Jar 압축부(250)는, 바인딩/재배치부(230)와 마찬가지로, 응용프로그램 메모리(Mapp)만을 이용한다.
The binary file generator 240 generates a class file transmitted from the binding / relocator 230 as a binary file, and the binary file generated by the binary file generator 240 is output from the jar compressor 250. It is compressed into a Jar file and sent to the Java virtual machine. Like the binding / relocating unit 230, the binary file generating unit 240 and the jar compressing unit 250 use only the application program memory M app .

이하에서는, 인스톨-타임 컴파일러의 구현 시 고려해야 하는 사항들에 대하여 구체적으로 살펴보고, 이를 기반으로 본 발명의 일 실시예에 따른 인스톨-타임 컴파일러를 구현하고 그 성능을 평가해 보기로 한다. 구체적으로, 인스톨-타임 컴파일러와 관련하여, 효율적인 코드 생성을 위해 응용프로그램을 분석하여, 참조 접근 최적화, 및 메모리의 사용량의 특성을 다음과 같이 고려해 본다.
Hereinafter, the matters to be considered in the implementation of the install-time compiler will be described in detail. Based on this, the install-time compiler according to an embodiment of the present invention will be implemented and the performance thereof will be evaluated. Specifically, in relation to the install-time compiler, the application program is analyzed for efficient code generation, and the characteristics of reference access optimization and memory usage are considered as follows.

1. 응용프로그램에 대한 분석
1. Analysis of the application

본 발명에서는, 다음 표 1에 기재된 9개의 응용프로그램을 분석하여 효율적인 인스톨-타임 컴파일러(컴파일링 방식)를 구현하기 위한 방법들을 제안한다. 아래 표 1에 기재된 9개의 분석 대상 응용프로그램을 살펴보면, 처음 3개의 응용프로그램인 armflo, manyballs 및 midpman은 사용자 입력을 받아들이는 프로그램이며, 각각 3D 응용프로그램, 2D 응용프로그램, 및 게임으로 구성된다. 또한, 나머지 6개의 응용프로그램은, 표 1에 기재된 바와 같이 내장형 자바 가상머신의 성능을 측정할 때 널리 사용되는 JKernelmark, 및 EEMBC에서 선택된 5개의 성능 측정 응용프로그램으로 구성하였다.The present invention proposes methods for implementing an efficient install-time compiler (compile method) by analyzing nine applications described in Table 1 below. Looking at the nine analyzed applications listed in Table 1 below, the first three applications, armflo, manyballs, and midpman, accept user input and consist of 3D applications, 2D applications, and games, respectively. In addition, the remaining six applications consisted of five performance measurement applications selected from JKernelmark and EEMBC, which are widely used when measuring the performance of embedded Java virtual machines, as shown in Table 1.

응용프로그램Application 설명Explanation armfloarmflo 3D 응용프로그램 (유저입력)3D application (user input) manyballsmanyballs 2D 응용프로그램 (유저입력)2D application (user input) midpmanmidpman 멀티스레드 사용한 게임 (유저입력)Multithreaded game (user input) JKernelMarkJKernelMark 6개의 성능 작은 테스트 코드 포함Includes six performance small test codes chesschess 자동 체스 게임 시물레이션(EEMBC)Automatic Chess Game Simulation (EEMBC) cryptocrypto 다양한 암호화 복호화(EEMBC)Various encryption decryption (EEMBC) kxmlkxml XML 파싱(EEMBC)XML parsing (EEMBC) parallelparallel 멀티스트레드 프로그램(EEMBC)Multithreaded Program (EEMBC) pngpng PNG 이미지 파일 디코딩(EEMBC)PNG image file decoding (EEMBC)

2. 참조 접근 최적화
2. Reference Access Optimization

전통적인 최적화 기법 외에 인스톨-타임 컴파일러가 활용할 수 있는 정보로는 내장형 시스템이 다운로드 받은 자바 응용프로그램 전체를 알고 있다는 점이다. 자바 응용프로그램은 자바 가상머신이 이해하는 자바 바이트코드로 작성되어 있으며, 메소드 호출 및 참조들은 자바 가상머신에서 수행될 때 이름과 타입을 가지고 실제 메소드와 참조들을 찾아 수행하게 되어 있다. 인스톨-타임 컴파일러는 자바 응용프로그램이 내장형 시스템에 탑재되어 있는 자바 가상머신에서 동작함을 인식하고 있으며, 메소드 호출 및 참조는 모드 응용프로그램과 자바 가상머신 내에서 이루어짐을 인식한다. 따라서 인스톨-타임 컴파일러는 인식된 것을 토대로 변환 대상이 되는 응용프로그램에서의 메소드 호출 및 참조들을 미리 해석하여 최적화된 코드를 생성할 수 있게 되며, 이렇게 생성된 코드는 수행 성능이 향상될 수 있다. 실제로 이러한 최적화를 적용하기 전에 위에서 선택된 응용프로그램에서 참조들의 비율을 측정해 보고 그 가능성을 확인해보기로 한다.
In addition to traditional optimization techniques, the information available to the install-time compiler is that the embedded system knows the entire Java application downloaded. Java applications are written in Java bytecode that the Java virtual machine understands, and method invocations and references are used to find and execute actual methods and references with names and types when executed in the Java virtual machine. The install-time compiler recognizes that Java applications run on the Java virtual machine embedded in the embedded system, and that method calls and references are made within the mode application and the Java virtual machine. Therefore, the install-time compiler can generate optimized code by interpreting method calls and references in the application to be converted based on the recognized information, and the generated code can improve performance. Before actually applying this optimization, let's measure the ratio of references in the application selected above and see the possibilities.

다음 표 2는 전체 바이트코드의 개수 중에서 실제로 각 종류의 참조들이 접근되는 바이트코드의 개수를 측정하여 비율로 표시한 것이다. 표 2에서, s.m.은 전체 바이트코드의 개수에서 정적 메소드(static method)에 접근하는 바이트코드의 비율을, v.m.은 전체 바이트코드의 개수에서 가상 메소드(virtual method)에 접근하는 바이트코드의 비율을, i.m.은 전체 바이트코드의 개수에서 인터페이스 메소드(interface method)에 접근하는 바이트코드의 비율을, s.f.는 전체 바이트코드의 개수에서 정적 필드(static field)에 접근하는 바이트코드의 비율을, i.f.은 전체 바이트코드의 개수에서 인터페이스 필드(interface field)에 접근하는 바이트코드의 비율을 각각 측정한 것이다. 표 2를 살펴보면, 자바 응용프로그램은 매우 많은 참조를 가지고 있음을 확인할 수 있다.Table 2 below shows the percentage of the total number of bytecodes measured by the number of bytecodes to which each kind of reference is actually accessed. In Table 2, sm is the ratio of bytecodes to accessing static methods in the total number of bytecodes, and vm is the ratio of bytecodes to accessing virtual methods in the total number of bytecodes. im is the ratio of bytecodes accessing the interface method to the total number of bytecodes, sf is the ratio of bytecodes accessing the static field to the total number of bytecodes, and if is total bytes The ratio of bytecodes accessing an interface field to the number of codes is measured, respectively. Looking at Table 2, you can see that Java applications have a lot of references.

프로그램program ClassClass s.ms.m v.m.v.m. i.m.i.m. s.f.s.f. i.f.i.f. armfloarmflo 27.327.3 4.04.0 5.45.4 0.00.0 0.90.9 9.99.9 manyballsmanyballs 35.235.2 2.52.5 6.96.9 0.00.0 2.42.4 16.516.5 midpmanmidpman 11.211.2 0.30.3 1.51.5 0.00.0 0.00.0 9.09.0 JKernelMarkJKernelMark 35.835.8 4.64.6 7.97.9 0.80.8 0.90.9 11.411.4 chesschess 29.429.4 3.63.6 5.65.6 0.00.0 0.20.2 12.912.9 cryptocrypto 11.011.0 2.12.1 1.41.4 0.10.1 0.60.6 2.82.8 kxmlkxml 38.438.4 5.05.0 12.212.2 0.10.1 0.40.4 10.310.3 parallelparallel 4.04.0 0.60.6 0.80.8 0.00.0 0.10.1 1.21.2 pngpng 27.627.6 4.84.8 5.35.3 0.00.0 0.30.3 8.68.6

특히, 개별 참조들의 비율을 모두 합산하면, 응용프로그램 kxml의 경우 매우 높은 비율의 참조를 가지고 있는 것을 확인할 수 있다. 하지만 많은 참조들이 실제로는 같은 참조를 여러 바이트코드에서 접근하는 경우도 있기에 이를 측정해 보았다. 실제로 위 참조 중에서 중복되는 경우를 제외하고 다시 측정하였다. 다음 표 3은 각 참조들이 중복된 참조를 제외하고 서로 다른 참조에 접근하는 비율을 보여주고 있다.In particular, if you add up the proportions of the individual references, you can see that the application kxml has a very high proportion of references. However, we measured this because many references actually access the same reference from multiple bytecodes. In fact, the measurements were repeated except for duplicates of the above references. Table 3 below shows the rate at which each reference accesses different references except duplicate references.

프로그램program ClassClass s.ms.m v.m.v.m. i.m.i.m. s.f.s.f. i.f.i.f. armfloarmflo 1.81.8 5.25.2 22.922.9 0.00.0 25.025.0 16.216.2 manyballsmanyballs 5.55.5 51.951.9 52.052.0 0.00.0 19.219.2 16.216.2 midpmanmidpman 2.02.0 57.957.9 31.431.4 0.00.0 0.00.0 10.810.8 JKernelMarkJKernelMark 4.84.8 24.324.3 34.434.4 0.00.0 14.314.3 16.816.8 chesschess 2.82.8 7.47.4 27.627.6 100.0100.0 23.823.8 15.515.5 cryptocrypto 3.53.5 8.58.5 33.933.9 4.54.5 21.221.2 16.916.9 kxmlkxml 3.33.3 13.313.3 23.923.9 100.0100.0 26.126.1 18.918.9 parallelparallel 5.45.4 15.915.9 27.027.0 100.0100.0 27.827.8 26.526.5 pngpng 4.54.5 12.412.4 27.427.4 100.0100.0 25.025.0 19.419.4

상기 표 3을 살펴보면 몇 가지 특징들을 발견할 수 있다.
Looking at Table 3, several features can be found.

우선, 자바 응용프로그램에서 매우 많이 나타나던 클래스(class) 접근 중 실제로 다른 클래스에 접근하는 비율은 5%이하에 불과하다는 점이다. 이는 평균적으로 약 20개의 클래스 접근은 중복된다는 것을 의미하며, 실제로 프로그램에서 사용하는 클래스는 매우 제한적임을 확인할 수 있다.
First, less than 5% of the class accesses that are very common in Java applications actually access other classes. This means that, on average, about 20 class accesses are redundant, and the classes actually used in the program are very limited.

반면에, 메소드(method)와 필드(field)에 접근하는 것들은 중복이 상대적으로 적었으며 이는 객체 지향 프로그래밍(Object Oriented Programming)을 지원하는 자바와 같은 언어에서 메소드와 필드에 접근하는 부분이 많으므로 이해되는 부분이다.
On the other hand, accessing methods and fields has relatively little duplication, which is understood by the fact that there are many ways to access methods and fields in languages such as Java that support Object Oriented Programming. It is a part.

마지막으로, 인터페이스 메소드(i.m.)의 경우 위 프로그램에서 실제로 사용되는 경우가 매우 적어, 응용프로그램 chess의 경우 1개, 100%가 나오는 경우가 있었으며, 응용프로그램 crypto와 같이 상대적으로 많은 인터페이스 메소드 접근이 있을 경우 다른 참조에 접근하는 경우와 마찬가지로 중복되는 경우가 많았다.
Lastly, the interface method (im) is rarely used in the above program, and there is one case of 100% of the application chess, and there are relatively many interface method accesses such as application crypto. There were many cases of duplicates, as in the case of accessing other references.

이와 같은 분석으로 인스톨-타임 컴파일러(컴파일링 방식)에서 각 참조들의 중복을 제거하는 기법을 적용하면 중복 때문에 발생되는 여러 오버헤드를 줄일 수 있을 것으로 판단된다. 자바 응용프로그램이 중복되는 오버헤드를 정리해보면 크게 다음과 같다.
With this analysis, we can reduce the overhead caused by duplication by applying the deduplication of each reference in the install-time compiler (compilation method). The overhead of duplicating Java applications is as follows.

우선, 자바 프로그램의 각 참조들은 자바 가상머신에서 클래스를 로딩할 때와 수행 중에 실제로 접근하는 참조의 메모리 주소를 찾게 된다. 하지만 이러한 방식은 수행 중에 서로 다른 바이트코드에서 같은 참조에 접근하더라도 바이트마다 실제 참조의 메모리 주소를 매번 찾게 되어 수행 성능 저하를 가져올 수 있다. 이를 한번 찾은 참조의 메모리 주소를 다시 찾지 않도록 하면 수행 성능을 향상시킬 수 있다.
First, each reference in a Java program finds the memory address of the reference that it actually accesses when loading the class in the Java virtual machine and at runtime. However, even if the same reference is accessed from different bytecodes during execution, this method finds the memory address of the actual reference every byte, which may cause performance degradation. You can improve performance by avoiding looking back the memory address of the reference once found.

또한, 자바 응용프로그램은 참조를 이름과 타입으로 찾기 때문에 클래스 파일 내에는 해당 참조의 이름과 타입을 스트링으로 가지고 있게 된다. 이러한 스트링은 클래스 파일 중 상수 풀(constant pool) 영역에 저장되게 되며, 스트링 형태로 저장되어 있다 보니 상대적으로 단순한 메모리 주소보다는 많은 파일 공간을 필요로 하게 된다. 물론 클래스 파일은 하나의 클래스 내에서 중복되는 참조들의 이름과 타입은 하나의 스트링을 공유하도록 하여 공간을 절약한다. 하지만 서로 다른 클래스에서 중복되는 참조의 이름과 타입은 공유하지 못하고 있어, 만약 본 발명에서 서로 다른 클래스에서 중복되는 참조에 대해서도 이름과 타입을 공유할 경우 추가로 공간을 절약할 수 있다.
Also, because Java applications look up references by name and type, they have the name and type of the reference as a string in the class file. These strings are stored in the constant pool area of class files, and because they are stored as strings, they require more file space than relatively simple memory addresses. Of course, class files save space by allowing duplicate names and types of references within a class to share a single string. However, since the names and types of duplicate references in different classes cannot be shared, if the names and types are also shared in the different classes in the present invention, space can be additionally saved.

그리고 마지막으로 같은 참조들의 주소 영역을 공유함으로써 절약된 메모리 공간을 추가로 절약할 수 있다.
And finally, you can save additional memory space by sharing the address range of the same references.

3. 메모리 사용량
3. Memory usage

인스톨-타임 컴파일러로 변환된 자바 응용프로그램의 성능 외에도 인스톨-타임 컴파일러 자체가 메모리가 적은 내장형 시스템에서 동작해야 하므로 인스톨-타임 컴파일러 자체의 메모리 사용량을 고려해야 한다. 일반적으로 최적화가 적용되는 컴파일러들은 코드 생성을 위한 작업을 진행하는 동안 다양한 분석(analysis)과 방대한 중간 코드(Intermediate representation)를 생성한다. 앞서 설명한 참조 접근들의 최적화를 위해서 응용프로그램 전체를 분석하는 경우에는 메모리 사용량이 더욱 늘어날 수밖에 없다. 따라서 본 발명에서 제안하는 컴파일러(컴파일링 방식)에서는 참조 접근 최적화와 같이 여러 클래스를 모두 분석해야 하는 기법들과 개별 최적화들을 분리하여 메모리 사용량이 필요 이상으로 커지지 않도록 한다.
In addition to the performance of Java applications converted by the install-time compiler, the install-time compiler itself must run on a low-memory embedded system, so you must consider the memory usage of the install-time compiler itself. In general, compilers with optimizations generate a variety of analysis and extensive intermediate representations while working on code generation. When analyzing the entire application to optimize the above-mentioned reference approaches, the memory usage is further increased. Therefore, the compiler (compilation method) proposed in the present invention separates the optimizations and the individual optimizations that must analyze all classes such as reference access optimization, so that the memory usage does not become larger than necessary.

구체적인 방법을 살펴보면, 우선 자바 응용프로그램 전체를 분석해야 하는 부분은 클래스들을 하나씩 읽어 들이면서 최적화할 참조들만 추후 메모리 주소를 얻을 수 있는 저장 리스트에 담아 두고 최적화는 뒤로 미루어 둔다. 이와 동시에 읽어 들인 하나의 클래스에 속한 메소드들은 메소드 단위로 변환하고 최적화를 적용하여 최적화된 머신 코드를 생성한다. 이렇게 생성된 머신 코드들은 참조 접근들에 대해서는 앞에서 생성한 리스트에 접근하도록 코드가 생성된다. 선택된 클래스가 모두 변환되면 리스트와 몇몇 자료구조를 제외하고 모든 사용 중인 메모리는 반납한다.
Looking at the concrete method, the first part of the entire Java application is to read the classes one by one, storing only the references to be optimized in a save list where the memory address can be obtained later, and defer the optimization. At the same time, the methods belonging to one class read are converted into method units and applied optimization to generate optimized machine code. The machine code thus generated is coded to access the list created earlier for reference accesses. When all selected classes are converted, all memory in use is returned, except for lists and some data structures.

이와 같은 방법으로 변환을 수행하면, 인스톨-타임 컴파일러의 최대 메모리 사용량은 기본적인 자료구조 및 리스트 그리고 현재 변환중인 클래스를 위한 자료구조의 크기로 결정된다. 물론 이 경우 변환하는 클래스 자체의 크기가 큰 경우도 있으므로, 이 부분도 2단계로 메소드 단위로 변환한 후 더 이상 필요 없는 메모리를 반납하는 과정이 필요하다.
In this way, the maximum memory usage of the install-time compiler is determined by the size of the underlying data structures and lists, and the data structures for the class currently being converted. Of course, in this case, the size of the converting class itself is large, so this part also needs to be converted into method units in two steps, and the memory that is no longer needed is returned.

메모리 할당 및 반납의 관점에서 본 발명에서 제안하고 있는 인스톨-타임 컴파일러(컴파일링 방식)의 변환 단계를 살펴보면 다음과 같다.
The conversion steps of the install-time compiler (compile method) proposed by the present invention in terms of memory allocation and return are as follows.

1. 응용프로그램 최적화를 위한 응용프로그램 메모리(Mapp) 할당1. Allocate application memory (M app ) for application optimization

예: 참조 리스트(resolve list)Example: resolve list

2. 하나의 클래스를 위한 클래스 메모리(Mclass) 할당2. Allocating class memory (M class ) for one class

2.1 현재 클래스 내의 각 메소드 선택2.1 Select each method in the current class

2.2 선택된 메소드를 위한 메소드 메모리(Mmethod) 할당2.2 Method memory (M method ) allocation for selected method

2.3 완료된 메소드를 위한 메소드 메모리(Mmethod) 반납2.3 Returning method memory (M method ) for completed methods

2.4 단계 2.1로 가서 다음 메소드에 대하여 동일한 과정 반복 수행2.4 Go to step 2.1 and repeat the same process for the next method

3. 현재 클래스 변환 후 클래스 메모리(Mclass) 반납3. Return class memory (M class ) after converting current class

4. 단계 2로 가서 다음 클래스에 대하여 동일한 과정 반복 수행4. Go to step 2 and repeat the same process for the next class

5. 모든 클래스 변환 후 클래스 응용프로그램 메모리(Mapp) 반납
5. Return class application memory (M app ) after converting all classes

이와 같이 진행하면, 본 발명에서 제안하고 있는 인스톨-타임 컴파일러(컴파일링 방식)의 어느 한 순간의 메모리 사용량(Mtotal)은 다음 수학식 1과 같이 결정될 수 있다.In this way, the memory usage M total at any one time of the install-time compiler (compile method) proposed by the present invention may be determined as in Equation 1 below.

Figure 112010001391065-pat00001
Figure 112010001391065-pat00001

또한, 최대 메모리 사용량은 상대적으로 많은 최적화와 중간코드(Intermediate Representation) 생성에 사용되는 메소드 메모리(Mmethod)에 의해서 결정되게 될 것이며, 클래스 메모리(Mclass)와 메소드 메모리(Mmethod)는 변환하는 클래스와 메소드에 의해서 영향을 받기 때문에 실제 구현 후 실험을 통해서 검증해야 한다.
In addition, the maximum memory usage will be determined by the method memory (M method ) used for relatively large optimizations and intermediate representation (Intermediate Representation) generation, class memory (M class ) and method memory (M method ) Because it is affected by classes and methods, it must be verified by experiment after actual implementation.

4. 실험 및 평가
4. Experiment and Evaluation

본 발명에서 제안하고 있는, 참조 접근 최적화와 효율적인 메모리 사용 기법을 적용한 인스톨-타임 컴파일러(컴파일링 방식)를 J2ME(Java2 Micro edition) CLDC/MIDP 환경에서 구현하였다. 수행되는 마이크로프로세서는 ARM7이며, Thumb ISA를 이용하여 코드를 생성하였다. 그리고 실험에서는 앞에서 분석한 자바 응용프로그램들을 이용하여 본 발명에서 제안하고 있는 인스톨-타임 컴파일러(컴파일링 방식)를 평가하였다.
The install-time compiler (compilation method) applying the reference access optimization and the efficient memory usage scheme proposed in the present invention is implemented in J2ME (Java2 Micro edition) CLDC / MIDP environment. The microprocessor executed is ARM7, and the code was generated using Thumb ISA. In the experiment, we evaluated the install-time compiler (compile method) proposed in the present invention using the Java applications analyzed above.

도 3 내지 도 5는 본 발명의 일 실시예에 따른, 내장형 자바 시스템을 위한 인스톨-타임 컴파일러(컴파일러 방식)의 성능을 평가한 그래프를 나타내는 도면이다.
3 to 5 are graphs illustrating performance of an install-time compiler (compiler method) for an embedded Java system according to an embodiment of the present invention.

먼저, 도 3은 본 발명의 일 실시예에 따른 인스톨-타임 컴파일러(컴파일러 방식)에서 참조를 공유하기 전과 후의 성능 차이를 비교한 그래프이다. 가로축은 각각의 응용프로그램을 나타내고, 세로축은 성능 향상 비율을 나타낸다. 여기서, 사용자의 입력에 따라 행동이 달라지는 자바 응용프로그램인 armflo, manyballs 및 midpman은 성능을 측정하지 않았다. 대신에, 자바 응용프로그램 JKernelmark의 5개의 작은 벤치마크들을 분리하여 측정하였다. 도 3으로부터, 본 발명에서 제안하고 있는 인스톨-타임 컴파일러(컴파일링 방식)를 적용할 경우, 기하학적 평균으로 약 5%의 성능 향상을 얻을 수 있음을 확인할 수 있었으며, 이는 순수하게 참조 접근 바이트코드에서 찾은 메모리 주소를 공유하여 얻을 수 있는 성능 향상이다. 하지만 단순 계산 연산이 성능을 결정하는 logic과 같은 벤치마크에서는 성능 향상 효과가 상대적으로 적었다.
First, FIG. 3 is a graph comparing performance differences before and after sharing a reference in an install-time compiler (compiler method) according to an embodiment of the present invention. The horizontal axis represents each application program, and the vertical axis represents the performance improvement rate. Here, armflo, manyballs, and midpman, Java applications whose behavior depends on user input, did not measure performance. Instead, we measured five small benchmarks of the Java application JKernelmark separately. From FIG. 3, it can be seen that when the install-time compiler (compile method) proposed in the present invention is applied, a 5% performance improvement can be obtained by geometric mean, which is purely in the reference access bytecode. This is a performance improvement that can be achieved by sharing the memory address found. However, in benchmarks such as logic where simple computations determine performance, the performance gains are relatively small.

다음으로, 도 4는 본 발명의 일 실시예에 따른 인스톨-타임 컴파일러(컴파일러 방식)에서 참조 접근을 위한 자료구조가 생성되는 파일의 크기를 증가시키는 비율을, 참조의 중복을 제거하기 전과 후를 비교하여 나타낸 그래프이다. 도 4에서, 가로축은 각각의 응용프로그램을 나타내고, 세로축은 오버헤드 비율을 나타낸다. 또한, 흑색 그래프는 중복 제거 전의 자료구조가 생성되는 파일의 크기를 나타내며, 빗살 그래프는 중복 제거 후의 자료구조가 생성되는 파일의 크기를 나타낸다. 도 4로부터, 참조의 중복을 제거하기 전에는 파일의 크기가 2~6.4% 증가되는데 비하여, 참조 최적화를 통해서 중복되는 참조들을 공유한 후에는 파일의 크기가 1~3%만 증가된 것을 확인할 수 있다. 파일 크기 증가의 세부 항목을 살펴보면 중복을 제거한 후에는 참조에 접근하기 위한 테이블의 크기는 1% 이내로 대폭 줄어들었다. 하지만, 중복을 제거하기 위한 추가적인 자료구조인 리스트가 필요하여 결국 1~3%정도의 파일 크기 증가를 나타내고 있다. 요약하면 중복되는 참조를 제거함으로써 얻은 이득이 더욱 커 파일의 크기를 줄였다. 이는 수행 중 코드 메모리 사용량에서도 같은 효과가 있다.
Next, FIG. 4 shows a ratio of increasing the size of a file in which a data structure for reference access is generated in an install-time compiler (compiler method) according to an embodiment of the present invention. It is a graph shown in comparison. In Fig. 4, the horizontal axis represents each application program, and the vertical axis represents the overhead ratio. Also, the black graph shows the size of the file in which the data structure before deduplication is created, and the comb graph shows the size of the file in which the data structure after deduplication is created. From FIG. 4, the size of the file is increased by 2 to 6.4% before the deduplication of the reference, whereas after sharing the duplicated references through the reference optimization, the size of the file is increased by only 1 to 3%. . Looking at the details of increasing file size, after eliminating redundancy, the size of the table to access the reference has been significantly reduced to within 1%. However, an additional data structure is needed to remove duplicates, which results in a file size increase of 1 to 3%. In summary, the benefits of eliminating duplicate references are even greater, reducing the file size. This has the same effect on code memory usage during execution.

마지막으로, 인스톨-타임 컴파일러의 변환 중 메모리 사용량을 측정하여, 본 발명의 일 실시예에 따라 구현된 인스톨-타임 컴파일러가 내장형 시스템에서 동작할 수 있는가를 확인하였다. 이를 위하여, 인터프리터 기반의 자바 가상머신에서 응용프로그램을 동작시켰을 때 최대로 사용하는 수행 중 메모리와, 본 발명에서 제안하고 있는 인스톨-타임 컴파일러가 변환 중 사용하는 최대 메모리를 비교하였다. 이와 같은 비교를 통하여, 실제 해당 응용프로그램이 수행할 수 있는 환경에서 본 발명에서 제안하고 있는 인스톨-타임 컴파일러가 메모리 문제없이 변환을 마칠 수 있다는 것을 보여줄 수 있기 때문이다. 도 5는 응용프로그램 수행 시 최대 메모리 사용량 대비 본 발명에서 제안하고 있는 인스톨-타임 컴파일러의 최대 메모리 사용량의 비율을 나타내는 그래프로서, 가로축은 각각의 응용프로그램을, 세로축은 메모리 사용량의 비율을 각각 나타낸다. 도 5로부터, 각각의 응용프로그램 수행 시 런타임 최대 메모리의 25.5% 이내에서, 본 발명에서 제안하고 있는 인스톨-타임 컴파일러가 메모리를 사용함을 확인할 수 있었으며, 이러한 결과로부터 본 발명에서 제안하고 있는 인스톨-타임 컴파일러가 내장형 자바 시스템에서 동작할 수 있음을 분명하게 확인할 수 있었다.
Finally, by measuring the memory usage during the conversion of the install-time compiler, it was confirmed whether the install-time compiler implemented according to an embodiment of the present invention can operate in the embedded system. To this end, we compared the maximum amount of in-memory memory used by an interpreter-based Java virtual machine to run an application program, and the maximum memory used by the install-time compiler proposed by the present invention during conversion. Through this comparison, it is possible to show that the install-time compiler proposed in the present invention can complete the conversion without a memory problem in an environment that can be actually executed by the corresponding application. 5 is a graph showing the ratio of the maximum memory usage of the install-time compiler proposed by the present invention to the maximum memory usage when the application program is executed. The horizontal axis represents each application program and the vertical axis represents the ratio of memory usage. From FIG. 5, it can be seen that the install-time compiler proposed by the present invention uses the memory within 25.5% of the maximum runtime at the time of executing each application program. From these results, the install-time proposed by the present invention is suggested. It was clear that the compiler could work on an embedded Java system.

이상 설명한 본 발명은 본 발명이 속한 기술분야에서 통상의 지식을 가진 자에 의하여 다양한 변형이나 응용이 가능하며, 본 발명에 따른 기술적 사상의 범위는 아래의 특허청구범위에 의하여 정해져야 할 것이다.The present invention described above may be variously modified or applied by those skilled in the art, and the scope of the technical idea according to the present invention should be defined by the following claims.

200: 인스톨-타임 컴파일러
205: 응용프로그램 리더부
210: 클래스 파일 리더/바이트코드 검증부
220: 바이트코드 변환부
260: 클래스 데이터 구조/런타임 함수부
230: 바인딩/재배치부
240: 이진 파일 생성부
250: Jar 압축부
200 : install-time compiler
205: application reader unit
210: class file reader / byte code verification unit
220: byte code conversion unit
260: class data structure / runtime function unit
230: binding / repositioning unit
240: binary file generator
250: Jar compression unit

Claims (3)

내장형 자바시스템을 위한 인스톨-타임 컴파일러 프로그램을 기록한 컴퓨터 판독가능한 기록매체에 있어서,
(1) 응용프로그램 메모리(Mapp)만을 사용하며(여기서, 메모리를 '사용'한다는 것은 메모리에 저장(기록)하거나 메모리를 참조(판독)하는 것을 의미함.), 외부로부터 입력되는 입력 Jar 파일에 포함되어 있는 클래스 파일 목록 및 리소스 파일 목록을 읽어 들이는 응용프로그램 리더부;
(2) 응용프로그램 메모리(Mapp)만을 사용하며, 상기 외부로부터 입력되는 입력 Jar 파일에 포함되어 있는 클래스 파일들을 읽어 들이고 바이트코드를 검증하는 클래스 파일 리더/바이트코드 검증부;
(3) 메소드 메모리(Mmethod)를 사용하여, 상기 클래스 파일 리더/바이트코드 검증부에서 검증된 바이트코드에 대하여 변환 작업을 수행하되, 변환 중 (최적화할) 참조에 접근하는 바이트코드를 만나게 되면 상기 응용프로그램 메모리(Mapp)에 참조 리스트를 만들고, 상기 응용프로그램 메모리(Mapp)의 참조 리스트를 참조하여 코드를 생성하는 바이트코드 변환부;
(4) 클래스 메모리(Mclass)만을 사용하며, 상기 파일 리더/바이트코드 검증부로부터 검증된 클래스 파일의 클래스 데이터 구조 및 런타임 함수들을 저장하는 클래스 데이터구조/런타임 함수부;
(5) 응용프로그램 메모리(Mapp)만을 사용하며, 상기 생성된 코드를 플랫폼 상에서 실행 가능하도록 바인딩 및 재배치 처리를 통하여 수정하는 바인딩/재배치부;
(6)응용프로그램 메모리(Mapp)만을 사용하며, 상기 바인딩/재배치부로부터 전송된 클래스 파일을 이진 파일로 생성하는 이진 파일 생성부; 및
(7) 응용프로그램 메모리(Mapp)만을 사용하며, 상기 이진 파일 생성부에서 생성된 이진 파일을 출력 Jar 파일로 압축하여 자바 가상머신으로 전송하는 Jar 압축부를 포함하는 것을 특징으로 하는 내장형 자바시스템을 위한 인스톨-타임 컴파일러 프로그램을 기록한 컴퓨터 판독가능한 기록매체.
In a computer-readable recording medium recording an install-time compiler program for an embedded Java system,
(1) Use only application memory (M app ) (where 'use' means to store (write) to memory or to reference (read) memory), input Jar file input from outside An application program reader unit for reading a list of class files and a list of resource files included in the list;
(2) a class file reader / byte code verification unit using only application program memory (M app ) and reading class files contained in the input Jar file input from the outside and verifying byte codes;
(3) Using a method memory (M method ), performing a conversion operation on the bytecode verified by the class file reader / bytecode verification unit, and when encountering a bytecode that accesses a reference to be optimized (optimized) during conversion. the application memory (M app) to create a reference to the list, the number of bytes to generate a code with reference to a reference list of the application memory (M app) code converter;
(4) a class data structure / runtime function unit that uses only class memory (M class ) and stores class data structures and runtime functions of the class file verified by the file reader / bytecode verification unit;
(5) a binding / relocation unit that uses only application program memory M app and modifies the generated code through a binding and relocation process to be executed on a platform;
(6) a binary file generation unit using only an application memory M app and generating a class file transmitted from the binding / relocation unit as a binary file; And
(7) an embedded Java system using only an application program memory (M app ) and including a Jar compression unit for compressing the binary file generated by the binary file generation unit into an output Jar file and transmitting the result to a Java virtual machine. A computer-readable recording medium having recorded thereon an install-time compiler program.
제1항에 있어서, 상기 바이트코드 변환부는,
상기 응용프로그램 메모리(Mapp)의 참조 리스트에 없는 새로운 참조 접근이 나오게 되면, 상기 응용프로그램 메모리(Mapp)에 상기 새로운 참조를 추가하는 것을 특징으로 하는 내장형 자바시스템을 위한 인스톨-타임 컴파일러 프로그램을 기록한 컴퓨터 판독가능한 기록매체.
The method of claim 1, wherein the bytecode conversion unit,
When a new reference approach is not in the reference list of the application memory (M app) come out, the application memory installed for embedded Java systems which comprises adding a new reference to the (M app) - Time compiler program Computer-readable recording medium.
제1항에 있어서, 상기 바이트코드 변환부는,
상기 파일 리더/바이트코드 검증부로부터 입력되는 바이트코드를 IR로 변환하고 최적화를 수행하는 IR 생성/최적화부;
상기 IR 생성/최적화부의 후단에 배치되어, 레지스터를 할당하는 레지스터 할당부; 및
상기 레지스터 할당부의 후단에 배치되어, 코드를 생성하는 코드 생성부를 포함하는 것을 특징으로 하는 내장형 자바시스템을 위한 인스톨-타임 컴파일러 프로그램을 기록한 컴퓨터 판독가능한 기록매체.
The method of claim 1, wherein the bytecode conversion unit,
An IR generation / optimizer for converting byte codes inputted from the file reader / byte code verification unit into IR and performing optimization;
A register allocating unit arranged at a rear end of the IR generation / optimizing unit to allocate a register; And
And a code generating unit arranged at a rear end of the register allocating unit to generate a code. The computer-readable recording medium recording an install-time compiler program for an embedded Java system.
KR1020100002022A 2010-01-08 2010-01-08 Computer readable recording medium having install-time compiler program for embedded system KR101088515B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020100002022A KR101088515B1 (en) 2010-01-08 2010-01-08 Computer readable recording medium having install-time compiler program for embedded system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020100002022A KR101088515B1 (en) 2010-01-08 2010-01-08 Computer readable recording medium having install-time compiler program for embedded system

Publications (2)

Publication Number Publication Date
KR20110081719A KR20110081719A (en) 2011-07-14
KR101088515B1 true KR101088515B1 (en) 2011-11-30

Family

ID=44920168

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020100002022A KR101088515B1 (en) 2010-01-08 2010-01-08 Computer readable recording medium having install-time compiler program for embedded system

Country Status (1)

Country Link
KR (1) KR101088515B1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101869008B1 (en) * 2016-09-02 2018-07-20 단국대학교 산학협력단 Apparatus for authenticating input value based on bytecode in java application and method thereof
CN112631622A (en) * 2020-12-29 2021-04-09 Oppo广东移动通信有限公司 Application installation method and device, server and computer readable medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100725386B1 (en) 2004-09-25 2007-06-07 삼성전자주식회사 Method for executing virtual machine application, and the digital broadcast receiver thereof
US20090249313A1 (en) 2008-03-31 2009-10-01 Sobel William E System and Method for Prioritizing the Compilation of Bytecode Modules During Installation of a Software Application

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100725386B1 (en) 2004-09-25 2007-06-07 삼성전자주식회사 Method for executing virtual machine application, and the digital broadcast receiver thereof
US20090249313A1 (en) 2008-03-31 2009-10-01 Sobel William E System and Method for Prioritizing the Compilation of Bytecode Modules During Installation of a Software Application

Also Published As

Publication number Publication date
KR20110081719A (en) 2011-07-14

Similar Documents

Publication Publication Date Title
US11175896B2 (en) Handling value types
US10216497B2 (en) Selective compiling method, device, and corresponding computer program product
EP3155517A1 (en) Complex constants
US20070250825A1 (en) Compiling Alternative Source Code Based on a Metafunction
Kotzmann et al. Escape analysis in the context of dynamic compilation and deoptimization
US9424004B2 (en) Execution guards in dynamic programming
US11573894B2 (en) Tracking garbage collection states of references
US20150339139A1 (en) Enhanced java array
US20030086620A1 (en) System and method for split-stream dictionary program compression and just-in-time translation
KR101088515B1 (en) Computer readable recording medium having install-time compiler program for embedded system
Titzer et al. Improving compiler-runtime separation with XIR
De Sutter et al. Combining global code and data compaction
EP3738028B1 (en) Reduced instructions to generate global variable addresses
US10733095B2 (en) Performing garbage collection on an object array using array chunk references
Garner et al. A comprehensive evaluation of object scanning techniques
Lim et al. A selective ahead-of-time compiler on android device
KR101088516B1 (en) Compilation method for embedded system using precompilation during execution
US10416967B2 (en) Method of optimizing vargs in object-oriented programming languages
Da Silva et al. An Experimental Evaluation of JAVA JIT Technology.
You et al. A static region‐based compiler for the Dalvik virtual machine
KR20130077673A (en) A extended method for eliminating null pointer check using method specialization
Titzer et al. Vertical object layout and compression for fixed heaps
Guo A Study of Code Compilation and Garbage Collection on Android.
Bergstrom et al. Arity raising in Manticore
Zhang et al. Compressing heap data for improved memory performance

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20141103

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20151102

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20171101

Year of fee payment: 7

FPAY Annual fee payment

Payment date: 20191028

Year of fee payment: 9