SlideShare a Scribd company logo
1 of 81
Implementing a
JavaScript Engine

Krystal Mok (@rednaxelafx)
2013-11-10
Implementing a
(Modern, High Performance?)
JavaScript Engine
About Me
• Programming language and virtual machine
enthusiast
• Worked on the HotSpot JVM at Taobao and
Oracle
• Also worked on a JavaScript engine project
• Twitter / Sina Weibo: @rednaxelafx
• Blog: English / Chinese
Agenda
•
•
•
•

Know the Heritage
JavaScript Engine Overview
Implementation Strategies and Tradeoffs
A bit about Nashorn
The roots of JavaScript language and modern JavaScript engines

KNOW THE HERITAGE
Heritage of the Language
Scheme
function closure

Self

prototype-based OO

C-like syntax,
built-in objects

Java
…

JavaScript
Language Comparison
Self
• Prototype-based OO
• Multiple Prototype
• Dynamically Typed
• Dynamically Extend Objects
• Mirror-based Reflection
• Block (closure)
• Support Non-local Return
• (pass a error handler to
methods that might one)

JavaScript (ECMAScript 5)
• Prototype-based OO
• Single Prototype
• Dynamically Typed
• Dynamically Extend Objects
• Reflection
• First-class Function (closure)
• (no non-local return)
• Exception Handling
Heritage of the Language
function MyPoint(x, y) {
this.x = x;
this.y = y;
}
MyPoint.prototype.distance = function (p) {
var xd = this.x - p.x,
yd = this.y - p.y;
return Math.sqrt(xd*xd + yd*yd);
}
var p = new Point(2013, 11);
Heritage of the Language
traits myPoint = (|
parent* = traits clonable.
initX: newX Y: newY = (x: newX. y: newY)
distance: p = (| xd. yd |
xd: x - p x.
yd: y - p y.
(xd squared + yd squared) squareRooted
).
|).
myPoint = (|
parent* = traits myPoint.
x <- 0.
y <- 0
|).
p: myPoint copy initX: 2013 Y: 11
Heritage of the Language

on Self 4.4 / Mac OS X 10.7.5
Heritage of the VM
CLDC-HI
(Java)

HotSpot VM
(Java)

Strongtalk VM
(Smalltalk)

Self VM

V8

(Self)

(JavaScript)
What’s in common?
• Lars Bak!
VM Comparison
Self VM (3rd Generation)

V8 (with Crankshaft)

• Fast Object w/Hidden Class
• Tiered Compilation

• Fast Object w/Hidden Class
• Tiered Compilation

– OSR and deoptimization
– support for full-speed
debugging

– OSR and deoptimization
– support for full-speed
debugging

• Type Feedback
– Polymorphic Inline Caching

•
•
•
•

Type Inference
Method/Block Inlining
Method Customization
Generational Scavenging
– Scavenging + Mark-Compact

• Type Feedback
– Polymorphic Inline Caching

• Type Inference
• Function Inlining
• Generational Scavenging
– Scavenging + MarkSweep/Mark-Compact
To Implement a High Performance
JavaScript Engine
• Learn from Self VM as a basis!
Themes
• Pay-as-you-go / Lazy
• Take advantage of runtime information
– Type feedback

• Take advantage of actual code stability
– Try to behave as static as possible
Outline of the main components

JAVASCRIPT ENGINE OVERVIEW
Components of a JavaScript Engine
•
•
•
•
•
•

Parser
Runtime
Execution Engine
Garbage Collector (GC)
Foreign Function Interface (FFI)
Debugger and Diagnostics
Components of a JavaScript Engine
Source
Code

Parser

F
F
I
host /
external
library

AST

Execution
Engine

Memory (Runtime Data Areas)

Call
Stack

JavaScript
Objects

GC
Components of a JavaScript Engine
•
•
•
•
•
•

Parser
Runtime
Execution Engine
Garbage Collector (GC)
Foreign Function Interface (FFI)
Debugger and Diagnostics
Parser
• Parse source code into internal representation
• Usually generates AST
VarDecl: z

