SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
Copyright © 2017 Instantiations, Inc.
2017 FAST Conference
La Plata, Argentina
November, 2017
VA Smalltalk 9: Exploring the
next-gen LLVM-based virtual
machine
Alexander Mitin
Senior Software Engineer
Instantiations, Inc.
Copyright © 2017 Instantiations, Inc.
The New VM Runtime
• 64-bit & 32-bit
• Written from scratch
• Compatibility & Performance
• LLVM is a core tech
Copyright © 2017 Instantiations, Inc.
Traditional Way
• Written in C or C++
• Interpreter is a huge case statement
• Or a huge function with lots of labels
• Lots of overhead
• Support for JIT is complicated
Copyright © 2017 Instantiations, Inc.
Options?
• Continue to develop using legacy tools?
• Use assembly language?
• Develop a special language for building a VM?
Copyright © 2017 Instantiations, Inc.
Let’s C
A typical C language compiler has these stages:
• Preprocessor
• Code parsing
• Building some intermediate representation
• Optimizations
• Machine code generation
• Output to an object file
Copyright © 2017 Instantiations, Inc.
Let’s C
A typical C language compiler has these stages:
• Preprocessor
• Code parsing
• Building some intermediate representation
• Optimizations
• Machine code generation
• Output to an object file
Copyright © 2017 Instantiations, Inc.
LLVM Can Do it
LLVM is a compiler infrastructure
• Advanced IR
• Object file generation
• Open-source with big community
• Capable for JIT
Copyright © 2017 Instantiations, Inc.
Instantiations Way
• Written in LLVM IR
• Every bytecode handler is a function
• Fine-tuned using LLVM intrinsics and attrs
• Minimized overhead
• Transparent interpreter-JIT transitions
Copyright © 2017 Instantiations, Inc.
A bytecode
01 I_32 BCpushMagicB(VMContext* vmStruct, oop** sp, I_8* pc)
02 {
03 I_PTR operand = (I_PTR)*pc++; // load a bytecode
operand
04 *--sp = (oop*)operand; // store it to a
stack slot and advance sp
05 I_8 nextBC = *pc++; // get
next bytecode
06 BCFuncType* nextHandler = bytecodeTable[nextBC];// get next bytecode handler function
07 return nextHandler(vmStruct, sp, pc) // call it
08 }
Copyright © 2017 Instantiations, Inc.
LLVM Crash Course
• Modules & Functions
• Basic Blocks
• SSA form
Copyright © 2017 Instantiations, Inc.
A bytecode
01 define internal cc18 i32 @BCpushMagicB(%VMContext* inreg %vmStruct, %oop** inreg %sp, i8* inreg %pc) #1 align 8
02 {
03 %1 = load i8, i8* %pc, align 1
04 %2 = sext i8 %1 to i64
05 %3 = getelementptr inbounds i8, i8* %pc, i64 1
06 %4 = inttoptr i64 %2 to %oop*
07 %5 = getelementptr %oop*, %oop** %sp, i64 -1
08 store %oop* %4, %oop** %5
09 %6 = load i8, i8* %3
10 %7 = zext i8 %6 to i64
11 %8 = getelementptr inbounds i8, i8* %3, i64 1
12 %9 = getelementptr inbounds @bytecodeTable, i64 0, i64 %7
13 %10 = load BCFuncType*, BCFuncType** %9, align 8
14 %11 = tail call cc18 i32 %10(%VMContext* inreg %vmStruct, %oop** inreg %5, i8* inreg %8)
15 ret i32 %11
16 }
Copyright © 2017 Instantiations, Inc.
A bytecode
01 void EsVMBytecodes::pushMagic(IRBuilder<>& b, Value* sp, Value* pc, Value* bp, EsBCOpType
bcot)
02 {
03 Value *operand;
04 Value *currentPC = getNext(b, pc, bcot, operand);
05 Value *currentSP = stackPush(b, sp, operand);
06 executeNextBytecode(b, currentSP, currentPC, bp);
07 }
Copyright © 2017 Instantiations, Inc.
A bytecode
00 BCpushMagicB:
01 movsbq (%rsi), %rax ; load bytecode operand from pc
02 movq %rax, -8(%r15) ; store it into a stack slot
03 addq $-8, %r15 ; advance stack pointer
04 movzbl 1(%rsi), %eax ; get next bytecode from pc + 1
05 addq $2, %rsi ; advance pc by 2
06 movabsq $bytecodeTable, %rcx
07 rex64 jmpq *(%rcx,%rax,8) ; indirect jump to the next bytecode
handler
Copyright © 2017 Instantiations, Inc.
The Idea
• LLVM tail-call elimination optimization
• Keep performance-critical data in CPU regs
Copyright © 2017 Instantiations, Inc.
Method Exec: Interpreted
// a pseudo-code
I_32 methodExec(VMContext*, I_PTR arg1, I_PTR arg2)
{
AllocateStackFrame(ftInterpreted);
return ExecuteNextBytecode(arg2); // tail-call
}
Copyright © 2017 Instantiations, Inc.
Method Exec: Native
// a pseudo-code
I_32 methodExec(VMContext*, I_PTR arg1, I_PTR arg2)
{
AllocateStackFrame(ftNative);
// execute JIT-generated native code in place
}
Copyright © 2017 Instantiations, Inc.
Memory Manager
• Written in C from scratch
• So far the same algorithm as it was in v.8
• It’s ready for modifications
Copyright © 2017 Instantiations, Inc.
Build System
• CMake based
• MinGW64/gcc compiler
• A special app with LLVM IR
• MinGW64/gcc linker
Copyright © 2017 Instantiations, Inc.
Future Work
• Unicode support
• Alternative memory manager with parallel GC
• Alternative JIT engine (OMR?)
• Make use of CPU’s stack pointer register
• Compressed OOPs
Copyright © 2017 Instantiations, Inc.
Thank you for your attention
Questions?
Contacts:
E-mail: amitin@instantiations.com
GitHub: amitin

