1 research outputs found
ES6 ์๋ฐ์คํฌ๋ฆฝํธ์ ์ค๋ ์ท ๊ธฐ๋ฐ ๋ง์ด๊ทธ๋ ์ด์
ํ์๋
ผ๋ฌธ(์์ฌ) -- ์์ธ๋ํ๊ต๋ํ์ : ๊ณต๊ณผ๋ํ ์ ๊ธฐยท์ ๋ณด๊ณตํ๋ถ, 2021.8. ๋ฌธ์๋ฌต.์ต๊ทผ ์น ํ๋ซํผ ๋ฐ ์๋ฐ์คํฌ๋ฆฝํธ์ ์ธ๊ธฐ์ ํจ๊ป, ์๋ฐ์คํฌ๋ฆฝํธ๋ก ์์ฑ๋ ํ๋ก๊ทธ๋จ์ ์ํ ์ฑ ๋ง์ด๊ทธ๋ ์ด์
๊ธฐ์ ์ด ์ฐ๊ตฌ๋ ๋ฐ ์๋ค. ์ด๋ ์ด์ข
์ ๊ธฐ๊ธฐ ๊ฐ์ ์ฐ์์ ์ธ ์ํฌํ๋ก์ฐ๋ฅผ ์ ๊ณตํด ์๋ก์ด ์ฌ์ฉ์ ๊ฒฝํ์ ์ ๊ณตํ๋ ๊ธฐ์ ์ ์ผ์ปซ๋๋ค. ์ฌ๋ฌ ์ ํ ์ฐ๊ตฌ์์ ์ค๋
์ท ๊ธฐ๋ฐ ๋ฐฉ๋ฒ๋ก ์ ์ฌ์ฉํด ์ฑ์ ๋ฐํ์ ์ํ๋ฅผ ํ
์คํธ ํํ๋ก ์ง๋ ฌํ ๋ฐ ๋ณต์ํ๋ ์๋๋ฅผ ํ๋ค. ๊ทธ๋ฌ๋, ๊ธฐ์กด ์ฐ๊ตฌ๋ค์ ๊ตฌ ๋ฒ์ ์๋ฐ์คํฌ๋ฆฝํธ ์์์ ์งํ๋๋ค๋ ํ๊ณ๊ฐ ์๋ค. ์ด์ ๋นํด ECMAScript2015 (ES6) ์
๋ฐ์ดํธ ์ดํ ์๋ฐ์คํฌ๋ฆฝํธ์ ๋ค์ํ ๊ธฐ๋ฅ์ด ๋์
๋์๊ธฐ ๋๋ฌธ์, ๊ธฐ์กด ๋ฐฉ๋ฒ๋ค์ ์ค๋๋ real-world ์ ํ๋ฆฌ์ผ์ด์
์ ๋ง์ด๊ทธ๋ ์ด์
ํ๊ธฐ ์ด๋ ต๋ค.
๋ณธ ๋
ผ๋ฌธ์ [19]์์ ์๊ฐ๋ ์ฐ๋ฆฌ์ ํ๋ ์์ํฌ๋ฅผ ์๊ฐํ๋ค. ์ฐ๋ฆฌ๋ ์ ํ ์ฐ๊ตฌ์์ ๋ค๋ค์ง์ง ์์ block scope, module, class syntax์ ๊ฐ์ ES6์ ์ฃผ์ ๊ธฐ๋ฅ์ ๋ถ์ํ์ผ๋ฉฐ ์ด๋ฌํ ์๋ก์ด ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ ์ฑ์ ๋ง์ด๊ทธ๋ ์ด์
ํ๊ธฐ ์ํ ์๊ณ ๋ฆฌ์ฆ์ ์ ์ํ๋ค. ๋ํ, ์ฐ๋ฆฌ๋ ์ต์ ์๋ฐ์คํฌ๋ฆฝํธ ์์ง์ ๋ํ ๋ถ์์ ํตํด ์คํ ์ค์ธ ์๋ฐ์คํฌ๋ฆฝํธ ํ๋ก๊ทธ๋จ์ ๋ฐํ์ ์ํ๋ฅผ scope tree๋ผ๋ ์๋ฃ๊ตฌ์กฐ ์์ ์ง๋ ฌํํ๊ณ , ํ์ฒ๋ฆฌ๋ฅผ ๊ฑฐ์น scope tree๋ก๋ถํฐ ์ค๋
์ท ์ฝ๋๋ฅผ ์์ฑํ๋ค. ์ด๋ฌํ ๋ฐฉ๋ฒ๋ก ์ V8 ์๋ฐ์คํฌ๋ฆฝํธ ์์ง์ธ ์์ ๊ตฌํํ์ผ๋ฉฐ, ๋ณต์กํ ์ต์ ์๋ฐ์คํฌ๋ฆฝํธ ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ ๋ฒค์น๋งํฌ ํ๋ก๊ทธ๋จ์ ๋ํด ์คํํ๋ค. ์คํ ๊ฒฐ๊ณผ๋ฅผ ํตํด ์ด๋ฌํ ๋ฐฉ๋ฒ์ด ๋ชจ๋ฐ์ผ ๊ธฐ๊ธฐ ๊ฐ์ 5๊ฐ์ ๋ฒค์น๋งํฌ ํ๋ก๊ทธ๋จ์ ์ฑ๊ณต์ ์ผ๋ก ๋ง์ด๊ทธ๋ ์ด์
์ํจ๋ค๋ ๊ฒ์ ๋ณด์๋ค. ๋ณต์ก๋๊ฐ ๊ฐ์ฅ ๋์ ์ฑ (ML ๋ฒค์น๋งํฌ, ์์ค ์ฝ๋ ํฌ๊ธฐ 213KB)์ ๋ํ ์คํ์์ ํ๋ ์์ํฌ๋ก ์ธํ ์๊ฐ ๋ถํ๋ฅผ ์ธก์ ํ ๊ฒฐ๊ณผ, X86 ๋ฉํฑ์์ 200ms ๋ฏธ๋ง, ARM ๊ธฐ๋ฐ ์๋ฒ ๋๋ ๋ณด๋์์ 800ms ๋ฏธ๋ง์ด์๋ค. ์ด๋ฌํ ๊ฒฐ๊ณผ๋ฅผ ํตํด ์์์ด ์ ํ๋ IoT ๊ธฐ๊ธฐ ๋ฑ์ ๋ํ ์ ์ฉ ๊ฐ๋ฅ์ฑ์ ๊ฒ์ฆํ์ผ๋ฉฐ, ์ถ๊ฐ์ ์ผ๋ก ํ๋ ์์ํฌ์ ํ์ฉ ๋ฐฉ์ ๋ฐ ํฅํ ์ฐ๊ตฌ ๋ฐฉํฅ์ ๋ํด ๋
ผ์ํ๋ค.With the growing popularity of the web platform and JavaScript, an interesting user experience called application (app) migration has been proposed for JavaScript programs. To enable a non-breaking workflow across different devices, recent studies have proposed snapshot-based techniques in which an appโs runtime state is serialized into a text form that can be restored back later. A limitation of existing literature, however, is that they are based on old JavaScript specifications. Since major updates introduced by ECMASCript2015 (a.k.a. ES6), JavaScript supports various features that cannot be migrated correctly with existing methods. Some of these features are heavily used in todayโs real-world apps and thus greatly reduces the scope of previous works.
In this thesis, I will mainly introduce my work presented in [19]. In the paper, we analyzed ES6 features such as block scopes, modules, and class syntax that were previously uncovered in app migration. We presented an algorithm that enables migration of apps implemented with these new features. Based on the standards adopted in modern JavaScript engines, our approach serializes a running program into a scope tree and reorganizes it for snapshot code generation. We implemented our idea on the open source V8 engine and experiment with complex benchmark programs of modern JavaScript. Results showed that our approach correctly migrates 5 target programs between mobile devices. Our framework could migrate the most complex app of source code size 213KB in less than 200ms in a X86 laptop and 800ms in an embedded ARM board, showing feasibility in resource-constrained IoT devices. I will also discuss possible use cases and research directions and conclude.Chapter 1. Introduction 1
1.1. JavaScript App Migration 1
1.2. Purpose of Research 2
Chapter 2. Background 4
2.1. Snapshot-based Approach 4
2.2. Function Closure and Scope Tree 6
2.3. Limitations of Previous Works 6
Chapter 3. Proposed Approach 10
3.1. Module Profiling 10
3.2. Migrating Modified Built-in Objects 11
3.3. Scope Tree Building 11
3.4. Syntax-Aware Tree Re-ordering 12
3.5. Tree Partitioning 13
3.6. Snapshot Code Generation 13
Chapter 4. Evaluation 17
4.1. Implementation and Setup 17
4.2. Scope Tree Analysis 18
4.3. Snapshot Code Sizes 19
4.4. Framework Time Overhead 20
Chapter 5. Discussion 22
5.1. Limitations 22
5.2. Alternative Approach 22
5.3. Potential Use Cases 23
Chapter 6. Conclusion 24
Bibliography 25
Abstract in Korean 27์