var z = x + y

BinaryArith: +

x

y
Components of a JavaScript Engine
•
•
•
•
•
•

Parser
Runtime
Execution Engine
Garbage Collector (GC)
Foreign Function Interface (FFI)
Debugger and Diagnostics
Runtime
•
•
•
•

Value Representation
Object Model
Built-in Objects
Misc.
Object

Function
__proto__
prototype

__proto__

__proto__

constructor

prototype

…

__proto__

null

__proto__

x

2013

constructor

y

11

…

…

…
Components of a JavaScript Engine
•
•
•
•
•
•

Parser
Runtime
Execution Engine
Garbage Collector (GC)
Foreign Function Interface (FFI)
Debugger and Diagnostics
Execution Engine
• Execute JavaScript Code
VarDecl: z

addl %rcx, %rax

BinaryArith: +

x

y
Components of a JavaScript Engine
•
•
•
•
•
•

Parser
Runtime
Execution Engine
Garbage Collector (GC)
Foreign Function Interface (FFI)
Debugger and Diagnostics
Garbage Collector
• Collect memory from unused objects
Components of a JavaScript Engine
•
•
•
•
•
•

Parser
Runtime
Execution Engine
Garbage Collector (GC)
Foreign Function Interface (FFI)
Debugger and Diagnostics
Foreign Function Interface
• Handle interaction between JavaScript and
“the outside world”
• JavaScript call out to native function
• Native function call into JavaScript function, or
access JavaScript object
Components of a JavaScript Engine
•
•
•
•
•
•

Parser
Runtime
Execution Engine
Garbage Collector (GC)
Foreign Function Interface (FFI)
Debugger and Diagnostics
Debugger and Diagnostics
IMPLEMENTATION STRATEGIES AND
TRADEOFFS
Parser
•
•
•
•
•

LR
LL
Recursive Descent
Operator Precedence
Lazy Parsing / Deferred Parsing
Value Representation
• Pointers, and all values allocated on heap
• Discriminated Union
• Tagged Value / Tagged Pointer
Value Representation
• Pointers, and all values allocated on heap
• Discriminated Union
• Tagged Value / Tagged Pointer

Tag_Int
2013

typedef Object* JSValue;
Value Representation
• Pointers, and all values allocated on heap
• Discriminated Union
• Tagged Value / Tagged Pointer

Tag_Int
2013

class JSValue {
ObjectType ot;
union {
double n;
bool
b;
Object* o;
// …
} u;
}
Tagged
• Tagged Pointer

small integer

00

pointer

01

– Non-zero tag on pointer
– Favor small integer arithmetics

• Tagged Value
– Non-zero tag on non-pointer
– Favor pointer access

• NaN-boxing
– use special NaN value as box
Tagged
• Tagged Pointer
– Non-zero tag on pointer
– Favor small integer arithmetics

• Tagged Value
– Non-zero tag on non-pointer
– Favor pointer access

• NaN-boxing
– use special NaN value as box

small integer

01

pointer

00
Tagged
• Tagged Pointer
– Non-zero tag on pointer
– Favor small integer arithmetics

• Tagged Value
– Non-zero tag on non-pointer
00000000
– Favor pointer access

• NaN-boxing

pointer

xxxxxxxx
11111111

double
00000000

– use special QNaN value as box

integer
Value Representation in Self
Numeric Tower
•
•
•
•

Internal Numeric Tower
Smi -> HeapDouble
int -> long -> double
unboxed number
Object Model
• Hash based
– “Dictionary Mode”

• Hidden Class based
– “Fast Object”
Object Model
Example: behind Groovy’s “object literal”-ish syntax
Groovy code:

Equivalent Java code:

obj = [
x: 2013,
y: 42
];

obj =
new LinkedHashMap(2);
obj.put("x", 2013);
obj.put("y", 42);

i = obj.x;

i = obj.get("x");
key

“y”

