SlideShare a Scribd company logo
Copyright © 2015 Instantiations, Inc.
23rd ESUG Conference
Brescia, Italy
July 13-19, 2015
Dino2
The Evolution of the
VA Smalltalk Virtual Machine
John O’Keefe
Chief Technical Officer
Instantiations, Inc.
Copyright © 2015 Instantiations, Inc.
Dino2
• Why am I giving the presentation instead of a
real VM guy?
Copyright © 2014 Instantiations, Inc.
Dino2
• Because the real
VM guy is busy!!
• Seth and Kate’s
daughter Adelyn, born
June 19
Copyright © 2015 Instantiations, Inc.
Dino2
Agenda
• Driving forces
• VAST VM history
• Do we need a new VM?
• Challenges
• How we did it
• Results
• Demo
• Still to do
• Q&A
Copyright © 2015 Instantiations, Inc.
Dino2
Driving Forces
• 64-bit support required
• Dramatically expands available memory space
• Interface with 64-bit DLLs/SOs
• Simplify maintenance and enhancement of the
VAST VM
• Enables use of modern tool chains
• Replaces current proprietary modeling language with C
Copyright © 2015 Instantiations, Inc.
Dino2
VAST VM History
• Extremely stable - basically unchanged in 25+
years
• Developed using proprietary Smalltalk VM
Modeling Language
• Maximize efficiency on constrained hardware
• Cross-platform model
• No dependency on C compiler
Smalltalk
Model Code
x86
Power
PC
SPARC
Portable
Assembler
Copyright © 2015 Instantiations, Inc.
Dino2
Do We Need a NEW VM?
• Smalltalk Modeling Language
• Obscure – hard to learn/extend
• Obfuscates the algorithms
• Portable Assembler
• Does not take advantage of new machine architectures
• Generated machine code
• Non-standard calling conventions
• Standard debuggers don’t work
• Hard to map performance tools result back to model
• JIT
• Must be hand-built to match machine architecture
Copyright © 2015 Instantiations, Inc.
Dino2
Sample Smalltalk Model code
VMprCharacterTestBit
self
systemPrimitive: 'VMprCharacterTestBit'
receiverClass: Character
body: [| receiver byteArray bit addr |
receiver := registerModel allocateDataRegister.
byteArray := registerModel allocateAddressRegister.
bit := registerModel allocateDataRegister.
byteArray gets: (self parm: 1 of: 1).
([self isImmediate: byteArray] || [(self isBytes: byteArray) not]) do: [
self failAsmPrimitiveViaCache: PrimErrInvalidClass arg: 1].
receiver gets: (self receiverForParms: 1).
self convertToCharacter: receiver.
bit gets: receiver.
bit &= 7.
receiver shiftRightLogical: 3.
(receiver greaterThanOrEqualUnsigned: (byteArray at: (constant field: 'size' of: K8ObjectHeader))) do: [
self failAsmPrimitiveViaCache: PrimErrInvalidSize arg: 1].
registerModel region: [
addr := registerModel allocateAddressRegister asBytePointer.
addr gets: (constant addressOfLabel: (label global data named: 'K8SetBits')).
bit loadUnsigned: (addr indexedBy: bit)].
receiver loadUnsigned: ((byteArray asBytePointer at: constant objectHeaderSize) index: receiver).
and setFlags source: bit dest: receiver.
condition zero do: [receiver gets: false] else: [receiver gets: true].
self return: receiver parms: 1]
Copyright © 2015 Instantiations, Inc.
Dino2
Sample C code
EsPrimitive(VMprCharacterTestBit)
{
U_16 value;
EsObject byteArray;
U_8 bit;
byteArray = EsPrimitiveArgument(1, 1);
if (!EsIsBytes(byteArray))
EsPrimitiveFailed(EsPrimErrInvalidClass, 1);
value = EsCharacterToU16(EsPrimitiveReceiver(1));
bit = (U_8)(value & 7); /* 0 to 7 bit number within byte */
value = (value >> 3) + 1; /* 1 to (MAX_CHARACTER_VALUE/8)+1 byte number within table */
if (value > (byteArray->size))
EsPrimitiveFailed(EsPrimErrInvalidSize, 1);
EsPrimitiveSucceed((((EsByteAt(byteArray, value)) & (1<<bit)) ? EsTrue : EsFalse), 1);
}
Copyright © 2015 Instantiations, Inc.
Dino2
Challenges
• Minimal existing test cases
• If the basic image tests run, the VM is OK
• ‘VM in C’ performance
• 32-bit x86 VM loses an available register (-)
• C compilers produce far superior code; example:
instruction reordering (+)
• Many benchmarks (both micro and macro) ported and
developed
• Tool chain convergence
• Image conversion
• Impedance mis-match
• “Jump where ever I want to”, stack and register mgmt
Copyright © 2015 Instantiations, Inc.
Dino2
How We Did It
• Moved to cmake and gcc based tool chain
• Use ‘register intrinsics’ for performance
• Nightly build and test
• Minimal assembler
• Low-level arithmetic, exception handling, OLE support
• Incremental changes
• Shim code developed to cross old/new boundary
• VM always works
• 64-bit ‘clean’ changes as we go
• Detour from plan: Interpreter was done all in one piece
Copyright © 2015 Instantiations, Inc.
Dino2
How We Did It
• Example: Garbage Collector
• 3 major components: Scavenger, Mark-Compact,
Allocator
• Components converted one-at-a-time
• Millions of lines of trace output produced to verify
everything worked the same
• Incremental changes means we always had a working
VM to test the changes
Copyright © 2015 Instantiations, Inc.
Dino2
How We Did It
• Just in time image conversion (64-bit VM)
• 32-bit images and image components (ICs) converted
on first use
• Image can be saved in 64-bit format
• 32-bit ICs loadable from 64-bit image
Copyright © 2015 Instantiations, Inc.
Dino2
How We Did It
There’s no magic in software, just hard work with a result that
may appear to be magic!
• The image has to change -- because 64-bitness
shows through
• Foreign Function Interfaces (FFI) aka PlatformFunctions
• Memory mapping objects (OSObjects)
• Goal is to minimize changes in user code
• So most of the changes are in VAST framework code
Copyright © 2015 Instantiations, Inc.
Dino2
How We Did It
• Elastic PlatformFunctions
• Holds template for making FFI call
• Parameter sizes and offsets were fixed
• Changed parameter sizes and offsets from fixed to
relative
Copyright © 2015 Instantiations, Inc.
Dino2
How We Did It
• Elastic OSStructures
• Accessors were based on fixed size and structure offsets
• Changed accessors from absolute to relative offset
• Compute fixed offsets on image startup
Copyright © 2015 Instantiations, Inc.
Dino2
How We Did It
• Elastic OSStructure Example (C)
#ifdef _WIN32
#include <pshpack1.h>
#endif
typedef struct NMHDR
{
HWND hwndFrom;
UINT_PTR idFrom;
UINT code; // NM_ code
};
typedef struct TVKEYDOWN {
NMHDR hdr;
WORD wVKey;
UINT flags;
};
#ifdef _WIN32
#include <poppack.h>
#endif
Copyright © 2015 Instantiations, Inc.
Dino2
How We Did It
• Elastic OSStructure Example (Smalltalk)
"Define NMHDR Struct“
OSNmhdr members: #(#hwndFrom #idFrom #code) types: #(pointer pointer
uint32).
"Define TVKEYDOWN Struct - Pack1 if 32-bit“
OSTvKeydown members: #(hdr wVKey flags) types: #(OSNmhdr uint16 uint32).
System is64BitVM ifFalse: [OSTvKeydown updateAlignmentType: AlignNone]. "Pack
on byte boundary“
-----------------------------------------------------------------------------------------------
OSTvKeydown>>#flags
"Answer the member: UINT flags.
32/64-bit compatible“
^ self uint32At: #flags
Copyright © 2015 Instantiations, Inc.
Dino2
How We Did It
• Additional Benefits of Elastic OSStructures
• Custom Packing for data structures
• OSStructure members: #(a b) types: #(int8 int8) alignment:
Align2 "pack2"
• Custom Padding
• OSStructure members: #(a b) types: #(int8 pad[3] int32)
alignment: AlignNone "pack1/manual pad“
• Embedded OSStructures
• OSStructureA members #(a) types: #(int8)
• OSStructureB members #(a b) types: #(int8 OSStructureA)
• Nested Anonymous Structures/Unions
• OSStructure members: #(a (b c) ) types: #(int32 ((int32 int32)) )
• struct { int a; struct { int b; int c; } }
• OSStructure members: #(a (b c) ) types: #(int32 (int32 double) )
• struct { int a; union { int b; double c; } }
• -
Copyright © 2015 Instantiations, Inc.
Dino2
How We Did It
• Additional Benefits of Elastic OSStructures
• Pointer Types
• OSStructure members #(a b) types: #(pointer int32) "4 bytes on
32-bit, 8 bytes on 64-bit"
• OSStructure members #(a b) types: #('uint8*' int32) "Also a
pointer with additional type info"
• Arrays
• OSStructure members #(a b) types: #('int8[10]' int32) "Array
types are supported
• OSVariableStructure members: #(a b) types: #(int8 pointer[])
"Flexible array types supported
Copyright © 2015 Instantiations, Inc.
Dino2
How We Did It
• Additional Benefits of Elastic OSStructures
• Dependency Analyzer
• Don't need to define OSStructures in order of their dependencies
• Invalid Circular dependencies will be detected
• Extensible Base Types
• You can add your own types, either globally or method override
• We do a method override for TCHAR for future Unicode support
• Currently a char8, but may later be a char32. Existing definitions using
TCHAR are now future proofed for this change
Copyright © 2015 Instantiations, Inc.
Dino2
Results
• 64-bit VM is just a recompile
• No separate 32-to-64 bit image converter
• Interpreter benchmarks are > 80% of current VM
• Before algorithm tuning
• Before C tuning
• User code is largely unaware of change
Copyright © 2015 Instantiations, Inc.
Dino2
Demo
Copyright © 2015 Instantiations, Inc.
Dino2
Still To Do
• 80% done means more work to do
• Performance tuning (algorithms and C)
• JIT
• 64-bit Packager
• Improved garbage collector
• Installation and setup
• UNIX
Copyright © 2015 Instantiations, Inc.
Dino2
When can we have it?
• Windows - 3 delivery dates
• Alpha
• 1Q2016
• Early customer involvement program; entry by invitation
• Beta
• 2Q2016
• Open registration
• Production
• V9.0 on normal product delivery schedule
• UNIX later
Copyright © 2015 Instantiations, Inc.
Contact us
• General information
• info@instantiations.com
• Sales
• sales@instantiations.com
• Support
• support@instantiations.com
• Me
• john_okeefe@instantiations.com
Copyright © 2015 Instantiations, Inc.
Thank you for your attention
Questions?

