polyglot on the jvm with graal (japanese)

91
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Polyglot on the JVM with Graal Akihiro Nishikawa May 20, 2017 JJUG CCC 2017 Spring

Upload: akihiro-nishikawa

Post on 21-Jan-2018

732 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

PolyglotontheJVMwithGraal

Akihiro Nishikawa

May 20, 2017JJUGCCC2017Spring

Page 2: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

SafeHarborStatementThefollowingisintendedtooutlineourgeneralproductdirection.Itisintendedforinformationpurposesonly,andmaynotbeincorporatedintoanycontract.Itisnotacommitmenttodeliveranymaterial,code,orfunctionality,andshouldnotberelieduponinmakingpurchasingdecisions.Thedevelopment,release,andtimingofanyfeaturesorfunctionalitydescribedforOracle’sproductsremainsatthesolediscretionofOracle.

2

Page 3: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

ProgramAgenda

3

What’sGraal?What’sGraal VM?

PolyglotinGraal VM

Howtouse

Appendix

1

2

3

4

Page 4: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

What’sGraal?What’sGraal VM?

4

Page 5: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

GraalとGraal VM

• speculative optimizationを得意とする、Javaで記述されたJITコンパイラ– HotSpotベース–種々の言語の実行パフォーマンス向上を目指して設計– JVMCI (Java-LevelJVMCompilerInterface、 JEP243)準拠– Java 9には実験的機能として搭載

5

Graal

Page 6: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

GraalとGraal VM

• GraalやTruffle、その他の言語がバンドルされたJVM

6

Graal VM

Page 7: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 7

GraalとGraal VM

C++

Java

HotSpot

Compiler Interface

Client Server

HotSpot

JVMCI

Graal

HotSpotVM Graal VM

Compiler Interface

Client

Page 8: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

PolyglotinGraal VM

8

Page 9: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

TheOneVMConceptHighperformancepolyglotvirtualmachine

9

Page 10: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 10

TheRubyLogoisCopyright(c)2006,YukihiroMatsumoto.ItislicensedunderthetermsoftheCreativeCommonsAttribution-ShareAlike 2.5agreementJSLogoCopyright(c)2011ChristopherWilliams<[email protected]>,MITlicence

YoucandistributetheRlogounderthetermsoftheCreativeCommonsAttribution-ShareAlike 4.0Internationallicense(CC-BY-SA4.0)or(atyouroption)theGNUGeneralPublicLicenseversion2(GPL-2).

Page 11: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

Impl Impl Impl Impl

11

VM VM VM VM

Page 12: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

VM

Impl Impl Impl Impl

12

Page 13: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

• JavaScript– ECMAScript2016のスコアはV8より良好–パフォーマンスもV8と同等– node.jsのフルサポート

• R–統計解析向けのプログラミング言語及びその開発実行環境

13

• Ruby– JRubyのフォーク– 5〜10倍ほど高性能

• C、C++、Fortran– LLVM(Sulong)を使ってNativeLanguageをサポート

GraalVMPolyglot

Page 14: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 14

GraalVMPolyglot

C

HotSpot

JVMCI

Graal

Truffle

LLVM(Sulong)RRubyJavaScript

Java

Page 15: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

Truffle

• Graalコンパイラと一緒に使うことで、Truffleインタプリタは自動的にJITコンパイルされ、通常のJavaのパフォーマンスを出すことができる

•実行時に自己最適化を実行する抽象構文木(AST)インタープリタを構築するための基本的な基盤ならびにツール(TruffleDSL)を提供

15

シンプルなインタプリタとして言語を実装するためのフレームワーク

Page 16: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 16

ネイティブモジュールを含めて互換性を担保

Graal.jsのアーキテクチャ

C++JavaScript Java

nodeモジュール(Javaスクリプトのみ)

node標準ライブラリ

V8API Thread pool(libeio)

Event loop(libev)

DNS(c-ares)

crypto(OpenSSL)

Graal.js JavaScriptEngine

AdapterV8APItoGraal.js (viaJNI)

Nativeextensions nodebindings(socket,http,…)

nodeモジュール(Nativeextension)

Page 17: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

FastR

• Goal:RのためのTruffleスタックのメリットを認識すること– CやC++といったNativeLanguageを使わなくても優れたパフォーマンス–データの重いアプリケーションと並列アプリケーション向けに設計– CRAN/Bioconductorリポジトリのサポート

• GNURの「段階的な改善」ではない– Truffleベースの新しい実行エンジン– GNURの置換エンジンとして設計

•最新のGNURインタプリタよりも高速(2〜10倍)

17

https://github.com/graalvm/fastr

Page 18: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

JavaScriptinGraal VM

18