Más contenido relacionado

La actualidad más candente

Comprehensive Container Based Service Monitoring with Kubernetes and Istio
Comprehensive Container Based Service Monitoring with Kubernetes and IstioComprehensive Container Based Service Monitoring with Kubernetes and Istio
Comprehensive Container Based Service Monitoring with Kubernetes and IstioFred Moyer
 
Netflow Analysis using Elastic Stack - 조인중
Netflow Analysis using Elastic Stack - 조인중Netflow Analysis using Elastic Stack - 조인중
Netflow Analysis using Elastic Stack - 조인중NAVER D2
 
GitOps is the best modern practice for CD with Kubernetes
GitOps is the best modern practice for CD with KubernetesGitOps is the best modern practice for CD with Kubernetes
GitOps is the best modern practice for CD with KubernetesVolodymyr Shynkar
 
Taming the Tiger: Tips and Tricks for Using Telegraf
Taming the Tiger: Tips and Tricks for Using TelegrafTaming the Tiger: Tips and Tricks for Using Telegraf
Taming the Tiger: Tips and Tricks for Using TelegrafInfluxData
 
Cleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven DevelopmentCleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven DevelopmentAll Things Open
 
Kubecon 2019_eu-k8s-secrets-csi
Kubecon 2019_eu-k8s-secrets-csiKubecon 2019_eu-k8s-secrets-csi
Kubecon 2019_eu-k8s-secrets-csiRita Zhang
 
Java Webinar #13 “Where Is My Development Zone?”
Java Webinar #13 “Where Is My Development Zone?”Java Webinar #13 “Where Is My Development Zone?”
Java Webinar #13 “Where Is My Development Zone?”GlobalLogic Ukraine
 
Kubernetes for Beginners
Kubernetes for BeginnersKubernetes for Beginners
Kubernetes for BeginnersDigitalOcean
 
Deploying Anything as a Service (XaaS) Using Operators on Kubernetes
Deploying Anything as a Service (XaaS) Using Operators on KubernetesDeploying Anything as a Service (XaaS) Using Operators on Kubernetes
Deploying Anything as a Service (XaaS) Using Operators on KubernetesAll Things Open
 
stackconf 2021 | Embracing change: Policy-as-code for Kubernetes with OPA and...
stackconf 2021 | Embracing change: Policy-as-code for Kubernetes with OPA and...stackconf 2021 | Embracing change: Policy-as-code for Kubernetes with OPA and...
stackconf 2021 | Embracing change: Policy-as-code for Kubernetes with OPA and...NETWAYS
 
Nodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design PatternNodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design PatternTalentica Software
 
Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan
Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan
Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan VMware Tanzu
 
Netflix OSS Meetup Season 5 Episode 1
Netflix OSS Meetup Season 5 Episode 1Netflix OSS Meetup Season 5 Episode 1
Netflix OSS Meetup Season 5 Episode 1aspyker
 
Intro to Kubernetes & GitOps Workshop
Intro to Kubernetes & GitOps WorkshopIntro to Kubernetes & GitOps Workshop
Intro to Kubernetes & GitOps WorkshopWeaveworks
 
Onnx and onnx runtime
Onnx and onnx runtimeOnnx and onnx runtime
Onnx and onnx runtimeVishwas N
 
5 Kubernetes Security Tools You Should Use
5 Kubernetes Security Tools You Should Use5 Kubernetes Security Tools You Should Use
5 Kubernetes Security Tools You Should UseDevOps.com
 
Open Source and Secure Coding Practices
Open Source and Secure Coding PracticesOpen Source and Secure Coding Practices
Open Source and Secure Coding PracticesAll Things Open
 
