SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
A low Overhead Per
Object Write Barrier
for the CogVM
Clément Béra
Introduction
• The CogVM is the standardVM for:
• Pharo
• Squeak
• Newspeak
• Cuis
Introduction
• Working runtime optimizer for Cog’s JIT
• Problem with literal mutability
Problem
• Is it possible to mark any object as read-
only ?
• Smalltalk code to handle mutation
failure
• Overhead
Terminology
• Discussion onVM mailing-list
• Immutable: state cannot change after
object’s initialization
• Write barrier or read-only object
Use-cases
• Modification tracker
• Read-only literals
• Compiler optimizations
• Inconsistent literal modifications
• Others...
This paper
• NOT about framework built using read-
only objects
• Implementation details to limit the
overhead
Feature
• Any object can be marked as read-only,
except:
• Immediate objects
• Context instances
• Objects related to Process scheduling
• Objects internal to the runtime
APIs
• Object >> isReadOnlyObject
• Object >> setIsReadOnlyObject:
• Object >> beWritableObject
• Object >> beReadOnlyObject
Read-only object
• Instance variable store fail
• Primitives mutating a read-only object fail
IV store failure
• Instance variable is not set.
• A call-back is sent:
Primitive failure
• First value of array is not set
Primitive error code
• new error code: #'no modification'
Other details
• Support flags
• Mirror primitives
• Object >> object:setIsReadOnlyObject:
VM compilation option
• VM C compiler flag
• TheVM can be compiled with or without
the feature.
Implementation
• Object representation
• Interpreter support
• JIT support
Implementation
• Most critical part:
• How to keep IV store efficient ?
• Machine code generated by the JIT
• Discussed in the paper...
IV Store details
• Wanted
• to show it,
x86 Assembly Meaning
movl -12(%ebp), %edx
popl %edi
movl %edi, %ds:0x8(%edx)
testl 0x00000003, %edi If the value to store is
immediate, jump after the
store check.jnz after_store
Jump after the store check if
the receiver is young:
compare the young object
space limit with receiver
address
movl 0x00040088, %eax
jb after_store
cmpl %eax, %edx
Load the receiver in %edx.
jnb after_store
cmpl %eax, %edi If the value to store is an old
object, jump after the store
check.
jnz after_store
testb 0x20, %al
movzbl %ds:0x3(%edx), %eax
If the receiver is already in
the remembered table, jump
after the store check.
call store_check_trampoline
Calls the store check
trampoline.
Perform the store in the first
instance variable using both
registers (%edx and %edi)
Load the value to store in
%edi.
after_store: Code following the store.
x86 Assembly Meaning
movl -12(%ebp), %edx
popl %ecx
movl %ecx, %ds:0x8(%edx)
testb 0x03, %cl If the value to store is
immediate, jump after the
store check.jnz after_store
If the receiver is a young
object, jump after the store
check.
movl 0x00040088, %eax
jb after_store
cmpl %eax, %edx
jnb after_store
cmpl %eax, %ecx If the value to store is an old
object, jump after the store
check.
jnz after_store
testb 0x20, %al
movzbl %ds:0x3(%edx), %eax
If the receiver is already in
the remembered table, jump
after the store check.
call store_trampoline
Calls the store check
trampoline.
Perform the store in the first
instance variable using both
registers (%edx and %ecx)
Load the receiver in %edx.
Load the value to store in
%ecx.
movl -12(%ebp), %edx
movl %ds:(%edx), %eax
testl 0x00800000, %eax
jnz store_trampoline
If the receiver is read-only,
jump to the store trampoline.
Restore the receiver (to keep
its register live).
store_trampoline:
after_store: Code following the store.
Evaluation: Slow-down
• Binary trees
• IV Store intensive
• No significant difference
Evaluation: Slow-down
• Pathological case: setter
Evaluation: Slow-down
• At writing time, setter overhead was 17%
• Stack frame creation problem
• Two path compilation
• Now faster than before
Conclusion
• New feature: read-only object
• Overhead is very limited

Contenu connexe

Tendances

Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript ProgrammingRaveendra R
 
Automate - Madhu Kanoor, Greg McCullough - ManageIQ Design Summit 2016
Automate - Madhu Kanoor, Greg McCullough - ManageIQ Design Summit 2016Automate - Madhu Kanoor, Greg McCullough - ManageIQ Design Summit 2016
Automate - Madhu Kanoor, Greg McCullough - ManageIQ Design Summit 2016ManageIQ
 