More Related Content

Viewers also liked

Containerization Is More than the New Virtualization
Containerization Is More than the New VirtualizationContainerization Is More than the New Virtualization
Containerization Is More than the New Virtualization
C4Media
 
Top 8 youth program director resume samples
Top 8 youth program director resume samplesTop 8 youth program director resume samples
Top 8 youth program director resume samplestonychoper1905
 
Class seven sura akhlas
Class seven sura akhlasClass seven sura akhlas
Class seven sura akhlas
Cambriannews
 
Manú SPA
Manú SPAManú SPA
Manú SPA
Juan Nopitsch
 
Don't or Doesn't
Don't or Doesn'tDon't or Doesn't
Don't or Doesn't
Bestpresentoksana
 
Don't doesn't ed
Don't doesn't edDon't doesn't ed
Don't doesn't ed
Gabriela Reyes
 
38
3838
Class seven i like folk songs
Class seven i like folk songsClass seven i like folk songs
Class seven i like folk songs
Cambriannews
 
PRESSURE DROP STUDIES IN WAVY CORRUGATED PLATE HEAT EXCHANGERS
PRESSURE DROP STUDIES IN WAVY CORRUGATED PLATE HEAT EXCHANGERSPRESSURE DROP STUDIES IN WAVY CORRUGATED PLATE HEAT EXCHANGERS
PRESSURE DROP STUDIES IN WAVY CORRUGATED PLATE HEAT EXCHANGERS
IAEME Publication
 