Running a Cost-Effective DynamoDB-Compatible Database on Managed Kubernetes S...
Running a Cost-Effective DynamoDB-Compatible Database on Managed Kubernetes S...Running a Cost-Effective DynamoDB-Compatible Database on Managed Kubernetes S...
Running a Cost-Effective DynamoDB-Compatible Database on Managed Kubernetes S...DevOps.com
 
Image Scanning Best Practices for Containers and Kubernetes
Image Scanning Best Practices for Containers and KubernetesImage Scanning Best Practices for Containers and Kubernetes
Image Scanning Best Practices for Containers and KubernetesDevOps.com
 

La actualidad más candente (20)

Comprehensive Container Based Service Monitoring with Kubernetes and Istio
Comprehensive Container Based Service Monitoring with Kubernetes and IstioComprehensive Container Based Service Monitoring with Kubernetes and Istio
Comprehensive Container Based Service Monitoring with Kubernetes and Istio
 
Netflow Analysis using Elastic Stack - 조인중
Netflow Analysis using Elastic Stack - 조인중Netflow Analysis using Elastic Stack - 조인중
Netflow Analysis using Elastic Stack - 조인중
 
Node.js Chapter1
Node.js Chapter1Node.js Chapter1
Node.js Chapter1
 
GitOps is the best modern practice for CD with Kubernetes
GitOps is the best modern practice for CD with KubernetesGitOps is the best modern practice for CD with Kubernetes
GitOps is the best modern practice for CD with Kubernetes
 
Taming the Tiger: Tips and Tricks for Using Telegraf
Taming the Tiger: Tips and Tricks for Using TelegrafTaming the Tiger: Tips and Tricks for Using Telegraf
Taming the Tiger: Tips and Tricks for Using Telegraf
 
Cleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven DevelopmentCleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven Development
 
Kubecon 2019_eu-k8s-secrets-csi
Kubecon 2019_eu-k8s-secrets-csiKubecon 2019_eu-k8s-secrets-csi
Kubecon 2019_eu-k8s-secrets-csi
 
Java Webinar #13 “Where Is My Development Zone?”
Java Webinar #13 “Where Is My Development Zone?”Java Webinar #13 “Where Is My Development Zone?”
Java Webinar #13 “Where Is My Development Zone?”
 
Kubernetes for Beginners
Kubernetes for BeginnersKubernetes for Beginners
Kubernetes for Beginners
 
Deploying Anything as a Service (XaaS) Using Operators on Kubernetes
Deploying Anything as a Service (XaaS) Using Operators on KubernetesDeploying Anything as a Service (XaaS) Using Operators on Kubernetes
Deploying Anything as a Service (XaaS) Using Operators on Kubernetes
 
stackconf 2021 | Embracing change: Policy-as-code for Kubernetes with OPA and...
stackconf 2021 | Embracing change: Policy-as-code for Kubernetes with OPA and...stackconf 2021 | Embracing change: Policy-as-code for Kubernetes with OPA and...
stackconf 2021 | Embracing change: Policy-as-code for Kubernetes with OPA and...
 
Nodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design PatternNodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design Pattern
 
Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan
Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan
Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan
 
Netflix OSS Meetup Season 5 Episode 1
Netflix OSS Meetup Season 5 Episode 1Netflix OSS Meetup Season 5 Episode 1
Netflix OSS Meetup Season 5 Episode 1
 
Intro to Kubernetes & GitOps Workshop
Intro to Kubernetes & GitOps WorkshopIntro to Kubernetes & GitOps Workshop
Intro to Kubernetes & GitOps Workshop
 
Onnx and onnx runtime
Onnx and onnx runtimeOnnx and onnx runtime
Onnx and onnx runtime
 
5 Kubernetes Security Tools You Should Use
5 Kubernetes Security Tools You Should Use5 Kubernetes Security Tools You Should Use
5 Kubernetes Security Tools You Should Use
 
Open Source and Secure Coding Practices
Open Source and Secure Coding PracticesOpen Source and Secure Coding Practices
Open Source and Secure Coding Practices
 
Running a Cost-Effective DynamoDB-Compatible Database on Managed Kubernetes S...
Running a Cost-Effective DynamoDB-Compatible Database on Managed Kubernetes S...Running a Cost-Effective DynamoDB-Compatible Database on Managed Kubernetes S...
Running a Cost-Effective DynamoDB-Compatible Database on Managed Kubernetes S...
 
Image Scanning Best Practices for Containers and Kubernetes
Image Scanning Best Practices for Containers and KubernetesImage Scanning Best Practices for Containers and Kubernetes
Image Scanning Best Practices for Containers and Kubernetes
 

Similar a VA ST 9: Exploring the next gen LLVM based virtual machine by Alexander Mitin