JavaScript Object Oriented Programming Cheat Sheet
JavaScript Object Oriented Programming Cheat SheetJavaScript Object Oriented Programming Cheat Sheet
JavaScript Object Oriented Programming Cheat SheetHDR1001
 
Node.js System: The Approach
Node.js System: The ApproachNode.js System: The Approach
Node.js System: The ApproachHaci Murat Yaman
 
Javascript basics for automation testing
Javascript  basics for automation testingJavascript  basics for automation testing
Javascript basics for automation testingVikas Thange
 
JavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft TrainingJavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft TrainingRadoslav Georgiev
 
Javascript conditional statements
Javascript conditional statementsJavascript conditional statements
Javascript conditional statementsnobel mujuji
 
Web development basics (Part-4)
Web development basics (Part-4)Web development basics (Part-4)
Web development basics (Part-4)Rajat Pratap Singh
 
Intro to Javascript
Intro to JavascriptIntro to Javascript
Intro to JavascriptAnjan Banda
 
JavaScript: Patterns, Part 2
JavaScript: Patterns, Part  2JavaScript: Patterns, Part  2
JavaScript: Patterns, Part 2Chris Farrell
 
JavaScript 101
JavaScript 101JavaScript 101
JavaScript 101ygv2000
 

Tendances (20)

Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript Programming
 
Automate - Madhu Kanoor, Greg McCullough - ManageIQ Design Summit 2016
Automate - Madhu Kanoor, Greg McCullough - ManageIQ Design Summit 2016Automate - Madhu Kanoor, Greg McCullough - ManageIQ Design Summit 2016
Automate - Madhu Kanoor, Greg McCullough - ManageIQ Design Summit 2016
 
JavaScript Object Oriented Programming Cheat Sheet
JavaScript Object Oriented Programming Cheat SheetJavaScript Object Oriented Programming Cheat Sheet
JavaScript Object Oriented Programming Cheat Sheet
 
oojs
oojsoojs
oojs
 
JavaScript Basics
JavaScript BasicsJavaScript Basics
JavaScript Basics
 
JS Event Loop
JS Event LoopJS Event Loop
JS Event Loop
 
Node.js System: The Approach
Node.js System: The ApproachNode.js System: The Approach
Node.js System: The Approach
 
Javascript basics for automation testing
Javascript  basics for automation testingJavascript  basics for automation testing
Javascript basics for automation testing
 
JavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft TrainingJavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft Training
 
Csharp
CsharpCsharp
Csharp
 
Javascript conditional statements
Javascript conditional statementsJavascript conditional statements
Javascript conditional statements
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Web development basics (Part-4)
Web development basics (Part-4)Web development basics (Part-4)
Web development basics (Part-4)
 
Javantura v2 - Making Java web-apps Groovy - Franjo Žilić
Javantura v2 - Making Java web-apps Groovy - Franjo ŽilićJavantura v2 - Making Java web-apps Groovy - Franjo Žilić
Javantura v2 - Making Java web-apps Groovy - Franjo Žilić
 
C# Asynchronous delegates
C# Asynchronous delegatesC# Asynchronous delegates
C# Asynchronous delegates
 
Intro to Javascript
Intro to JavascriptIntro to Javascript
Intro to Javascript
 
Javascript
JavascriptJavascript
Javascript
 
Java tutorial part 4
Java tutorial part 4Java tutorial part 4
Java tutorial part 4
 
JavaScript: Patterns, Part 2
JavaScript: Patterns, Part  2JavaScript: Patterns, Part  2
JavaScript: Patterns, Part 2
 
JavaScript 101
JavaScript 101JavaScript 101
JavaScript 101
 

En vedette

OpenPonk modeling platform
OpenPonk modeling platformOpenPonk modeling platform
OpenPonk modeling platformESUG
 
Power and Energy Code Profiling in Pharo
Power and Energy Code Profiling in PharoPower and Energy Code Profiling in Pharo
Power and Energy Code Profiling in PharoESUG
 
Lowcode: Extending Smalltalk with C Types to Improve Performance
Lowcode: Extending Smalltalk with C Types to Improve PerformanceLowcode: Extending Smalltalk with C Types to Improve Performance
Lowcode: Extending Smalltalk with C Types to Improve PerformanceESUG
 
PaaS: An Enabler for IoT in NFV Worlds
PaaS: An Enabler for IoT in NFV WorldsPaaS: An Enabler for IoT in NFV Worlds
PaaS: An Enabler for IoT in NFV WorldsOPNFV
 
