ãµã¨æãç«ã£ã¦ YARV ããã® JIT ã³ã³ãã¤ã©ã Xbyak ã§æ¸ãå§ãã¦ã¿ã¾ããã x86 㨠x86_64 ã両æ¹ãµãã¼ãããã¤ããã ã£ããã©ãã¨ããããé©å½ã«ãããã㦠x86_64 ã«ä¾åãã¾ãã£ã¦ãã¾ã£ãã®ã§ã¨ããããç¾ç¶ãã£ã¡ã ããä»åº¦ x86 対å¿ã¯ã¡ããã¨ãããã㨠Windows 㨠MacOSX ããã¶ãã¾ã ã ã(調ã¹ãããç°å¢ãããªã)ã http://shinh.skr.jp/tmp/yajit.tgz YA ãªã®ã¯ãªããä»ã«ãã£ã¦ã人ããã¿ããã ããç§ã®è¨æ¶ã確ããªã YARV ã«ãæããããæé©åãã©ã°ãã£ããããªãå®è£ ããã¦ããã¯ç¥ãããã©ã ã¨ããããåãã³ã¼ããããã°åããã³ã¼ããâ¦ã£ã¦æãã§ããéããã¨ããã¨â¦é ãæ°ããããã¨ãããããããã¯å¼ã³åºããã¨ã« mprotect ãã¦ãã¨ãããã¾ãã«åé¡å¤ãããæ°ããããã¨ãããããããªã¨ã¦ãæ£æçãªã
以åãã®ãµã¤ãã¨ããã°ã«ï¼ä½åº¦ãã¢ã©ã¤ã³ã¡ã³ãã«é¢ããè¨äºãæ¸ãã¾ãã (ãµã¤ãå é¢é£ãã¼ã¸åç §)ï¼ ãã®ããããã¢ã©ã¤ã³ã¡ã³ããã§æ¤ç´¢ãã¦æ¥ã¦ããã人ãå¤ãã®ã§ï¼ éå»ã®è¨äºã«å çä¿®æ£ãã¦ãã®ãã¼ã¸ãæ°ãã«ä½æãã¾ããï¼ å çããç¹ã¯æ¬¡ã®ã¨ããã§ãï¼ ã¢ã©ã¤ã³ã¡ã³ãã¨ã¡ã¢ãªã¢ã¯ã»ã¹åæ°ã®é¢ä¿ãããããããããããï¼ (ã»ãã®å°ã) å³ãå°å ¥ãã¾ããï¼ ããã¼ã¿ãã¢ã©ã¤ã³ããã¦ããªãã¨ã¡ã¢ãªã¢ã¯ã»ã¹åæ°ãå¢ããã ã¨è¨èã§èª¬æãã¦ãããµã¤ãã¯å¤ãã®ã§ããï¼ å³ã§ç¤ºãã¦ããã¨ããã¯ã¾ã è¦ããã¨ããã¾ããï¼ ã¢ã©ã¤ã³ããã¦ããªãã¢ãã¬ã¹ã«ãã¼ã¿ãæ¸ãè¾¼ãå ´åï¼ èªã¿åºãã®å ´å以ä¸ã«ã¡ã¢ãªã¢ã¯ã»ã¹åæ°ããããå¯è½æ§ããããã¨ã追è¨ãã¾ããï¼ ä»¥åã¯ãè¤åãã¼ã¿å (é åï¼æ§é ä½ï¼å ±ç¨ä½) ã®ã¢ã©ã¤ã³ã¡ã³ããã¯ã»ã¨ãã©èªæã®ãã¨ã ã¨æã£ã¦ããã®ã§è»½ãæµãã¦ãã¾ãããï¼ æå¤ãªãã¨ã«ããã解説ãã¦ã
ã¨ããããï¼å¤§å¦ã® Windows PC ã§ãã£ã¦ã¿ã¾ããï¼ ã½ã¼ã¹ã³ã¼ãã¯ãããªæãã§ãï¼ cat.c (ã ?) #include<stdio.h> void cry() {printf("Nya-, Nya- !\n");} dog.c (ããã ? ããããã¦â¦) #include<stdio.h> void cry() {printf("Bow, Bow !\n");} polymorphism.c (ã»ãã»ãï¼ã ãã ãå«ãªäºæããã¦ããã§ãã ï½) #include<stdio.h> #include<string.h> #include<assert.h> #include<dlfcn.h> int main(int argc, char** argv) { void (*cry)(); void* handle; char dlname[256]; #if defined
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}