7++ Reasons to Move Your C++ Code to Visual Studio 2017
7++ Reasons to Move Your C++ Code to Visual Studio 20177++ Reasons to Move Your C++ Code to Visual Studio 2017
7++ Reasons to Move Your C++ Code to Visual Studio 2017Microsoft Tech Community
 
Immutable Kubernetes with Digital Rebar Provision
Immutable Kubernetes with Digital Rebar ProvisionImmutable Kubernetes with Digital Rebar Provision
Immutable Kubernetes with Digital Rebar ProvisionRackN
 
"OpenCV on Zynq: Accelerating 4k60 Dense Optical Flow and Stereo Vision," a P...
"OpenCV on Zynq: Accelerating 4k60 Dense Optical Flow and Stereo Vision," a P..."OpenCV on Zynq: Accelerating 4k60 Dense Optical Flow and Stereo Vision," a P...
"OpenCV on Zynq: Accelerating 4k60 Dense Optical Flow and Stereo Vision," a P...Edge AI and Vision Alliance
 
introduction of c langauge(I unit)
introduction of c langauge(I unit)introduction of c langauge(I unit)
introduction of c langauge(I unit)Prashant Sharma
 
A Gentle Introduction to GPU Computing by Armen Donigian
A Gentle Introduction to GPU Computing by Armen DonigianA Gentle Introduction to GPU Computing by Armen Donigian
A Gentle Introduction to GPU Computing by Armen DonigianData Con LA
 
Tomas Della Vedova - Building a future proof framework - Codemotion Milan 2018
Tomas Della Vedova - Building a future proof framework - Codemotion Milan 2018Tomas Della Vedova - Building a future proof framework - Codemotion Milan 2018
Tomas Della Vedova - Building a future proof framework - Codemotion Milan 2018Codemotion
 
Accelerating Spark MLlib and DataFrame with Vector Processor “SX-Aurora TSUBASA”
Accelerating Spark MLlib and DataFrame with Vector Processor “SX-Aurora TSUBASA”Accelerating Spark MLlib and DataFrame with Vector Processor “SX-Aurora TSUBASA”
Accelerating Spark MLlib and DataFrame with Vector Processor “SX-Aurora TSUBASA”Databricks
 
HIS 2017 Jonathan Pallant- Delivering quality, time after time
HIS 2017 Jonathan Pallant-  Delivering quality, time after timeHIS 2017 Jonathan Pallant-  Delivering quality, time after time
HIS 2017 Jonathan Pallant- Delivering quality, time after timejamieayre
 
You Don't Know Node: Quick Intro to 6 Core Features
You Don't Know Node: Quick Intro to 6 Core FeaturesYou Don't Know Node: Quick Intro to 6 Core Features
You Don't Know Node: Quick Intro to 6 Core FeaturesGreat Wide Open
 
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat Pôle Systematic Paris-Region
 
“State-of-the-art Model Quantization and Optimization for Efficient Edge AI,”...
“State-of-the-art Model Quantization and Optimization for Efficient Edge AI,”...“State-of-the-art Model Quantization and Optimization for Efficient Edge AI,”...
“State-of-the-art Model Quantization and Optimization for Efficient Edge AI,”...Edge AI and Vision Alliance
 
InterConnect2016: WebApp Architectures with Java and Node.js
InterConnect2016: WebApp Architectures with Java and Node.jsInterConnect2016: WebApp Architectures with Java and Node.js
InterConnect2016: WebApp Architectures with Java and Node.jsChris Bailey
 
How much performance can you get out of Javascript? - Massimiliano Mantione -...
How much performance can you get out of Javascript? - Massimiliano Mantione -...How much performance can you get out of Javascript? - Massimiliano Mantione -...
How much performance can you get out of Javascript? - Massimiliano Mantione -...Codemotion
 
TestUpload
TestUploadTestUpload
TestUploadZarksaDS
 
Php 7.x 8.0 and hhvm and
Php 7.x 8.0 and hhvm and Php 7.x 8.0 and hhvm and
Php 7.x 8.0 and hhvm and Pierre Joye
 
Modeling an Embedded Device for PSpice Simulation
Modeling an Embedded Device for PSpice SimulationModeling an Embedded Device for PSpice Simulation
Modeling an Embedded Device for PSpice SimulationEMA Design Automation
 
A Check of the Open-Source Project WinSCP Developed in Embarcadero C++ Builder
A Check of the Open-Source Project WinSCP Developed in Embarcadero C++ BuilderA Check of the Open-Source Project WinSCP Developed in Embarcadero C++ Builder
A Check of the Open-Source Project WinSCP Developed in Embarcadero C++ BuilderAndrey Karpov
 
