KR20150122924A - Apparatus and method for performance evaluation of java script - Google Patents

Apparatus and method for performance evaluation of java script Download PDF

Info

Publication number
KR20150122924A
KR20150122924A KR1020140049069A KR20140049069A KR20150122924A KR 20150122924 A KR20150122924 A KR 20150122924A KR 1020140049069 A KR1020140049069 A KR 1020140049069A KR 20140049069 A KR20140049069 A KR 20140049069A KR 20150122924 A KR20150122924 A KR 20150122924A
Authority
KR
South Korea
Prior art keywords
code
unit
javascript
performance
jit
Prior art date
Application number
KR1020140049069A
Other languages
Korean (ko)
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 KR1020140049069A priority Critical patent/KR20150122924A/en
Publication of KR20150122924A publication Critical patent/KR20150122924A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A java script performance evaluating device according to the present invention comprises: a central treating unit for performing lexical analysis (lexer) and parsing on a received java script source code; a JIT table unit for converting a parsed intermediate expression code into a machine code that can be performed through a just-in-time (JIT) compile performed through hardware; a feature access unit for classifying the converted machine code in accordance with usage frequency to be stored in a JIT table, searching for a machine code stored in the JIT table through a high speed table search function according to a request for code calling, and transferring a corresponding machine code; and a performance analyzing unit for inserting a probe code in the received java script source code to collect performance data, and measuring electricity consumption of the central treating unit, JIT table unit, and feature access unit.

Description

자바스크립트 성능 평가 장치 및 성능 평가 방법{APPARATUS AND METHOD FOR PERFORMANCE EVALUATION OF JAVA SCRIPT}[0001] APPARATUS AND METHOD FOR PERFORMANCE EVALUATION OF JAVA SCRIPT [0002]

본 발명은 웹 기반 어플리케이션 최적화에 관한 기술로서, 보다 상세하게는 웹 기반 가상 머신의 실행 속도 가속 및 성능 평가에 관한 기술이다.TECHNICAL FIELD The present invention relates to a technique for optimizing a web-based application, and more particularly, to a technique for accelerating execution speed and evaluating performance of a web-based virtual machine.

월드 와이드 웹(World Wide Web)의 측면을 서술하고 정의하는 공식적인 표준 기술 규격인 웹 표준에 따라 차세대 웹으로 글로벌 웹 표준인 HTML5 기반의 웹 플랫폼이 부상하고 있다. 현재 스마트폰과 같은 모바일 단말에서 주로 사용되는 응용프로그램은 대부분 네이티브 앱(Native App)형태를 가진다. 네이티브 앱은 구성요소가 패키지화 되어 있거나 라이브러리 형태로 제공되기 때문에 개발과 유지가 편리하여 로딩되는 속도가 빠른 장점이 있다. 하지만, 네이티브 앱은 모바일 단말의 운영체제에 종속되어 있다. 따라서, 네이티브 앱은 모바일 단말의 운영체제에 따라 개발환경이 다르며, 개발환경에 따른 운영체제 하에서만 실행이 가능하다는 단점이 존재한다. 반면에, HTML5 기반의 웹 앱은 모바일 단말의 운영체제에 종속되지 않아 웹 앱 개발환경에서 만들어진 하나의 소스 코드(One Source Code)로 다양한 운영체제(Multi-OS)를 지원할 수 있다. Web standards based on HTML5, the global web standard, are emerging as the next generation of web standards in accordance with the Web standard, which is the official standard specification for describing and defining the aspects of the World Wide Web. Currently, most of the applications that are mainly used in mobile terminals such as smart phones have the form of native apps. Native apps have the advantage of being easy to develop and maintain because the components are packaged or provided in the form of a library, and the loading speed is fast. However, the native app depends on the operating system of the mobile terminal. Therefore, there is a disadvantage that the native application differs in development environment according to the operating system of the mobile terminal, and can be executed only under the operating system according to the development environment. On the other hand, the HTML5-based web app is not dependent on the operating system of the mobile terminal, and can support various operating systems (Multi-OS) with one source code created in the web application development environment.

웹 표준에 따른 HTML5 기반의 웹 응용프로그램(Web Application)은 크게 HTML5(HyperText Markup Language 5), CSS3(Cascading Style Sheet 3.0) 및 자바스크립트(JavaScript)로 구성된다. HTML5는 정해진 태그를 사용하여 웹 문서를 작성하는 기본 언어로 콘텐츠 내용과 형식을 표현한다. CSS3는 웹 페이지의 스타일과 레이아웃을 제어하는 언어로서 콘텐츠 표현 방법을 정의한다. 그리고, 자바스크립트는 웹상에서 발생하는 이벤트를 처리하고 사용자에게 정보를 입력 받는 폼 값을 가공하여 서버로 전송하는 스트립트 언어로서 각종 API(Application Programming Interface)를 통해 기능을 표현한다.HTML5-based web applications according to web standards are composed of HTML5 (HyperText Markup Language 5), CSS3 (Cascading Style Sheet 3.0) and JavaScript (JavaScript). HTML5 is a basic language for creating web documents using defined tags, and expresses content content and format. CSS3 is a language that controls the style and layout of web pages, and defines how to express content. In addition, JavaScript is a script language that processes events occurring on the Web and processes form values for inputting information to the user and transmits them to the server, and expresses functions through various APIs (Application Programming Interfaces).

자바스크립트는 프로그래밍이 용이하고 하드웨어 및 운영체제와 같은 플랫폼에 의존하지 않고 작동하는 장점이 있다. 하지만, 자바스크립트는 C언어나 자바(Java)와 같은 프로그래밍 언어에 비해 실행속도가 상대적으로 느린 문제가 있다. 이와 같은 자바스크립트의 단점을 개선하기 위해 다양한 자바스크립트 가속화 연구가 추진되고 있다. 자바스크립트의 실행속도 문제를 개선하기 위한 방법으로 AP(Application Processor) 또는 CPU(Central Processor Unit)의 코어(Core) 및 스레드(Thread) 수를 증가시켜 자바스크립트를 병렬 처리 하는 방안이 연구되고 있다. 하지만, 이처럼 코어 및 스레드 수를 증가시켜 자바스크립트를 가속화하는 방법은 코어 및 스레드 수가 증가한 만큼 소비 전력이 증가하여 높은 소비 전력을 가지는 문제가 있다. 특히, 배터리 용량이 한정된 스마트폰과 같은 모바일 단말에서 소비 전력 증가는 모바일 단말의 사용시간을 감소시키게 된다.JavaScript is easy to program and has the advantage of being platform independent, such as hardware and operating system. However, JavaScript has a relatively slow execution speed compared to programming languages such as C or Java. Various JavaScript acceleration studies are underway to improve the disadvantages of JavaScript. As a method to improve the execution speed of JavaScript, a method of parallel processing of JavaScript by increasing the number of core and thread of AP (Application Processor) or CPU (Central Processor Unit) is being studied. However, such a method of increasing the number of cores and threads to accelerate JavaScript has a problem that the power consumption increases due to an increase in the number of cores and threads, resulting in high power consumption. In particular, an increase in power consumption in a mobile terminal such as a smart phone having a limited battery capacity reduces the use time of the mobile terminal.

대한민국 공개특허 제10-2013-0022493호는 모바일 환경에서 자바 스크립트 라이브러리 최적화 방법 및 장치에 대해 기술되어 있다. 대한민국 공개특허 제10-2013-0022493호는 기존의 자바 스크립트 라이브러리에서 다양한 웹 브라우저에 적용 가능하도록 구현된 이식성 코드를 제거하고 모바일 단말의 웹 브라우저에 맞추어 자바 스크립트 라이브러리를 재구현하고, 미리 정의된 주요 기능 모듈을 웹 브라우저 엔진상에서 수행되도록 구현하여 최적화를 수행한다. 하지만, 이 특허문헌은 라이브러리에 대한 최적화만을 수행할 뿐, 자바 스크립트 실행 처리에 소요되는 시간을 단축시키기 위한 하드웨어 장치를 포함하고 있지 않다.Korean Patent Publication No. 10-2013-0022493 describes a method and apparatus for optimizing a JavaScript library in a mobile environment. Korean Patent Laid-Open No. 10-2013-0022493 discloses a method of removing a portable code implemented in an existing JavaScript library so as to be applicable to various web browsers, re-implementing a JavaScript library according to a web browser of a mobile terminal, Optimization is performed by implementing the function module to be executed on the web browser engine. However, this patent document only performs optimization for the library, but does not include a hardware device for shortening the time required for executing the JavaScript.

대한민국 공개특허 제10-2013-0022493호Korean Patent Publication No. 10-2013-0022493

