JavaScriptã¯Java, .netã«ç¶ãILç°å¢ã«ãªããã
ãã®è¨äºã¯å¤ã postmortem: http://d.hatena.ne.jp/mjt/20110502/p1
OSã¨ããæèã¯ã¨ããããGoogle Chromeãç¾å¨ã®ç°å¢ã¨ãã¦ãã£ã¨ãéè¦ãªè¨èªå¦çç³»ãé
å¸ãã¦ããã¨ãããã¨ã¯æ³¨ç®ã«å¤ããã
Java, .net, LLVMãä¹ããªãã£ãã®ã¯ä½æ ã
éè¦ãªã®ã¯ãJavaScriptã®JITCã¨ããå¸å ´ã«ãJavaãä»ã®ä¸éè¨èªã·ã¹ãã ãä¹ããªãã£ãã¨ãããã¤ã³ãã«æããã
å¸å ´ã«ããã»ã¼å
¨ã¦ã®JavaScript JITCã¯ãèªåã®(äºææ§ã®ãªã)ä¸éè¨èªã¨ã³ã³ãã¤ã©ãæã¡ãä»ã®è¨èªãåãå
¥ããä½è£ãç¡ãã
ãããªãã¨ãä»å¾ã¯Javaã®ãã¤ãã³ã¼ããåºåãã代ããã«ãJavaScriptãåºåããã³ã³ãã¤ã©ãæ±ããããæ代ãæ¥ãããç¥ããªãã
ä¾ãã°ããã¤ãããã¯ãªã³ã³ãã¤ã«ãä¼´ãã¨ãã¥ã¬ã¼ã¿ãããããã®ç°å¢ã§å®ç¾ãããã¨ãèãããIKVM(Javaâ.net)ãRhino(JavaScriptâJava)ãJPSX(MIPSâJava)ã®ãããªå
±éã®ã¤ã³ãã©ã¹ãã©ã¯ãã£ã®åå¨ããç°å¢ã§ã¯ååã«å®ç¾ã§ãããããããJavaScriptã«ç½®ãæãããã¨ã«ãããªã¼ãã¼ãããããè¨èªãããã³ã°æ¦ç¥ãªã©ã¯æ¤è¨ãããªããã°ãªããªãã
fat IL
å¾æ¥ã®ä¸éè¨èª(IL)ã«æ¯ã¹ã¦ãã¢ãã³ãªé«ç´è¨èªãILã¨ãã¦ä½¿ããã¨ãã¨ããããfat ILã¨å¼ãã§ããã
éå»ã«ãOLEã¨ãããã¤ããã©ã¼ãããããè¿å¹´ã®XMLã¸ç§»è¡ããããã«ãä¸éè¨èªã¨ãããã¤ããã©ã¼ãããããJavaScriptã¨ãã£ãfat ILã¸ã®ç§»è¡ãè¡ãããå ´åãåã
ã®JITCã«ãããå¤æã®å
±éé
ã模索ããå¿
è¦ãçããã
fat ILã¨ãã¦æ¢åã®è¨èªã使ç¨ãã試ã¿ã¨ãã¦ã¯ãqemu(ã®dyngen)ãCè¨èªã使ã£ã¦ã³ã¼ããã©ã°ã¡ã³ããçæãã¦ãããã¨ãæãå½ãããããããJavaScriptãfat ILã¨ãã¦å©ç¨ããå ´åã¯ãããã¢ãã³ãªè¨èªæ©è½(GCãä¾å¤ãXMLãæ¥ä»å¦çã¨ãã£ãå種ã©ã¤ãã©ãª)ã¨é©åã«ãããã³ã°ãããªããã°ãã¤ãã£ãã¨åçã®ããã©ã¼ãã³ã¹ãå®ç¾ãããã¨ã¯é£ããããç¥ããªãã
æ§è³ªã®è¿ãè¨èªã¨ã¯è¯ããããã³ã°ããã¨èãããããJavaScriptã¯Javaã«ãä¼¼ã¦ãããã®ã§ãGCçã®è¨èªæ©è½ãæå¾
ããILã®ã³ã¼ãããã®ã¾ã¾å¤æãã¦ã大ããªåé¡ã¯çºçããªãã ããã
éã«ãCè¨èªãLLVMã®ILã¨ãã£ãåç´ãªã·ã¹ãã ããããã³ã°ããã®ã¯é£ããåé¡ã«ãªãããã
ä¾ãã°ãJavaScriptã¯ãã¼ã¿æ§é ãããã°ã©ãã³ã°ããªããããã¯2æ¹åã®åé¡ã¨ãªããã¤ã¾ããããã¼ã¿æ§é ã解ä½ããã¯ã©ã¹ã«åé
ããããã¨ã¨ããã¯ã©ã¹ããã¼ã¿æ§é ã«ç½®ãæããããã¨ã®ä¸¡æ¹ãå¿
è¦ã«ãªãã
ãã¼ã¿æ§é ã解ä½ããã®ã¯ãCè¨èªã§ã¯æ§é ä½ã®ä½ç½®ã«ä¾åããã³ã¼ããè¨è¿°ã§ããã¨ããåé¡ã®ããã«å¿
è¦ã«ãªããå¿
è¦ãªã¨ãã«ã ãæ§é ä½ãã¡ã¢ãªä¸ã«åç¾ãããã¨ã§ç¡é§ãªå å·¥å¦çãæ¸ãããå¯è½æ§ãããã
å¾è
ã¯æ¬æ¥ã¯ã³ã³ãã¤ã©ãèããã¹ãåé¡ã ããæãã æ§é ä½ãå¾ãããã«ã³ã¼ãçæå´ãé
æ
®ããå¿
è¦ãããã ããã
ãã£ã¨ããGoogle ChromeããJavaScriptã®JITCãæ®åãããããªãã®ãªããããããfat ILãèãããã¨èªä½ã«ãã¾ãæå³ãç¡ããªããä»ã®å¦çç³»ã®ååã注è¦ããªããã°ãªããªãã
åé¡ãåç´åãããªãã以ä¸ã®çåã«ã¾ã¨ããããã
- JavaScriptã§JVMãå¹ççã«å®è£ ã§ããã®ã
- Java Bytecodeãçµç±ããJavaScirptã§å®ç¾ãããJVMã§å®è¡ããã®ã¨ãJavaScriptã³ã¼ããç´æ¥åºåããã®ã§ã¯ã©ã®ãããªéããããã®ã
- LLVMã®ãããªè»½ãä¸éè¨èªã¨äºã£ãå ´åã¯ã©ãã
å人çã«ã¯ããã¼ã¿æ§é ãæ½è±¡åã«å«ãã§ããªãä¸éè¨èªç°å¢(ã¤ã¾ãããã¯JVMçãå«ã)ã§ã¯ãä»å¾ã®ã¢ã¼ããã¯ãã£ã®å¤åã«å¯¾å¿åºæ¥ãªãã®ã§ã¯ãªããã¨èãããä¾ãã°SIMDåãããªãã§ãããªã©ã®ãã¯ããã¯ã¯ä»å¾ä¸å¯æ¬ ã«ãªããããã®è¯ããµãã¼ãã®ããã«ã¯é©åãªãã¼ã¿æ§é ã®çæãå¿ è¦ã«ãªãã