The Little Unicorn That Could
The Little Unicorn That CouldThe Little Unicorn That Could
The Little Unicorn That CouldPVS-Studio
 
NET core 2 e i fratelli
NET core 2 e i fratelliNET core 2 e i fratelli
NET core 2 e i fratelliAndrea Tosato
 

Similar a VA ST 9: Exploring the next gen LLVM based virtual machine by Alexander Mitin (20)

7++ Reasons to Move Your C++ Code to Visual Studio 2017
7++ Reasons to Move Your C++ Code to Visual Studio 20177++ Reasons to Move Your C++ Code to Visual Studio 2017
7++ Reasons to Move Your C++ Code to Visual Studio 2017
 
Immutable Kubernetes with Digital Rebar Provision
Immutable Kubernetes with Digital Rebar ProvisionImmutable Kubernetes with Digital Rebar Provision
Immutable Kubernetes with Digital Rebar Provision
 
"OpenCV on Zynq: Accelerating 4k60 Dense Optical Flow and Stereo Vision," a P...
"OpenCV on Zynq: Accelerating 4k60 Dense Optical Flow and Stereo Vision," a P..."OpenCV on Zynq: Accelerating 4k60 Dense Optical Flow and Stereo Vision," a P...
"OpenCV on Zynq: Accelerating 4k60 Dense Optical Flow and Stereo Vision," a P...
 
introduction of c langauge(I unit)
introduction of c langauge(I unit)introduction of c langauge(I unit)
introduction of c langauge(I unit)
 
A Gentle Introduction to GPU Computing by Armen Donigian
A Gentle Introduction to GPU Computing by Armen DonigianA Gentle Introduction to GPU Computing by Armen Donigian
A Gentle Introduction to GPU Computing by Armen Donigian
 
Tomas Della Vedova - Building a future proof framework - Codemotion Milan 2018
Tomas Della Vedova - Building a future proof framework - Codemotion Milan 2018Tomas Della Vedova - Building a future proof framework - Codemotion Milan 2018
Tomas Della Vedova - Building a future proof framework - Codemotion Milan 2018
 
C++ Coroutines
C++ CoroutinesC++ Coroutines
C++ Coroutines
 
Accelerating Spark MLlib and DataFrame with Vector Processor “SX-Aurora TSUBASA”
Accelerating Spark MLlib and DataFrame with Vector Processor “SX-Aurora TSUBASA”Accelerating Spark MLlib and DataFrame with Vector Processor “SX-Aurora TSUBASA”
Accelerating Spark MLlib and DataFrame with Vector Processor “SX-Aurora TSUBASA”
 
HIS 2017 Jonathan Pallant- Delivering quality, time after time
HIS 2017 Jonathan Pallant-  Delivering quality, time after timeHIS 2017 Jonathan Pallant-  Delivering quality, time after time
HIS 2017 Jonathan Pallant- Delivering quality, time after time
 
You Don't Know Node: Quick Intro to 6 Core Features
You Don't Know Node: Quick Intro to 6 Core FeaturesYou Don't Know Node: Quick Intro to 6 Core Features
You Don't Know Node: Quick Intro to 6 Core Features
 
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
 
“State-of-the-art Model Quantization and Optimization for Efficient Edge AI,”...
“State-of-the-art Model Quantization and Optimization for Efficient Edge AI,”...“State-of-the-art Model Quantization and Optimization for Efficient Edge AI,”...
“State-of-the-art Model Quantization and Optimization for Efficient Edge AI,”...
 
InterConnect2016: WebApp Architectures with Java and Node.js
InterConnect2016: WebApp Architectures with Java and Node.jsInterConnect2016: WebApp Architectures with Java and Node.js
InterConnect2016: WebApp Architectures with Java and Node.js
 
How much performance can you get out of Javascript? - Massimiliano Mantione -...
How much performance can you get out of Javascript? - Massimiliano Mantione -...How much performance can you get out of Javascript? - Massimiliano Mantione -...
How much performance can you get out of Javascript? - Massimiliano Mantione -...
 
TestUpload
TestUploadTestUpload
TestUpload
 
Php 7.x 8.0 and hhvm and
Php 7.x 8.0 and hhvm and Php 7.x 8.0 and hhvm and
Php 7.x 8.0 and hhvm and
 
Modeling an Embedded Device for PSpice Simulation
Modeling an Embedded Device for PSpice SimulationModeling an Embedded Device for PSpice Simulation
Modeling an Embedded Device for PSpice Simulation
 
A Check of the Open-Source Project WinSCP Developed in Embarcadero C++ Builder
A Check of the Open-Source Project WinSCP Developed in Embarcadero C++ BuilderA Check of the Open-Source Project WinSCP Developed in Embarcadero C++ Builder
A Check of the Open-Source Project WinSCP Developed in Embarcadero C++ Builder
 
