{"id":372137,"date":"2024-05-21T05:05:11","date_gmt":"2024-05-21T05:05:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=372137"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=372137","title":{"rendered":"<span>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f JIT \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f C++<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/bf\/p-\/nh\/bfp-nhjb78dua4_ix26ews1nqmi.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/bf\/p-\/nh\/bfp-nhjb78dua4_ix26ews1nqmi.jpeg\" data-blurred=\"true\"\/><\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u0434\u0430\u0432\u043d\u043e \u044f \u043f\u0438\u0441\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u044e-\u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0425\u0430\u0431\u0440\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0438 \u0434\u043b\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0440\u0435\u0432\u044c\u044e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/539674\/\">\u0425\u0430\u0431\u0440 \u2014 \u0443\u043c\u0430 \u043f\u0430\u043b\u0430\u0442\u0430<\/a>, \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043d\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u043e\u0441\u043d\u043e\u0432\u0435.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c, \u043f\u043e\u0445\u043e\u0436\u0435, \u044f \u043d\u0430\u0448\u0435\u043b \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0425\u0430\u0431\u0440\u043e\u0445\u0430\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0425\u0430\u0431\u0440\u0430 \u043a\u0430\u043a \u0437\u0430\u043f\u0438\u0441\u043d\u043e\u0439 \u043a\u043d\u0438\u0436\u043a\u0438, \u043d\u043e \u043d\u0435 \u043a\u0430\u043a \u0432 \u0442\u043e\u043c \u0430\u043d\u0435\u043a\u0434\u043e\u0442\u0435 <code>\u044f \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u043b\u043e\u043a\u043d\u043e\u0442 \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0442\u043e\u043a, \u0430 \u0432\u0441\u0435\u043c \u0432\u0438\u0434\u043d\u043e \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u044f \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043b<\/code>, \u0430 \u0432 \u0441\u0430\u043c\u043e\u043c \u0445\u043e\u0440\u043e\u0448\u0435\u043c \u0441\u043c\u044b\u0441\u043b\u0435 \u2014 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0434\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0438\u0442\u043e\u0433\u043e\u0432 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0445 \u0432\u044b\u0432\u043e\u0434\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a, \u043d\u0430 \u0434\u043d\u044f\u0445 \u0438\u0441\u043a\u0430\u043b \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u043f\u0440\u043e JIT \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e C++ \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e clang\/llvm \u0438 \u043f\u043e\u0438\u0441\u043a \u043c\u043d\u0435 \u0432\u044b\u0434\u0430\u043b \u043c\u043e\u044e \u0436\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u0442\u0440\u0435\u0445\u0433\u043e\u0434\u0438\u0447\u043d\u043e\u0439 \u0434\u0430\u0432\u043d\u043e\u0441\u0442\u0438: <a href=\"https:\/\/habr.com\/ru\/companies\/timeweb\/articles\/572878\/\">\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f JIT \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0421\/\u0421++ \u0432 LLVM \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Clang \/ \u0425\u0430\u0431\u0440<\/a>. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0443\u0436\u0435 \u044d\u0442\u0430 \u043d\u043e\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e JIT \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e C\/\u0421++.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h3 id=\"predystoriya\">\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u041c\u043d\u0435 \u0434\u043b\u044f \u044f\u0437\u044b\u043a\u0430 <a href=\"https:\/\/github.com\/rsashka\/newlang\" rel=\"nofollow noopener noreferrer\">NewLang<\/a> \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u0441\u044f JIT \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0421++ \u0438 \u0441\u043f\u0435\u0440\u0432\u0430 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430. \u0423 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 clang \u0435\u0441\u0442\u044c <a href=\"https:\/\/github.com\/llvm\/llvm-project\/tree\/main\/clang\/examples\" rel=\"nofollow noopener noreferrer\">\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438<\/a> \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043a\u043e\u0434\u0430, \u043d\u043e \u0432\u0441\u0435 \u043e\u043d\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u043e\u043c \u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0421++ <strong>LLVM<\/strong> <strong>IR<\/strong> (\u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435).<\/p>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 llvm \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 JIT \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c LLVM IR <a href=\"https:\/\/github.com\/llvm\/llvm-project\/tree\/main\/llvm\/examples\/HowToUseLLJIT\" rel=\"nofollow noopener noreferrer\">HowToUseLLJIT<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/github.com\/llvm\/llvm-project\/tree\/main\/llvm\/examples\/HowToUseJIT\" rel=\"nofollow noopener noreferrer\">HowToUseJIT<\/a>, \u043d\u043e \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u0442\u0430\u043c \u043d\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f C++ -> IR.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0432\u0437\u044f\u0442\u044c <a href=\"https:\/\/github.com\/root-project\/cling\" rel=\"nofollow noopener noreferrer\">cling<\/a>. \u041d\u043e \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 <a href=\"https:\/\/github.com\/root-project\/llvm-project\" rel=\"nofollow noopener noreferrer\">\u043f\u0440\u043e\u043f\u0430\u0442\u0447\u0435\u043d\u043d\u044b\u0439 \u0444\u043e\u0440\u043a llvm<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0442\u0441\u0442\u0430\u0435\u0442 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0443 \u043c\u0435\u043d\u044f \u0442\u0430\u043a \u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0435\u0433\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c. \u0418 \u043f\u043e\u0441\u043b\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u044f\u0442\u043e\u0439 \u0438\u043b\u0438 \u0448\u0435\u0441\u0442\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u044f \u043f\u043b\u044e\u043d\u0443\u043b, \u0438 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<p>  <\/p>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u044b\u043b\u0438 \u043b\u0438\u0431\u043e \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 LLVM \u0438 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f (\u044d\u0442\u0430 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 clang \u0438 LLVM), \u043b\u0438\u0431\u043e \u043d\u0435 \u0442\u043e, \u0447\u0442\u043e \u043c\u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u043a\u0430\u043a \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435, \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u043c\u043d\u0435 \u043c\u043e\u044e \u0436\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0438\u0437 C++ \u0432 IR \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0435\u0439 \u0432 JIT, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0438 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043b \u043f\u043e\u0434 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e LLVM 18 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <a href=\"https:\/\/github.com\/llvm\/llvm-project\/tree\/main\/llvm\/examples\/OrcV2Examples\" rel=\"nofollow noopener noreferrer\">\u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 OrcV2<\/a>. \u041d\u043e \u043f\u0440\u0435\u0436\u0434\u0435, \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u043a\u043e\u0434\u0443, \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u0441\u0430\u043c LLVM ORC.<\/p>\n<p>  <\/p>\n<h3 id=\"llvm-orc\">LLVM ORC<\/h3>\n<p>  <\/p>\n<p>LLVM ORC, \u044d\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0439 API \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f JIT-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432. \u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <a href=\"https:\/\/llvm.org\/docs\/ORCv2.html#use-cases\" rel=\"nofollow noopener noreferrer\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<blockquote>\n<ol>\n<li>\u0412 \u0443\u0447\u0435\u0431\u043d\u044b\u0445 \u043f\u043e\u0441\u043e\u0431\u0438\u044f\u0445 \u043f\u043e LLVM \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 JIT-\u043a\u043b\u0430\u0441\u0441 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 ORC \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0438\u0433\u0440\u0443\u0448\u0435\u0447\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430: \u043a\u0430\u043b\u0435\u0439\u0434\u043e\u0441\u043a\u043e\u043f\u0430.<\/li>\n<li>\u041e\u0442\u043b\u0430\u0434\u0447\u0438\u043a LLVM, LLDB, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 JIT \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a\u0430, \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435\/\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435. <\/li>\n<li>\u0412 \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 JIT (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, JVM, Julia), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0442\u044f\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 LLVM \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 JIT-\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435. <\/li>\n<li>\u0412 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430\u0445 \u0438 REPL, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440. Cling (C++) \u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 Swift. <\/li>\n<\/ol>\n<p>  <\/p><\/blockquote>\n<p>\u042d\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0438 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f &#171;\u0444\u0438\u0448\u043a\u0430&#187; \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u0430\u0432\u0438\u043b \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0449\u0438\u043a\u0430\u043c\u0438. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 ORC JIT \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 LLVM IR, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u043c\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, clang), \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u0430\u043a \u043f\u043e\u0437\u0434\u043d\u0435\u0435 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435, \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0441\u043b\u0430\u0431\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0438 \u0442.\u0434. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 <a href=\"https:\/\/llvm.org\/docs\/ORCv2.html#design-overview\" rel=\"nofollow noopener noreferrer\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>  <\/p>\n<h3 id=\"pererabotannyy-kod-jit-kompilyatora-c-pod-llvm-18-na-orcv2\">\u041f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 JIT \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 C++ \u043f\u043e\u0434 LLVM 18 \u043d\u0430 ORCv2<\/h3>\n<p>  <\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c <a href=\"https:\/\/github.com\/rsashka\/cpp-jit-llvm\" rel=\"nofollow noopener noreferrer\">\u0442\u0443\u0442<\/a> \u043b\u0438\u0431\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u043f\u043e\u0439\u043b\u0435\u0440.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u0440\u0442\u044f\u043d\u043a\u0430 \u043a\u043e\u0434\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;iostream> #include &lt;fcntl.h>  #include &lt;llvm-c\/Core.h> #include &lt;llvm-c\/Support.h> #include &lt;llvm-c\/TargetMachine.h>  #include &lt;clang\/Frontend\/CompilerInstance.h> #include &lt;clang\/Frontend\/TextDiagnosticPrinter.h> #include &lt;clang\/CodeGen\/CodeGenAction.h>  #include &lt;llvm\/Support\/InitLLVM.h> #include &lt;llvm\/Support\/TargetSelect.h> #include &lt;llvm\/InitializePasses.h> #include &lt;llvm\/Passes\/PassBuilder.h> #include &lt;llvm\/ExecutionEngine\/Orc\/LLJIT.h>  using namespace llvm; using namespace llvm::orc;  \/*   * \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0438\u0437\u043d\u0443\u0442\u0440\u0438 JIT  *\/ namespace ns_stub {      int func_stub(int arg1, short arg2) {         return arg1*arg2;     };      int func_extern_stub() {         return 4242;     };      class class_stub {     public:         int field_1;         static int static_field_2;          static class_stub * create(int a1, int a2) {             return new class_stub(a1, a2);         }          class_stub() {             printf(\"Call constructor class_stub()\\n\");             field_1 = 0;         }          class_stub(int arg1, int arg2) {             printf(\"Call constructor class_stub(%d, %d)\\n\", arg1, arg2);             field_1 = arg1;             static_field_2 = arg2;         }          virtual ~class_stub() {             printf(\"Call virtual ~class_stub()\\n\");         }          int method_sum() {              return field_1 + static_field_2;         }          int method_field1(int arg) {              return field_1;         }          virtual double method_virt2() {              return 999999999;         }          virtual float method_virt() {              return 3.14 + field_1;         }          static float method_static() {             return 3.1415;         }     };      int class_stub::static_field_2 = 0;      class class_full {     public:          class_full() {         }          int method() {             return 42;         }     }; };  \/*  * \u0421\u0442\u0440\u043e\u043a\u0430 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0432 JIT  *\/ const char * func_text = \"\"         \"extern \\\"C\\\" int printf(const char *, ...);\\n\"         \"extern \\\"C\\\" int nv_add(int a, int b) {\"         \"   printf(\\\"call nv_add(%d, %d)\\\\n\\\", a, b);\"         \"   return a + b;\"         \"};\\n\"         \"\"         \"extern \\\"C\\\" int nv_sub(int a, int b) {\"         \"   printf(\\\"call nv_sub(%d, %d)\\\\n\\\", a, b);\"         \"   return a - b;\"         \"};\\n\"         \"extern \\\"C\\\" int run(){\"         \"   nv_add(100, 123);\"         \"   nv_sub(100, 123);\"         \"   return 42;\"         \"};\\n\"         \"\"         \"namespace ns_stub {\"         \"   class run_internal {\"         \"       public:\\n\"         \"       run_internal(){};\"         \"       int method(){\"         \"           return 43;\"         \"       };\"         \"   };\"         \"   class class_full {\"         \"       public:\\n\"         \"       class_full();\"         \"       int method();\"         \"   };\"         \"\"         \"   class class_stub {\"         \"       public:\\n\"         \"       static class_stub * create(int, int);\"         \"       class_stub();\"         \"       class_stub(int arg1, int arg2);\"         \"       int method_sum();\"         \"       int method_field1(int);\"         \"       virtual float method_virt();\"         \"   };\"         \"\"         \"};\"         \"extern \\\"C\\\" int run_internal(){\"         \"   ns_stub::run_internal cl_int;\"         \"   printf(\\\"run_internal.method %d\\\\n\\\", cl_int.method());\"         \"   return 44;\"         \"};\\n\"         \"\"         \"extern \\\"C\\\" int run_stub(){\"         \"   ns_stub::class_stub *cl = ns_stub::class_stub::create(123, 123);\"         \"   printf(\\\"class_stub.method_sum %d\\\\n\\\", cl->method_sum());\"         \"   delete cl;\"         \"   return 42;\"         \"};\\n\"         \"\"         \"extern \\\"C\\\" int run_extern();\"         \"extern \\\"C\\\" int run_extern_stub(){\"         \"   return run_extern();\"         \"};\\n\"         \"extern \\\"C\\\" int run_virt(){\"         \"   ns_stub::class_stub *cl = ns_stub::class_stub::create(124, 125);\"         \"   printf(\\\"class_stub.method_virt %f\\\\n\\\", cl->method_virt());\"         \"   delete cl;\"         \"   return 0;\"         \"};\\n\"         \"\";  #define DEBUG_MSG(msg) std::cout &lt;&lt; \"[DEBUG]: \"&lt;&lt;msg&lt;&lt; std::endl;  void InitializeLLVM() {      \/\/ We have not initialized any pass managers for any device yet.     \/\/ Run the global LLVM pass initialization functions.     llvm::InitializeNativeTarget();     llvm::InitializeNativeTargetAsmPrinter();     llvm::InitializeNativeTargetAsmParser();      auto&amp; Registry = *llvm::PassRegistry::getPassRegistry();      llvm::initializeCore(Registry);     llvm::initializeScalarOpts(Registry);     llvm::initializeVectorization(Registry);     llvm::initializeIPO(Registry);     llvm::initializeAnalysis(Registry);     llvm::initializeTransformUtils(Registry);     llvm::initializeInstCombine(Registry);     llvm::initializeTarget(Registry); }  std::unique_ptr&lt;llvm::Module> CompileCpp(std::string source) {     clang::CompilerInstance compilerInstance;     auto&amp; compilerInvocation = compilerInstance.getInvocation();      \/\/ \u0414\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b Clang     clang::IntrusiveRefCntPtr&lt;clang::DiagnosticOptions> DiagOpts = new clang::DiagnosticOptions;     clang::TextDiagnosticPrinter *textDiagPrinter =             new clang::TextDiagnosticPrinter(llvm::outs(), &amp;*DiagOpts);      clang::IntrusiveRefCntPtr&lt;clang::DiagnosticIDs> pDiagIDs;      clang::DiagnosticsEngine *pDiagnosticsEngine =             new clang::DiagnosticsEngine(pDiagIDs, &amp;*DiagOpts, textDiagPrinter);      \/\/ \u0426\u0435\u043b\u0435\u0432\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430     std::string triple = LLVMGetDefaultTargetTriple();      std::vector&lt;std::string> itemstrs;     itemstrs.push_back(triple.insert(0, \"-triple=\"));     itemstrs.push_back(\"-xc++\");     itemstrs.push_back(\"-std=c++20\");     \/\/    itemstrs.push_back(\"-fno-exceptions\");     \/\/    itemstrs.push_back(\"-funwind-tables\");      std::vector&lt;const char*> itemcstrs;     for (unsigned idx = 0; idx &lt; itemstrs.size(); idx++) {         \/\/ note: if itemstrs is modified after this, itemcstrs will be full         \/\/ of invalid pointers! Could make copies, but would have to clean up then...         itemcstrs.push_back(itemstrs[idx].c_str());         std::cout &lt;&lt; itemcstrs.back() &lt;&lt; \"\\n\";     }      \/\/ \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0438\u0437 \u043f\u0430\u043c\u044f\u0442\u0438     \/\/ Send code through a pipe to stdin     int codeInPipe[2];     pipe2(codeInPipe, O_NONBLOCK);     write(codeInPipe[1], source.c_str(), source.size());     close(codeInPipe[1]); \/\/ We need to close the pipe to send an EOF     dup2(codeInPipe[0], STDIN_FILENO);      itemcstrs.push_back(\"-\"); \/\/ Read code from stdin      clang::CompilerInvocation::CreateFromArgs(compilerInvocation,             llvm::ArrayRef&lt;const char *>(itemcstrs.data(),             itemcstrs.size()), *pDiagnosticsEngine);      auto&amp; languageOptions = compilerInvocation.getLangOpts();     auto&amp; preprocessorOptions = compilerInvocation.getPreprocessorOpts();     auto&amp; targetOptions = compilerInvocation.getTargetOpts();      auto&amp; frontEndOptions = compilerInvocation.getFrontendOpts();     \/\/    frontEndOptions.ShowStats = true;      auto&amp; headerSearchOptions = compilerInvocation.getHeaderSearchOpts();     \/\/    headerSearchOptions.Verbose = true;      auto&amp; codeGenOptions = compilerInvocation.getCodeGenOpts();      targetOptions.Triple = LLVMGetDefaultTargetTriple();     compilerInstance.createDiagnostics(textDiagPrinter, false);      DEBUG_MSG(\"Using target triple: \" &lt;&lt; triple);      LLVMContextRef ctx = LLVMContextCreate();     std::unique_ptr&lt;clang::CodeGenAction> action = std::make_unique&lt;clang::EmitLLVMOnlyAction>((llvm::LLVMContext *)ctx);      assert(compilerInstance.ExecuteAction(*action));      \/\/ Runtime LLVM Module     std::unique_ptr&lt;llvm::Module> module = action->takeModule();      assert(module);      \/\/ \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f IR     llvm::PassBuilder passBuilder;     llvm::LoopAnalysisManager loopAnalysisManager;     llvm::FunctionAnalysisManager functionAnalysisManager;     llvm::CGSCCAnalysisManager cGSCCAnalysisManager;     llvm::ModuleAnalysisManager moduleAnalysisManager;      passBuilder.registerModuleAnalyses(moduleAnalysisManager);     passBuilder.registerCGSCCAnalyses(cGSCCAnalysisManager);     passBuilder.registerFunctionAnalyses(functionAnalysisManager);     passBuilder.registerLoopAnalyses(loopAnalysisManager);     passBuilder.crossRegisterProxies(loopAnalysisManager, functionAnalysisManager, cGSCCAnalysisManager, moduleAnalysisManager);      llvm::ModulePassManager modulePassManager = passBuilder.buildPerModuleDefaultPipeline(llvm::OptimizationLevel::O3);     modulePassManager.run(*module, moduleAnalysisManager);      return module; }  ExitOnError ExitOnErr;  ThreadSafeModule createDemoModule() {     auto Context = std::make_unique&lt;LLVMContext>();     auto M = std::make_unique&lt;Module>(\"test\", *Context);      \/\/ Create the add1 function entry and insert this entry into module M.  The     \/\/ function will have a return type of \"int\" and take an argument of \"int\".     Function *Add1F = Function::Create(FunctionType::get(Type::getInt32Ty(*Context),{Type::getInt32Ty(*Context)}, false),     Function::ExternalLinkage, \"add1\", M.get());      \/\/ Add a basic block to the function. As before, it automatically inserts     \/\/ because of the last argument.     BasicBlock *BB = BasicBlock::Create(*Context, \"EntryBlock\", Add1F);      \/\/ Create a basic block builder with default parameters.  The builder will     \/\/ automatically append instructions to the basic block `BB'.     IRBuilder&lt;> builder(BB);      \/\/ Get pointers to the constant `1'.     Value *One = builder.getInt32(1);      \/\/ Get pointers to the integer argument of the add1 function...     assert(Add1F->arg_begin() != Add1F->arg_end()); \/\/ Make sure there's an arg     Argument *ArgX = &amp;*Add1F->arg_begin(); \/\/ Get the arg     ArgX->setName(\"AnArg\"); \/\/ Give it a nice symbolic name for fun.      \/\/ Create the add instruction, inserting it into the end of BB.     Value *Add = builder.CreateAdd(One, ArgX);      \/\/ Create the return instruction and add it to the basic block     builder.CreateRet(Add);      return ThreadSafeModule(std::move(M), std::move(Context)); }  int main(int argc, char *argv[]) {     \/\/ Initialize LLVM.     InitLLVM X(argc, argv);      InitializeNativeTarget();     InitializeNativeTargetAsmPrinter();      cl::ParseCommandLineOptions(argc, argv, \"HowToUseLLJIT\");     ExitOnErr.setBanner(std::string(argv[0]) + \": \");      \/\/ Create an LLJIT instance.     auto J = ExitOnErr(LLJITBuilder().create());     \/\/    auto M = createDemoModule();     auto M = ThreadSafeModule(std::move(CompileCpp(func_text)), std::make_unique&lt;LLVMContext>());      std::string dump;     llvm::raw_string_ostream err(dump);      ExecutionSession &amp;ES = J->getExecutionSession();      \/\/    JITDylib *plat = ES.getJITDylibByName(\"&lt;Platform>\");     \/\/    assert(plat);     \/\/    dump.clear();     \/\/    plat->dump(err);     \/\/    std::cout &lt;&lt; \"&lt;Platform>:\\n\" &lt;&lt; dump &lt;&lt; \"\\n\";     \/\/     \/\/    JITDylib *proc = ES.getJITDylibByName(\"&lt;Process Symbols>\");     \/\/    assert(proc);     \/\/    dump.clear();     \/\/    proc->dump(err);     \/\/    std::cout &lt;&lt; \"&lt;Process Symbols>:\\n\" &lt;&lt; dump &lt;&lt; \"\\n\";      ExitOnErr(J->addIRModule(std::move(M)));      \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0441 \u0438\u043c\u0435\u043d\u0435\u043c run_extern \u043e\u0442\u0441\u0443\u0441\u0442\u0432\u0443\u0435\u0442 (JIT session error: Symbols not found: [ run_extern ])     \/\/ \u041f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043d\u043e \u0441 \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043e\u043c (func_extern_stub)     const SymbolStringPtr Foo = ES.intern(\"run_extern\");     const ExecutorSymbolDef FooSym(ExecutorAddr::fromPtr(&amp;ns_stub::func_extern_stub), llvm::JITSymbolFlags::Exported | llvm::JITSymbolFlags::Absolute);     auto as = absoluteSymbols({         {Foo, FooSym}     });      if (auto Err = J->getMainJITDylib().define(as)) {         std::cout &lt;&lt; \"JD.define error: !\\n\";         return 0;     }      Expected&lt;ExecutorAddr> test = J->lookup(\"nv_add\");     if (!test) {         std::cout &lt;&lt; \"lookup error:\\n\" &lt;&lt; toString(test.takeError());         return 0;     }      DEBUG_MSG(\"Retrieving nv_add\/nv_sub functions...\");      auto addAddr = ExitOnErr(J->lookup(\"nv_add\"));     int (*add)(int, int) = addAddr.toPtr&lt;int(int, int) >();     assert(add);      int res = add(40, 2);     assert(42 == res);      auto subAddr = ExitOnErr(J->lookup(\"nv_sub\"));     int (*sub)(int, int) = subAddr.toPtr&lt;int(int, int) >();     assert(sub);      res = sub(50, 7);     assert(43 == res);      printf(\"Call: run_internal\\n\");     auto run_internalAddr = ExitOnErr(J->lookup(\"run_internal\"));     int (*run_internal)() = run_internalAddr.toPtr&lt;int() >();     assert(run_internal);      res = run_internal();     assert(44 == res);      \/\/ \u041b\u0438\u043d\u043a\u0435\u0440 \u0443\u0434\u0430\u044f\u0435\u0442 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043a\u043e\u0434,      \/\/ \u0438 \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u043c\u0435\u0442\u043e\u0434\u0443 \u0442\u043e \u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043b\u044c\u0437\u044f \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0432 JIT     \/\/ JIT session error: Symbols not found: [ _ZN7ns_stub10class_stub6createEii, _ZN7ns_stub10class_stub10method_sumEv ]     ns_stub::class_stub *cl = ns_stub::class_stub::create(0, 0);     printf(\"Check run_stub.method %d\\n\", cl->method_sum());     printf(\"Check run_stub.method_virt %f\\n\", cl->method_virt());     delete cl;      printf(\"Call: run_stub\\n\");     auto run_stubAddr = ExitOnErr(J->lookup(\"run_stub\"));     int (*run_stub)() = run_stubAddr.toPtr&lt;int() >();     assert(run_stub);      res = run_stub();     assert(42 == res);      printf(\"Call: run_extern_stub\\n\");     auto run_extern_stubAddr = ExitOnErr(J->lookup(\"run_extern_stub\"));     int (*run_extern_stub)() = run_extern_stubAddr.toPtr&lt;int() >();     assert(run_extern_stub);      res = run_extern_stub();     assert(4242 == res);      \/*      *       * \u0422\u0430\u043a \u043d\u0435\u043b\u044c\u0437\u044f !!!!!       * \u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u0437\u043d\u0443\u0442\u0440\u0438 JIT \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u0440\u0438 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435!      *       * ERROR !!!!      * Virtual methods from within JIT are called incorrectly when the header file is incorrect!      *            *\/      printf(\"Call: run_virt\\n\");     auto run_virtAddr = ExitOnErr(J->lookup(\"run_virt\"));     int (*run_virt)() = run_virtAddr.toPtr&lt;int() >();     assert(run_virt);      res = run_virt();     assert(0 == res);      return 0; }<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h3 id=\"osobennosti-raboty-jit-i-ogranicheniya\">\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b JIT \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u0412 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u0435 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0432\u0430\u0436\u043d\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0432\u0435\u0434\u044c \u044d\u0442\u043e \u0432\u0441\u0435 \u0442\u0430\u043a\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u0430 \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 JIT \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 C\/C++. <\/p>\n<p>  <\/p>\n<ul>\n<li>\u0415\u0441\u043b\u0438 \u0432 \u043a\u043e\u0434\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438, \u043d\u043e \u043a \u043d\u0438\u043c \u043d\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0432 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435, \u0442\u043e \u0432\u0441\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0430\u0436\u0435 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.<\/li>\n<li>\u0422\u0430\u043a \u043a\u0430\u043a \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0449\u0438\u043a \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0438\u0437 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435 \u0431\u044b\u043b\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f, \u0442\u043e JIT \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0438\u0445 \u043d\u0430\u0439\u0442\u0438, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u044b\u0434\u0430\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 (\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u044b). \u041f\u0440\u0438\u0447\u0435\u043c \u044d\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043d\u043e \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u043e\u0432.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u0421++:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041c\u043d\u0435 \u0442\u0430\u043a \u0438 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c JIT \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0435\u043c\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0431\u0435\u0437 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u044b\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u2014 \u0444\u0430\u0431\u0440\u0438\u043a\u0443 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/li>\n<li>\u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 (\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f), \u0447\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0432 JIT, \u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432), \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u0441\u044f \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0432\u044b\u0437\u043e\u0432\u0430 \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 JIT (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u043e \u0442\u043e\u0436\u0435 \u0431\u044b\u0432\u0430\u0435\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c).<\/li>\n<li>\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u0432 JIT \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u0442\u043e \u043a \u043f\u043e\u043b\u044f\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043b\u0443\u0447\u0448\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u043a\u0440\u0435\u0448\u0438\u0442\u044c\u0441\u044f \u043b\u0435\u0433\u0447\u0435 \u043b\u0435\u0433\u043a\u043e\u0433\u043e (\u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u043f\u043e\u043b\u044f\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044e \u0438 \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u044b \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f, \u0442\u043e <strong>\u043e\u0439<\/strong> \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e). \u041a\u0441\u0442\u0430\u0442\u0438, \u0438\u0437 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f JIT \u0434\u043b\u044f <del>\u0445\u0430\u043a\u0435\u0440\u043e\u0432<\/del> \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \ud83d\ude42<\/li>\n<\/ul>\n<p>  <\/p>\n<h4 id=\"ps\">P.S.<\/h4>\n<p>  <\/p>\n<p>\u0427\u0443\u0442\u044c \u043d\u0435 \u0437\u0430\u0431\u044b\u043b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u044b\u0439 \u043d\u044e\u0430\u043d\u0441. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043b\u0435 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 JIT \u043c\u043e\u0433 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043e\u0442\u0441\u0443\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438:<br \/>  <code>-fvisibility=default -Wl,--export-dynamic -rdynamic<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0430\u044e\u0442 \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a\u0443 \u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0438\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 <code>visibility=hidden<\/code> (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e) \u043d\u0430 <code>default<\/code>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/803787\/\"> https:\/\/habr.com\/ru\/articles\/803787\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/bf\/p-\/nh\/bfp-nhjb78dua4_ix26ews1nqmi.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/bf\/p-\/nh\/bfp-nhjb78dua4_ix26ews1nqmi.jpeg\" data-blurred=\"true\"\/><\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u0434\u0430\u0432\u043d\u043e \u044f \u043f\u0438\u0441\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u044e-\u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0425\u0430\u0431\u0440\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0438 \u0434\u043b\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0440\u0435\u0432\u044c\u044e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/539674\/\">\u0425\u0430\u0431\u0440 \u2014 \u0443\u043c\u0430 \u043f\u0430\u043b\u0430\u0442\u0430<\/a>, \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043d\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u043e\u0441\u043d\u043e\u0432\u0435.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c, \u043f\u043e\u0445\u043e\u0436\u0435, \u044f \u043d\u0430\u0448\u0435\u043b \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0425\u0430\u0431\u0440\u043e\u0445\u0430\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0425\u0430\u0431\u0440\u0430 \u043a\u0430\u043a \u0437\u0430\u043f\u0438\u0441\u043d\u043e\u0439 \u043a\u043d\u0438\u0436\u043a\u0438, \u043d\u043e \u043d\u0435 \u043a\u0430\u043a \u0432 \u0442\u043e\u043c \u0430\u043d\u0435\u043a\u0434\u043e\u0442\u0435 <code>\u044f \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u043b\u043e\u043a\u043d\u043e\u0442 \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0442\u043e\u043a, \u0430 \u0432\u0441\u0435\u043c \u0432\u0438\u0434\u043d\u043e \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u044f \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043b<\/code>, \u0430 \u0432 \u0441\u0430\u043c\u043e\u043c \u0445\u043e\u0440\u043e\u0448\u0435\u043c \u0441\u043c\u044b\u0441\u043b\u0435 \u2014 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0434\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0438\u0442\u043e\u0433\u043e\u0432 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0445 \u0432\u044b\u0432\u043e\u0434\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a, \u043d\u0430 \u0434\u043d\u044f\u0445 \u0438\u0441\u043a\u0430\u043b \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u043f\u0440\u043e JIT \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e C++ \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e clang\/llvm \u0438 \u043f\u043e\u0438\u0441\u043a \u043c\u043d\u0435 \u0432\u044b\u0434\u0430\u043b \u043c\u043e\u044e \u0436\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u0442\u0440\u0435\u0445\u0433\u043e\u0434\u0438\u0447\u043d\u043e\u0439 \u0434\u0430\u0432\u043d\u043e\u0441\u0442\u0438: <a href=\"https:\/\/habr.com\/ru\/companies\/timeweb\/articles\/572878\/\">\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f JIT \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0421\/\u0421++ \u0432 LLVM \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Clang \/ \u0425\u0430\u0431\u0440<\/a>. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0443\u0436\u0435 \u044d\u0442\u0430 \u043d\u043e\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e JIT \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e C\/\u0421++.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-372137","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/372137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=372137"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/372137\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=372137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=372137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=372137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}