Page 19: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

標準への対応

19

ECMAScript2015(ES6)(16298tests/16417tests)

テストが通らなかった大部分はUnicode正規表現

93.4%ECMAScript2016(ES7)累乗演算子やArray.prototype.includes()にも対応

テストが通らなかった部分は、ブロックレベル関数定義や、スプレッド演算子での特殊な条件でのテストなど

99.3%

Page 20: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| OracleConfidential– Internal

Octaneベンチマークの結果

0

0.2

0.4

0.6

0.8

1

1.2

1.4

V8(5.4.500.6) Graal.js

20

Page 21: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

RubyinGraal VM

21

Page 22: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

言語とコアライブラリの標準への対応

22

Ruby言語JRubyは 94%

96% RubyコアライブラリJRubyは 95%

99%

Page 23: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

ベンチマークの結果

0

5

10

15

20

25

30

35

40

45GraalVMJRuby+invokedynamicRuby

23

Rubyを基準としたパフォーマンスの比較(大きいほど高パフォーマンス)

このテストは、AlocationやBigIntegerのパフォーマンスによって制約を受ける

Page 24: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

“But,it’seasytooptimizethatkindofcode!”

24

Page 25: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 25

単純なローカル変数

ベクトル化してない

単純な浮動小数点の計算

基本的なループ

演算子以外使っていない(メソッド呼び出しがない)

数値型もしくはBoolean型しか使っていない

Page 26: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

“RealRubyismuchmorecomplex!”

26

Page 27: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 27

ループを使わずにSmalltalkスタイルのブロックを利用

ループの境界条件は単純な値ではなくオブジェクト

インスタンス変数

メソッドに隠れたロジック

配列の利用

Page 28: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 28

コアライブラリを使って計算中間オブジェクト

別の配列を使って、配列の配列にハッシュをマップし、変換してハッシュに戻す

r,g,bのハッシュとして内部ループのPixcelを表現

ローカル変数を使わず、メソッド呼び出しのみ

Page 29: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 29

メタプログラミング送信 動的に作成されるシンボル

実際のロジックメソッドの動的メソッド呼び出し

Page 30: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

ChunkyPNGkernels

0.01

0.1

1

10

100

1000 GraalVMJRuby+invokedynamicRuby

30

Rubyを基準として比較

これらのベンチマークは、GraalVMが完全に最適化

Page 31: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

PSD.rb kernels

0.1

1

10

100

1000 GraalVM JRuby+invokedynamic Ruby

31

Rubyを基準として比較

Page 32: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

Polyglot

32

Page 33: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

RESTpublicinternet

RESTprivateintranet

33

Page 34: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

RESTpublicinternet

34

Page 35: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

RESTpublicinternet

35

Page 36: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

HowwedopolyglotinGraal VM

36

Page 37: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

RubyTruffle::Interop.eval('application/language', source)

value = Truffle::Interop.import(name)

Truffle::Interop.export(name)

37

Page 38: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

JavaScriptInterop.eval('application/language', source)

value = Interop.import(name)

Interop.export(name)

// Returns 20Interop.eval('application/javascript', '14 + 6')

38

Page 39: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

JavaScriptinRuby

puts Truffle::Interop.eval('application/javascript','14 + 6')

39

Thisreturns20

JavaScript Ruby

Page 40: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

JavaScriptinRuby

Truffle::Interop.eval('application/javascript', "function add(a,b) {

return a + b;}Interop.export('add',

add.bind(this));")

add = Truffle::Interop.import('add')

puts add.call(14,2)

40

UsesfunctiondefinedinJavaScriptfromRuby

JavaScript

Ruby

Page 41: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

Ruby

JavaScript

41

Page 42: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

Ruby

JS

42

Page 43: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

Performance

43

Page 44: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 44

Clamp

ウォームアップ後、秒単位でのIterationをレポート

乱数入力があると最適化が効かない

Page 45: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

Ruby

010000002000000300000040000005000000600000070000008000000900000010000000

GraalVM JRuby+invokedynamic Ruby

Ope

ratio

nsPerSecon

d

45

Page 46: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 46

JavaScript(V8)JavaScriptに書き換え、 V8と組み合わせてみた

Page 47: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

Ruby+JavaScript(V8)

0

50000

100000

150000

200000

250000

300000

350000

Ruby(justRuby) Ruby(Ruby+JSwithV8)

Ope

ratio

nsPerSecon

d

47

Page 48: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 48

V8からRhinoへ変更

Page 49: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

JRuby +JavaScript(Rhino)

0

100000

200000

300000

400000

500000

600000

JRuby+indy(justRuby) JRuby+indy(Ruby+JSwithRhino)

Ope

ratio

