SlideShare a Scribd company logo
1 of 38
Download to read offline
나만 몰랐던
김형규
대덕소프트웨어마이스터고등학교
W3C HTML5 Conference 2019
2019.10.11
목차
- 발표자 소개
- 주제를 선정하게 된 계기
- V8이란?
- V8의 역사
- 기존 V8 엔진들 (2015 ~ 2016)
- 현재 V8 (2017 ~ )
- 현재 V8의 동작
- Ignition 인터프리팅 과정.
발표자 소개
김형규 / Clickim
Github: https://github.com/khg0712
Blog: https://velog.io/@k7120792
Email: k7120792@gmail.com
소속: 대덕소프트웨어마이스터고등학교 / MIDAS IT
주제 선정 이유
주제 선정 이유
주제 선정 이유
주제 선정 이유
V8이란?
V8이란?
C++로 작성된 구글의 오픈소스
ECMAScript, WebAssembly 엔진.
V8이란?
즉, JS와 WASM을 실행할 수 있는 환경
V8이 하는 일
V8이 하는 일
1. JS, WASM 코드 컴파일, 실행.
2. 콜 스택 처리 (함수 실행).
3. 메모리 할당
4. 가비지 컬렉션
기존 V8의 구성 요소 (2015)
• FullCode Generator
• Crankshaft
• TurboFan
기존 V8의 실행 과정 (2015)
Parser
Full-
codegen
Crankshaft
TurboFan
Unoptimized
Code
Optimized
Code
Optimized
Code
AST
(Abstract Syntax Tree)
기존 구조의 문제
• 메모리
• 속도
• 복잡성
기존 구조의 문제
• 메모리
• 속도
• 복잡성
기존 구조의 문제
• 메모리
• 속도
• 복잡성
기존 구조의 문제
• 메모리
• 속도
• 복잡성
Parser
Full-
codegen
Crankshaft
TurboFan
Unoptimized
Code
Optimized
Code
Optimized
Code
AST
(Abstract Syntax Tree)
인터프리팅으로의 전환
• 메모리 사용량 감소
• 기계어가 아닌 바이트 코드로의 변환
• 파싱 오버헤드 감소
• 컴파일러 복잡도 감소
• 바이트 코드를 source of truth로!!!
인터프리팅으로의 전환
• 메모리 사용량 감소
• 기계어가 아닌 바이트 코드로의 변환
• 파싱 오버헤드 감소
• 컴파일러 복잡도 감소
• 바이트 코드를 source of truth로!!!
현재 V8의 구성 요소
• Ignition
• TurboFan
현재 V8의 실행 과정
Ignition ByteCode
TurboFan
Optimized
Code
Parser
AST
(Abstract Syntax Tree)
현재 V8의 실행 과정
코드를 어떻게 최적화할까?
• SSA(Static Single Assignment form)을 활용한 최적화
• Loop-invariant code motion
• Linear-scan register allocation
• Inlining
Ignition의 작동 과정
function f(a, b) {
let result = a + b;
if (a > b) {
result = a - b;
}
return result;
}
00 : a1 StackCheck
01 : 25 02 Ldar a1
03 : 32 03 00 Add a0, [0]
06 : 26 fb Star r0
08 : 25 02 Ldar a1
10 : 67 03 01 TestGreaterThan a0, [1]
13 : 95 09 JumpIfFalse [9] (@ 22)
15 : 25 02 Ldar a1
17 : 33 03 02 Sub a0, [2]
20 : 26 fb Star r0
22 : 25 fb Ldar r0
24 : a5 Return
f(4, 10);
Ignition의 작동 과정
00 : a1 StackCheck
01 : 25 02 Ldar a1
03 : 32 03 00 Add a0, [0]
06 : 26 fb Star r0
08 : 25 02 Ldar a1
10 : 67 03 01 TestGreaterThan a0, [1]
13 : 95 09 JumpIfFalse [9] (@ 22)
15 : 25 02 Ldar a1
17 : 33 03 02 Sub a0, [2]
20 : 26 fb Star r0
22 : 25 fb Ldar r0
24 : a5 Return
f(4, 10);
버퍼 오버플로우를 막기 위한
스택 가드 체크
Ignition의 작동 과정
00 : a1 StackCheck
01 : 25 02 Ldar a1
03 : 32 03 00 Add a0, [0]
06 : 26 fb Star r0
08 : 25 02 Ldar a1
10 : 67 03 01 TestGreaterThan a0, [1]
13 : 95 09 JumpIfFalse [9] (@ 22)
15 : 25 02 Ldar a1
17 : 33 03 02 Sub a0, [2]
20 : 26 fb Star r0
22 : 25 fb Ldar r0
24 : a5 Return
f(4, 10);
4
parameters
registers
10
accumulator
a0
10
a1
r0
Ignition의 작동 과정
00 : a1 StackCheck
01 : 25 02 Ldar a1
03 : 32 03 00 Add a0, [0]
06 : 26 fb Star r0
08 : 25 02 Ldar a1
10 : 67 03 01 TestGreaterThan a0, [1]
13 : 95 09 JumpIfFalse [9] (@ 22)
15 : 25 02 Ldar a1
17 : 33 03 02 Sub a0, [2]
20 : 26 fb Star r0
22 : 25 fb Ldar r0
24 : a5 Return
4
parameters
registers
14
accumulator
a0
10
a1
r0
f(4, 10);
Ignition의 작동 과정
00 : a1 StackCheck
01 : 25 02 Ldar a1
03 : 32 03 00 Add a0, [0]
06 : 26 fb Star r0
08 : 25 02 Ldar a1
10 : 67 03 01 TestGreaterThan a0, [1]
13 : 95 09 JumpIfFalse [9] (@ 22)
15 : 25 02 Ldar a1
17 : 33 03 02 Sub a0, [2]
20 : 26 fb Star r0
22 : 25 fb Ldar r0
24 : a5 Return
4
parameters
14
registers
14
accumulator
a0
10
a1
r0
f(4, 10);
Ignition의 작동 과정
00 : a1 StackCheck
01 : 25 02 Ldar a1
03 : 32 03 00 Add a0, [0]
06 : 26 fb Star r0
08 : 25 02 Ldar a1
10 : 67 03 01 TestGreaterThan a0, [1]
13 : 95 09 JumpIfFalse [9] (@ 22)
15 : 25 02 Ldar a1
17 : 33 03 02 Sub a0, [2]
20 : 26 fb Star r0
22 : 25 fb Ldar r0
24 : a5 Return
4
parameters
14
registers
10
accumulator
a0
10
a1
r0
f(4, 10);
Ignition의 작동 과정
00 : a1 StackCheck
01 : 25 02 Ldar a1
03 : 32 03 00 Add a0, [0]
06 : 26 fb Star r0
08 : 25 02 Ldar a1
10 : 67 03 01 TestGreaterThan a0, [1]
13 : 95 09 JumpIfFalse [9] (@ 22)
15 : 25 02 Ldar a1
17 : 33 03 02 Sub a0, [2]
20 : 26 fb Star r0
22 : 25 fb Ldar r0
24 : a5 Return
4
parameters
14
registers
10
accumulator
a0
10
a1
r0
f(4, 10);
Ignition의 작동 과정
00 : a1 StackCheck
01 : 25 02 Ldar a1
03 : 32 03 00 Add a0, [0]
06 : 26 fb Star r0
08 : 25 02 Ldar a1
10 : 67 03 01 TestGreaterThan a0, [1]
13 : 95 09 JumpIfFalse [9] (@ 22)
15 : 25 02 Ldar a1
17 : 33 03 02 Sub a0, [2]
20 : 26 fb Star r0
22 : 25 fb Ldar r0
24 : a5 Return
4
parameters
14
registers
0
accumulator
a0
10
a1
r0
f(4, 10);
Ignition의 작동 과정
00 : a1 StackCheck
01 : 25 02 Ldar a1
03 : 32 03 00 Add a0, [0]
06 : 26 fb Star r0
08 : 25 02 Ldar a1
10 : 67 03 01 TestGreaterThan a0, [1]
13 : 95 09 JumpIfFalse [9] (@ 22)
15 : 25 02 Ldar a1
17 : 33 03 02 Sub a0, [2]
20 : 26 fb Star r0
22 : 25 fb Ldar r0
24 : a5 Return
4
parameters
14
registers
0
accumulator
a0
10
a1
r0
f(4, 10);
Ignition의 작동 과정
00 : a1 StackCheck
01 : 25 02 Ldar a1
03 : 32 03 00 Add a0, [0]
06 : 26 fb Star r0
08 : 25 02 Ldar a1
10 : 67 03 01 TestGreaterThan a0, [1]
13 : 95 09 JumpIfFalse [9] (@ 22)
15 : 25 02 Ldar a1
17 : 33 03 02 Sub a0, [2]
20 : 26 fb Star r0
22 : 25 fb Ldar r0
24 : a5 Return
4
parameters
14
registers
14
accumulator
a0
10
a1
r0
f(4, 10);
Ignition의 작동 과정
00 : a1 StackCheck
01 : 25 02 Ldar a1
03 : 32 03 00 Add a0, [0]
06 : 26 fb Star r0
08 : 25 02 Ldar a1
10 : 67 03 01 TestGreaterThan a0, [1]
13 : 95 09 JumpIfFalse [9] (@ 22)
15 : 25 02 Ldar a1
17 : 33 03 02 Sub a0, [2]
20 : 26 fb Star r0
22 : 25 fb Ldar r0
24 : a5 Return
4
parameters
14
registers
14
accumulator
a0
10
a1
r0
f(4, 10);
Q & A
참고 자료
• https://mathiasbynens.be/notes/prototypes
• https://draft.li/blog/2016/01/22/chromium-chrome-v8-crankshaft-bailout-
reasons/
• https://v8.dev/blog/launching-ignition-and-turbofan
• https://v8.dev/blog/ignition-interpreter
• https://github.com/v8/v8/blob/master/src/interpreter/bytecodes.h
• https://nodesource.com/blog/why-the-new-v8-is-so-damn-fast/
• https://medium.com/dailyjs/understanding-v8s-bytecode-317d46c94775
• https://hackernoon.com/javascript-v8-engine-explained-3f940148d4ef
• https://benediktmeurer.de/2016/11/25/v8-behind-the-scenes-november-edition
• https://v8.dev/docs/ignition
• https://v8.dev/docs/turbofan
감사합니다