The Little Unicorn That Could
The Little Unicorn That CouldThe Little Unicorn That Could
The Little Unicorn That Could
 
NET core 2 e i fratelli
NET core 2 e i fratelliNET core 2 e i fratelli
NET core 2 e i fratelli
 

Más de FAST

Threads, Critical Sections, and Termination
Threads, Critical Sections, and TerminationThreads, Critical Sections, and Termination
Threads, Critical Sections, and TerminationFAST
 
OOP with Smalltalk
OOP with SmalltalkOOP with Smalltalk
OOP with SmalltalkFAST
 
Powerlang: a Vehicle for Lively Implementing Programming Languages
Powerlang: a Vehicle for Lively Implementing Programming LanguagesPowerlang: a Vehicle for Lively Implementing Programming Languages
Powerlang: a Vehicle for Lively Implementing Programming LanguagesFAST
 
Constructing 3D scenes with Woden Engine
Constructing 3D scenes with Woden EngineConstructing 3D scenes with Woden Engine
Constructing 3D scenes with Woden EngineFAST
 
Demystifying the creation of coding tools
Demystifying the creation of coding toolsDemystifying the creation of coding tools
Demystifying the creation of coding toolsFAST
 
Application Starter: the entry point for your application
Application Starter: the entry point for your applicationApplication Starter: the entry point for your application
Application Starter: the entry point for your applicationFAST
 
Improving the Pharo VM
Improving the Pharo VMImproving the Pharo VM
Improving the Pharo VMFAST
 
What is (not) Pharo 8?
What is (not) Pharo 8?What is (not) Pharo 8?
What is (not) Pharo 8?FAST
 
Stargate: an interstellar journey to RESTful APIs
Stargate: an interstellar journey to RESTful APIsStargate: an interstellar journey to RESTful APIs
Stargate: an interstellar journey to RESTful APIsFAST
 
Opening Smalltalks 2019
Opening Smalltalks 2019Opening Smalltalks 2019
Opening Smalltalks 2019FAST
 
Smalltalk Computers, Past and Future by Jecel Mattos de Assumpção Jr
Smalltalk Computers, Past and Future by Jecel Mattos de Assumpção JrSmalltalk Computers, Past and Future by Jecel Mattos de Assumpção Jr
Smalltalk Computers, Past and Future by Jecel Mattos de Assumpção JrFAST
 
Adaptive Compilation by Jecel Mattos de Assumpção Jr
Adaptive Compilation by Jecel Mattos de Assumpção JrAdaptive Compilation by Jecel Mattos de Assumpção Jr
Adaptive Compilation by Jecel Mattos de Assumpção JrFAST
 
Choosing where to run our objects: the S8 Smalltalk approach by Description:F...
Choosing where to run our objects: the S8 Smalltalk approach by Description:F...Choosing where to run our objects: the S8 Smalltalk approach by Description:F...
Choosing where to run our objects: the S8 Smalltalk approach by Description:F...FAST
 
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...FAST
 
Improving VASmalltalk deployment, availability and scalability with Docker by...
Improving VASmalltalk deployment, availability and scalability with Docker by...Improving VASmalltalk deployment, availability and scalability with Docker by...
Improving VASmalltalk deployment, availability and scalability with Docker by...FAST
 
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the worldVASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the worldFAST
 
Hands-on Raspberry Pi and VA Smalltalk - Starting Workshop
Hands-on Raspberry Pi and VA Smalltalk - Starting WorkshopHands-on Raspberry Pi and VA Smalltalk - Starting Workshop
Hands-on Raspberry Pi and VA Smalltalk - Starting WorkshopFAST
 
Live typing: Update and what's next by Hernan Wilkinson
Live typing: Update and what's next by Hernan WilkinsonLive typing: Update and what's next by Hernan Wilkinson
Live typing: Update and what's next by Hernan WilkinsonFAST
 
Enhanced Email Protocol Framework for VAST by Seth Berman
Enhanced Email Protocol Framework for VAST by Seth BermanEnhanced Email Protocol Framework for VAST by Seth Berman
Enhanced Email Protocol Framework for VAST by Seth BermanFAST
 
VA Smalltalk Product Update by Seth Berman
VA Smalltalk Product Update by Seth BermanVA Smalltalk Product Update by Seth Berman
VA Smalltalk Product Update by Seth BermanFAST
 

Más de FAST (20)

Threads, Critical Sections, and Termination
Threads, Critical Sections, and TerminationThreads, Critical Sections, and Termination
Threads, Critical Sections, and Termination
 
OOP with Smalltalk
OOP with SmalltalkOOP with Smalltalk
OOP with Smalltalk
 
Powerlang: a Vehicle for Lively Implementing Programming Languages
Powerlang: a Vehicle for Lively Implementing Programming LanguagesPowerlang: a Vehicle for Lively Implementing Programming Languages
Powerlang: a Vehicle for Lively Implementing Programming Languages
 