Bakso somay 2
Bakso somay 2Bakso somay 2
Bakso somay 2
Ayu Agustina
 
La dieta mediterránea
 La dieta mediterránea La dieta mediterránea
La dieta mediterránea
aulasaludable
 

Viewers also liked (12)

Containerization Is More than the New Virtualization
Containerization Is More than the New VirtualizationContainerization Is More than the New Virtualization
Containerization Is More than the New Virtualization
 
Top 8 youth program director resume samples
Top 8 youth program director resume samplesTop 8 youth program director resume samples
Top 8 youth program director resume samples
 
Class seven sura akhlas
Class seven sura akhlasClass seven sura akhlas
Class seven sura akhlas
 
Manú SPA
Manú SPAManú SPA
Manú SPA
 
Don't or Doesn't
Don't or Doesn'tDon't or Doesn't
Don't or Doesn't
 
Don't doesn't ed
Don't doesn't edDon't doesn't ed
Don't doesn't ed
 
38
3838
38
 
Class seven i like folk songs
Class seven i like folk songsClass seven i like folk songs
Class seven i like folk songs
 
PRESSURE DROP STUDIES IN WAVY CORRUGATED PLATE HEAT EXCHANGERS
PRESSURE DROP STUDIES IN WAVY CORRUGATED PLATE HEAT EXCHANGERSPRESSURE DROP STUDIES IN WAVY CORRUGATED PLATE HEAT EXCHANGERS
PRESSURE DROP STUDIES IN WAVY CORRUGATED PLATE HEAT EXCHANGERS
 