Presentación Pedro Huichilaf - eCommerceDay Santiago 2016
Presentación Pedro Huichilaf - eCommerceDay Santiago 2016Presentación Pedro Huichilaf - eCommerceDay Santiago 2016
Presentación Pedro Huichilaf - eCommerceDay Santiago 2016eCommerce Institute
 
Presentación Sebastian Ojeda - eCommerce Day Santiago 2016
Presentación Sebastian Ojeda - eCommerce Day Santiago 2016Presentación Sebastian Ojeda - eCommerce Day Santiago 2016
Presentación Sebastian Ojeda - eCommerce Day Santiago 2016eCommerce Institute
 
REVISÃO OAB XXI Direito administrativo-ERICK ALVES
REVISÃO OAB XXI Direito administrativo-ERICK ALVESREVISÃO OAB XXI Direito administrativo-ERICK ALVES
REVISÃO OAB XXI Direito administrativo-ERICK ALVESEsdras Arthur Lopes Pessoa
 
MPLS-based Metro Ethernet Networks Tutorial by Khatri
MPLS-based Metro Ethernet Networks Tutorial by KhatriMPLS-based Metro Ethernet Networks Tutorial by Khatri
MPLS-based Metro Ethernet Networks Tutorial by KhatriFebrian ‎
 

En vedette (16)

HS Diploma0001
HS Diploma0001HS Diploma0001
HS Diploma0001
 
GK CV-ELV ENGR.
GK CV-ELV ENGR.GK CV-ELV ENGR.
GK CV-ELV ENGR.
 
Why EoMPLS for CE
Why EoMPLS for CEWhy EoMPLS for CE
Why EoMPLS for CE
 
CIPR Social media inside
CIPR Social media inside   CIPR Social media inside
CIPR Social media inside
 
Religions
ReligionsReligions
Religions
 
OpenPonk modeling platform
OpenPonk modeling platformOpenPonk modeling platform
OpenPonk modeling platform
 
Multi Chassis LAG for Cloud builders
Multi Chassis LAG for Cloud buildersMulti Chassis LAG for Cloud builders
Multi Chassis LAG for Cloud builders
 
My Resume
My ResumeMy Resume
My Resume
 
Power and Energy Code Profiling in Pharo
Power and Energy Code Profiling in PharoPower and Energy Code Profiling in Pharo
Power and Energy Code Profiling in Pharo
 
Lowcode: Extending Smalltalk with C Types to Improve Performance
Lowcode: Extending Smalltalk with C Types to Improve PerformanceLowcode: Extending Smalltalk with C Types to Improve Performance
Lowcode: Extending Smalltalk with C Types to Improve Performance
 
PaaS: An Enabler for IoT in NFV Worlds
PaaS: An Enabler for IoT in NFV WorldsPaaS: An Enabler for IoT in NFV Worlds
PaaS: An Enabler for IoT in NFV Worlds
 
Presentación Pedro Huichilaf - eCommerceDay Santiago 2016
Presentación Pedro Huichilaf - eCommerceDay Santiago 2016Presentación Pedro Huichilaf - eCommerceDay Santiago 2016
Presentación Pedro Huichilaf - eCommerceDay Santiago 2016
 
Presentación Sebastian Ojeda - eCommerce Day Santiago 2016
Presentación Sebastian Ojeda - eCommerce Day Santiago 2016Presentación Sebastian Ojeda - eCommerce Day Santiago 2016
Presentación Sebastian Ojeda - eCommerce Day Santiago 2016
 
2017 Resume Tips - Top 10 Resume Tips for 2017
2017 Resume Tips - Top 10 Resume Tips for 20172017 Resume Tips - Top 10 Resume Tips for 2017
2017 Resume Tips - Top 10 Resume Tips for 2017
 
REVISÃO OAB XXI Direito administrativo-ERICK ALVES
REVISÃO OAB XXI Direito administrativo-ERICK ALVESREVISÃO OAB XXI Direito administrativo-ERICK ALVES
REVISÃO OAB XXI Direito administrativo-ERICK ALVES
 
MPLS-based Metro Ethernet Networks Tutorial by Khatri
MPLS-based Metro Ethernet Networks Tutorial by KhatriMPLS-based Metro Ethernet Networks Tutorial by Khatri
MPLS-based Metro Ethernet Networks Tutorial by Khatri
 

Similaire à A low Overhead Per Object Write Barrier for Smalltalk

2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...chen yuki
 