value
keySet

null

0

next

null

values

null

1

hash

126

before

table
size
threshold

1

loadFactor
modCount

after

2

entrySet

header
42

key

null

0.75

value

null

key

2

next

null

value

null

hash

-1

next

null

before

hash

127

after

before

header
accessOrder

x

false

after

“x”

header
y

2013
Nashorn Object Model
Key

Setter

“x”

x getter

x setter

“y”
map

Getter
y getter

y setter

map

__proto__
context

…

flags

0

spill

__proto__

null

…

arrayData
EMPTY_ARRAY

L0

x

L1

y

L2

(unused)

2013

L3

(unused)

42
Let’s ignore
some fields
for now

Getter

Setter

“x”

x getter

x setter

“y”
map

Key

y getter

y setter

map

__proto__
context

…

flags

0

spill

__proto__

null

…

arrayData
EMPTY_ARRAY

L0

x

L1

y

L2

(unused)

2013

L3

(unused)

42
… and we’ll
get this

Key

Getter

Setter

“x”

x getter

x setter

“y”

y getter

y setter

map
L0

x

L1

y

2013
42
looks just
like a Java
object

Key

Offset

“x”

+12

“y”

+16

metadata
x

class Point {
Object x;
Object y;
}

y

2013

… with
boxed fields

42
would be
even better
if …

Key

Offset

“x”

+12

“y”

+16

metadata
x

2013

y

42

class Point {
int x;
int y;
}

but Nashorn
doesn’t go
this far yet
Key

Setter

“x”

x getter

x setter

“y”

y getter

y setter

“z”

z getter

z setter

“a”

a getter

a setter

“b”

map

Getter

b getter

b setter

__proto__
context

…

flags

0

map
__proto__
…

spill
arrayData

b

L0

x

L1

y

L2

z

L3

a

0

6

1

7
1

2
3
4

5
Inline Cache
• Facilitated by use of hidden class
• Improve property access efficiency
• Collect type information for type feedback
– later fed to JIT compilers for better optimization

• Works with both interpreted and compiled
code
String
•
•
•
•
•

Flat string
Rope / ConsString / ConcatString
Substring / Span
Symbol / Atom
External String
RegExp
•
•
•
•

NFA
Optimize to DFA where profitable
Interpreted
JIT Compiled
Call Stack
• Native or separate?
• Native
– fast
– easier transition between execution modes
– harder to implement

• Separate (aka “stack-less”)
– easy to implement
– slow
– overhead when transitioning between exec modes
Execution Engine
• Interpreter
• Compiler
– Ahead-of-Time Compiler
– Just-in-Time Compiler
– Dynamic / Adaptive Compiler

• Mixed-mode
• Tiered
Execution Engine in Self
Interpreter
•
•
•
•

Line Interpreter
AST Interpreter
Stack-based Bytecode Interpreter
Register-based Bytecode Interpreter
Interpreter
• Written in
– C/C++
– Assembler
– others?
Compiler Concurrency
• Foreground/Blocking Compilation
• Background Compilation
• Parallel Compilation
Baseline Compiler
• Fast compilation, little optimization
• Should generate type-stable code
Optimizing Compiler
• Type Feedback
• Type Inference
• Function Inlining
On-stack Replacement
Garbage Collection
• Reference Counting?
– not really used by any mainstream impl

• Tracing GC
– mark-sweep
– mark-compact
– copying
GC Advances
•
•
•
•

Generational GC
Incremental GC
Concurrent GC
Parallel GC
GC Concurrency
Mark-Sweep

Application Thread
JavaScript
GC

mark

sweep
GC Concurrency
Mark-Compact

Application Thread
JavaScript
GC

mark

compact
GC Concurrency
Scavenging

Application Thread
JavaScript
GC

scavenge
GC Concurrency
Incremental Mark

Application Thread
JavaScript
GC

incremental mark

sweep
GC Concurrency
Lazy Sweep

Application Thread
JavaScript
GC

mark