Bakso somay 2
Bakso somay 2Bakso somay 2
Bakso somay 2
 
La dieta mediterránea
 La dieta mediterránea La dieta mediterránea
La dieta mediterránea
 
Medio ambiente
Medio ambienteMedio ambiente
Medio ambiente
 

Similar to Dino2 - the Amazing Evolution of the VA Smalltalk Virtual Machine

embedded C.pptx
embedded C.pptxembedded C.pptx
embedded C.pptx
mohammedahmed539376
 
Sista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceSista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performance
ESUG
 
DevOpsCon 2015 - DevOps in Mobile Games
DevOpsCon 2015 - DevOps in Mobile GamesDevOpsCon 2015 - DevOps in Mobile Games
DevOpsCon 2015 - DevOps in Mobile Games
Andreas Katzig
 
Continuous Delivery the hard way with Kubernetes
Continuous Delivery the hard way with KubernetesContinuous Delivery the hard way with Kubernetes
Continuous Delivery the hard way with Kubernetes
Luke Marsden
 
Continuous Delivery the Hard Way with Kubernetes
Continuous Delivery the Hard Way with Kubernetes Continuous Delivery the Hard Way with Kubernetes
Continuous Delivery the Hard Way with Kubernetes
Weaveworks
 
Oh the compilers you'll build
Oh the compilers you'll buildOh the compilers you'll build
Oh the compilers you'll build
Mark Stoodley
 
Jfokus 2016 - A JVMs Journey into Polyglot Runtimes
Jfokus 2016 - A JVMs Journey into Polyglot RuntimesJfokus 2016 - A JVMs Journey into Polyglot Runtimes
Jfokus 2016 - A JVMs Journey into Polyglot Runtimes
Charlie Gracie
 
Continuous Delivery the Hard Way with Kubernetes
Continuous Delivery the Hard Way with Kubernetes Continuous Delivery the Hard Way with Kubernetes
Continuous Delivery the Hard Way with Kubernetes
Weaveworks
 
Building Applications with the Microsoft Kinect SDK
Building Applications with the Microsoft Kinect SDKBuilding Applications with the Microsoft Kinect SDK
Building Applications with the Microsoft Kinect SDK
DataLeader.io
 
03 workshop
 03 workshop 03 workshop
03 workshop
Ziyuan Chen
 