본 발명이 해결하고자 하는 과제는 소비 전력 증가를 최소화한 상태로 자바스크립트의 실행 속도를 개선시키기 위해 단말의 하드웨어 형태로 자바스크립트 성능 평가 장치 및 평가 방법을 제공하는 것이다.SUMMARY OF THE INVENTION It is an object of the present invention to provide a JavaScript performance evaluation apparatus and an evaluation method in hardware form of a terminal in order to improve the execution speed of the JavaScript in a state of minimizing an increase in power consumption.

본 발명에 따른 자바스크립트 성능 평가 장치는 수신된 자바스크립트 소스 코드를 어휘분석(Lexer) 및 파싱(Parsing)하는 중앙처리부, 파싱된 중간 표현 코드를 하드웨어로 구현된 JIT 컴파일(Just In Time Compile)을 통해 실행 가능한 기계어 코드(Machine Code)로 변환하는 JIT 테이블부, 변환된 기계어 코드의 사용 빈도에 따라 분류하여 JIT 테이블로 저장하고, 코드 호출 요청에 따라 고속 테이블 탐색 기능을 통해 상기 JIT 테이블에 저장된 기계어 코드를 검색하여 대응하는 기계어 코드를 전달하는 속성 액세스부 및 수신된 자바스크립트 소스 코드에 탐침 코드를 삽입하여 성능 데이터를 수집하고, 중앙처리부, JIT 테이블부 및 속성 액세스부의 전력 소모량을 측정하는 성능 분석부를 포함한다.The apparatus for evaluating performance of a JavaScript according to the present invention includes a central processing unit for performing lexical analysis and parsing of received JavaScript source code, a JIT compilation (Just In Time Compile) A JIT table unit for converting the machine code into an executable machine code and a use frequency of the converted machine code to store the JIT table in a JIT table, A property access unit for searching for a code and transmitting a corresponding machine code, a performance analyzing unit for collecting performance data by inserting a probe code into the received JavaScript source code, and measuring the power consumption of the central processing unit, the JIT table unit, and the property access unit .

성능 분석부는 성능 데이터 및 전력 소모량을 동기화하여 성능과 전력 소모량 사이의 상관 관계를 분석한다. 그리고, 중앙처리부는 수신된 자바스크립트 소스 코드의 어휘를 분석하여 파싱 과정을 수행하고, 파싱된 자바스크립트 소스 코드를 고속 인터페이스(High-speed Interface)를 통해 JIT 테이블부로 전달한다. JIT 테이블부는 파싱된 자바스크립트 소스 코드에 포함된 다수의 코드를 컴파일을 필요로 하는 소스 파일 및 바이트 코드 형태의 클래스 파일로 구분하고, 소스 파일은 JIT 컴파일을 통해 바이트 코드로 구성된 클래스 파일로 컴파일 하고, 클래스 파일은 인터프리팅(Interpreting)을 통해 기계어 코드로 변환한다.The performance analyzer analyzes the correlation between performance and power consumption by synchronizing performance data and power consumption. The central processing unit analyzes the vocabulary of the received JavaScript source code and performs a parsing process, and transmits the parsed JavaScript source code to the JIT table unit through a high-speed interface. The JIT table section divides a number of pieces of code included in the parsed JavaScript source code into a source file requiring a compilation and a class file of a byte code type, compiles the source file into a class file composed of byte codes through JIT compilation , The class file is converted into machine code by interpreting.

속성 액세스부는 생성된 기계어 코드와 대응하는 해시값을 생성하고, 생성된 해시값과 기계어 코드를 상기 JIT 테이블에 저장하며, 기계어 코드를 사용 빈도에 따라 분류하고, 해시값을 통해 저장된 기계어 코드를 고속 검색한다. 가비지 콜렉터부는 메모리 영역을 분석하여 스택 영역 및 레지스터에 위치한 하나 이상의 변수의 참조 경로를 추적하고, 상기 참조 경로 추적을 통해 힙 메모리 영역(Heap Memory Space) 내에 존재하는 다수의 힙 객체(Hep Object) 중에서 변수와 연결되어 사용중인 힙 객체(Heap Object Reachable) 및 불필요한 힙 객체(Unreachable Heap Object)를 구분하고, 불필요한 힙 객체의 주소를 일괄적으로 확인한 후, 불필요한 힙 객체를 병렬적으로 회수하여 메모리를 반환한다. 또한, 성능 분석부는 자바스크립트 소스 코드의 수정 없이 상기 탐침 코드를 코드 중간에 삽입한다.The attribute access unit generates a hash value corresponding to the generated machine code, stores the generated hash value and machine code in the JIT table, classifies the machine code according to the frequency of use, Search. The garbage collector unit analyzes a memory area and tracks a reference path of one or more variables located in a stack area and a register. The reference path trace is used to identify a plurality of heap objects (Hep objects) existing in a heap memory space Variable to identify the heap object in use and the unreachable heap object, collectively checks the addresses of unnecessary heap objects, reclaims unnecessary heap objects in parallel, and returns the memory do. In addition, the performance analyzer inserts the probe code into the middle of the code without modifying the JavaScript source code.

본 발명에 따른 자바스크립트 성능 평가 방법은 수신된 자바스크립트 소스 코드에 탐침 코드를 삽입하는 단계, 삽입된 탐침 코드를 통해 성능 데이터를 수집하는 단계, 수집된 데이터를 통해 하드웨어 성능을 측정하는 단계, 전력 소모량을 측정하는 단계, 성능 데이터 및 전력 소모량을 동기화하는 단계 및 동기화된 데이터를 분석하는 단계를 포함한다. 수신된 자바스크립트 소스 코드에 탐침 코드를 삽입하는 단계는 상기 자바스크립트 소스 코드의 수정 없이 상기 탐침 코드를 코드 중간에 삽입할 수 있다.A method for evaluating performance of a JavaScript according to the present invention includes the steps of inserting a probe code into a received JavaScript source code, collecting performance data through an inserted probe code, measuring hardware performance through collected data, Measuring power consumption, synchronizing performance data and power consumption, and analyzing synchronized data. The step of inserting the probe code into the received JavaScript source code may insert the probe code into the middle of the code without modifying the JavaScript source code.

본 발명에 따른 자바스크립트 성능 평가 장치 및 방법은 하드웨어로 구성된 JIT 컴파일러를 통해 컴파일을 수행하고 메모리 반환을 수행하며, 수행 과정 동안 측정된 성능 데이터와 전력소모량을 동기화하여 전력과 성능 사이의 상관 관계를 명확하게 할 수 있다. 이를 통해, 자바스크립트의 실행 속도를 향상시키면서 전력 소모량 증가를 최소화할 수 있다.The apparatus and method for evaluating the performance of a JavaScript according to the present invention perform compilation through a hardware JIT compiler, perform memory return, synchronize the measured performance data and power consumption during the execution, Can be clearly made. This allows you to speed up JavaScript execution while minimizing power consumption.

도 1은 본 발명에 따른 자바스크립트 성능 평가 장치의 일 실시예를 나타내는 구성도이다.
도 2는 본 발명의 일 실시예에 따른 자바스크립트 성능 평가 장치의 성능 분석부(160)를 나타내는 구성도이다.
도 3은 본 발명의 일 실시예에 따른 자바스크립트 성능 평가 장치의 중앙처리부(110) 및 JIT 테이블부(120)를 나타내는 구성도이다.
도 4는 본 발명의 일 실시예에 따른 자바스크립트 성능 평가 장치의 속성 액세스부(130)를 나타내는 구성도이다.
도 5는 본 발명의 일 실시예에 따른 자바스크립트 성능 평가 장치의 가비지 콜렉터부(140)의 동작을 나타내는 도면이다.
도 6은 본 발명의 일 실시예에 따른 자바 스크립트 성능 평가 장치의 기계어 코드 생성 방법을 나타내는 흐름도이다.
도 7은 본 발명의 일 실시예에 따른 자바스크립트 성능 평가 장치의 성능 평가 방법을 나타내는 흐름도이다.
1 is a block diagram showing an embodiment of a JavaScript performance evaluating apparatus according to the present invention.
2 is a block diagram illustrating a performance analysis unit 160 of a JavaScript performance evaluation apparatus according to an embodiment of the present invention.
3 is a configuration diagram illustrating a central processing unit 110 and a JIT table unit 120 of a JavaScript performance evaluation apparatus according to an embodiment of the present invention.
4 is a configuration diagram illustrating an attribute access unit 130 of a JavaScript performance evaluation apparatus according to an embodiment of the present invention.
5 is a diagram illustrating an operation of the garbage collector unit 140 of the JavaScript performance evaluation apparatus according to an embodiment of the present invention.
6 is a flowchart illustrating a method for generating machine code of a JavaScript performance evaluating apparatus according to an embodiment of the present invention.
7 is a flowchart illustrating a method for evaluating performance of a JavaScript performance evaluating apparatus according to an embodiment of the present invention.