lazy sweep
GC Concurrency
Incremental Mark + Lazy Sweep

Application Thread
JavaScript
GC

incremental mark

lazy sweep
GC Concurrency
Generational:
Scavenging + (Incremental Mark + Lazy Sweep)
Application Thread
JavaScript
GC

incremental mark
and scavenge

lazy sweep
GC Concurrency
(Mostly) Concurrent Mark-Sweep
Application Thread
JavaScript

GC Thread

GC
reset
initial mark
remark
concurrent mark concurrent sweep
A new high performance JavaScript on top of the JVM

A BIT ABOUT NASHORN
What is Nashorn?
Overview

• Oracle’s ECMAScript 5.1 implementation, on
the JVM
• Clean code base, 100% Java
– started from scratch; no code from Rhino

• An OpenJDK project
• GPLv2 licensed
What is Nashorn?
Origins of the “Nashorn” name: the Rhino book
What is Nashorn?
Origins of the “Nashorn” name: Mozilla Rhino
What is Nashorn?
Origins of the “Nashorn” name: the unofficial Nashorn logo
What is Nashorn?
Origins of the “Nashorn” name: my impression
Dynamic Languages on the JVM
Can easily get to a sports-car-ish level
Dynamic Languages on the JVM
Takes some effort to get to a decent sports car level
Dynamic Languages on the JVM
Hard to achieve extremely good performance
Nashorn Execution Model
JavaScript Source Code

Compiler Backend
Constant Folding

Parser (Compiler Frontend)

Control-flow Lowering

Lexical Analysis

Type Annotating

Syntax Analysis

Range Analysis (*)

Code Splitting
AST

Type Hardening
Bytecode Generation

* Not complete yet

Java Bytecode

More Related Content

What's hot

Basic JavaScript Tutorial
Basic JavaScript TutorialBasic JavaScript Tutorial
Basic JavaScript TutorialDHTMLExtreme
 
Java 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional InterfacesJava 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional InterfacesGanesh Samarthyam
 
Client-side JavaScript
Client-side JavaScriptClient-side JavaScript
Client-side JavaScriptLilia Sfaxi
 
Golang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / OverviewGolang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / OverviewMarkus Schneider
 
Design functional solutions in Java, a practical example
Design functional solutions in Java, a practical exampleDesign functional solutions in Java, a practical example
Design functional solutions in Java, a practical exampleMarian Wamsiedel
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSDavid Parsons
 
XPath локаторы в Selenium WebDriver
XPath локаторы в Selenium WebDriverXPath локаторы в Selenium WebDriver
XPath локаторы в Selenium WebDriverИлья Кожухов
 
Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java ProgrammingMath-Circle
 
Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScriptShahDhruv21
 
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...Edureka!
 
OOP-Advanced Programming with c++
OOP-Advanced Programming with c++OOP-Advanced Programming with c++
OOP-Advanced Programming with c++Mohamed Essam
 
TypeScript Best Practices
TypeScript Best PracticesTypeScript Best Practices
TypeScript Best Practicesfelixbillon
 

What's hot (20)

Basic JavaScript Tutorial
Basic JavaScript TutorialBasic JavaScript Tutorial
Basic JavaScript Tutorial
 
Google V8 engine
Google V8 engineGoogle V8 engine
Google V8 engine
 
Java 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional InterfacesJava 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional Interfaces
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 
3. Java Script
3. Java Script3. Java Script
3. Java Script
 
Client-side JavaScript
Client-side JavaScriptClient-side JavaScript
Client-side JavaScript
 
Golang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / OverviewGolang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / Overview
 
Design functional solutions in Java, a practical example
Design functional solutions in Java, a practical exampleDesign functional solutions in Java, a practical example
Design functional solutions in Java, a practical example
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
XPath локаторы в Selenium WebDriver
XPath локаторы в Selenium WebDriverXPath локаторы в Selenium WebDriver
XPath локаторы в Selenium WebDriver
 
Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java Programming
 
Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScript
 