The OMR GC talk - Ruby Kaigi 2015
The OMR GC talk - Ruby Kaigi 2015The OMR GC talk - Ruby Kaigi 2015
The OMR GC talk - Ruby Kaigi 2015
craig lehmann
 
Why use Gitlab
Why use GitlabWhy use Gitlab
Why use Gitlab
abenyeung1
 
Why and How to Run Your Own Gitlab Runners as Your Company Grows
Why and How to Run Your Own Gitlab Runners as Your Company GrowsWhy and How to Run Your Own Gitlab Runners as Your Company Grows
Why and How to Run Your Own Gitlab Runners as Your Company Grows
NGINX, Inc.
 
Srikanth_PILLI_CV_latest
Srikanth_PILLI_CV_latestSrikanth_PILLI_CV_latest
Srikanth_PILLI_CV_latestSrikanth Pilli
 
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Intel® Software
 
PyKinect: Body Iteration Application Development Using Python
PyKinect: Body Iteration Application Development Using PythonPyKinect: Body Iteration Application Development Using Python
PyKinect: Body Iteration Application Development Using Python
pycontw
 
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
Sang Don Kim
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsUsing Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsSerge Stinckwich
 
20191018 DevOpsDays Taipei 2019 從零開始的 Configuration Management
20191018 DevOpsDays Taipei 2019 從零開始的 Configuration Management20191018 DevOpsDays Taipei 2019 從零開始的 Configuration Management
20191018 DevOpsDays Taipei 2019 從零開始的 Configuration Management
Jiun-Yi Chen
 
SMP implementation for OpenBSD/sgi
SMP implementation for OpenBSD/sgiSMP implementation for OpenBSD/sgi
SMP implementation for OpenBSD/sgi
Takuya ASADA
 

Similar to Dino2 - the Amazing Evolution of the VA Smalltalk Virtual Machine (20)

embedded C.pptx
embedded C.pptxembedded C.pptx
embedded C.pptx
 
Sista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceSista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performance
 
DevOpsCon 2015 - DevOps in Mobile Games
DevOpsCon 2015 - DevOps in Mobile GamesDevOpsCon 2015 - DevOps in Mobile Games
DevOpsCon 2015 - DevOps in Mobile Games
 
Continuous Delivery the hard way with Kubernetes
Continuous Delivery the hard way with KubernetesContinuous Delivery the hard way with Kubernetes
Continuous Delivery the hard way with Kubernetes
 
Continuous Delivery the Hard Way with Kubernetes
Continuous Delivery the Hard Way with Kubernetes Continuous Delivery the Hard Way with Kubernetes
Continuous Delivery the Hard Way with Kubernetes
 
Oh the compilers you'll build
Oh the compilers you'll buildOh the compilers you'll build
Oh the compilers you'll build
 
Jfokus 2016 - A JVMs Journey into Polyglot Runtimes
Jfokus 2016 - A JVMs Journey into Polyglot RuntimesJfokus 2016 - A JVMs Journey into Polyglot Runtimes
Jfokus 2016 - A JVMs Journey into Polyglot Runtimes
 
Continuous Delivery the Hard Way with Kubernetes
Continuous Delivery the Hard Way with Kubernetes Continuous Delivery the Hard Way with Kubernetes
Continuous Delivery the Hard Way with Kubernetes
 
Building Applications with the Microsoft Kinect SDK
Building Applications with the Microsoft Kinect SDKBuilding Applications with the Microsoft Kinect SDK
Building Applications with the Microsoft Kinect SDK
 
03 workshop
 03 workshop 03 workshop
03 workshop
 
The OMR GC talk - Ruby Kaigi 2015
The OMR GC talk - Ruby Kaigi 2015The OMR GC talk - Ruby Kaigi 2015
The OMR GC talk - Ruby Kaigi 2015
 
Why use Gitlab
Why use GitlabWhy use Gitlab
Why use Gitlab
 
Why and How to Run Your Own Gitlab Runners as Your Company Grows
Why and How to Run Your Own Gitlab Runners as Your Company GrowsWhy and How to Run Your Own Gitlab Runners as Your Company Grows
Why and How to Run Your Own Gitlab Runners as Your Company Grows
 