Search at Twitter: Presented by Michael Busch, Twitter
Search at Twitter: Presented by Michael Busch, TwitterSearch at Twitter: Presented by Michael Busch, Twitter
Search at Twitter: Presented by Michael Busch, TwitterLucidworks
 
Sista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceSista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceESUG
 
Transactional Memory for Smalltalk
Transactional Memory for SmalltalkTransactional Memory for Smalltalk
Transactional Memory for SmalltalkLukas Renggli
 
Towards a Scalable Non-Blocking Coding Style
Towards a Scalable Non-Blocking Coding StyleTowards a Scalable Non-Blocking Coding Style
Towards a Scalable Non-Blocking Coding StyleAzul Systems Inc.
 
Best Practices in Qt Quick/QML - Part I
Best Practices in Qt Quick/QML - Part IBest Practices in Qt Quick/QML - Part I
Best Practices in Qt Quick/QML - Part IICS
 
Concurrency at the Database Layer
Concurrency at the Database Layer Concurrency at the Database Layer
Concurrency at the Database Layer mcwilson1
 
Efficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java ApplicationsEfficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java ApplicationsPhillip Koza
 
Javascript omg!
Javascript omg!Javascript omg!
Javascript omg!bwullems
 
Run-time of Node.js : V8 JavaScript Engine
Run-time of Node.js: V8 JavaScript EngineRun-time of Node.js: V8 JavaScript Engine
Run-time of Node.js : V8 JavaScript EngineGary Yeh
 
MongoDB Command Line Tools
MongoDB Command Line ToolsMongoDB Command Line Tools
MongoDB Command Line ToolsRainforest QA
 
Safe Wrappers and Sane Policies for Self Protecting JavaScript
Safe Wrappers and Sane Policies for Self Protecting JavaScript�Safe Wrappers and Sane Policies for Self Protecting JavaScript�
Safe Wrappers and Sane Policies for Self Protecting JavaScriptPhú Phùng
 
Object Oriented Exploitation: New techniques in Windows mitigation bypass
Object Oriented Exploitation: New techniques in Windows mitigation bypassObject Oriented Exploitation: New techniques in Windows mitigation bypass
Object Oriented Exploitation: New techniques in Windows mitigation bypassSam Thomas
 

Similaire à A low Overhead Per Object Write Barrier for Smalltalk (20)

Ruby on the JVM
Ruby on the JVMRuby on the JVM
Ruby on the JVM
 
Optimizing Java Notes
Optimizing Java NotesOptimizing Java Notes
Optimizing Java Notes
 
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
 
Search at Twitter: Presented by Michael Busch, Twitter
Search at Twitter: Presented by Michael Busch, TwitterSearch at Twitter: Presented by Michael Busch, Twitter
Search at Twitter: Presented by Michael Busch, Twitter
 
Sista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceSista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performance
 
Transactional Memory for Smalltalk
Transactional Memory for SmalltalkTransactional Memory for Smalltalk
Transactional Memory for Smalltalk
 
Towards a Scalable Non-Blocking Coding Style
Towards a Scalable Non-Blocking Coding StyleTowards a Scalable Non-Blocking Coding Style
Towards a Scalable Non-Blocking Coding Style
 
Variables in Pharo
Variables in PharoVariables in Pharo
Variables in Pharo
 
Best Practices in Qt Quick/QML - Part I
Best Practices in Qt Quick/QML - Part IBest Practices in Qt Quick/QML - Part I
Best Practices in Qt Quick/QML - Part I
 
Concurrency at the Database Layer
Concurrency at the Database Layer Concurrency at the Database Layer
Concurrency at the Database Layer
 
Efficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java ApplicationsEfficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java Applications
 
Javasession10
Javasession10Javasession10
Javasession10
 
Fm wtm12-v2
Fm wtm12-v2Fm wtm12-v2
Fm wtm12-v2
 
Javascript omg!
Javascript omg!Javascript omg!
Javascript omg!
 
Run-time of Node.js : V8 JavaScript Engine
Run-time of Node.js: V8 JavaScript EngineRun-time of Node.js: V8 JavaScript Engine
Run-time of Node.js : V8 JavaScript Engine
 
MongoDB Command Line Tools
MongoDB Command Line ToolsMongoDB Command Line Tools
MongoDB Command Line Tools
 
Lp seminar
Lp seminarLp seminar
Lp seminar
 
Safe Wrappers and Sane Policies for Self Protecting JavaScript
Safe Wrappers and Sane Policies for Self Protecting JavaScript�Safe Wrappers and Sane Policies for Self Protecting JavaScript�
Safe Wrappers and Sane Policies for Self Protecting JavaScript
 
