1 research outputs found

    ES6 ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ์˜ ์Šค๋ƒ…์ƒท ๊ธฐ๋ฐ˜ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜

    Get PDF
    ํ•™์œ„๋…ผ๋ฌธ(์„์‚ฌ) -- ์„œ์šธ๋Œ€ํ•™๊ต๋Œ€ํ•™์› : ๊ณต๊ณผ๋Œ€ํ•™ ์ „๊ธฐยท์ •๋ณด๊ณตํ•™๋ถ€, 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์„
    corecore