Puppeteer
PuppeteerPuppeteer
Puppeteer
 
GMock framework
GMock frameworkGMock framework
GMock framework
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
 
OOP-Advanced Programming with c++
OOP-Advanced Programming with c++OOP-Advanced Programming with c++
OOP-Advanced Programming with c++
 
Spring Batch 2.0
Spring Batch 2.0Spring Batch 2.0
Spring Batch 2.0
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
TypeScript Best Practices
TypeScript Best PracticesTypeScript Best Practices
TypeScript Best Practices
 

Similar to Implementing a JavaScript Engine

How to crack java script certification
How to crack java script certificationHow to crack java script certification
How to crack java script certificationKadharBashaJ
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updatesVinay H G
 
Dmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script TechnologiesDmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script TechnologiesLogeekNightUkraine
 
A Deep Dive into Javascript
A Deep Dive into JavascriptA Deep Dive into Javascript
A Deep Dive into JavascriptTiang Cheng
 
Doctrine 2.0 Enterprise Persistence Layer for PHP
Doctrine 2.0 Enterprise Persistence Layer for PHPDoctrine 2.0 Enterprise Persistence Layer for PHP
Doctrine 2.0 Enterprise Persistence Layer for PHPGuilherme Blanco
 
Typesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and PlayTypesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and PlayLuka Zakrajšek
 
Java day2016 "Reinventing design patterns with java 8"
Java day2016 "Reinventing design patterns with java 8"Java day2016 "Reinventing design patterns with java 8"
Java day2016 "Reinventing design patterns with java 8"Alexander Pashynskiy
 
MathWorks Interview Lecture
MathWorks Interview LectureMathWorks Interview Lecture
MathWorks Interview LectureJohn Yates
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and ActivatorKevin Webber
 
Triton and Symbolic execution on GDB@DEF CON China
Triton and Symbolic execution on GDB@DEF CON ChinaTriton and Symbolic execution on GDB@DEF CON China
Triton and Symbolic execution on GDB@DEF CON ChinaWei-Bo Chen
 
Jslab rssh: JS as language platform
Jslab rssh:  JS as language platformJslab rssh:  JS as language platform
Jslab rssh: JS as language platformRuslan Shevchenko
 
JSLab.Руслан Шевченко."JavaScript как платформа компиляции"
JSLab.Руслан Шевченко."JavaScript как платформа компиляции"JSLab.Руслан Шевченко."JavaScript как платформа компиляции"
JSLab.Руслан Шевченко."JavaScript как платформа компиляции"GeeksLab Odessa
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on RailsAvi Kedar
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...Malin Weiss
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...Speedment, Inc.
 

Similar to Implementing a JavaScript Engine (20)

How to crack java script certification
How to crack java script certificationHow to crack java script certification
How to crack java script certification
 
JS Essence
JS EssenceJS Essence
JS Essence
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updates
 
Dmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script TechnologiesDmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script Technologies
 
A Deep Dive into Javascript
A Deep Dive into JavascriptA Deep Dive into Javascript
A Deep Dive into Javascript
 
Naver_alternative_to_jpa
Naver_alternative_to_jpaNaver_alternative_to_jpa
Naver_alternative_to_jpa
 
Doctrine 2.0 Enterprise Persistence Layer for PHP
Doctrine 2.0 Enterprise Persistence Layer for PHPDoctrine 2.0 Enterprise Persistence Layer for PHP
Doctrine 2.0 Enterprise Persistence Layer for PHP
 
Java script basics
Java script basicsJava script basics
Java script basics
 
Typesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and PlayTypesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and Play
 
Scala Introduction
Scala IntroductionScala Introduction
Scala Introduction
 
Java day2016 "Reinventing design patterns with java 8"
Java day2016 "Reinventing design patterns with java 8"Java day2016 "Reinventing design patterns with java 8"
Java day2016 "Reinventing design patterns with java 8"
 