Constructing 3D scenes with Woden Engine
Constructing 3D scenes with Woden EngineConstructing 3D scenes with Woden Engine
Constructing 3D scenes with Woden Engine
 
Demystifying the creation of coding tools
Demystifying the creation of coding toolsDemystifying the creation of coding tools
Demystifying the creation of coding tools
 
Application Starter: the entry point for your application
Application Starter: the entry point for your applicationApplication Starter: the entry point for your application
Application Starter: the entry point for your application
 
Improving the Pharo VM
Improving the Pharo VMImproving the Pharo VM
Improving the Pharo VM
 
What is (not) Pharo 8?
What is (not) Pharo 8?What is (not) Pharo 8?
What is (not) Pharo 8?
 
Stargate: an interstellar journey to RESTful APIs
Stargate: an interstellar journey to RESTful APIsStargate: an interstellar journey to RESTful APIs
Stargate: an interstellar journey to RESTful APIs
 
Opening Smalltalks 2019
Opening Smalltalks 2019Opening Smalltalks 2019
Opening Smalltalks 2019
 
Smalltalk Computers, Past and Future by Jecel Mattos de Assumpção Jr
Smalltalk Computers, Past and Future by Jecel Mattos de Assumpção JrSmalltalk Computers, Past and Future by Jecel Mattos de Assumpção Jr
Smalltalk Computers, Past and Future by Jecel Mattos de Assumpção Jr
 
Adaptive Compilation by Jecel Mattos de Assumpção Jr
Adaptive Compilation by Jecel Mattos de Assumpção JrAdaptive Compilation by Jecel Mattos de Assumpção Jr
Adaptive Compilation by Jecel Mattos de Assumpção Jr
 
Choosing where to run our objects: the S8 Smalltalk approach by Description:F...
Choosing where to run our objects: the S8 Smalltalk approach by Description:F...Choosing where to run our objects: the S8 Smalltalk approach by Description:F...
Choosing where to run our objects: the S8 Smalltalk approach by Description:F...
 
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
 
Improving VASmalltalk deployment, availability and scalability with Docker by...
Improving VASmalltalk deployment, availability and scalability with Docker by...Improving VASmalltalk deployment, availability and scalability with Docker by...
Improving VASmalltalk deployment, availability and scalability with Docker by...
 
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the worldVASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
 
Hands-on Raspberry Pi and VA Smalltalk - Starting Workshop
Hands-on Raspberry Pi and VA Smalltalk - Starting WorkshopHands-on Raspberry Pi and VA Smalltalk - Starting Workshop
Hands-on Raspberry Pi and VA Smalltalk - Starting Workshop
 
Live typing: Update and what's next by Hernan Wilkinson
Live typing: Update and what's next by Hernan WilkinsonLive typing: Update and what's next by Hernan Wilkinson
Live typing: Update and what's next by Hernan Wilkinson
 
Enhanced Email Protocol Framework for VAST by Seth Berman
Enhanced Email Protocol Framework for VAST by Seth BermanEnhanced Email Protocol Framework for VAST by Seth Berman
Enhanced Email Protocol Framework for VAST by Seth Berman
 
VA Smalltalk Product Update by Seth Berman
VA Smalltalk Product Update by Seth BermanVA Smalltalk Product Update by Seth Berman
VA Smalltalk Product Update by Seth Berman
 

