42
Eclipse OMR A Modern Toolkit for Building Language Run:mes Mark Stoodley OMR Project Technical Lead

Eclipse OMR: a modern toolkit for building language runtimes

Embed Size (px)

Citation preview

Page 1: Eclipse OMR: a modern toolkit for building language runtimes

EclipseOMR

AModernToolkitforBuildingLanguageRun:mes

MarkStoodleyOMRProjectTechnicalLead

Page 2: Eclipse OMR: a modern toolkit for building language runtimes

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

Page 3: Eclipse OMR: a modern toolkit for building language runtimes

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

Page 4: Eclipse OMR: a modern toolkit for building language runtimes

4

•  Ini:alcontribu:onfromIBMonMarch7isabout200KLOC•  Projectteamisveryexcitedtobemovingforwardintheopen!

Page 5: Eclipse OMR: a modern toolkit for building language runtimes

OMRis…

5

Page 6: Eclipse OMR: a modern toolkit for building language runtimes

OMRis…

forBuildingLanguageRun:mes

6

Page 7: Eclipse OMR: a modern toolkit for building language runtimes

OMRis…

forBuildingLanguageRun:mes

7

Page 8: Eclipse OMR: a modern toolkit for building language runtimes

OMRis…

AModernToolkitforBuildingLanguageRun:mes

8

Page 9: Eclipse OMR: a modern toolkit for building language runtimes

Whatdoes

BuildingLanguageRun-mes

mean?

9

Page 10: Eclipse OMR: a modern toolkit for building language runtimes

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

Page 11: Eclipse OMR: a modern toolkit for building language runtimes

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

Page 12: Eclipse OMR: a modern toolkit for building language runtimes

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

Page 13: Eclipse OMR: a modern toolkit for building language runtimes

•  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

Page 14: Eclipse OMR: a modern toolkit for building language runtimes

Java Execution Environment

OMRstartedfromIBMJ9Java…

J9JavaPlaaormAbstrac:on Layer

J9JavaGarbage Collector

J9JavaDiagnos:cServices

Source Code Bytecode/AST Compiler

14

J9JavaJust-In-TimeCompiler

Interpreter Java

SourceJ9JavaBytecodeCompiler

J9JavaBytecodeInterpreter

Page 15: Eclipse OMR: a modern toolkit for building language runtimes

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

Page 16: Eclipse OMR: a modern toolkit for building language runtimes

1.  OMRhasnolanguageseman:cs2.  OMRisnotalanguagerun:me3.  OMRcanbecomepartofanylanguagerun:me

16

Page 17: Eclipse OMR: a modern toolkit for building language runtimes

…toolkitdoesn’tseemquiteright…

17

Page 18: Eclipse OMR: a modern toolkit for building language runtimes

…toolkitnotquiteright…

OMRprovidesHighQualityLanguageRun:me

Ingredients

18

Page 19: Eclipse OMR: a modern toolkit for building language runtimes

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

Page 20: Eclipse OMR: a modern toolkit for building language runtimes

Moreingredientscomingsoon!diag: morediagnos:csupportforrun:mestoaidrun:me

developersandusershcagentcore: coreIBMHealthCenteragentcodetoconnectwitha

run:megc: addinggenera:onalandotherpolicies/technologiesjit: JustInTimecompilerandna:vecodegenera:ontoolsdocs: <gasp>weneedmoreoverviewdocumenta:ontests: moreteststoensurehighqualitycontribu:ons

20

Page 21: Eclipse OMR: a modern toolkit for building language runtimes

Howdoyoutest

languagerun:mecomponents

withnolanguageseman:cs?

21

Page 22: Eclipse OMR: a modern toolkit for building language runtimes

Mockitup!•  fvtestdirectory

–  LeveragesGoogletestunittestframework–  Componenttestsfor:

•  Port,gc,signals,threads,vmfork,trace,agents•  U:li:esanddatastructures,methoddic:onary•  etc.