More Related Content

Recently uploaded

Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Wonjun Hwang
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Kim Daeun
 
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionKim Daeun
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Wonjun Hwang
 
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)Tae Young Lee
 

Recently uploaded (6)

Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
 
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)
 
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)
 

Featured

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming LanguageSimplilearn
 

Featured (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

V8의 작동원리

  • 2. 목차 - 발표자 소개 - 주제를 선정하게 된 계기 - V8이란? - V8의 역사 - 기존 V8 엔진들 (2015 ~ 2016) - 현재 V8 (2017 ~ ) - 현재 V8의 동작 - Ignition 인터프리팅 과정.
  • 3. 발표자 소개 김형규 / Clickim Github: https://github.com/khg0712 Blog: https://velog.io/@k7120792 Email: k7120792@gmail.com 소속: 대덕소프트웨어마이스터고등학교 / MIDAS IT
  • 9. V8이란? C++로 작성된 구글의 오픈소스 ECMAScript, WebAssembly 엔진.
  • 10. V8이란? 즉, JS와 WASM을 실행할 수 있는 환경
  • 12. V8이 하는 일 1. JS, WASM 코드 컴파일, 실행. 2. 콜 스택 처리 (함수 실행). 3. 메모리 할당 4. 가비지 컬렉션
  • 13. 기존 V8의 구성 요소 (2015) • FullCode Generator • Crankshaft • TurboFan
  • 14. 기존 V8의 실행 과정 (2015) Parser Full- codegen Crankshaft TurboFan Unoptimized Code Optimized Code Optimized Code AST (Abstract Syntax Tree)
  • 15. 기존 구조의 문제 • 메모리 • 속도 • 복잡성
  • 16. 기존 구조의 문제 • 메모리 • 속도 • 복잡성
  • 17. 기존 구조의 문제 • 메모리 • 속도 • 복잡성
  • 18. 기존 구조의 문제 • 메모리 • 속도 • 복잡성 Parser Full- codegen Crankshaft TurboFan Unoptimized Code Optimized Code Optimized Code AST (Abstract Syntax Tree)
  • 19. 인터프리팅으로의 전환 • 메모리 사용량 감소 • 기계어가 아닌 바이트 코드로의 변환 • 파싱 오버헤드 감소 • 컴파일러 복잡도 감소 • 바이트 코드를 source of truth로!!!
  • 20. 인터프리팅으로의 전환 • 메모리 사용량 감소 • 기계어가 아닌 바이트 코드로의 변환 • 파싱 오버헤드 감소 • 컴파일러 복잡도 감소 • 바이트 코드를 source of truth로!!!
  • 21. 현재 V8의 구성 요소 • Ignition • TurboFan
  • 22. 현재 V8의 실행 과정 Ignition ByteCode TurboFan Optimized Code Parser AST (Abstract Syntax Tree)
  • 24. 코드를 어떻게 최적화할까? • SSA(Static Single Assignment form)을 활용한 최적화 • Loop-invariant code motion • Linear-scan register allocation • Inlining
  • 25. Ignition의 작동 과정 function f(a, b) { let result = a + b; if (a > b) { result = a - b; } return result; } 00 : a1 StackCheck 01 : 25 02 Ldar a1 03 : 32 03 00 Add a0, [0] 06 : 26 fb Star r0 08 : 25 02 Ldar a1 10 : 67 03 01 TestGreaterThan a0, [1] 13 : 95 09 JumpIfFalse [9] (@ 22) 15 : 25 02 Ldar a1 17 : 33 03 02 Sub a0, [2] 20 : 26 fb Star r0 22 : 25 fb Ldar r0 24 : a5 Return f(4, 10);
  • 26. Ignition의 작동 과정 00 : a1 StackCheck 01 : 25 02 Ldar a1 03 : 32 03 00 Add a0, [0] 06 : 26 fb Star r0 08 : 25 02 Ldar a1 10 : 67 03 01 TestGreaterThan a0, [1] 13 : 95 09 JumpIfFalse [9] (@ 22) 15 : 25 02 Ldar a1 17 : 33 03 02 Sub a0, [2] 20 : 26 fb Star r0 22 : 25 fb Ldar r0 24 : a5 Return f(4, 10); 버퍼 오버플로우를 막기 위한 스택 가드 체크
  • 27. Ignition의 작동 과정 00 : a1 StackCheck 01 : 25 02 Ldar a1 03 : 32 03 00 Add a0, [0] 06 : 26 fb Star r0 08 : 25 02 Ldar a1 10 : 67 03 01 TestGreaterThan a0, [1] 13 : 95 09 JumpIfFalse [9] (@ 22) 15 : 25 02 Ldar a1 17 : 33 03 02 Sub a0, [2] 20 : 26 fb Star r0 22 : 25 fb Ldar r0 24 : a5 Return f(4, 10); 4 parameters registers 10 accumulator a0 10 a1 r0
  • 28. Ignition의 작동 과정 00 : a1 StackCheck 01 : 25 02 Ldar a1 03 : 32 03 00 Add a0, [0] 06 : 26 fb Star r0 08 : 25 02 Ldar a1 10 : 67 03 01 TestGreaterThan a0, [1] 13 : 95 09 JumpIfFalse [9] (@ 22) 15 : 25 02 Ldar a1 17 : 33 03 02 Sub a0, [2] 20 : 26 fb Star r0 22 : 25 fb Ldar r0 24 : a5 Return 4 parameters registers 14 accumulator a0 10 a1 r0 f(4, 10);
  • 29. Ignition의 작동 과정 00 : a1 StackCheck 01 : 25 02 Ldar a1 03 : 32 03 00 Add a0, [0] 06 : 26 fb Star r0 08 : 25 02 Ldar a1 10 : 67 03 01 TestGreaterThan a0, [1] 13 : 95 09 JumpIfFalse [9] (@ 22) 15 : 25 02 Ldar a1 17 : 33 03 02 Sub a0, [2] 20 : 26 fb Star r0 22 : 25 fb Ldar r0 24 : a5 Return 4 parameters 14 registers 14 accumulator a0 10 a1 r0 f(4, 10);
  • 30. Ignition의 작동 과정 00 : a1 StackCheck 01 : 25 02 Ldar a1 03 : 32 03 00 Add a0, [0] 06 : 26 fb Star r0 08 : 25 02 Ldar a1 10 : 67 03 01 TestGreaterThan a0, [1] 13 : 95 09 JumpIfFalse [9] (@ 22) 15 : 25 02 Ldar a1 17 : 33 03 02 Sub a0, [2] 20 : 26 fb Star r0 22 : 25 fb Ldar r0 24 : a5 Return 4 parameters 14 registers 10 accumulator a0 10 a1 r0 f(4, 10);
  • 31. Ignition의 작동 과정 00 : a1 StackCheck 01 : 25 02 Ldar a1 03 : 32 03 00 Add a0, [0] 06 : 26 fb Star r0 08 : 25 02 Ldar a1 10 : 67 03 01 TestGreaterThan a0, [1] 13 : 95 09 JumpIfFalse [9] (@ 22) 15 : 25 02 Ldar a1 17 : 33 03 02 Sub a0, [2] 20 : 26 fb Star r0 22 : 25 fb Ldar r0 24 : a5 Return 4 parameters 14 registers 10 accumulator a0 10 a1 r0 f(4, 10);
  • 32. Ignition의 작동 과정 00 : a1 StackCheck 01 : 25 02 Ldar a1 03 : 32 03 00 Add a0, [0] 06 : 26 fb Star r0 08 : 25 02 Ldar a1 10 : 67 03 01 TestGreaterThan a0, [1] 13 : 95 09 JumpIfFalse [9] (@ 22) 15 : 25 02 Ldar a1 17 : 33 03 02 Sub a0, [2] 20 : 26 fb Star r0 22 : 25 fb Ldar r0 24 : a5 Return 4 parameters 14 registers 0 accumulator a0 10 a1 r0 f(4, 10);
  • 33. Ignition의 작동 과정 00 : a1 StackCheck 01 : 25 02 Ldar a1 03 : 32 03 00 Add a0, [0] 06 : 26 fb Star r0 08 : 25 02 Ldar a1 10 : 67 03 01 TestGreaterThan a0, [1] 13 : 95 09 JumpIfFalse [9] (@ 22) 15 : 25 02 Ldar a1 17 : 33 03 02 Sub a0, [2] 20 : 26 fb Star r0 22 : 25 fb Ldar r0 24 : a5 Return 4 parameters 14 registers 0 accumulator a0 10 a1 r0 f(4, 10);
  • 34. Ignition의 작동 과정 00 : a1 StackCheck 01 : 25 02 Ldar a1 03 : 32 03 00 Add a0, [0] 06 : 26 fb Star r0 08 : 25 02 Ldar a1 10 : 67 03 01 TestGreaterThan a0, [1] 13 : 95 09 JumpIfFalse [9] (@ 22) 15 : 25 02 Ldar a1 17 : 33 03 02 Sub a0, [2] 20 : 26 fb Star r0 22 : 25 fb Ldar r0 24 : a5 Return 4 parameters 14 registers 14 accumulator a0 10 a1 r0 f(4, 10);
  • 35. Ignition의 작동 과정 00 : a1 StackCheck 01 : 25 02 Ldar a1 03 : 32 03 00 Add a0, [0] 06 : 26 fb Star r0 08 : 25 02 Ldar a1 10 : 67 03 01 TestGreaterThan a0, [1] 13 : 95 09 JumpIfFalse [9] (@ 22) 15 : 25 02 Ldar a1 17 : 33 03 02 Sub a0, [2] 20 : 26 fb Star r0 22 : 25 fb Ldar r0 24 : a5 Return 4 parameters 14 registers 14 accumulator a0 10 a1 r0 f(4, 10);
  • 36. Q & A
  • 37. 참고 자료 • https://mathiasbynens.be/notes/prototypes • https://draft.li/blog/2016/01/22/chromium-chrome-v8-crankshaft-bailout- reasons/ • https://v8.dev/blog/launching-ignition-and-turbofan • https://v8.dev/blog/ignition-interpreter • https://github.com/v8/v8/blob/master/src/interpreter/bytecodes.h • https://nodesource.com/blog/why-the-new-v8-is-so-damn-fast/ • https://medium.com/dailyjs/understanding-v8s-bytecode-317d46c94775 • https://hackernoon.com/javascript-v8-engine-explained-3f940148d4ef • https://benediktmeurer.de/2016/11/25/v8-behind-the-scenes-november-edition • https://v8.dev/docs/ignition • https://v8.dev/docs/turbofan