nsPerSecon

d

49

Page 50: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 50

Nashornで試す

Page 51: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

JRuby +JavaScript(Nashorn)

0

100000

200000

300000

400000

500000

600000

JRuby+indy(justRuby) JRuby+indy(Ruby+JSwithRhino)

JRuby+indy(Ruby+JSwithNashorn)

Ope

ratio

nsPerSecon

d

51

Page 52: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 52

Graal VM

Page 53: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

Ruby+JavaScript(Graal VM)

010000002000000300000040000005000000600000070000008000000900000010000000

GraalVM(justRuby) GraalVM(Ruby+JS) JRuby+invokedynamic Ruby

Ope

ratio

nsPerSecon

d

53

Page 54: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

010000002000000300000040000005000000600000070000008000000900000010000000

GraalVM(justRuby)

GraalVM(Ruby+JS)

JRuby+indy(justRuby)

JRuby+indy(Ruby+JSwithRhino)

JRuby+indy(Ruby+JS

withNashorn)

Ruby(justRuby)

Ruby(Ruby+JSwith

V8)

Ope

ratio

nsPerSecon

d

54

Page 55: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

1

10

100

1000

10000

100000

1000000

10000000

GraalVM(justRuby)

GraalVM(Ruby+JS)

JRuby+indy(justRuby)

JRuby+indy(Ruby+JSwithRhino)

JRuby+indy(Ruby+JS

withNashorn)

Ruby(justRuby)

Ruby(Ruby+JSwith

V8)

Ope

ratio

nsPerSecon

d

55

Page 56: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

HowGraal achievesthis

56

Page 57: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

Hotspot

JIT

57

Page 58: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

Hotspot

JITGraal

Truffle

58

Page 59: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

BasicsofTruffleandGraal

59

Page 60: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

BasicConcepts• プログラムの表現を共通化

•意味を失わないようにそのままに

•表現の最適化も共通化

60

Page 61: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

x + y * z

+

x *

y z

load_local xload_local yload_local zcall *call +

pushq %rbpmovq %rsp, %rbpmovq %rdi, -8(%rbp)movq %rsi, -16(%rbp)movq %rdx, -24(%rbp)movq -16(%rbp), %raxmovl %eax, %edxmovq -24(%rbp), %raximull %edx, %eaxmovq -8(%rbp), %rdxaddl %edx, %eaxpopq %rbpret

61

Page 62: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

U

U U

U

U I

I I

G

G I

I I

G

G

Node Rewriting for Profiling Feedback

AST InterpreterRewritten Nodes

AST InterpreterUninitialized Nodes

Compilation usingPartial Evaluation

Compiled Code

Node Transitions

S

UI

D

G

Uninitialized Integer

Generic

DoubleString

T.Würthinger,C.Wimmer,A.Wöß,L.Stadler,G.Duboscq,C.Humer,G.Richards,D.Simon,andM.Wolczko.OneVMtorulethemall.InProceedingsofOnward!,2013.

62

Page 63: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

U

U U

U

U I

I I

G

G I

I I

G

G

Node Rewriting for Profiling Feedback

AST InterpreterRewritten Nodes

AST InterpreterUninitialized Nodes

Compilation usingPartial Evaluation

Compiled Code

Node Transitions

S

UI

D

G

Uninitialized Integer

Generic

DoubleString

T.Würthinger,C.Wimmer,A.Wöß,L.Stadler,G.Duboscq,C.Humer,G.Richards,D.Simon,andM.Wolczko.OneVMtorulethemall.InProceedingsofOnward!,2013.

63

Page 64: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

U

U U

U

U I

I I

G

G I

I I

G

G

Node Rewriting for Profiling Feedback

AST InterpreterRewritten Nodes

AST InterpreterUninitialized Nodes

Compilation usingPartial Evaluation

Compiled Code

Node Transitions

S

UI

D

G

Uninitialized Integer

Generic

DoubleString

T.Würthinger,C.Wimmer,A.Wöß,L.Stadler,G.Duboscq,C.Humer,G.Richards,D.Simon,andM.Wolczko.OneVMtorulethemall.InProceedingsofOnward!,2013.

64

Page 65: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

T.Würthinger,C.Wimmer,A.Wöß,L.Stadler,G.Duboscq,C.Humer,G.Richards,D.Simon,andM.Wolczko.OneVMtorulethemall.InProceedingsofOnward!,2013.

I

I I

G

G I

I I

G

G

Deoptimizationto AST Interpreter

D

I D

G

G D

I D

G

G

Node Rewriting to Update Profiling Feedback

Recompilation usingPartial Evaluation

65

Page 66: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