이하, 본 발명의 실시예를 첨부된 도면들을 참조하여 상세하게 설명한다. 본 명세서에서 사용되는 용어 및 단어들은 실시예에서의 기능을 고려하여 선택된 용어들로서, 그 용어의 의미는 발명의 의도 또는 관례 등에 따라 달라질 수 있다. 따라서 후술하는 실시예에서 사용된 용어는, 본 명세서에 구체적으로 정의된 경우에는 그 정의에 따르며, 구체적인 정의가 없는 경우는 당업자들이 일반적으로 인식하는 의미로 해석되어야 할 것이다.
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. The terms and words used in the present specification are selected in consideration of the functions in the embodiments, and the meaning of the terms may vary depending on the intention or custom of the invention. Therefore, the terms used in the following embodiments are defined according to their definitions when they are specifically defined in this specification, and unless otherwise specified, they should be construed in a sense generally recognized by those skilled in the art.

도 1은 본 발명에 따른 자바스크립트 성능 평가 장치의 일 실시예를 나타내는 구성도이다. 1 is a block diagram showing an embodiment of a JavaScript performance evaluating apparatus according to the present invention.

도 1을 참조하면, 본 발명에 따른 자바스크립트 성능 평가 장치(100)는 중앙 처리부(110), JIT 테이블부(120), 속성 액세스부(130), 가비지 콜렉터부(140), 메모리(150) 및 성능 분석부(160)를 포함한다.Referring to FIG. 1, a JavaScript performance evaluation apparatus 100 according to the present invention includes a central processing unit 110, a JIT table unit 120, an attribute access unit 130, a garbage collector unit 140, a memory 150, And a performance analysis unit 160.

중앙처리부(110)는 수신된 자바스크립트 소스 코드를 파싱(Parsing) 및 중간 표현(Intermediated Representation) 과정을 통해 중간 표현 코드로 변환하여 JIT 테이블부(120)로 전달한다. JIT 테이블부(120)는 하드웨어로 구현된 JIT 컴파일(Just In Time Compilation)을 통해 병렬 처리하여 실행 가능한 코드인 기계어 코드(Machine Code)로 변환하는 인터프리팅(Interpreting)을 수행한다. 그리고, JIT 테이블부(120)는 변환된 기계어 코드를 프로그래밍 가능한 JIT 테이블(Programmable Just In Time Table) 형태로 메모리(150)에 저장한다. 상기 과정에서, 중앙처리부(110)와 JIT 테이블부(120)는 고속 인터페이스(High-speed Interface)를 통해 중간 표현 코드 및 기계어 코드를 빠르게 교환한다. The central processing unit 110 converts the received JavaScript source code into an intermediate representation code through a parsing and an intermediate representation process and transmits the intermediate representation code to the JIT table unit 120. The JIT table unit 120 performs interpreting in which a JIT compilation (Just In Time Compilation) implemented in hardware is executed in parallel and converted into machine code (Machine Code), which is executable code. The JIT table unit 120 stores the converted machine code in the memory 150 in the form of a programmable JIT table (Programmable Just In Time Table). In the above process, the central processing unit 110 and the JIT table unit 120 exchange the intermediate representation code and the machine language code quickly through a high-speed interface.

JIT 테이블부(120)는 소프트웨어 절차를 통해 동작하는 중앙처리부(110)와 달리 상기 과정을 하드웨어 절차를 통해 수행한다. 즉, JIT 테이블부(120)는 자바스크립트 소스 코드를 기계어 코드로 인터프리팅 하는 과정을 하드웨어 장치로 구현하여 처리하여, 자바 스크립트를 소프트웨어적으로 인터프리팅 하는 종래 방법에 비해 중앙처리부(110)의 부담을 줄이고, 처리 속도를 높여 고속 변환을 가능하게 한다. The JIT table unit 120 performs the above process through a hardware procedure, unlike the central processing unit 110, which operates through a software procedure. That is, the JIT table unit 120 performs a process of interpreting the JavaScript source code into the machine language code by implementing it as a hardware device, Thereby increasing the processing speed and enabling high-speed conversion.

속성 액세스부(130)는 객체 타입 예측을 위한 런타임(Run-time) 프로파일링 기법을 통해 실행 패턴을 분석하여 동적 바인딩(Binding)을 최적화하고, 함수 및 메소드 매칭을 위한 고속 테이블 탐색 기능을 통해 메모리(150)에 저장된 JIT 테이블을 검색한다. 속성 액세스부(130)는 JIT 테이블 형태로 저장된 기계어 코드의 사용 빈도를 검사하여, 사용 빈도에 따라 분류하고, 소정의 기준 이하의 사용 빈도를 보이는 기계어 코드를 삭제할 수 있다. 그리고, 속성 액세스부(130)는 중앙처리부(110)로부터 새로운 중간 표현 코드가 수신되면, 객체 추적용 고속 탐색을 통해 JIT 테이블을 검색하여 동일한 기계어 코드가 저장되어 있는지를 확인한다. 동일한 기계어 코드가 저장되어 있다면, 속성 액세스부(130)는 수신된 중간 표현 코드를 기계어 코드로 변환하는 과정을 생략하고 저장된 기계어 코드를 다시 중앙처리부(110)로 전달한다.The attribute access unit 130 analyzes execution patterns through a run-time profiling technique for predicting object types to optimize dynamic binding, and provides a high-speed table search function for function and method matching, The JIT table stored in the JIT table 150 is retrieved. The attribute access unit 130 may check the frequency of use of the machine code stored in the JIT table form, classify it according to the frequency of use, and delete the machine code showing the frequency of use less than a predetermined criterion. When a new intermediate representation code is received from the central processing unit 110, the attribute access unit 130 searches the JIT table through high-speed search for object tracking to check whether the same machine code is stored. If the same machine code is stored, the attribute access unit 130 skips the process of converting the received intermediate representation code into the machine code and transfers the stored machine code to the central processing unit 110 again.