SFDC Batch Apex
SFDC Batch ApexSFDC Batch Apex
SFDC Batch Apex
 
Object Oriented Exploitation: New techniques in Windows mitigation bypass
Object Oriented Exploitation: New techniques in Windows mitigation bypassObject Oriented Exploitation: New techniques in Windows mitigation bypass
Object Oriented Exploitation: New techniques in Windows mitigation bypass
 

Plus de ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsESUG
 

Plus de ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Dernier

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 

Dernier (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 

A low Overhead Per Object Write Barrier for Smalltalk

  • 1. A low Overhead Per Object Write Barrier for the CogVM Clément Béra
  • 2. Introduction • The CogVM is the standardVM for: • Pharo • Squeak • Newspeak • Cuis
  • 3. Introduction • Working runtime optimizer for Cog’s JIT • Problem with literal mutability
  • 4. Problem • Is it possible to mark any object as read- only ? • Smalltalk code to handle mutation failure • Overhead
  • 5. Terminology • Discussion onVM mailing-list • Immutable: state cannot change after object’s initialization • Write barrier or read-only object
  • 6. Use-cases • Modification tracker • Read-only literals • Compiler optimizations • Inconsistent literal modifications • Others...
  • 7. This paper • NOT about framework built using read- only objects • Implementation details to limit the overhead
  • 8. Feature • Any object can be marked as read-only, except: • Immediate objects • Context instances • Objects related to Process scheduling • Objects internal to the runtime
  • 9. APIs • Object >> isReadOnlyObject • Object >> setIsReadOnlyObject: • Object >> beWritableObject • Object >> beReadOnlyObject
  • 10. Read-only object • Instance variable store fail • Primitives mutating a read-only object fail
  • 11. IV store failure • Instance variable is not set. • A call-back is sent:
  • 12. Primitive failure • First value of array is not set
  • 13. Primitive error code • new error code: #'no modification'
  • 14. Other details • Support flags • Mirror primitives • Object >> object:setIsReadOnlyObject:
  • 15. VM compilation option • VM C compiler flag • TheVM can be compiled with or without the feature.
  • 16. Implementation • Object representation • Interpreter support • JIT support
  • 17. Implementation • Most critical part: • How to keep IV store efficient ? • Machine code generated by the JIT • Discussed in the paper...
  • 18. IV Store details • Wanted • to show it, x86 Assembly Meaning movl -12(%ebp), %edx popl %edi movl %edi, %ds:0x8(%edx) testl 0x00000003, %edi If the value to store is immediate, jump after the store check.jnz after_store Jump after the store check if the receiver is young: compare the young object space limit with receiver address movl 0x00040088, %eax jb after_store cmpl %eax, %edx Load the receiver in %edx. jnb after_store cmpl %eax, %edi If the value to store is an old object, jump after the store check. jnz after_store testb 0x20, %al movzbl %ds:0x3(%edx), %eax If the receiver is already in the remembered table, jump after the store check. call store_check_trampoline Calls the store check trampoline. Perform the store in the first instance variable using both registers (%edx and %edi) Load the value to store in %edi. after_store: Code following the store. x86 Assembly Meaning movl -12(%ebp), %edx popl %ecx movl %ecx, %ds:0x8(%edx) testb 0x03, %cl If the value to store is immediate, jump after the store check.jnz after_store If the receiver is a young object, jump after the store check. movl 0x00040088, %eax jb after_store cmpl %eax, %edx jnb after_store cmpl %eax, %ecx If the value to store is an old object, jump after the store check. jnz after_store testb 0x20, %al movzbl %ds:0x3(%edx), %eax If the receiver is already in the remembered table, jump after the store check. call store_trampoline Calls the store check trampoline. Perform the store in the first instance variable using both registers (%edx and %ecx) Load the receiver in %edx. Load the value to store in %ecx. movl -12(%ebp), %edx movl %ds:(%edx), %eax testl 0x00800000, %eax jnz store_trampoline If the receiver is read-only, jump to the store trampoline. Restore the receiver (to keep its register live). store_trampoline: after_store: Code following the store.
  • 19. Evaluation: Slow-down • Binary trees • IV Store intensive • No significant difference
  • 21. Evaluation: Slow-down • At writing time, setter overhead was 17% • Stack frame creation problem • Two path compilation • Now faster than before
  • 22. Conclusion • New feature: read-only object • Overhead is very limited