Último

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Último (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

VA ST 9: Exploring the next gen LLVM based virtual machine by Alexander Mitin

  • 1. Copyright © 2017 Instantiations, Inc. 2017 FAST Conference La Plata, Argentina November, 2017 VA Smalltalk 9: Exploring the next-gen LLVM-based virtual machine Alexander Mitin Senior Software Engineer Instantiations, Inc.
  • 2. Copyright © 2017 Instantiations, Inc. The New VM Runtime • 64-bit & 32-bit • Written from scratch • Compatibility & Performance • LLVM is a core tech
  • 3. Copyright © 2017 Instantiations, Inc. Traditional Way • Written in C or C++ • Interpreter is a huge case statement • Or a huge function with lots of labels • Lots of overhead • Support for JIT is complicated
  • 4. Copyright © 2017 Instantiations, Inc. Options? • Continue to develop using legacy tools? • Use assembly language? • Develop a special language for building a VM?
  • 5. Copyright © 2017 Instantiations, Inc. Let’s C A typical C language compiler has these stages: • Preprocessor • Code parsing • Building some intermediate representation • Optimizations • Machine code generation • Output to an object file
  • 6. Copyright © 2017 Instantiations, Inc. Let’s C A typical C language compiler has these stages: • Preprocessor • Code parsing • Building some intermediate representation • Optimizations • Machine code generation • Output to an object file
  • 7. Copyright © 2017 Instantiations, Inc. LLVM Can Do it LLVM is a compiler infrastructure • Advanced IR • Object file generation • Open-source with big community • Capable for JIT
  • 8. Copyright © 2017 Instantiations, Inc. Instantiations Way • Written in LLVM IR • Every bytecode handler is a function • Fine-tuned using LLVM intrinsics and attrs • Minimized overhead • Transparent interpreter-JIT transitions
  • 9. Copyright © 2017 Instantiations, Inc. A bytecode 01 I_32 BCpushMagicB(VMContext* vmStruct, oop** sp, I_8* pc) 02 { 03 I_PTR operand = (I_PTR)*pc++; // load a bytecode operand 04 *--sp = (oop*)operand; // store it to a stack slot and advance sp 05 I_8 nextBC = *pc++; // get next bytecode 06 BCFuncType* nextHandler = bytecodeTable[nextBC];// get next bytecode handler function 07 return nextHandler(vmStruct, sp, pc) // call it 08 }
  • 10. Copyright © 2017 Instantiations, Inc. LLVM Crash Course • Modules & Functions • Basic Blocks • SSA form
  • 11. Copyright © 2017 Instantiations, Inc. A bytecode 01 define internal cc18 i32 @BCpushMagicB(%VMContext* inreg %vmStruct, %oop** inreg %sp, i8* inreg %pc) #1 align 8 02 { 03 %1 = load i8, i8* %pc, align 1 04 %2 = sext i8 %1 to i64 05 %3 = getelementptr inbounds i8, i8* %pc, i64 1 06 %4 = inttoptr i64 %2 to %oop* 07 %5 = getelementptr %oop*, %oop** %sp, i64 -1 08 store %oop* %4, %oop** %5 09 %6 = load i8, i8* %3 10 %7 = zext i8 %6 to i64 11 %8 = getelementptr inbounds i8, i8* %3, i64 1 12 %9 = getelementptr inbounds @bytecodeTable, i64 0, i64 %7 13 %10 = load BCFuncType*, BCFuncType** %9, align 8 14 %11 = tail call cc18 i32 %10(%VMContext* inreg %vmStruct, %oop** inreg %5, i8* inreg %8) 15 ret i32 %11 16 }
  • 12. Copyright © 2017 Instantiations, Inc. A bytecode 01 void EsVMBytecodes::pushMagic(IRBuilder<>& b, Value* sp, Value* pc, Value* bp, EsBCOpType bcot) 02 { 03 Value *operand; 04 Value *currentPC = getNext(b, pc, bcot, operand); 05 Value *currentSP = stackPush(b, sp, operand); 06 executeNextBytecode(b, currentSP, currentPC, bp); 07 }
  • 13. Copyright © 2017 Instantiations, Inc. A bytecode 00 BCpushMagicB: 01 movsbq (%rsi), %rax ; load bytecode operand from pc 02 movq %rax, -8(%r15) ; store it into a stack slot 03 addq $-8, %r15 ; advance stack pointer 04 movzbl 1(%rsi), %eax ; get next bytecode from pc + 1 05 addq $2, %rsi ; advance pc by 2 06 movabsq $bytecodeTable, %rcx 07 rex64 jmpq *(%rcx,%rax,8) ; indirect jump to the next bytecode handler
  • 14. Copyright © 2017 Instantiations, Inc. The Idea • LLVM tail-call elimination optimization • Keep performance-critical data in CPU regs
  • 15. Copyright © 2017 Instantiations, Inc. Method Exec: Interpreted // a pseudo-code I_32 methodExec(VMContext*, I_PTR arg1, I_PTR arg2) { AllocateStackFrame(ftInterpreted); return ExecuteNextBytecode(arg2); // tail-call }
  • 16. Copyright © 2017 Instantiations, Inc. Method Exec: Native // a pseudo-code I_32 methodExec(VMContext*, I_PTR arg1, I_PTR arg2) { AllocateStackFrame(ftNative); // execute JIT-generated native code in place }
  • 17. Copyright © 2017 Instantiations, Inc. Memory Manager • Written in C from scratch • So far the same algorithm as it was in v.8 • It’s ready for modifications
  • 18. Copyright © 2017 Instantiations, Inc. Build System • CMake based • MinGW64/gcc compiler • A special app with LLVM IR • MinGW64/gcc linker
  • 19. Copyright © 2017 Instantiations, Inc. Future Work • Unicode support • Alternative memory manager with parallel GC • Alternative JIT engine (OMR?) • Make use of CPU’s stack pointer register • Compressed OOPs
  • 20. Copyright © 2017 Instantiations, Inc. Thank you for your attention Questions? Contacts: E-mail: amitin@instantiations.com GitHub: amitin