EclipseOMR
AModernToolkitforBuildingLanguageRun:mes
MarkStoodleyOMRProjectTechnicalLead
About me
• Mark Stoodley [email protected] @mstoodle
• Senior software developer in Toronto, Canada working for IBM Runtime Technologies
• Spent the last 14 years building JIT compilers in JVMs
• OMR Project Technical Lead
2
hBp://www.eclipse.org/omrhBps://github.com/eclipse/omr
InteractwithteamviamailinglistorGitHubIssues([email protected])
DualLicense:
EclipsePublicLicenseV1.0Apache2.0
Contributors:pleasesignEclipseCLAJ!hBp://www.eclipse.org/legal/CLA.php
EclipseOMRisLive!!
3
4
• Ini:alcontribu:onfromIBMonMarch7isabout200KLOC• Projectteamisveryexcitedtobemovingforwardintheopen!
OMRis…
5
OMRis…
forBuildingLanguageRun:mes
6
OMRis…
forBuildingLanguageRun:mes
7
OMRis…
AModernToolkitforBuildingLanguageRun:mes
8
Whatdoes
BuildingLanguageRun-mes
mean?
9
Java Execution Environment
What’sinaLanguageRun:meforJava?
JavaPlaaormAbstrac:on Layer
JavaGarbage Collector
JavaDiagnos:cServices
Source Code Bytecode/AST Compiler
10
JavaJust-In-TimeCompiler
Interpreter Java
SourceJava
BytecodeCompiler
JavaBytecodeInterpreter
Ruby Execution Environment
What’sinaLanguageRun:meforRuby?
RubyPlaaormAbstrac:on Layer
RubyGarbage Collector
RubyDiagnos:cServices
Source Code Bytecode/AST Compiler
11
RubyJust-In-TimeCompiler
Interpreter RubySource
RubyBytecodeCompiler
RubyBytecodeInterpreter
Python Execution Environment
What’sinaLanguageRun:meforPython?
PythonPlaaormAbstrac:on Layer
PythonGarbage Collector
PythonDiagnos:cServices
Source Code Bytecode/AST Compiler
12
PythonJust-In-TimeCompiler
Interpreter PythonSource
PythonBytecodeCompiler
PythonBytecodeInterpreter
• Investment in one runtime has no leverage in other runtimes
• Cloud => many languages => expensive to advance platform
But all language runtimes are completely different implementations
13
Java Execution Environment
OMRstartedfromIBMJ9Java…
J9JavaPlaaormAbstrac:on Layer
J9JavaGarbage Collector
J9JavaDiagnos:cServices
Source Code Bytecode/AST Compiler
14
J9JavaJust-In-TimeCompiler
Interpreter Java
SourceJ9JavaBytecodeCompiler
J9JavaBytecodeInterpreter
J9Java
JITCompilerGlue
J9 Java Execution Environment
Byconcentra:ng“Java”nessintoa“glue”layerforeachcorecomponent
OMRPlaaormAbstrac:on Layer
OMRGarbage Collector
OMRDiagnos:cServices
Source Code Bytecode/AST Compiler
15
Interpreter Java
SourceJ9JavaBytecodeCompiler
J9JavaBytecodeInterpreter
J9JavaDiagnos:cGlue
J9JavaGCGlue
OMRJustinTime
(JIT)Compiler
1. OMRhasnolanguageseman:cs2. OMRisnotalanguagerun:me3. OMRcanbecomepartofanylanguagerun:me
16
…toolkitdoesn’tseemquiteright…
17
…toolkitnotquiteright…
OMRprovidesHighQualityLanguageRun:me
Ingredients
18
IngredientsNowAvailable!port plaaormabstrac:on(por:ng)librarythread crossplaaormpthread-likethreadinglibrarygc garbagecollec:onframeworkformanagedheapsvm APIstomanageper-interpreterandper-threadcontextsomrtrace tracinglibraryforcommunica:onwithIBMHealthCenter
monitoringtoolsomrsigcompat signalhandlingcompa:bilitylibraryexample demonstra:oncodetoshowhowalanguagerun:memight
consumesomeOMRcomponents,alsousedfortes:ngfvtest alanguageindependenttestframeworksothatOMR
componentscanbetestedoutsideofalanguagerun:me+afewothers…aliBlelessthan200KLOCatthispoint
19
Moreingredientscomingsoon!diag: morediagnos:csupportforrun:mestoaidrun:me
developersandusershcagentcore: coreIBMHealthCenteragentcodetoconnectwitha
run:megc: addinggenera:onalandotherpolicies/technologiesjit: JustInTimecompilerandna:vecodegenera:ontoolsdocs: <gasp>weneedmoreoverviewdocumenta:ontests: moreteststoensurehighqualitycontribu:ons
20
Howdoyoutest
languagerun:mecomponents
withnolanguageseman:cs?
21
Mockitup!• fvtestdirectory
– LeveragesGoogletestunittestframework– Componenttestsfor:
• Port,gc,signals,threads,vmfork,trace,agents• U:li:esanddatastructures,methoddic:onary• etc.
• “maketest”formsthebasisforhighqualitycontribu:ons– Contribu:onscannotcausenewfailuresin“maketest”
22
Canitreallywork?
Weaskedourselvesthesameques:on…
23
Soweputittothetest!
Ruby+OMRPython+OMR
SOM++(Smalltalk)+OMR
…alsousedinIBMSDKforJava8…andconsumeddailyaswebuildthenextIBMSDKforJava
Goal:testdriveintegra:onintoexis:ngrun:mecommuni:es
COMPATIBILITYiscri:cal
24
Ruby+OMRTechnologyPreview
• WeportedOMRintoCRuby– Focusoneasyintegra:onandcompa:bility– AllCextensionsworkas-is– ItrunsRails!
• PresentedatRubyKaigi2015,FOSDEM&jFokus2016
• Availableongithub:– Downloaddockerimagesfor64-bitX86,OpenPOWER,andLinuxONE@hBps://goo.gl/P3yXuy
25
Diagnos:cTooling
26
HealthCenter
• Providesaliveviewofrun:medetails• WorkswithIBMJDK,IBMNode.js,andRuby+OMRTechnologyPreview
• hBp://goo.gl/u3VITI
27
Health Center – CRuby Method Profiling
28
Health Center – OMR GC Statistics from CRuby
29
GarbageCollec:onandMemoryVisualizer
30
• ProvidesagraphicaldetailsonGCeventspostmortemfromverbose:gclogs
• WorkswithIBMJDK,IBMNode.jsandRuby+OMRTechnologyPreview
• hBps://goo.gl/YwNrmI
GarbageCollec:onandMemoryVisualizer
31
Performance
Upto2.5XfasteronsomebenchmarkswithRuby+OMRJIT!
32
112.84122.57
0
20
40
60
80
100
120
140
Ruby2.2.2 Ruby2.2.2+OMR
IsRubyFastYet?
33
28.4
17.2
5.5
1.10
5
10
15
20
25
30
Ruby2.2.2 Ruby2.2.2+OMR Ruby2.2.2+OMR+JIT OMRIlBuilder
Pow(2,N)
34
Time(secon
ds)
• Weknowitworks;wetriedit!
• IBMJavaSDKwillcon:nuetoconsumeOMRtechnologyandworkdirectlyinopenOMRproject
• Projectisopentoall;wewelcomeothers– Newcontributors!– Newplaaorms!– Newlanguages!– Newtoolinterfaces!– Newtechnologytohelpbuildrun:mes!
35
WrapUp• EclipseOMR:highqualitylanguagerun:mecomponents
1. hasnolanguageseman:cs2. isnotalanguagerun:me3. canbecomepartofanylanguagerun:me
• WeareliveatEclipseasanincubator!– hBp://www.eclipse.org/omr– hBps://github.com/eclipse/omr– [email protected]– ContactusviamailinglistorGItHubissues
• DualEclipse1.0+Apache2.0license
• Wewouldlovetoseeyouallthere!36
• Almost no one starts a new project saying: – First, I’ll write the firmware from scratch … – First, I’ll write the file system from scratch … – First, I’ll write the display drivers from scratch …
• We would like to make these statements just as unlikely: – First, I’ll write the cross platform port library from scratch … – First, I’ll write a garbage collector technology from scratch … – First, I’ll write the JIT compiler technology from scratch …
37
APar:ngThought
• Almost no one starts a new project saying: – First, I’ll write the firmware from scratch … – First, I’ll write the file system from scratch … – First, I’ll write the display drivers from scratch …
• We would like to make these statements just as unlikely: – First, I’ll write the cross platform port library from scratch … – First, I’ll write the garbage collector from scratch … – First, I’ll write the JIT compiler from scratch …
38
APar:ngThought
BoFsessiontonightat7pminLakeAnneA
Na:vecodegenera:onfordynamiclanguages
LearnabitmoreabouttheOMRJITanditsna:vecodegenera:onservices
39
LearnmoreaboutOMR!• AVMisaVMisaVM:TheSecretPathtoHighPerformanceMul:LanguageRun:mes(MarkStoodley,JVM
LanguagesSummit2015)hBps://www.youtube.com/watch?v=kOnyJurioyw
• BeyondtheCoffeeCup:LeveragingJavaRun:meTechnologiesforthePolyglot(DarylMaier,JavaOne2015)hBp://www.slideshare.net/0xdaryl/javaone-2015-con7547-beyond-the-coffee-cup-leveraging-java-run:me-technologies-for-polyglot
• What’sinanObject?JavaGarbageCollec:onforthePolyglot(CharlieGracie,JavaOne2015)hBp://www.slideshare.net/charliegracie1/javaone-whats-in-an-object
• BuildingYourOwnLanguageRun:me(AngelaLin,RobertYoung,CraigLehmann,XiaoliLiang,CASCON2015)hBps://ibm.box.com/s/7xdg25we2ezmdjjbqdys30d7dl1iyo49
• It’sDangeroustoGCalone.Takethis!(RobertYoungandCraigLehmann,RubyKaigi2015)hBp://www.slideshare.net/craiglehmann/the-omr-gc-talk-ruby-kaigi-2015
• ExperimentsinsharingJavaVMTechnologywithCRuby(MaBhewGaudet,RubyKaigi2015) hBp://www.slideshare.net/MaBhewGaudet/experiments-in-sharing-java-vm-technology-with-cruby
• RubyandOMR:Experimentsinu:lizingOMRtechnologiesinRuby(MRI)(CharlieGracie,FOSDEM2016)hBp://www.slideshare.net/CharlieGracie/ruby-and-omr
• AJVMsJourneyintoPolyglotRun:mes(CharlieGracie,jFokus2016)hBps://t.co/efCKf6aCB4
• OMR:Amoderntoolkitforbuildinglanguagerun:mes(MarkStoodley,EclipseConMarch2016)[You’rereadingitrightnow!]
• Ruby+OMRTechnologyPreviewgithubprojectwithdockerimagesforLinuxonLinuxONE,OpenPOWER,andX86hBps://github.com/rubyomr-preview/rubyomr-preview
• Contact:– MarkStoodley([email protected],@mstoodle) OMRProjectTechnicalLead
40
Trademarks,Copyrights,Disclaimers
IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole discretion. Information regarding potential future products is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver any material, code or functionality. Information about potential future products may not be incorporated into any contract. The development, release, and timing of any future features or functionality described for our products remains at our sole discretion.
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of other IBM trademarks is available on the web at "Copyright and trademark information" at http://www.ibm.com/legal/copytrade.shtml Other company, product, or service names may be trademarks or service marks of others. THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN ADDITION, THIS INFORMATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE. IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION. NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, NOR SHALL HAVE THE EFFECT OF, CREATING ANY WARRANTIES OR REPRESENTATIONS FROM IBM (OR ITS SUPPLIERS OR LICENSORS), OR ALTERING THE TERMS AND CONDITIONS OF ANY AGREEMENT OR LICENSE GOVERNING THE USE OF IBM PRODUCTS OR SOFTWARE. © Copyright International Business Machines Corporation 2016. All rights reserved.
41
Addi:onalImportantDisclaimers• THEINFORMATIONCONTAINEDINTHISPRESENTATIONISPROVIDEDFORINFORMATIONAL
PURPOSESONLY.• WHILSTEFFORTSWEREMADETOVERIFYTHECOMPLETENESSANDACCURACYOFTHE
INFORMATIONCONTAINEDINTHISPRESENTATION,ITISPROVIDED“ASIS”,WITHOUTWARRANTYOFANYKIND,EXPRESSORIMPLIED.
• ALLPERFORMANCEDATAINCLUDEDINTHISPRESENTATIONHAVEBEENGATHEREDINACONTROLLEDENVIRONMENT.YOUROWNTESTRESULTSMAYVARYBASEDONHARDWARE,SOFTWAREORINFRASTRUCTUREDIFFERENCES.
• ALLDATAINCLUDEDINTHISPRESENTATIONAREMEANTTOBEUSEDONLYASAGUIDE.• INADDITION,THEINFORMATIONCONTAINEDINTHISPRESENTATIONISBASEDONIBM’SCURRENT
PRODUCTPLANSANDSTRATEGY,WHICHARESUBJECTTOCHANGEBYIBM,WITHOUTNOTICE.• IBMANDITSAFFILIATEDCOMPANIESSHALLNOTBERESPONSIBLEFORANYDAMAGESARISING
OUTOFTHEUSEOF,OROTHERWISERELATEDTO,THISPRESENTATIONORANYOTHERDOCUMENTATION.
• NOTHINGCONTAINEDINTHISPRESENTATIONISINTENDEDTO,ORSHALLHAVETHEEFFECTOF:• -CREATINGANYWARRANTORREPRESENTATIONFROMIBM,ITSAFFILIATEDCOMPANIESORITS
ORTHEIRSUPPLIERSAND/ORLICENSORS
42