T.Würthinger,C.Wimmer,A.Wöß,L.Stadler,G.Duboscq,C.Humer,G.Richards,D.Simon,andM.Wolczko.OneVMtorulethemall.InProceedingsofOnward!,2013.

I

I I

G

G I

I I

G

G

Deoptimizationto AST Interpreter

D

I D

G

G D

I D

G

G

Node Rewriting to Update Profiling Feedback

Recompilation usingPartial Evaluation

66

Page 67: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 67

呼び出していたら…

Page 68: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 68

高頻度で呼び出している場合…

Page 69: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 69

Page 70: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 70

異言語で作成していても

高頻度で呼び出している場合…

Page 71: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 71

Page 72: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 72

Page 73: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

Lookingathoweffectivethisis

73

Page 74: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 74

Page 75: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 75

Page 76: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 76

Page 77: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 77

Page 78: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 78

Page 79: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 79

Page 80: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 80

Page 81: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

HowtouseGraal VM

81

Page 82: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

•含まれているもの– JVM(REと DK)– Java– JavaScript– Ruby– R–その他は将来追加予定

•バイナリをtarballとして提供• macOS用もしくはLinux用

82

Graal VM– everythinginonepackagetoday

Page 83: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 83

Java 8のGraal VMとは異なり、素のJVMを利用Java9では、JVMCIを使って連携

Hotspot

Graal

Truffle

JS others…Ruby

Java

C++

JVMCI(JVMCompilerInterface)

Page 84: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 84

Java 8のGraal VMとは異なり、素のJVMを利用Java9では、JVMCIを使って連携

Hotspot

Graal

Truffle

JS others…Ruby

Mavenなどを利用

Java 9

Page 85: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

Appendix

85

Page 86: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 86

http://www.oracle.com/technetwork/oracle-labs/program-languages“Graal OTN”で検索

Page 87: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.| 87

https://github.com/graalvm“GitHub GraalVM”で検索

Page 88: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

AcknowledgementsOracleDaniloAnsaloniStefanAnzingerCosminBascaDanieleBonettaMatthiasBrantnerPetrChalupaJürgenChristLaurentDaynèsGillesDuboscqMartinEntlicherBrandonFishBastianHossbachChristianHumerMickJordanVojinJovanovicPeterKesslerDavidLeopoldsederKevinMenardJakubPodlešákAleksandarProkopecTomRodriguez

Oracle(continued)RolandSchatzChrisSeatonDougSimonŠtěpánŠindelářZbyněkŠlajchrtLukasStadlerCodrutStancuJanŠtolaJaroslavTulachMichaelVanDeVanterAdamWelcChristianWimmerChristianWirthPaulWögererMarioWolczkoAndreasWößThomasWürthinger

JKULinzProf.HanspeterMössenböckBenoitDalozeJosefEislThomasFeichtingerMatthiasGrimmerChristianHäublJosefHaiderChristianHuberStefanMarrManuelRiggerStefanRumzuckerBernhardUrban

Universityof EdinburghChristopheDubachJuanJoséFumero AlfonsoRanjeet SinghToomas Remmelg

LaBRIFloréal Morandat

Universityof California,IrvineProf.MichaelFranzGulfemSavrunYeniceriWeiZhang

Purdue UniversityProf.JanVitekTomasKaliberaPetrMajLeiZhao

T.U.DortmundProf.PeterMarwedelHelenaKotthausIngoKorb

Universityof California,DavisProf.DuncanTempleLangNicholasUlle

Universityof Lugano,SwitzerlandProf.WalterBinderSunHaiyangYudiZheng

OracleInternsBrianBellevilleMiguelGarciaShamsImamAlexeyKaryakinStephenKellAndreasKunftVolkerLantingGeroLeinemannJulianLettnerJoeNashDavidPiorkowskiGregorRichardsRobertSeilbeckRifatShariyar

AlumniErikEcksteinMichaelHauptChristosKotselidisHyunjinLeeDavidLeibsChrisThalingerTillWestmann

Page 89: Polyglot on the JVM with Graal (Japanese)

Copyright©2017,Oracleand/oritsaffiliates.Allrightsreserved.|

SafeHarborStatementTheprecedingisintendedtooutlineourgeneralproductdirection.Itisintendedforinformationpurposesonly,andmaynotbeincorporatedintoanycontract.Itisnotacommitmenttodeliveranymaterial,code,orfunctionality,andshouldnotberelieduponinmakingpurchasingdecisions.Thedevelopment,release,andtimingofanyfeaturesorfunctionalitydescribedforOracle’sproductsremainsatthesolediscretionofOracle.

89

Page 90: Polyglot on the JVM with Graal (Japanese)
Page 91: Polyglot on the JVM with Graal (Japanese)