•  “maketest”formsthebasisforhighqualitycontribu:ons–  Contribu:onscannotcausenewfailuresin“maketest”

22

Page 23: Eclipse OMR: a modern toolkit for building language runtimes

Canitreallywork?

Weaskedourselvesthesameques:on…

23

Page 24: Eclipse OMR: a modern toolkit for building language runtimes

Soweputittothetest!

Ruby+OMRPython+OMR

SOM++(Smalltalk)+OMR

…alsousedinIBMSDKforJava8…andconsumeddailyaswebuildthenextIBMSDKforJava

Goal:testdriveintegra:onintoexis:ngrun:mecommuni:es

COMPATIBILITYiscri:cal

24

Page 25: Eclipse OMR: a modern toolkit for building language runtimes

Ruby+OMRTechnologyPreview

•  WeportedOMRintoCRuby–  Focusoneasyintegra:onandcompa:bility–  AllCextensionsworkas-is–  ItrunsRails!

•  PresentedatRubyKaigi2015,FOSDEM&jFokus2016

•  Availableongithub:–  Downloaddockerimagesfor64-bitX86,OpenPOWER,andLinuxONE@hBps://goo.gl/P3yXuy

25

Page 26: Eclipse OMR: a modern toolkit for building language runtimes

Diagnos:cTooling

26

Page 27: Eclipse OMR: a modern toolkit for building language runtimes

HealthCenter

•  Providesaliveviewofrun:medetails•  WorkswithIBMJDK,IBMNode.js,andRuby+OMRTechnologyPreview

•  hBp://goo.gl/u3VITI

27

Page 28: Eclipse OMR: a modern toolkit for building language runtimes

Health Center – CRuby Method Profiling

28

Page 29: Eclipse OMR: a modern toolkit for building language runtimes

Health Center – OMR GC Statistics from CRuby

29

Page 30: Eclipse OMR: a modern toolkit for building language runtimes

GarbageCollec:onandMemoryVisualizer

30

•  ProvidesagraphicaldetailsonGCeventspostmortemfromverbose:gclogs

•  WorkswithIBMJDK,IBMNode.jsandRuby+OMRTechnologyPreview

•  hBps://goo.gl/YwNrmI

Page 31: Eclipse OMR: a modern toolkit for building language runtimes

GarbageCollec:onandMemoryVisualizer

31

Page 32: Eclipse OMR: a modern toolkit for building language runtimes

Performance

Upto2.5XfasteronsomebenchmarkswithRuby+OMRJIT!

32

Page 33: Eclipse OMR: a modern toolkit for building language runtimes

112.84122.57

0

20

40

60

80

100

120

140

Ruby2.2.2 Ruby2.2.2+OMR

IsRubyFastYet?

33

Page 34: Eclipse OMR: a modern toolkit for building language runtimes

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)

Page 35: Eclipse OMR: a modern toolkit for building language runtimes

•  Weknowitworks;wetriedit!

•  IBMJavaSDKwillcon:nuetoconsumeOMRtechnologyandworkdirectlyinopenOMRproject

•  Projectisopentoall;wewelcomeothers–  Newcontributors!–  Newplaaorms!–  Newlanguages!–  Newtoolinterfaces!–  Newtechnologytohelpbuildrun:mes!

35

Page 36: Eclipse OMR: a modern toolkit for building language runtimes

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

Page 37: Eclipse OMR: a modern toolkit for building language runtimes

•  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

Page 38: Eclipse OMR: a modern toolkit for building language runtimes

•  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

Page 39: Eclipse OMR: a modern toolkit for building language runtimes

BoFsessiontonightat7pminLakeAnneA

Na:vecodegenera:onfordynamiclanguages

LearnabitmoreabouttheOMRJITanditsna:vecodegenera:onservices

39

Page 40: Eclipse OMR: a modern toolkit for building language runtimes

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

Page 41: Eclipse OMR: a modern toolkit for building language runtimes

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

Page 42: Eclipse OMR: a modern toolkit for building language runtimes

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