Srikanth_PILLI_CV_latest
Srikanth_PILLI_CV_latestSrikanth_PILLI_CV_latest
Srikanth_PILLI_CV_latest
 
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
 
PyKinect: Body Iteration Application Development Using Python
PyKinect: Body Iteration Application Development Using PythonPyKinect: Body Iteration Application Development Using Python
PyKinect: Body Iteration Application Development Using Python
 
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsUsing Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systems
 
20191018 DevOpsDays Taipei 2019 從零開始的 Configuration Management
20191018 DevOpsDays Taipei 2019 從零開始的 Configuration Management20191018 DevOpsDays Taipei 2019 從零開始的 Configuration Management
20191018 DevOpsDays Taipei 2019 從零開始的 Configuration Management
 
SMP implementation for OpenBSD/sgi
SMP implementation for OpenBSD/sgiSMP implementation for OpenBSD/sgi
SMP implementation for OpenBSD/sgi
 

More from 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 programming
ESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
ESUG
 
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
ESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
ESUG
 
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 results
ESUG
 
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
ESUG
 
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
ESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
ESUG
 
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
ESUG
 
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
ESUG
 
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
ESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
ESUG
 
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
ESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
ESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
ESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
ESUG
 
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
ESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
ESUG
 
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
ESUG
 

More from 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
 

Recently uploaded

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 

Recently uploaded (20)

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 