가비지 콜렉터부(140)는 전용 가비지 콜렉터(Garbage Collector) 하드웨어 구조와 분석 도구를 통해 자바스크립트 수행 시 메모리(150)의 힙 메모리 영역(Heap Memory Space)내의 미사용 객체 메모리를 반환하고 여유 메모리를 확보한다. 가비지 콜렉터부(140)는 힙 영역내 모든 객체의 참조 경로를 추적하여 참조되지 않는 객체의 힙 메모리를 병렬적으로 회수한다. 그리고, 가비지 콜렉터부(140)는 메모리(150)의 힙 메모리 회수에 따른 메모리 프리 리스트(Free list)를 갱신하여 가비지 콜렉션(Garbage Collection)을 위한 가속 절차를 수행한다. HTML5 기반의 웹 앱을 실행하는 자바스크립트의 경우 급격하게 애플리케이션에 의한 객체의 사용이 집중되거나, 메모리 부족 현상이 발생하는 경우, 가비지 콜렉터부(140)는 먼저 모든 프로세서를 중단하고, 메모리(150)의 스택 영역(Stack Segment) 또는 레지스터(Register)에 위치한 지역 변수(Local Variable)의 참조 경로를 추적하여 힙 메모리 영역 내에 존재하는 다수의 힙 객체(Heap Object) 중에서 지역 변수가 도달한 힙 객체(Heap Object Reachable)와 도달하지 못한 힙 객체(Unreachable Heap Object)의 주소를 확인한다. 그리고, 가비지 콜렉터부(140)는 확인된 도달하지 못한 힙 객체를 병렬적으로 회수하여 메모리를 반환한다. 그리고, 가비지 콜렉터부(140)는 메모리 프리 리스트를 갱신한다. 메모리 프리 리스트는 메모리(150)에서 할당 가능한 모든 힙 블록(Heap Block)을 포함한다. 이를 위해, 가비지 콜렉터부(140)는 중앙처리부(110)와 가비지 콜렉터부(140)의 동기화를 위한 신호(Sync), 가비지 콜렉팅 시작 신호(GC Start), 가비지 콜렉팅 종료 신호(GC End) 및 캐쉬 제어 신호(Cache Control)를 송수신한다.The garbage collector unit 140 returns an unused object memory in the heap memory space of the memory 150 and acquires a free memory when executing JavaScript through a dedicated garbage collector hardware structure and analysis tool . The garbage collector unit 140 tracks the reference paths of all the objects in the heap area and reclaims the heap memory of the unreferenced objects in parallel. The garbage collector unit 140 updates the memory list according to the number of heap memories of the memory 150 to perform an acceleration process for garbage collection. In the case of JavaScript that executes an HTML5-based web application, when the use of an object by the application is concentrated or an insufficient memory occurs, the garbage collector unit 140 firstly stops all the processors, A heap memory area in which a local variable reaches a heap object (Heap object) among a plurality of heap objects existing in the heap memory area by tracing a reference path of a local variable located in a stack area Object Reachable) and the address of an unreachable heap object. Then, the garbage collector unit 140 reclaims the heap object that has not been notified in parallel and returns the memory. Then, the garbage collector unit 140 updates the memory-free list. The memory-free list includes all the heap blocks that can be allocated in the memory 150. A garbage collection start signal GC start and a garbage collection end signal GC End for synchronizing the central processing unit 110 and the garbage collector unit 140. [ And a cache control signal (Cache Control).

성능 분석부(160)는 소프트웨어 분석과 전력 소모량 분석을 통해 성능을 분석한다. 성능 분석부(160)는 소프트웨어 분석을 위해 중앙 처리부(110)로 전달되는 자바스크립트 소스 코드 및 및 JIT 테이블부(120)로 전달되는 중간 표현 코드에 성능 분석을 위한 탐침 코드를 삽입한다. 이 과정에서, 성능 분석부(160)는 탐침 코드를 중간에 삽입하여 소스 코드를 직접 수정할 필요가 없이 중앙 처리부(110) 및 JIT 테이블부(120)로부터 성능 데이터를 수집할 수 있다. 그리고, 성능 분석부(160)는 커널 도구를 활용하여 소스 코드 수정 없이 중앙 처리부(110) 및 JIT 테이블부(120)로부터 데이터를 수집할 수 있다. 성능 분석부(160)는 성능 데이터 수집을 통해 하드웨어의 성능을 측정할 수 있다. 그리고, 성능 분석부(160)는 중앙 처리부(110), JIT 테이블부(120), 속성 액세스부(130) 및 가비지 콜렉터부(140)의 전력을 측정하여 전력소모량을 확인한다. 이를 위해, 성능 분석부(160)는 DAQ(Data Acquisition) 및 파워 모니터(Power Monitor)를 포함하는 계측기를 구비한다. 성능 분석부(160)는 구비된 계측기를 통해 전체 시스템의 파워를 측정하고 파워 레일(Power Rail) 별로 파워를 측정할 수 있다.The performance analysis unit 160 analyzes the performance through software analysis and power consumption analysis. The performance analyzer 160 inserts the probe code for performance analysis into the JavaScript source code transmitted to the central processing unit 110 and the intermediate representation code transmitted to the JIT table unit 120 for software analysis. In this process, the performance analysis unit 160 can collect performance data from the central processing unit 110 and the JIT table unit 120 without interposing the probe code and directly modifying the source code. The performance analyzer 160 may collect data from the central processing unit 110 and the JIT table unit 120 without using source code modification by using the kernel tool. The performance analyzer 160 can measure the hardware performance through performance data collection. The performance analyzer 160 measures the power of the central processing unit 110, the JIT table unit 120, the attribute access unit 130, and the garbage collector unit 140 to check the power consumption. For this, the performance analyzer 160 includes a meter including a DAQ (Data Acquisition) and a power monitor. The performance analyzer 160 measures the power of the entire system through the provided measuring instrument and measures the power of each power rail.

성능 분석부(160)는 수집된 데이터를 현재 시스템의 상태와 함께 표시하며, 수집된 데이터를 누적시켜 통계값으로 표시할 수 있다. 또한, 성능 분석부(160)는 성능 데이터와 전력소모량 데이터를 서로 동기화하여 표시할 수 있다. 일반적으로 전력소모와 하드웨어 성능은 서로 비례한다. 즉, 하드웨어가 높은 성능을 낼수록 전력 소모량 또한 증가한다. 하지만, 낮은 전력소모량은 AP 및 CPU 설계에 있어 요구되는 중요한 요인 중 하나이다. 따라서, 성능 데이터와 전력소모량 데이터를 동기화하여 분석하여 전력소모량과 성능 사이에 상관 관계를 정확하게 분석하고, 이러한 통합 분석으로 해결책을 모색한다.The performance analyzer 160 displays the collected data together with the status of the current system, and accumulates the collected data and displays the accumulated data as statistical values. In addition, the performance analyzer 160 can display the performance data and the power consumption data in synchronization with each other. Power consumption and hardware performance are generally proportional to each other. That is, the higher the performance of the hardware, the higher the power consumption. However, low power consumption is an important factor in AP and CPU design. Therefore, by analyzing performance data and power consumption data in a synchronized manner, the correlation between power consumption and performance is analyzed accurately, and a solution is sought through such integrated analysis.

본 발명에 따른 자바 스크립트 성능 평가 장치(100)는 자바스크립트 가속 엔진을 탑재한 AP(Application Processor) 또는 CPU(Central Processing Unit)를 설계하는 과정에서 성능 평가를 위해 FPGA(Field Programmable Gate Array)로 구현될 수 잇다.The JavaScript performance evaluating apparatus 100 according to the present invention may be implemented as an FPGA (Field Programmable Gate Array) for performance evaluation in the process of designing an AP (Application Processor) or a CPU (Central Processing Unit) It can be.

도 2는 본 발명의 일 실시예에 따른 자바스크립트 성능 평가 장치의 성능 분석부(160)를 나타내는 구성도이다.2 is a block diagram illustrating a performance analysis unit 160 of a JavaScript performance evaluation apparatus according to an embodiment of the present invention.

도 1 및 도 2를 참조하면, 본 발명의 일 실시예에 따른 자바스크립트 성능 평가 장치의 성능 분석부(160)는 데이터 수집부(161), 전력측정부(162) 및 동기화 분석부(163)를 포함한다.1 and 2, the performance analyzing unit 160 of the Javascript performance evaluating apparatus according to an embodiment of the present invention includes a data collecting unit 161, a power measuring unit 162 and a synchronization analyzing unit 163, .

데이터 수집부(161)는 소프트웨어 분석을 위한 성능 데이터를 수집한다. 데이터 수집부(161)는 JIT 테이블부(120)로 전달되는 자바스크립트 소스 코드 및 중간 표현 코드에 성능 분석을 위한 탐침 코드를 삽입한다. 탐침 코드는 소프트웨어 성능 분석을 위한 데이터를 수집하는 코드로서, 탐침 코드를 중간에 삽입하여 데이터를 수집하기 때문에, 소스 코드를 직접 수정할 필요가 없다. 따라서, 소스 코드에 영향을 주지 않으며, 필요한 성능 데이터만을 수집할 수 있다. 또한, 데이터 수집부(161)는 커널 도구를 활용하여 소스 코드 수정 없이 중앙 처리부(110) 및 JIT 테이블부(120)로부터 데이터를 수집할 수 있다. 성능 분석부(160)는 데이터 수집을 통해 하드웨어의 성능을 측정할 수 있다.The data collection unit 161 collects performance data for software analysis. The data collecting unit 161 inserts the probe code for performance analysis into the Javascript source code and the intermediate representation code that are transmitted to the JIT table unit 120. The probe code is a code for collecting data for software performance analysis. Since the probe code is interleaved to collect data, there is no need to directly modify the source code. Therefore, it does not affect the source code, and only necessary performance data can be collected. Also, the data collection unit 161 can collect data from the central processing unit 110 and the JIT table unit 120 without modifying the source code using the kernel tool. The performance analyzer 160 can measure hardware performance through data collection.

데이터 수집부(161)는 중앙 처리부(110), JIT 테이블부(120), 속성 액세스부(130) 및 가비지 콜렉터부(140)의 전력을 측정하여 전력소모량을 확인한다. 이를 위해, 데이터 수집부(161)는 DAQ(Data Acquisition) 및 파워 모니터(Power Monitor)를 포함하는 계측기를 구비한다. 데이터 수집부(161)는 구비된 계측기를 통해 전체 시스템의 파워를 측정하고 파워 레일(Power Rail) 별로 파워를 측정할 수 있다.The data collection unit 161 measures the power of the central processing unit 110, the JIT table unit 120, the attribute access unit 130, and the garbage collector unit 140 to check the power consumption. To this end, the data collecting unit 161 includes a meter including a DAQ (Data Acquisition) and a power monitor. The data collecting unit 161 may measure the power of the entire system through the provided measuring instrument and measure the power of each power rail.

동기화 분석부(163)는 데이터 수집부(161)를 통해 수집된 성능 데이터와 전력측정부(162)를 통해 수집된 전력소모량 데이터를 서로 동기화하여 관리한다. 일반적으로 전력소모와 하드웨어 성능은 서로 비례한다. 즉, 하드웨어가 높은 성능을 낼수록 전력 소모량 또한 증가한다. 하지만, 낮은 전력소모량은 AP 및 CPU 설계에 있어 요구되는 중요한 요인 중 하나이다. 따라서, 성능 데이터와 전력소모량 데이터를 동기화하여 분석하여 전력소모량과 성능 사이에 상관 관계를 확인할 수 있다. 전력소모량과 성능 사이에 상관 관계를 정확하게 분석하고, 이러한 통합 분석으로 해결책을 모색한다. 또한, 동기화 분석부(163)는 데이터 수집부(161)를 통해 수집된 성능 데이터와 전력측정부(162)를 통해 수집된 전력소모량 데이터를 누적하여 통계화된 데이터로 관리할 수 있다.The synchronization analyzer 163 synchronizes and manages the performance data collected through the data collector 161 and the power consumption data collected through the power measuring unit 162. [ Power consumption and hardware performance are generally proportional to each other. That is, the higher the performance of the hardware, the higher the power consumption. However, low power consumption is an important factor in AP and CPU design. Therefore, performance data and power consumption data can be analyzed in synchronization to check the correlation between power consumption and performance. Correctly analyze the correlation between power consumption and performance, and seek solutions through this integrated analysis. The synchronization analysis unit 163 may accumulate the performance data collected through the data collection unit 161 and the power consumption data collected through the power measurement unit 162 and manage the accumulated data as statistical data.

도 3은 본 발명의 일 실시예에 따른 자바스크립트 성능 평가 장치의 중앙처리부(110) 및 JIT 테이블부(120)를 나타내는 구성도이다.3 is a configuration diagram illustrating a central processing unit 110 and a JIT table unit 120 of a JavaScript performance evaluation apparatus according to an embodiment of the present invention.

도 1 및 도 3를 참조하면, 중앙처리부(110)는 전단(Front End) 처리부 (111), 프로파일부(112) 및 펌웨어부(113)를 포함한다.Referring to FIGS. 1 and 3, the central processing unit 110 includes a front end processing unit 111, a profile unit 112, and a firmware unit 113.

자바스크립트 소스 코드가 수신되면, 전단 처리부(111)는 렉서(Lexer) 및 파서(Parser)를 통해 수신된 자바스크립트 소스 코드의 어휘를 분석하고, 파싱 과정을 수행한다. 그리고, 파싱된 자바스크립트 소스 코드를 중간 표현(Intermediated Representation) 과정을 통해 중간 표현 코드로 변환한다. 그리고, 프로파일부(112)는 타겟 머신코드 생성 및 전달을 위한 프로파일 정보를 포함한다. 프로파일부(112)로부터 전달된 프로파일 정보를 통해 펌웨어부(113)는 타겟 머신코드 생성 및 전달을 위한 최적화 펌웨어를 생성하고, 생성된 펌웨어에 기초하여 전단 처리부(111)를 통해 변환된 중간 표현 코드를 JIT 테이블부(120)로 전달한다. 중앙처리부(110)는 고속 인터페이스(High-speed Interface)를 통해 중간 표현 코드를 JIT 테이블부(120)로 지연 시간 없이 전달할 수 있다.When the JavaScript source code is received, the front end processing unit 111 analyzes the vocabulary of the JavaScript source code received via the Lexer and the parser, and performs a parsing process. Then, the parsed JavaScript source code is converted into an intermediate representation code through an intermediate representation process. The profile unit 112 includes profile information for target machine code generation and delivery. The firmware unit 113 generates optimized firmware for generating and delivering the target machine code through the profile information transmitted from the profile unit 112, To the JIT table unit 120. The central processing unit 110 can transmit the intermediate representation code to the JIT table unit 120 through a high-speed interface without delay.

JIT 테이블부(120)는 스위치부(121), 인터프리터부(122) 및 가속 컴파일부(123)를 포함한다.The JIT table unit 120 includes a switch unit 121, an interpreter unit 122, and an acceleration compiling unit 123.

스위치부(121)는 수신된 중간 표현 코드에 포함된 다수의 코드 중에서 컴파일을 필요로 하는 소스 파일과 바이트 코드 형태의 클래스 파일로 구분한다. 수신된 중간 표현 코드에 포함된 다수의 코드 중에서 컴파일을 필요로 하는 소스 파일은 컴파일부(123)에서 JIT 컴파일러를 통해 바이트 코드로 구성된 클래스 파일로 컴파일한다. 그리고, 수신된 중간 표현 코드에 포함된 다수의 코드 중에서 바이트 코드 형태의 클래스 파일은 인터프리터부(122)를 통해 실행되어 기계어 코드로 변환된다. 그리고, JIT 테이블부(120)는 변환된 기계어 코드를 프로그래밍 가능한 JIT 테이블 형태로 메모리(150)에 저장한다. 상기 과정에서, 중앙처리부(110)와 JIT 테이블부(120)는 고속 인터페이스(High-speed Interface)를 통해 중간 표현 코드 및 기계어 코드를 빠르게 교환한다. The switch unit 121 divides a plurality of codes included in the received intermediate representation code into a source file requiring compilation and a class file having a byte code form. Among the plurality of codes included in the received intermediate representation code, the source file requiring compilation is compiled by the compiler 123 into a class file composed of byte codes through the JIT compiler. Of the plurality of codes included in the received intermediate representation code, the byte-code type class file is executed through the interpreter unit 122 and converted into machine code. The JIT table unit 120 stores the converted machine code in the memory 150 in the form of a programmable JIT table. In the above process, the central processing unit 110 and the JIT table unit 120 exchange the intermediate representation code and the machine language code quickly through a high-speed interface.

JIT 테이블부(120)는 소프트웨어 절차를 통해 동작하는 중앙처리부(110)와 달리 상기 과정을 하드웨어 절차를 통해 수행한다. 즉, JIT 테이블부(120)는 자바스크립트 소스 코드를 기계어 코드로 인터프리팅 하는 과정을 하드웨어 장치로 구현하여 처리하여, 자바 스크립트를 소프트웨어적으로 인터프리팅 하는 종래 방법에 비해 중앙처리부(110)의 부담을 줄이고, 처리 속도를 높여 고속 변환을 가능하게 한다. The JIT table unit 120 performs the above process through a hardware procedure, unlike the central processing unit 110, which operates through a software procedure. That is, the JIT table unit 120 performs a process of interpreting the JavaScript source code into the machine language code by implementing it as a hardware device, Thereby increasing the processing speed and enabling high-speed conversion.

도 4는 본 발명의 일 실시예에 따른 자바스크립트 성능 평가 장치의 속성 액세스부(130)를 나타내는 구성도이다.4 is a configuration diagram illustrating an attribute access unit 130 of a JavaScript performance evaluation apparatus according to an embodiment of the present invention.

도 1 및 도 4를 참조하면, 본 발명의 일 실시예에 따른 자바스크립트 성능 평가 장치의 속성 액세스부(130)는 테이블 검색부(131), 해시 생성부(132) 및 테이블 접근부(133)를 포함한다.1 and 4, the property access unit 130 of the JavaScript performance evaluating apparatus according to an embodiment of the present invention includes a table search unit 131, a hash generating unit 132, and a table access unit 133. [ .

해시 생성부(132)는 생성된 기계어 코드와 대응하는 해시값을 생성하여 기계어 코드를 JIT 테이블(301) 형태로 메모리(150)에 저장 및 관리한다. 테이블 검색부(131)는 해시값을 통해 JIT 테이블(301)을 고속 검색한다. 그리고, 테이블 검색부(131)는 객체 타입 예측을 위한 런타임(Run-time) 프로파일링 기법을 통해 실행 패턴을 분석하여 동적 바인딩(Binding)을 최적화하고, 함수 및 메소드 매칭을 위한 키 값을 통해 고속 테이블 탐색 기능을 통해 메모리(150)에 저장된 JIT 테이블을 검색한다. The hash generation unit 132 generates a hash value corresponding to the generated machine language code and stores and manages the machine language code in the memory 150 in the form of a JIT table 301. The table searching unit 131 searches the JIT table 301 at high speed through the hash value. The table search unit 131 analyzes execution patterns through a run-time profiling technique for predicting object types to optimize dynamic binding, and searches for a high-speed through a key value for function and method matching, The JIT table stored in the memory 150 is retrieved through the table search function.

또한, 테이블 검색부(131)는 JIT 테이블(301) 형태로 저장된 기계어 코드의 사용 빈도를 검사하여, 사용 빈도에 따라 분류하고, 소정의 기준 이하의 사용 빈도를 보이는 기계어 코드를 삭제할 수 있다. 그리고, 테이블 검색부(131)는 중앙처리부(110)로부터 코드 호출이 수신되면, 객체 추적용 고속 탐색을 통해 JIT 테이블(301)을 검색하여 동일한 기계어 코드가 저장되어 있는지를 확인한다. JIT 테이블(301)은 기계어 코드 및 기계어 코드와 대응하는 해시값을 함수 형태로 저장하여 필요로 하는 기계어 코드에 대한 빠른 검색 및 접근을 지원한다. 테이블 접근부(133)는 동일한 기계어 코드가 저장되어 있다면, 수신된 중간 표현 코드를 기계어 코드로 변환하는 과정을 생략하고 저장된 기계어 코드를 다시 중앙처리부(110)로 전달한다.Also, the table searching unit 131 may check the frequency of use of the machine code stored in the form of the JIT table 301, classify it according to the frequency of use, and delete the machine code showing the frequency of use less than a predetermined criterion. When receiving a code call from the central processing unit 110, the table searching unit 131 searches the JIT table 301 through fast search for object tracking to check whether the same machine code is stored. The JIT table 301 stores the hash values corresponding to the machine code and the machine code and functions as a function to support quick retrieval and access to the machine code required. If the same machine code is stored, the table access unit 133 skips the process of converting the received intermediate representation code into the machine code and transfers the stored machine code to the central processing unit 110 again.

속성 액세스부(130)는 상술한 내용을 통해 하드웨어를 이용하여 함수 및 메소드 매칭을 위한 고속 테이블 탐색을 지원하여 새로운 소스 코드에 대한 JIT 컴파일 시간을 단축할 수 있다.The attribute access unit 130 can support JIT compilation time for new source code by supporting high-speed table search for function and method matching using hardware through the above description.

도 5는 본 발명의 일 실시예에 따른 자바스크립트 성능 평가 장치의 가비지 콜렉터부(140)의 동작을 나타내는 도면이다.5 is a diagram illustrating an operation of the garbage collector unit 140 of the JavaScript performance evaluation apparatus according to an embodiment of the present invention.

도 1 및 도 5를 참조하면, 가비지 콜렉터부(140)는 전용 가비지 콜렉터(Garbage Collector) 하드웨어 구조와 분석 도구를 통해 자바스크립트 수행시 메모리(150)의 힙 메모리 영역(Heap Memory Space)내의 미사용 객체 메모리를 반환하고 여유 메모리를 확보한다. 가비지 콜렉터부(140)는 힙 영역내 모든 객체의 참조 경로를 추적하여 참조되지 않는 객체의 힙 메모리를 병렬적으로 회수한다. 그리고, 가비지 콜렉터부(140)는 메모리(150)의 힙 메모리 회수에 따른 메모리 프리 리스트(Free list)를 갱신하여 가비지 콜렉션(Garbage Collection)을 위한 가속 절차를 수행한다. Referring to FIGS. 1 and 5, the garbage collector unit 140 includes a garbage collector hardware structure and an analysis tool. The garbage collector unit 140 analyzes the unused objects in the heap memory space of the memory 150, Returns memory and free memory. The garbage collector unit 140 tracks the reference paths of all the objects in the heap area and reclaims the heap memory of the unreferenced objects in parallel. The garbage collector unit 140 updates the memory list according to the number of heap memories of the memory 150 to perform an acceleration process for garbage collection.

자바 스크립트 기반의 웹 앱을 실행하는 과정에서 각각의 코드 및 데이터는 메모리 영역에 상주하여 실행되게 된다. 이 과정에서, 사용이 종료된(또는 불필요한) 메모리 영역을 방치하는 경우 메모리 부족 현상이 발생할 수 있다. 따라서, 사용이 종료된 메모리 영역을 반환해야 하지만, 사용중인 메모리 영역을 검색하여 회수하는 과정에서 시간 지연이 발생할 수 있다. 따라서, 가비지 콜렉터부(140)는 이와 같은 가비지 콜렉팅 과정에서 소요되는 시간을 최소화하기 위하여 우선 데이터 영역을 검색하여 사용이 종료된 메모리 영역의 주소만을 가져온 후, 병렬적으로 처리하여 메모리를 회수한다.In the process of executing the JavaScript based web app, each code and data is executed in the memory area. In this process, memory shortage may occur when the used memory area is left unused (or unnecessary). Therefore, although the memory area which has been used is to be returned, a time delay may occur in the process of retrieving and retrieving the memory area in use. Accordingly, in order to minimize the time required in the garbage collection process, the garbage collector unit 140 first retrieves the data area, fetches only the address of the used memory area, processes it in parallel, and retrieves the memory .

가비지 콜렉터부(140)는 먼저 메모리 루트 세트(Root set, 410)의 스택 영역(420) 및 레지스터(430)에 위치한 지역 변수(421) 및 스태틱/글로벌 변수(422)의 참조 경로를 추적한다. 참조 경로 추적을 통해 가비지 콜렉터부(140)는 힙 메모리 영역(430)에 존재하는 다수의 힙 객체 중에서 지역 변수(421)와 직간접적으로 연결되어 있는 사용 힙 객체(Heap Object Reachable, 431)와 불필요한 힙 객체(Unreachable Heap Object, 432))를 검사한다. 그리고, 가비지 콜렉터부(140)는 불필요한 힙 객체(432) 전체의 메모리 주소를 일괄적으로 확인한 후, 불필요한 힙 객체(432)를 병렬적으로 회수하여 메모리 공간을 확보한다. 그리고, 가비지 콜렉터부(140)는 메모리 프리 리스트를 갱신한다. 메모리 프리 리스트는 메모리(150)에서 할당 가능한 모든 힙 블록(Heap Block)을 포함한다. 이를 위해, 가비지 콜렉터부(140)는 중앙처리부(110)와 가비지 콜렉터부(140)의 동기화를 위한 신호(Sync), 가비지 콜렉팅 시작 신호(GC Start), 가비지 콜렉팅 종료 신호(GC End) 및 캐쉬 제어 신호(Cache Control)를 송수신한다.The garbage collector unit 140 first traces the reference path of the static variable 422 and the static variable 421 located in the stack area 420 and the register 430 of the memory root set 410. The garbage collector unit 140 traces the reference path through a use heap object 431 directly or indirectly connected to the local variable 421 among a plurality of heap objects existing in the heap memory area 430, Heap object (Unreachable Heap Object, 432)). The garbage collector unit 140 collectively checks the memory addresses of all the unnecessary heap objects 432 and then collects unnecessary heap objects 432 in parallel to secure a memory space. Then, the garbage collector unit 140 updates the memory-free list. The memory-free list includes all the heap blocks that can be allocated in the memory 150. A garbage collection start signal GC start and a garbage collection end signal GC End for synchronizing the central processing unit 110 and the garbage collector unit 140; And a cache control signal (Cache Control).

도 6은 본 발명의 일 실시예에 따른 자바 스크립트 성능 평가 장치의 기계어 코드 생성 방법을 나타내는 흐름도이다.6 is a flowchart illustrating a method for generating machine code of a JavaScript performance evaluating apparatus according to an embodiment of the present invention.

도 6을 참조하면, 본 발명의 일 실시예에 따른 자바 스크립트 성능 평가 장치의 기계어 코드 생성 방법은 수신된 자바스크립트 소스 코드를 파싱(Parsing) 및 중간 표현(Intermediated Representation) 과정을 통해 중간 표현 코드로 변환한다(601). 자바스크립트 소스 코드가 수신되면, 렉서(Lexer) 및 파서(Parser)를 통해 수신된 자바스크립트 소스 코드의 어휘를 분석하고, 파싱 과정을 수행한다. 그리고, 파싱된 자바스크립트 소스 코드를 중간 표현(Intermediated Representation) 과정을 통해 중간 표현 코드로 변환한다. Referring to FIG. 6, a method for generating a machine code of a JavaScript performance evaluating apparatus according to an embodiment of the present invention includes parsing and receiving an intermediate JavaScript code, (601). When the JavaScript source code is received, it analyzes the vocabulary of the JavaScript source code received through the Lexer and Parser, and performs the parsing process. Then, the parsed JavaScript source code is converted into an intermediate representation code through an intermediate representation process.

다음으로, 변환된 중간 표현 코드를 컴파일을 필요로 하는 소스 파일과 바이트 코드 형태의 클래스 파일로 구분한다(602). 그리고, 수신된 중간 표현 코드에 포함된 다수의 코드 중에서 컴파일을 필요로 하는 소스 파일은 JIT 컴파일러를 통해 바이트 코드로 구성된 클래스 파일로 컴파일하고, 수신된 중간 표현 코드에 포함된 다수의 코드 중에서 바이트 코드 형태의 클래스 파일은 실행 과정을 통해 기계어 코드로 변환하여 JIT 테이블에 저장한다(603). 컴파일 및 인터프리팅 과정을 통해 생성된 기계어 코드는 프로그래밍 가능한 JIT 테이블 형태로 메모리에 저장한다. 컴파일 및 인터프리팅 과정을 하드웨어 절차를 통해 수행하여, 자바 스크립트를 소프트웨어적으로 인터프리팅 하는 종래 방법에 비해 중앙처리부의 부담을 줄이고, 처리 속도를 높여 고속 변환을 가능하게 한다. Next, the converted intermediate rendering code is divided into a source file requiring compilation and a class file in byte code form (602). Among the plurality of codes included in the received intermediate representation code, a source file that requires compilation is compiled into a class file composed of byte codes through a JIT compiler, and among the plurality of codes included in the received intermediate representation code, The class file of the type is converted into the machine code through the execution process and stored in the JIT table (603). The machine code generated through compiling and interpreting is stored in memory in the form of a programmable JIT table. Compiling and interpreting are performed through hardware procedures to reduce the burden on the central processing unit and increase the processing speed and enable high-speed conversion as compared with the conventional method of interpreting JavaScript in software.

다음으로, JIT 테이블의 기계어 코드를 사용 빈도에 따라 분류한다(604). 객체 타입 예측을 위한 런타임(Run-time) 프로파일링 기법을 통해 실행 패턴을 분석하여 동적 바인딩(Binding)을 최적화하고, 함수 및 메소드 매칭을 위한 고속 테이블 탐색 기능을 통해 메모리에 저장된 JIT 테이블을 검색한다. 그리고, JIT 테이블 형태로 저장된 기계어 코드의 사용 빈도를 검사하여, 사용 빈도에 따라 분류하고, 소정의 기준 이하의 사용 빈도를 보이는 기계어 코드를 삭제할 수 있다. 다음으로 새로운 중간 표현 코드가 수신되면, 객체 추적용 고속 탐색을 통해 JIT 테이블을 검색하여 동일한 기계어 코드가 저장되어 있는지를 확인한다(605). 동일한 기계어 코드가 저장되어 있다면, 수신된 중간 표현 코드를 기계어 코드로 변환하는 과정을 생략하고 저장된 기계어 코드를 전달한다.Next, the machine code of the JIT table is classified according to the frequency of use (604). Run-time profiling technique for object type prediction optimizes dynamic binding by analyzing execution pattern and searches JIT table stored in memory through fast table search function for function and method matching . Then, the frequency of use of the machine code stored in the JIT table form is checked, the classified machine code is classified according to the frequency of use, and the machine code showing the frequency of use less than a predetermined criterion can be deleted. Next, when a new intermediate representation code is received, the JIT table is searched through the high-speed search for object tracking to check whether the same machine code is stored (605). If the same machine code is stored, the process of converting the received intermediate code into machine code is skipped and the stored machine code is transferred.

도 7은 본 발명의 일 실시예에 따른 자바스크립트 성능 평가 장치의 성능 평가 방법을 나타내는 흐름도이다.7 is a flowchart illustrating a method for evaluating performance of a JavaScript performance evaluating apparatus according to an embodiment of the present invention.

도 7을 참조하면, 본 발명의 일 실시예에 따른 자바스크립트 성능 평가 장치의 성능 평가 방법은 먼저, 수신된 자바스크립트 소스 코드 및 중간 표현 코드에 성능 분석을 위한 탐침 코드를 삽입한다(701). 탐침 코드는 소프트웨어 성능 분석을 위한 데이터를 수집하는 코드로서, 탐침 코드를 중간에 삽입하여 데이터를 수집하기 때문에, 소스 코드를 직접 수정할 필요가 없다. 그리고, 탐침 코드에 기초하여 성능 데이터를 수집한다(702). 탐침 코드는 추가로 삽입되어 소스 코드에 영향을 주지 않으며, 필요한 성능 데이터만을 수집할 수 있다. 또한, 커널 도구를 활용하여 소스 코드 수정 없이 데이터를 수집할 수 있다. 그리고, 수집된 데이터를 통해 하드웨어의 성능을 측정한다(703).Referring to FIG. 7, a performance evaluation method of a JavaScript performance evaluating apparatus according to an embodiment of the present invention first inserts probe codes for performance analysis into received JavaScript source code and intermediate presentation code (701). The probe code is a code for collecting data for software performance analysis. Since the probe code is interleaved to collect data, there is no need to directly modify the source code. The performance data is collected based on the probe code (702). The probe code is further inserted so that it does not affect the source code, and only the necessary performance data can be collected. You can also use the kernel tools to collect data without modifying the source code. Then, hardware performance is measured through the collected data (703).

다음으로, 전력을 측정하여 전력소모량을 확인한다(704). 이를 위해, 구비된 DAQ(Data Acquisition) 및 파워 모니터(Power Monitor)를 포함하는 계측기를 통해 전체 시스템의 파워를 측정하고 파워 레일(Power Rail) 별로 파워를 측정할 수 있다.Next, the power consumption is measured by measuring the power (704). For this purpose, the power of the entire system can be measured and the power can be measured for each power rail through a meter including a DAQ (Data Acquisition) and a power monitor.

다음으로, 수집된 성능 데이터와 수집된 전력소모량 데이터를 서로 동기화한다(705). 일반적으로 전력소모와 하드웨어 성능은 서로 비례한다. 즉, 하드웨어가 높은 성능을 낼수록 전력 소모량 또한 증가한다. 하지만, 낮은 전력소모량은 AP 및 CPU 설계에 있어 요구되는 중요한 요인 중 하나이다. 따라서, 성능 데이터와 전력소모량 데이터를 동기화하여 분석하여 전력소모량과 성능 사이에 상관 관계를 확인할 수 있다. 또한, 수집된 성능 데이터와 수집된 전력소모량 데이터를 누적하여 통계화된 데이터로 관리할 수 있다. 그리고, 동기화된 통계 데이터를 분석(706)한다. 이를 통해, 전력소모량과 성능 사이에 상관 관계를 정확하게 분석하고, 이러한 통합 분석으로 해결책을 모색한다.
Next, the collected performance data and the collected power consumption data are synchronized with each other (705). Power consumption and hardware performance are generally proportional to each other. That is, the higher the performance of the hardware, the higher the power consumption. However, low power consumption is an important factor in AP and CPU design. Therefore, performance data and power consumption data can be analyzed in synchronization to check the correlation between power consumption and performance. In addition, the collected performance data and collected power consumption data can be accumulated and managed as statistical data. The analyzed statistical data is then analyzed (706). By doing so, we can accurately analyze the correlation between power consumption and performance, and search for solutions through this integrated analysis.

이상 바람직한 실시예를 들어 본 발명을 상세하게 설명하였으나, 본 발명은 전술한 실시예에 한정되지 않고, 본 발명의 기술적 사상의 범위 내에서 당분야에서 통상의 지식을 가진자에 의하여 여러 가지 변형이 가능하다.While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed exemplary embodiments, but, on the contrary, It is possible.

100: 자바스크립트 가속 엔진
110: 중앙 처리부
111: 전단 처리부
112: 프로파일부
113: 펌웨어부
120: JIT 테이블부
121: 스위치부
122: 인터프리터부
123: 가속 컴파일부
130: 속성 액세스부
131: 테이블 검색부
132: 해시 생성부
133: 테이블 접근부
140: 가비지 콜렉터부
150: 메모리
160: 성능 분석부
161: 데이터 수집부
162: 전력측정부
163: 동기화 분석부
100: JavaScript acceleration engine
110:
111:
112: Profile section
113: Firmware section
120: JIT table portion
121:
122: Interpreter
123: Accelerated compilation unit
130: Property Access Unit
131:
132: hash generator
133: table access section
140: Garbage collector unit
150: Memory
160: Performance Analysis Department
161: Data collecting unit
162: Power measurement unit
163:

Claims (10)

수신된 자바스크립트 소스 코드를 어휘분석(Lexer) 및 파싱(Parsing)하는 중앙처리부;
상기 파싱된 자바스크립트 소스 코드를 하드웨어로 구현된 JIT 컴파일(Just In Time Compile)을 통해 실행 가능한 기계어 코드(Machine Code)로 변환하는 JIT 테이블부;
상기 변환된 기계어 코드의 사용 빈도에 따라 분류하여 JIT 테이블로 저장하고, 코드 호출 요청에 따라 고속 테이블 탐색 기능을 통해 상기 JIT 테이블에 저장된 기계어 코드를 검색하여 대응하는 기계어 코드를 전달하는 속성 액세스부; 및
상기 수신된 자바스크립트 소스 코드에 탐침 코드를 삽입하여 성능 데이터를 수집하고, 상기 중앙처리부, 상기 JIT 테이블부 및 상기 속성 액세스부의 전력 소모량을 측정하는 성능 분석부;
를 포함하는 것을 특징으로 하는 자바스크립트 성능 평가 장치.
A central processing unit for performing lexical analysis (Lexer) and parsing (Parsing) of the received JavaScript source code;
A JIT table unit for converting the parsed JavaScript source code into a machine code that can be executed through hardware-implemented JIT compilation (Just In Time Compile);
An attribute access unit for classifying the converted machine code according to the frequency of use of the machine code, storing the classified machine code in a JIT table, searching for a machine code stored in the JIT table in response to a code call request, and transmitting a corresponding machine code; And
A performance analyzer for inserting probe codes into the received JavaScript source code to collect performance data, and measuring power consumption of the central processing unit, the JIT table unit, and the property access unit;
And a second step of determining whether or not the JavaScript function is valid.
제1항에 있어서,
상기 성능 분석부는,
상기 성능 데이터 및 상기 전력 소모량을 동기화하여 성능과 전력 소모량 사이의 상관 관계를 분석하는 것을 특징으로 하는 자바스크립트 성능 평가 장치.
The method according to claim 1,
Wherein the performance analyzer comprises:
And analyzing a correlation between performance and power consumption by synchronizing the performance data and the power consumption.
제1항에 있어서,
상기 중앙처리부는,
상기 수신된 자바스크립트 소스 코드의 어휘를 분석하여 파싱 과정을 수행하고, 상기 파싱된 자바스크립트 소스 코드를 고속 인터페이스(High-speed Interface)를 통해 상기 JIT 테이블부로 전달하는 것을 특징으로 하는 자바스크립트 성능 평가 장치.
The method according to claim 1,
The central processing unit,
And parsing the received vocabulary of the JavaScript source code to perform a parsing process, and transmitting the parsed Java script source code to the JIT table unit through a high-speed interface. Device.
제1항에 있어서,
상기 JIT 테이블부는,
상기 파싱된 자바스크립트 소스 코드에 포함된 다수의 코드를 컴파일을 필요로 하는 소스 파일 및 바이트 코드 형태의 클래스 파일로 구분하고, 상기 소스 파일은 JIT 컴파일을 통해 바이트 코드로 구성된 상기 클래스 파일로 컴파일 하고, 상기 클래스 파일은 인터프리팅(Interpreting)을 통해 기계어 코드로 변환되는 것을 특징으로 하는 자바스크립트 성능 평가 장치.
The method according to claim 1,
The JIT table unit,
A plurality of codes included in the parsed JavaScript source code are classified into a source file requiring compilation and a class file of a byte code type and the source file is compiled into the class file composed of byte codes through JIT compilation , And the class file is converted into machine code through interpreting.
제1항에 있어서,
상기 속성 액세스부는,
상기 생성된 기계어 코드와 대응하는 해시값을 생성하고, 상기 생성된 해시값과 상기 기계어 코드를 상기 JIT 테이블에 저장하며, 상기 기계어 코드를 사용 빈도에 따라 분류하고, 상기 해시값을 통해 상기 저장된 기계어 코드를 고속 검색하는 것을 특징으로 하는 자바스크립트 성능 평가 장치.
The method according to claim 1,
The attribute access unit,
Generating a hash value corresponding to the generated machine code, storing the generated hash value and the machine code in the JIT table, classifying the machine code according to the frequency of use, And the code is retrieved at a high speed.
제1항에 있어서,
상기 성능 분석부는,
상기 자바스크립트 소스 코드의 수정 없이 상기 탐침 코드를 코드 중간에 삽입하는 것을 특징으로 하는 자바스크립트 성능 평가 장치.
The method according to claim 1,
Wherein the performance analyzer comprises:
And inserting the probe code into the middle of the code without modifying the JavaScript source code.
제1항에 있어서,
자바스크립트 실행 시, 가비지 콜렉터(Garbage Collector) 하드웨어 구조와 분석 도구를 통해 메모리의 힙 메모리 영역(Heap Memory Space) 내의 미사용 객체 메모리를 반환하여 여유 메모리를 확보하는 가비지 콜렉터부;
를 더 포함하는 것을 특징으로 하는 자바스크립트 성능 평가 장치.
The method according to claim 1,
A garbage collector unit for recovering free memory by returning an unused object memory in a heap memory space of a memory through a garbage collector hardware structure and an analysis tool when the JavaScript is executed;
Further comprising: means for determining whether or not the JavaScript is to be validated.
제7항에 있어서,
상기 가비지 콜렉터부는,
메모리 영역을 분석하여 스택 영역 및 레지스터에 위치한 하나 이상의 변수의 참조 경로를 추적하고, 상기 참조 경로 추적을 통해 힙 메모리 영역(Heap Memory Space) 내에 존재하는 다수의 힙 객체(Hep Object) 중에서 변수와 연결되어 사용중인 힙 객체(Heap Object Reachable) 및 불필요한 힙 객체(Unreachable Heap Object)를 구분하고, 상기 불필요한 힙 객체의 주소를 일괄적으로 확인한 후, 상기 불필요한 힙 객체를 병렬적으로 회수하여 메모리를 반환하는 것을 특징으로 하는 자바스크립트 성능 평가 장치.
8. The method of claim 7,
The garbage collector unit,
The memory region is analyzed to trace the reference path of one or more variables located in the stack region and the register, and the reference path is traced to connect the variable among the plurality of heap objects (Hep Objects) existing in the heap memory space The heap object allocator classifies the heap object in use and the unreachable heap object and collects the unnecessary heap objects in parallel and collects the unnecessary heap objects in parallel to return the memory Wherein the JavaScript performance evaluating device comprises:
수신된 자바스크립트 소스 코드에 탐침 코드를 삽입하는 단계;
상기 삽입된 탐침 코드를 통해 성능 데이터를 수집하는 단계;
상기 수집된 데이터를 통해 하드웨어 성능을 측정하는 단계;
전력 소모량을 측정하는 단계;
상기 성능 데이터 및 상기 전력 소모량을 동기화하는 단계; 및
상기 동기화된 데이터를 분석하는 단계;
를 포함하는 것을 특징을 하는 자바스크립트 성능 평가 방법.
Inserting a probe code into the received JavaScript source code;
Collecting performance data through the inserted probe code;
Measuring hardware performance through the collected data;
Measuring power consumption;
Synchronizing the performance data and the power consumption; And
Analyzing the synchronized data;
Wherein the method comprises:
제9항에 있어서,
상기 수신된 자바스크립트 소스 코드에 탐침 코드를 삽입하는 단계는 상기 자바스크립트 소스 코드의 수정 없이 상기 탐침 코드를 코드 중간에 삽입하는 것을 특징으로 하는 자바스크립트 성능 평가 방법.
10. The method of claim 9,
Wherein inserting the probe code into the received JavaScript source code inserts the probe code into the middle of the code without modifying the JavaScript source code.
KR1020140049069A 2014-04-24 2014-04-24 Apparatus and method for performance evaluation of java script KR20150122924A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020140049069A KR20150122924A (en) 2014-04-24 2014-04-24 Apparatus and method for performance evaluation of java script

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020140049069A KR20150122924A (en) 2014-04-24 2014-04-24 Apparatus and method for performance evaluation of java script

Publications (1)

Publication Number Publication Date
KR20150122924A true KR20150122924A (en) 2015-11-03

Family

ID=54599066

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020140049069A KR20150122924A (en) 2014-04-24 2014-04-24 Apparatus and method for performance evaluation of java script

Country Status (1)

Country Link
KR (1) KR20150122924A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170119477A (en) * 2016-04-19 2017-10-27 삼성에스디에스 주식회사 System and method for monitoring service
KR20190100850A (en) * 2018-02-21 2019-08-29 서강대학교산학협력단 Method for predicting energy consumption of heap memory object and memory system implementing the same

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170119477A (en) * 2016-04-19 2017-10-27 삼성에스디에스 주식회사 System and method for monitoring service
KR20190100850A (en) * 2018-02-21 2019-08-29 서강대학교산학협력단 Method for predicting energy consumption of heap memory object and memory system implementing the same

Similar Documents

Publication Publication Date Title
US5815720A (en) Use of dynamic translation to collect and exploit run-time information in an optimizing compilation system
AU2014275115B2 (en) Debugging native code by transitioning from execution in native mode to execution in interpreted mode
US8819649B2 (en) Profile guided just-in-time (JIT) compiler and byte code generation
US20130205282A1 (en) Transferring program execution from compiled code to interpreted code
TWI525543B (en) Hybrid dynamic code compiling device, method, and service system thereof
EP1918812A1 (en) A software development system
CN103106132A (en) Kernel function calling stack analyzing and debugging method in case of Linux system breakdown
CN105183592B (en) Method and apparatus for supporting performance evaluation
US20130139137A1 (en) Systems and Methods for Customizing Optimization/Transformation/ Processing Strategies
US8122439B2 (en) Method and computer program product for dynamically and precisely discovering deliquent memory operations
CN103412754A (en) Dynamic language code execution method and device
US9250939B2 (en) Information processing device, profile target determining program, and method
JP2020500368A (en) Data prefetching method, apparatus, and system
Zheng et al. Accurate profiling in the presence of dynamic compilation
CN103544276B (en) Method and device for displaying script files by virtual machine
Wang et al. Software performance simulation strategies for high-level embedded system design
KR20150122924A (en) Apparatus and method for performance evaluation of java script
Kyle et al. Efficiently parallelizing instruction set simulation of embedded multi-core processors using region-based just-in-time dynamic binary translation
KR20150122923A (en) Apparatus and method for accellation of java script
CN115629762A (en) JSON data processing method and device, electronic equipment and storage medium
CN114610364A (en) Application program updating method, application program developing method, application program updating device, application program developing device and computer equipment
US9652208B2 (en) Compiler and method for global-scope basic-block reordering
Azeem et al. An interactive code generator and profiler system
Yin et al. Debugopt: Debugging fully optimized natively compiled programs using multistage instrumentation
Cornaglia et al. JIT-based context-sensitive timing simulation for efficient platform exploration

Legal Events

Date Code Title Description
WITN Withdrawal due to no request for examination