2幎åãã³ãŒãåãPanamaããšããæ°ãããããžã§ã¯ããOpenJDKã§äœæãããŸããã ç 究ã®äž»ãªåéã§ã¯ããã©ãããã©ãŒã ã«äŸåããã©ã€ãã©ãªãšJavaããŒãå€ïŒãªãããŒãïŒã®ããŒã¿ãæäœããããã®æ°ããã€ã³ã¿ãŒãã§ã€ã¹ã®äœæãçºè¡šãããŸããã ãããããããžã§ã¯ãã®ç®æšã¯ããåºããJVMãšãå€éšãïŒéJavaïŒAPIéã®çžäºäœçšã®ã¡ã«ããºã ãç 究ããããšã§ãã
ãŠã©ãžããŒã«ã»ã€ã¯ãã iwanowwwã¯ãªã©ã¯ã«ã®äž»èŠãšã³ãžãã¢ã§ãããHotSpot Javaä»®æ³ãã·ã³éçºããŒã ã§åããŠããŸãã 圌ã¯JITã®ã³ã³ãã€ã«ãšJavaãã©ãããã©ãŒã ã§ã®ä»£æ¿èšèªã®ãµããŒããå°éãšããŠããŸãã Vladimirã¯2005幎ã«Sun MicrosystemsïŒ2010幎ã«Oracleã«è²·åïŒã«å ¥ç€ŸããŠä»¥æ¥ãå€æ°ã®Javaãããžã§ã¯ãïŒHotSpot JVMãRTSJãJavaFXïŒã«åå ããŠããŸãã
JNI 2.0ïŒ
-ããããããžã§ã¯ãã®ã»ãšãã©ã¯ãJavaã³ãŒãã®ãã€ãã£ãã©ã€ãã©ãªã䜿çšããŠããŸãã ã©ãããã°ä»ãããè¡ãããšãã§ããŸããïŒ
-Javaã®ãã€ãã£ãã³ãŒãã䜿çšããããšã¯åžžã«å¯èœã§ããã ãã€ãã£ãã¡ãœããã¯ãã§ã«Javaã®æåã®ããŒãžã§ã³ã«ãããæšæºã®JNIã€ã³ã¿ãŒãã§ã€ã¹ã¯ããŒãžã§ã³1.1ã«ãã§ã«ãããŸããã ããããæéãçµã¡ããã©ãããã©ãŒã ãéçºãããèŠä»¶ãå€æŽãããçŸåšJNIãèŠããšããã€ãã£ãã©ã€ãã©ãªã§ã®äœæ¥ããã䟿å©ãã€å¹ççã«æŽçã§ããããšãç解ãããŠããŸãã
JNIã«ã¯ã䜿çšã®è€éããšé床ã«é¢é£ããå€ãã®æ¬ ç¹ããããŸãã ã©ã€ãã©ãªãã¢ããªã±ãŒã·ã§ã³ã«çµ±åããã«ã¯ãC / C ++ã§ã©ã€ãã©ãªã®ã©ãããŒãèšè¿°ããã ãã§ãªãããµããŒããããŠãããã¹ãŠã®ãã©ãããã©ãŒã ã«ã¢ã»ã³ããªãæäŸããå¿ èŠããããŸãã ããã¯ãææ°ã®Javaã¢ããªã±ãŒã·ã§ã³ã®ã³ã³ãã€ã«ããã»ã¹ã«ããŸãé©åãããå®è£ ã®å€§ããªéå£ã«ãªãå¯èœæ§ããããŸãã ãŸããJavaäžå¿ã§ãããããJNIãä»ããååŒã³åºãã«ã¯ç¹å®ã®ãªãŒããŒãããã䌎ããŸããããã¯ãå°ããªã¡ãœããã§ãéäžçã«äœæ¥ããå Žåã«ç¹ã«é¡èã«ãªããŸãã ããããããžã§ã¯ãã¯ããšãããããã䟿å©ã§çç£çãªJNIã®æ°ããããŒãžã§ã³ã§ãããJNI 2.0ããäœæããè©Šã¿ã§ãã ãããŠããã§ã«JEPããããŸãïŒ JEP 191ïŒ "Foreign Function Interface" ã
-JNIã¯éåžžã«è€éã«èšèšãããŠããããã䜿çšããã®ã¯å¿«é©ã§ã¯ãªããšããæèŠããããŸãã ããã«ã€ããŠã©ãæããŸããïŒ
-ããã¯ãéœåžäŒèª¬ãã®ã«ããŽãªãŒã®ãã®ã§ãã å šäœãšããŠãæèŠã¯ãã¡ããééã£ãŠããŸãããããã«ã¯ããããã®çå®ããããŸããJNIã®æ¹åã«æè³ããããšã¯åªå äºé ã§ã¯ãããŸããã§ããã ãã¹ãŠãJavaã§èšè¿°ããæ¹ãããå¹ççã§äŸ¿å©ã§ãããšä¿¡ããããŠããŸããã ãŠãŒã¶ãŒããŒãºã®90ïŒ ä»¥äžãã«ããŒããã€ã³ã¿ãŒãã§ã€ã¹ããããéçºããå¿ èŠã¯ãããŸããã§ããã ãŸãããµãŒãããŒãã£ã®ã©ã€ãã©ãªã䜿çšãããšãJNIã§ã®äœæ¥ãå€§å¹ ã«ç°¡çŽ åã§ããŸãã JNRãã芧ãã ãããããã«ãããC / C ++ã³ãŒããèšè¿°ããã«ããã€ãã£ãã©ã€ãã©ãªãå®å šã«æäœã§ããŸãã
-JNIã¯ãã§ã«20æ³ã§ããããªãããããããžã§ã¯ããç»å Žããä»éçºäžã§ããïŒ
-ç§ãã¡ã¯ãã®ãããžã§ã¯ãã«çããŠãããšèšããŸãã é·å¹Žã«ããã£ãŠãJNIã®é·æãšçæãæããã«ãªããJavaãã©ãããã©ãŒã ã¯ãã®éçºã«ãããŠé·ãéã®ããæ©ãã§ããŸããã Javaã ãã§ã¢ããªã±ãŒã·ã§ã³ãéçºããããšãåžžã«æšå¥šããããšã¯éããªãããšãæããã«ãªããŸãããããã«ãJavaããŒãå€ã®ããŒã¿ãæ±ãããšãã¯ããã«äžè¬çã«ãªã£ãŠããŸãã JNIãšNIOã¯ãã¹ãŠã®ããŒãºãæºãããŠããªãããããŠãŒã¶ãŒã¯sun.misc.Unsafeã䜿çšããå¿ èŠããããŸãã ããããããžã§ã¯ãã¯ã圌ããçŽé¢ããå€ãã®åé¡ã解決ããããšãç®æããŠããŸãã
ãããžã§ã¯ããç£ç£ããJohn RoseïŒOracleã¢ãŒããã¯ãJVM JVMïŒãçºè¡šããããã«ãæçšãªã©ã€ãã©ãªã¯ãJavaãšã³ã·ã¹ãã ã®äžéšãšããŠïŒJavaã§æžãããŠãããã©ããã«é¢ä¿ãªãïŒç°¡åã«ã¢ã¯ã»ã¹ã§ããå¿ èŠããããŸãã
ããšãã°ãå ã Fortranã§æžãããç·åœ¢ä»£æ°ããã±ãŒãžLAPACKããããŸãã å€ãã®ãªãœãŒã¹ãæé©åã«æè³ãããŠãããJavaã§ã®æžãçŽãã¯äœã®åœ¹ã«ãç«ããªãã§ãããã ããšãã°ãC / C ++ããã°ã©ããè¡ãããã«ãåçŽã«åå©çšããæ¹ãã¯ããã«çç£çã§ãã
äžè¬ã«ããå€ãèŠããæåã®è©Šã¿ã¯Project Sumatraãšèããããšãã§ããŸãããã®ç®çã¯ãGPUã䜿çšããŠJavaããã°ã©ã ãå®è¡ããããã®èŠéããç 究ããããšã§ããã çè«çã«ã¯ããã¹ãŠãéåžžã«é åçã«èãããŸããGPUãå©çšå¯èœãªããã€ã¹ã§ããã°ã©ã ãå®è¡ãããšãJVMãèªåçã«äœ¿çšãéå§ããŸãã ãããå®éã«ã¯ããã¹ãŠãããã»ã©ãã©è²ã§ã¯ãªããææ°ã®GPUã§Javaãã€ãã³ãŒããå®è¡ããããã®å¹æçãªã¡ã«ããºã ãäœæã§ããŸããã§ããã JavaããGPUãæäœããããã®Javaã©ã€ãã©ãªïŒ Aparapiããã³Rootbeer ïŒãããã€ããããŸãããOpenCL / CUDAã«äŒŒãããªãäœã¬ãã«ã®ã¢ãããŒããæäŸããŸãã
ãããã§ã¯ãGPUã®äœ¿çšã«é¢ããåé¡ã«ã€ããŠç°ãªãèŠç¹ããããŸããGPUã§Javaãã€ãã³ãŒããå®è¡ããå¿ èŠã¯ãããŸãããGPUã§äœããã¹ãããç¥ã£ãŠããã©ã€ãã©ãªãæäœããã ãã§ååã§ãã ãã®ãããªæ©èœã¯ãããšãã°ãäžéšã®BLASå®è£ ãšMAGMAç·åœ¢ä»£æ°ããã±ãŒãžã«åãã£ãŠããŸãã
-ããã°ã©ããŒã¯çŸåšãJNIã䜿ââçšããŠã©ã®ãããªã¿ã¹ã¯ã解決ããŠããŸããïŒ
-Javaã©ã€ãã©ãªã®ãšã³ã·ã¹ãã ã¯è±å¯ã§ããããã¹ãŠãJavaã§æžãããŠããããã§ã¯ãããŸããã ç·åœ¢ä»£æ°ãšLAPACKããã±ãŒãžã«ã€ããŠã¯æ¢ã«è¿°ã¹ãŸããã Javaããã°ã©ã ã§ãããã䜿çšããå¯äžã®æ¹æ³ã¯JNIã§ãã å¥ã®äŸã¯3Dã°ã©ãã£ãã¯ã¹ã§ããJavaããOpenGLãæäœããæ¹æ³ã¯ïŒ æšæºã®Java APIã¯ãªããå¿ èŠãªæ©èœãåãããã©ãããã©ãŒã å®è£ ããããŸãããJavaããããããšçµ±åããæ¹æ³ãå¿ èŠã§ãã çãã¯ãã¯ãJNIã§ãã
-ãããŠãã©ã®ãããªæåãããããžã§ã¯ããçŸåšJNIã䜿ââçšããŠããŸããïŒ
-äžè¬çã«ãå€ããå°ãªãã人æ°ã®ããéJavaã©ã€ãã©ãªã«ã¯Javaã®ã©ãããŒããŒãžã§ã³ããããŸãããã¡ãããããã¯ãã¹ãŠJNIã䜿ââçšããŠå®è£ ãããŸãã ããšãã°ãã³ã³ãã¥ãŒã¿ãŒããžã§ã³ã®åéã§ã¯ãããã¯OpenCVã©ã€ãã©ãªã§ãã 3Dã°ã©ãã£ãã¯ã¹ãèŠããšãããã¯OpenGL APIãšLightweight Java Game Libraryã®Javaãã€ã³ãã£ã³ã°ã§ã ã
ç·åœ¢ä»£æ°ããã±ãŒãžã«é¢ããŠã netlib-javaã¯BLAS / LAPACKãã©ãããã©ãŒã å®è£ ãžã®ã¢ã¯ã»ã¹ãæäŸããŸãã ãšããã§ã Apache Sparkã®ææ°ããŒãžã§ã³ã«ååšããŸãã
Javaãããžã§ã¯ãããã¯ãJNIãçŽæ¥äœ¿çšããã®ã§ã¯ãªãããã©ãããã©ãŒã åºæã®APIãæäœããããã«JNRã«äŸåããJRubyã«èšåããŸãã
ããŒãå€ã¢ã¯ã»ã¹ãšããŒã¿æäœ
-ãã€ãã£ãã©ã€ãã©ãªãåŒã³åºãããã®ã€ã³ã¿ãŒãã§ã€ã¹ã«å ããŠãããããããžã§ã¯ãã«ã¯ãã€ãã£ãããŒã¿æ§é ã®ãµããŒããå«ãŸããŠããŸãã ãããå¥ã®æ©èœãšèããŠããŸããããããšããã€ãã£ãã©ã€ãã©ãªãåŒã³åºãããã«å¿ èŠãªæ©èœãšèããŠããŸããïŒ
-ãããšå¥ã®äž¡æ¹ã Javaã®ãã€ãã£ãã³ãŒããæ±ãéã®äž»ãªåé¡ã¯ãããŒã¿äº€æã§ãã ä»®æ³ãã·ã³ã¯Javaãªããžã§ã¯ãã®è¡šçŸãå®å šã«èªç±ã«éžæã§ããå€ãã®å Žåããã®åœ¢åŒã¯ãã€ãã£ãã©ã€ãã©ãªãšäžè²«æ§ããããŸããã ããŒã¿ãååŸã«ã³ããŒãããã1ã€ã®ã³ããŒã§äœæ¥ããå¿ èŠããããŸãã
JNIã¯ããã€ãã£ãã³ãŒãã§JavaããŒãã«ã¢ã¯ã»ã¹ããããã®APIãæäŸãããªãããŒãã§äœæ¥ããã«ã¯ãJNIã©ãããŒã§ã³ãŒããèšè¿°ããå¿ èŠããããŸãã ããã©ãŒãã³ã¹ãšå¿ èŠãªã³ãŒãã®éã®äž¡æ¹ã®ç¹ã§éåžžã«é«äŸ¡ã§ãã
ãããã§ã¯ãæ°ãããã©ãŒãããïŒ Layout Definition Language ïŒã«åãçµãã§ããŸããããã«ãããããªãè€éãªããŒã¿æ§é ãã³ã³ãã¯ãã§æè»ãªåœ¢åŒã§èšè¿°ããããšãã§ããŸãã LDLèšè¿°ã¯C / C ++ããããŒããèªåçã«æœåºã§ããããŒã¿ãåŠçããããã®Javaã³ãŒãã¯ããªã³ã¶ãã©ã€ãã®èšè¿°ã«åŸã£ãŠçæãããŸãã JVMã¯ããã®æ å ±ã䜿çšããŠãããšãã°ãGCå ã®Javaãªããžã§ã¯ããžã®ãã€ã³ã¿ãŒãæ€çŽ¢ããããšãã§ããŸãã ãã®å Žåããã€ãã£ãã³ãŒãã¯ãè¿œå ã®é©å¿ãªãã§ããã®ããŒã¿ãçŽæ¥æäœã§ããŸãã
ãã€ã³ã¿ãŒãšæ瀺çãªã¡ã¢ãªç®¡çãšã®çµã¿åããã§ãããã¯ãªãããŒããœãªã¥ãŒã·ã§ã³ã«äœ¿çšãããsun.misc.Unsafeæ©èœã®äžéšãå®å šã«ã«ããŒããŸãã
ããããããã ãã§ã¯ãããŸããã JVMåŽã®é©åãªãµããŒãã«ãããLDLã䜿çšããŠJavaãªããžã§ã¯ãã®æ§é ãèšè¿°ããããšãã§ããŸãã
ãŸã第äžã«ãããã«ããæŽåãå¶åŸ¡ããããã£ã³ã°ãã£ãŒã«ããäœæã§ããŸãã
ãããããã³ãŒãã§ã¯ãåœå ±æãšéå¢çæŽåã¡ã¢ãªã¢ã¯ã»ã¹ã®åœ±é¿ãå®è¡é床ã«æ·±å»ãªåœ±é¿ãåãŒããŸãã JDKå ã«ã¯@Contendedã¢ãããŒã·ã§ã³ããããŸããããŠãŒã¶ãŒã«ãšã£ãŠã誀ã£ãå ±æãåé¿ããå¯äžã®æ¹æ³ã¯ãJVMãé åºãç¶æããããšãæåŸ ããŠãåé¡ã®ãã£ãŒã«ããä»ã®ãã£ãŒã«ããšæåã§ããªãŒããŒã¬ã€ãããããšã§ãã
ããããæãéèŠãªããšã¯ãèåç·ïŒèŠåºããš1ã€ã®ãªããžã§ã¯ããšããŠã®æåã®é åïŒãã¿ã°ä»ãé åïŒé åã®åèŠçŽ ãŸãã¯ããªããã£ãå€ããŸãã¯ãªããžã§ã¯ããžã®ãã€ã³ã¿ãŒïŒãªã©ãå€ãã®ãšããŸããã¯ãªæ§é ãžã®éãéããŸãã
ãããžã§ã¯ãã®ãã®éšåã«ã¯ãããŒã¿ãžã®é«éã¢ã¯ã»ã¹ïŒä»»æããã³ã·ãŒã±ã³ã·ã£ã«ã®äž¡æ¹ïŒãåããã³ã³ãã¯ããªJavaæ§é ãäœæãããšããç¹ã§ãValhallaããã³å€åãšå ±éç¹ããããŸãã
-ãããžã§ã¯ãã®æ©èœã¯ãŠãŒã¶ãŒããæãéèŠããããšæããŸããïŒ
-ãããã«ã¯å€ãã®ç¬ç«ããç 究åéããããŸãã 1ã€ç®ã¯ããã€ãã£ãã³ãŒããšãªãããŒãããŒã¿ã®æäœã§ãã ããããæ°ããJNI眮æAPIã®åºçªã§ãã ç§ã®æšå®ã«ãããšããããžã§ã¯ãã®ãã®éšåã¯æã人æ°ãããã¯ãã§ãã
ä»ã®æ¹åãããããŒã¿ã®ãããåŠççšã®APIïŒ Vector API ïŒã«èšåããŸãã ææ°ã®ããã»ããµã«ã¯ãããŒã¿ã®ãããåŠççšã®åœä»€ ïŒ SIMDåœä»€ ïŒãå«ããã¯ãã«æ¡åŒµïŒx86ã§ã¯SSEãšAVXãARMã§ã¯NEONïŒããããŸãã çŸæç¹ã§ã¯ãJVMã¯åçã³ã³ãã€ã«äžã«ã³ãŒãã®èªåãã¯ãã«åãå®è¡ã§ããŸãããããã¯ãã¹ãŠã®èå³æ·±ãã±ãŒã¹ãã«ããŒããŠããããã§ã¯ãããŸããã ããŒã¿ã®ãããåŠçã®æäœãæ瀺çã«èšè¿°ããããšãå¯èœã«ããç¹å¥ãªAPIã®äœæ¥ãé²è¡äžã§ãã
ãã1ã€ã®åéã¯ãArrays 2.0ãšãåŒã°ããJavaé åã®æŽæ°ã§ãã é åã¯æåããJavaã«ãããããã€ãã®é¢ã§ã¯éåžžã«æ代é ãã§ãïŒããšãã°ã2Gbã®ãµã€ãºå¶éïŒã ããããèšè¿°ããŠæäœããããã®ãããå¹æçã§æè»ãªã¡ã«ããºã ãå¿ èŠã§ãã
-JVMããã³Javaã®ãã®ä»ã®å€æŽãšæ¯èŒããå ŽåãçŸæç¹ã§ã®ããããããžã§ã¯ãã®éèŠæ§ã¯ïŒ
-ãããã§ã®äœæ¥ã¯ç©æ¥µçã«é²è¡äžã§ããããŸã ç 究段éã§ãã Javaã«äœããã€çµ±åãããã¯ãŸã 決ããŠããŸããã
ãããŸã§ãJDK 9ã®éèŠãªãããžã§ã¯ãã¯ãã©ãããã©ãŒã ã®ã¢ãžã¥ãŒã«åã§ãïŒ Project Jigsaw ïŒã
ãããã®æèã§ã¯ã VarHandleã®å€èŠ³ã¯éåžžã«èå³æ·±ããã®ã§ãïŒ JEP 193ïŒâ Variable Handlesâ ïŒã ãããã¯ããã£ãŒã«ããšé åã®äž¡æ¹ãããã³ãªãããŒãããŒã¿ã®äž¡æ¹ã§æ©èœããæšæºã®Javaã¡ã¢ãªã¢ãã«ã§ã¯èª¬æã§ããªãå€ãã®ç¹æ®ãªèªã¿åã/æžã蟌ã¿ã¢ãŒããæäŸããŸãã ãã®ãããªãµããŒãã¯ãéããããã³ã°åæã®å¹æçãªå®è£ ã«å¿ èŠã§ããjava.util.concurrentããã±ãŒãžã¯ãJDK 9ã®sun.misc.UnsafeããVarHandleã«ãã§ã«å®å šã«ç§»è¡ãããŠããŸãã ãããã§ææ¡ãããæ°ããããªããã£ãã¯ã VarHandleãä»ããŠã¢ã¯ã»ã¹ãã©ãã€ã ã«é©åãããªã³ããŒãããŒã¿ãšãªãããŒãããŒã¿ãžã®ã¢ã¯ã»ã¹ãçµ±äžããå¿ èŠããããŸãã
次ã¯ïŒ JDKã®æªæ¥
-ãããŠãå°æ¥ã®ããŒãžã§ã³ã§ã¯ïŒ
-çŸåšã掻çºã«éçºãããŠããã®ããããžã§ã¯ããŽã¡ã«ãã©ã§ãã ããããããžã§ã¯ãã¯è³ã«ã¯èãããŸããããç§ã®æèŠã§ã¯ãé·æçã«ã¯Javaãã©ãããã©ãŒã ã«ãšã£ãŠããã»ã©éèŠã§ã¯ãããŸããã
FFIã®è©±ãšãªãããŒãã®æäœã¯ããªãåããç¶ããŠããŸãããæè¿ã§ã¯Vector APIã«åŒ·ãé¢å¿ãå¯ããããŠããŸãã ä»å¹Žã®JVM Language Summitã«ã³ãã¡ã¬ã³ã¹ã§ã¯ãé¢çœãç¬éããããŸããããããã«ã€ããŠè°è«ãããšããFacebookã®ååã¯ã Vector APIãJavaã«ç»å Žããã®ããã€åŸ ã€ãã«ã€ããŠéåžžã«èå³ãããã3幎åã«æ¬åœã«å¿ èŠã ãšèšããŸããã 圌ããé·ãéæ²é»ããŠããã®ã¯æ®å¿µã§ãã 圌ãã¯æ¯å¹ŽJVMLSã«æ¥ãŠããã®ã§ããããã¯ãããã«æèµ·ããå¿ èŠããããŸããã åœæãæ瀺çãªãã¯ãã«åã®ãµããŒãã«ã¯ããŸãé¢å¿ããããŸããã§ããã
-Javaã§èšè¿°ãããäžéšã®ãããžã§ã¯ãã¯ãæ°ããAPIã䜿çšããŠæžãæããããäºå®ã§ããïŒ
-ãã¡ãããJNIã¯æ®ããŸãããçŸåšJNIã䜿ââçšããŠãã人ã ã«ãšã£ãŠãæ°ããAPIã¯ã¯ããã«é åçã§ãã æ°ããã€ã³ã¿ãŒãã§ãŒã¹ãåããç§ãã¡ã®çµéšããå€æãããšãJNIã®å¿ èŠæ§ã¯ãã¯ããªãã¯ãã§ãã
çŸåšã®ãããã¿ã€ããç©æ¥µçã«å®éšããŠããããã®çµæã«æºè¶³ããŠããŸããClang㯠C / C ++ããããŒããæ å ±ãæœåºããããã«äœ¿çšãããä»ã§ã¯ããã€ã³ãã£ã³ã°ãå šäœããããã®æ°ããããŒã«ãããã«ãã£ãŠäœæãããŸãã ã·ã³ãã«ã§äŸ¿å©ãªããã移è¡äžã®æéãå€§å¹ ã«ç¯çŽã§ããŸãã
-ã€ãŸããããããããžã§ã¯ãã¯Javaãã©ãããã©ãŒã å ã§éèŠããããŸããïŒ
-ãã¡ããããã€ãã£ãã³ãŒãã®åŒã³åºãããã©ãããã©ãŒã å ã§ç©æ¥µçã«äœ¿çšãããããããã䟿å©ã§å¹ççãªã¡ã«ããºã ã®åºçŸã«ãããJDKã§åŸã ã«åãæ¿ããŸããããããã¯å éšãšããŠäœçœ®ä»ããããŠããŸããã ãã®ç®æšã¯ãJavaãã©ãããã©ãŒã ã®ãã€ãã£ãã³ãŒããšãªãããŒãããŒã¿ãæäœããããã®æ°ããã¡ã«ããºã ãäœæããããšã§ããããã¯ãæ°ãããããªãã¯APIã®åºçŸãæå³ããŸãã
-ã€ãŸããJNIã¯ã¬ã¬ã·ãŒãã¬ãŒã ã¯ãŒã¯ãšããŠã®èšèªã®ãŸãŸã§ããïŒ
-誰ããŸã JNIãåãé€ãã€ããã¯ãããŸããã äžäœäºææ§ã¯Javaã«ãšã£ãŠéèŠã§ããããµããŒãã¯ç¶ç¶ãããŸãã å°æ¥ãJNIããåé€çšããšããŒã¯ãããå¯èœæ§ããããŸãïŒå»æ¢äºå®ïŒããçŸæç¹ã§ã¯ãã®ãããªèšç»ã¯ãããŸããã
ãŸããJNIã¯ããããããžã§ã¯ãã§ã®äœæ¥ããå©çãåŸãå¯èœæ§ãæãé«ãããšã«æ³šæããããšæããŸãã ãã€ãã£ãã³ãŒããå¹æçã«äœ¿çšããã«ã¯ãJVMåŽã§ã®æ¬æ ŒçãªãµããŒããå¿ èŠã§ãã ãããã£ãŠãæ°ããJVMããªããã£ãã䜿çšããŠJNIãæžãæãããšãããã©ãŒãã³ã¹ãå€§å¹ ã«åäžããŸãã
- ãããŠãJDK 9ã§ã¯ä»ã«äœãå©çšå¯èœã«ãªããŸããïŒ
-ããŸãç¥ãããŠããªããããžã§ã¯ãã®ãã¡ãJVMCIã€ã³ã¿ãŒãã§ãŒã¹ïŒ JEP 243ïŒâ Java-Level JVM Compiler Interfaceâ ïŒãéžã³ãŸãã ããã䜿çšãããšããµãŒãããŒãã£ã®ãã€ãããã¯ã³ã³ãã€ã©ãJVMã«æ¥ç¶ã§ããŸãããã®APIã®æåã®ãŠãŒã¶ãŒã¯ãOracle LabsãéçºããGraalã§ãã ããã¯ããã¹ãŠJavaã§èšè¿°ãããæ°ããJITã³ã³ãã€ã©ã§ãã
-ã€ãŸããæšæºã®JITã³ã³ãã€ã©ãGraalã«çœ®ãæããããšã¯å¯èœã§ããããïŒ
-ã¯ããGraalã¯ãæé©åãããã³ãŒããçæãããã©ã¹ãã¬ãã«ãã³ã³ãã€ã©ãŒïŒãããã¹ãããã®C2ãµãŒããŒã³ã³ãã€ã©ãŒã眮ãæããïŒãšããŠããŸãã¯ä»®æ³ãã·ã³ã®å¯äžã®JITã³ã³ãã€ã©ãŒãšããŠäœ¿çšã§ããŸãã çŸåšå ¥æå¯èœã§ãããç¹å¥ãªJVMãã«ããå¿ èŠã§ãã
äžè¬ã«ããJava on Javaãå®è£ ã®å®éšã¯é·ãéè¡ãããŠããŸããã Maxine VMã®ãããžã§ã¯ãããããŸãããå®å šã«ïŒïŒïŒJavaã§æžãããä»®æ³ãã·ã³ã§ãã æ倧ã®æåã¯ãåçã³ã³ãã€ã©ã®åéã§éæãããŸããã çµå±ã®ãšãããGraalã¯ã¯ã©ã€ã¢ã³ãã³ã³ãã€ã©ãHotSpotããJavaã«æžãçŽãè©Šã¿ããå§ãŸããŸããã Maxineã§ã¯ãæåã¯C1XãšåŒã°ããŠããŸããã æåŸã«ããã©ãããã©ãŒã ã§éçºãå®è£ ãããšããæ¥ãŸããã
JVMãšã³ãžãã¢ãšããŠãJavaã§ä»®æ³ãã·ã³ãæžãæããåŸåã¯éåžžã«å°è±¡çã§ãã äžæ¹ã§ã¯ã䟿å©ãªããŒã«ããããé«ã¬ãã«ã®èšèªæ§æããã«ãã¹ã¬ããããã°ã©ãã³ã°ã®åªãããµããŒããåããåºç¯ãªæšæºã©ã€ãã©ãªãããææ°ã®ãã©ãããã©ãŒã ã§å®è£ ãååŸããŸãã ãŸãããã®ãã©ãããã©ãŒã ãå®å šã«å¶åŸ¡ããããšãéèŠã§ãããã®ãããå¿ èŠãªæ¹åã«ãã©ãããã©ãŒã ãæ¡åŒµããèªåã§çºçããåé¡ã解決ããæ©äŒããããŸãã äžæ¹ãäœã¬ãã«ã®ã¿ã¹ã¯ã解決ããããã®JavaããŒã«ãè¿œå ããŸãã ãããŠãããããããžã§ã¯ãã¯ããã§éèŠãªåœ¹å²ã®1ã€ãæãããŸãã
ç§ãã¡ãšåããããJVMã®ãã¬ãããã奜ããªå Žåã¯ã Vladimirã®ã¬ããŒãããã€ãã£ãã³ãŒãããªãããŒãããŒã¿ãJavaãã«å ã㊠ã次ã®Joker 2016ã¬ããŒããã芧ã«ãªãããšããå§ãããŸãã