Dino2 - the Amazing Evolution of the VA Smalltalk Virtual Machine

  • 1. Copyright © 2015 Instantiations, Inc. 23rd ESUG Conference Brescia, Italy July 13-19, 2015 Dino2 The Evolution of the VA Smalltalk Virtual Machine John O’Keefe Chief Technical Officer Instantiations, Inc.
  • 2. Copyright © 2015 Instantiations, Inc. Dino2 • Why am I giving the presentation instead of a real VM guy?
  • 3. Copyright © 2014 Instantiations, Inc. Dino2 • Because the real VM guy is busy!! • Seth and Kate’s daughter Adelyn, born June 19
  • 4. Copyright © 2015 Instantiations, Inc. Dino2 Agenda • Driving forces • VAST VM history • Do we need a new VM? • Challenges • How we did it • Results • Demo • Still to do • Q&A
  • 5. Copyright © 2015 Instantiations, Inc. Dino2 Driving Forces • 64-bit support required • Dramatically expands available memory space • Interface with 64-bit DLLs/SOs • Simplify maintenance and enhancement of the VAST VM • Enables use of modern tool chains • Replaces current proprietary modeling language with C
  • 6. Copyright © 2015 Instantiations, Inc. Dino2 VAST VM History • Extremely stable - basically unchanged in 25+ years • Developed using proprietary Smalltalk VM Modeling Language • Maximize efficiency on constrained hardware • Cross-platform model • No dependency on C compiler Smalltalk Model Code x86 Power PC SPARC Portable Assembler
  • 7. Copyright © 2015 Instantiations, Inc. Dino2 Do We Need a NEW VM? • Smalltalk Modeling Language • Obscure – hard to learn/extend • Obfuscates the algorithms • Portable Assembler • Does not take advantage of new machine architectures • Generated machine code • Non-standard calling conventions • Standard debuggers don’t work • Hard to map performance tools result back to model • JIT • Must be hand-built to match machine architecture
  • 8. Copyright © 2015 Instantiations, Inc. Dino2 Sample Smalltalk Model code VMprCharacterTestBit self systemPrimitive: 'VMprCharacterTestBit' receiverClass: Character body: [| receiver byteArray bit addr | receiver := registerModel allocateDataRegister. byteArray := registerModel allocateAddressRegister. bit := registerModel allocateDataRegister. byteArray gets: (self parm: 1 of: 1). ([self isImmediate: byteArray] || [(self isBytes: byteArray) not]) do: [ self failAsmPrimitiveViaCache: PrimErrInvalidClass arg: 1]. receiver gets: (self receiverForParms: 1). self convertToCharacter: receiver. bit gets: receiver. bit &= 7. receiver shiftRightLogical: 3. (receiver greaterThanOrEqualUnsigned: (byteArray at: (constant field: 'size' of: K8ObjectHeader))) do: [ self failAsmPrimitiveViaCache: PrimErrInvalidSize arg: 1]. registerModel region: [ addr := registerModel allocateAddressRegister asBytePointer. addr gets: (constant addressOfLabel: (label global data named: 'K8SetBits')). bit loadUnsigned: (addr indexedBy: bit)]. receiver loadUnsigned: ((byteArray asBytePointer at: constant objectHeaderSize) index: receiver). and setFlags source: bit dest: receiver. condition zero do: [receiver gets: false] else: [receiver gets: true]. self return: receiver parms: 1]
  • 9. Copyright © 2015 Instantiations, Inc. Dino2 Sample C code EsPrimitive(VMprCharacterTestBit) { U_16 value; EsObject byteArray; U_8 bit; byteArray = EsPrimitiveArgument(1, 1); if (!EsIsBytes(byteArray)) EsPrimitiveFailed(EsPrimErrInvalidClass, 1); value = EsCharacterToU16(EsPrimitiveReceiver(1)); bit = (U_8)(value & 7); /* 0 to 7 bit number within byte */ value = (value >> 3) + 1; /* 1 to (MAX_CHARACTER_VALUE/8)+1 byte number within table */ if (value > (byteArray->size)) EsPrimitiveFailed(EsPrimErrInvalidSize, 1); EsPrimitiveSucceed((((EsByteAt(byteArray, value)) & (1<<bit)) ? EsTrue : EsFalse), 1); }
  • 10. Copyright © 2015 Instantiations, Inc. Dino2 Challenges • Minimal existing test cases • If the basic image tests run, the VM is OK • ‘VM in C’ performance • 32-bit x86 VM loses an available register (-) • C compilers produce far superior code; example: instruction reordering (+) • Many benchmarks (both micro and macro) ported and developed • Tool chain convergence • Image conversion • Impedance mis-match • “Jump where ever I want to”, stack and register mgmt
  • 11. Copyright © 2015 Instantiations, Inc. Dino2 How We Did It • Moved to cmake and gcc based tool chain • Use ‘register intrinsics’ for performance • Nightly build and test • Minimal assembler • Low-level arithmetic, exception handling, OLE support • Incremental changes • Shim code developed to cross old/new boundary • VM always works • 64-bit ‘clean’ changes as we go • Detour from plan: Interpreter was done all in one piece
  • 12. Copyright © 2015 Instantiations, Inc. Dino2 How We Did It • Example: Garbage Collector • 3 major components: Scavenger, Mark-Compact, Allocator • Components converted one-at-a-time • Millions of lines of trace output produced to verify everything worked the same • Incremental changes means we always had a working VM to test the changes
  • 13. Copyright © 2015 Instantiations, Inc. Dino2 How We Did It • Just in time image conversion (64-bit VM) • 32-bit images and image components (ICs) converted on first use • Image can be saved in 64-bit format • 32-bit ICs loadable from 64-bit image
  • 14. Copyright © 2015 Instantiations, Inc. Dino2 How We Did It There’s no magic in software, just hard work with a result that may appear to be magic! • The image has to change -- because 64-bitness shows through • Foreign Function Interfaces (FFI) aka PlatformFunctions • Memory mapping objects (OSObjects) • Goal is to minimize changes in user code • So most of the changes are in VAST framework code
  • 15. Copyright © 2015 Instantiations, Inc. Dino2 How We Did It • Elastic PlatformFunctions • Holds template for making FFI call • Parameter sizes and offsets were fixed • Changed parameter sizes and offsets from fixed to relative
  • 16. Copyright © 2015 Instantiations, Inc. Dino2 How We Did It • Elastic OSStructures • Accessors were based on fixed size and structure offsets • Changed accessors from absolute to relative offset • Compute fixed offsets on image startup
  • 17. Copyright © 2015 Instantiations, Inc. Dino2 How We Did It • Elastic OSStructure Example (C) #ifdef _WIN32 #include <pshpack1.h> #endif typedef struct NMHDR { HWND hwndFrom; UINT_PTR idFrom; UINT code; // NM_ code }; typedef struct TVKEYDOWN { NMHDR hdr; WORD wVKey; UINT flags; }; #ifdef _WIN32 #include <poppack.h> #endif
  • 18. Copyright © 2015 Instantiations, Inc. Dino2 How We Did It • Elastic OSStructure Example (Smalltalk) "Define NMHDR Struct“ OSNmhdr members: #(#hwndFrom #idFrom #code) types: #(pointer pointer uint32). "Define TVKEYDOWN Struct - Pack1 if 32-bit“ OSTvKeydown members: #(hdr wVKey flags) types: #(OSNmhdr uint16 uint32). System is64BitVM ifFalse: [OSTvKeydown updateAlignmentType: AlignNone]. "Pack on byte boundary“ ----------------------------------------------------------------------------------------------- OSTvKeydown>>#flags "Answer the member: UINT flags. 32/64-bit compatible“ ^ self uint32At: #flags
  • 19. Copyright © 2015 Instantiations, Inc. Dino2 How We Did It • Additional Benefits of Elastic OSStructures • Custom Packing for data structures • OSStructure members: #(a b) types: #(int8 int8) alignment: Align2 "pack2" • Custom Padding • OSStructure members: #(a b) types: #(int8 pad[3] int32) alignment: AlignNone "pack1/manual pad“ • Embedded OSStructures • OSStructureA members #(a) types: #(int8) • OSStructureB members #(a b) types: #(int8 OSStructureA) • Nested Anonymous Structures/Unions • OSStructure members: #(a (b c) ) types: #(int32 ((int32 int32)) ) • struct { int a; struct { int b; int c; } } • OSStructure members: #(a (b c) ) types: #(int32 (int32 double) ) • struct { int a; union { int b; double c; } } • -
  • 20. Copyright © 2015 Instantiations, Inc. Dino2 How We Did It • Additional Benefits of Elastic OSStructures • Pointer Types • OSStructure members #(a b) types: #(pointer int32) "4 bytes on 32-bit, 8 bytes on 64-bit" • OSStructure members #(a b) types: #('uint8*' int32) "Also a pointer with additional type info" • Arrays • OSStructure members #(a b) types: #('int8[10]' int32) "Array types are supported • OSVariableStructure members: #(a b) types: #(int8 pointer[]) "Flexible array types supported
  • 21. Copyright © 2015 Instantiations, Inc. Dino2 How We Did It • Additional Benefits of Elastic OSStructures • Dependency Analyzer • Don't need to define OSStructures in order of their dependencies • Invalid Circular dependencies will be detected • Extensible Base Types • You can add your own types, either globally or method override • We do a method override for TCHAR for future Unicode support • Currently a char8, but may later be a char32. Existing definitions using TCHAR are now future proofed for this change
  • 22. Copyright © 2015 Instantiations, Inc. Dino2 Results • 64-bit VM is just a recompile • No separate 32-to-64 bit image converter • Interpreter benchmarks are > 80% of current VM • Before algorithm tuning • Before C tuning • User code is largely unaware of change
  • 23. Copyright © 2015 Instantiations, Inc. Dino2 Demo
  • 24. Copyright © 2015 Instantiations, Inc. Dino2 Still To Do • 80% done means more work to do • Performance tuning (algorithms and C) • JIT • 64-bit Packager • Improved garbage collector • Installation and setup • UNIX
  • 25. Copyright © 2015 Instantiations, Inc. Dino2 When can we have it? • Windows - 3 delivery dates • Alpha • 1Q2016 • Early customer involvement program; entry by invitation • Beta • 2Q2016 • Open registration • Production • V9.0 on normal product delivery schedule • UNIX later
  • 26. Copyright © 2015 Instantiations, Inc. Contact us • General information • info@instantiations.com • Sales • sales@instantiations.com • Support • support@instantiations.com • Me • john_okeefe@instantiations.com
  • 27. Copyright © 2015 Instantiations, Inc. Thank you for your attention Questions?