MathWorks Interview Lecture
MathWorks Interview LectureMathWorks Interview Lecture
MathWorks Interview Lecture
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and Activator
 
Triton and Symbolic execution on GDB@DEF CON China
Triton and Symbolic execution on GDB@DEF CON ChinaTriton and Symbolic execution on GDB@DEF CON China
Triton and Symbolic execution on GDB@DEF CON China
 
06.1 .Net memory management
06.1 .Net memory management06.1 .Net memory management
06.1 .Net memory management
 
Jslab rssh: JS as language platform
Jslab rssh:  JS as language platformJslab rssh:  JS as language platform
Jslab rssh: JS as language platform
 
JSLab.Руслан Шевченко."JavaScript как платформа компиляции"
JSLab.Руслан Шевченко."JavaScript как платформа компиляции"JSLab.Руслан Шевченко."JavaScript как платформа компиляции"
JSLab.Руслан Шевченко."JavaScript как платформа компиляции"
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
 

More from Kris Mok

Nashorn on JDK 8 (ADC2013)
Nashorn on JDK 8 (ADC2013)Nashorn on JDK 8 (ADC2013)
Nashorn on JDK 8 (ADC2013)Kris Mok
 
Intrinsic Methods in HotSpot VM
Intrinsic Methods in HotSpot VMIntrinsic Methods in HotSpot VM
Intrinsic Methods in HotSpot VMKris Mok
 
JVM: A Platform for Multiple Languages
JVM: A Platform for Multiple LanguagesJVM: A Platform for Multiple Languages
JVM: A Platform for Multiple LanguagesKris Mok
 
Java Crash分析(2012-05-10)
Java Crash分析(2012-05-10)Java Crash分析(2012-05-10)
Java Crash分析(2012-05-10)Kris Mok
 
UseNUMA做了什么?(2012-03-14)
UseNUMA做了什么?(2012-03-14)UseNUMA做了什么?(2012-03-14)
UseNUMA做了什么?(2012-03-14)Kris Mok
 
为啥别读HotSpot VM的源码(2012-03-03)
为啥别读HotSpot VM的源码(2012-03-03)为啥别读HotSpot VM的源码(2012-03-03)
为啥别读HotSpot VM的源码(2012-03-03)Kris Mok
 
JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011Kris Mok
 

More from Kris Mok (7)

Nashorn on JDK 8 (ADC2013)
Nashorn on JDK 8 (ADC2013)Nashorn on JDK 8 (ADC2013)
Nashorn on JDK 8 (ADC2013)
 
Intrinsic Methods in HotSpot VM
Intrinsic Methods in HotSpot VMIntrinsic Methods in HotSpot VM
Intrinsic Methods in HotSpot VM
 
JVM: A Platform for Multiple Languages
JVM: A Platform for Multiple LanguagesJVM: A Platform for Multiple Languages
JVM: A Platform for Multiple Languages
 
Java Crash分析(2012-05-10)
Java Crash分析(2012-05-10)Java Crash分析(2012-05-10)
Java Crash分析(2012-05-10)
 
UseNUMA做了什么?(2012-03-14)
UseNUMA做了什么?(2012-03-14)UseNUMA做了什么?(2012-03-14)
UseNUMA做了什么?(2012-03-14)
 
为啥别读HotSpot VM的源码(2012-03-03)
为啥别读HotSpot VM的源码(2012-03-03)为啥别读HotSpot VM的源码(2012-03-03)
为啥别读HotSpot VM的源码(2012-03-03)
 
JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011
 

Recently uploaded

Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 

Recently uploaded (20)

Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 

Implementing a JavaScript Engine

Editor's Notes

  1. Self 4.0 cannot run a block after its enclosing method has returned.
  2. http://blogs.msdn.com/b/ie/archive/2012/06/13/advances-in-javascript-performance-in-ie10-and-windows-8.aspxChakra employs a conservative, quasi-generational, mark and sweep, garbage collector that does most of its work concurrently on a dedicated thread to minimize script execution pauses that would interrupt the user experience.