{"id":246426,"date":"2022-07-09T09:00:31","date_gmt":"2022-07-09T01:00:31","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=246426"},"modified":"2022-06-30T15:02:19","modified_gmt":"2022-06-30T07:02:19","slug":"openjdk-java-linux","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/openjdk-java-linux.html","title":{"rendered":"OpenJDK \u63d0\u8bae\u5c06\u8981\u63d0\u4f9b Java \u7c7b\u6587\u4ef6 API"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nJava \u793e\u533a\u6b63\u5728\u915d\u917f\u4e00\u9879 Classfile API \u63d0\u6848\uff0c\u65e8\u5728\u63d0\u4f9b\u4e00\u4e2a\u7528\u4e8e\u89e3\u6790\u3001\u751f\u6210\u548c\u8f6c\u6362 Java \u7c7b\u6587\u4ef6\u7684 API\uff1b\u6700\u521d\u5c06\u4f5c\u4e3a JDK \u4e2d ASM \u7684\u5185\u90e8\u66ff\u4ee3\u54c1\uff0c\u4e4b\u540e\u518d\u4f5c\u4e3a\u516c\u5171 API \u5f00\u653e\u3002\u6839\u636e\u8ba1\u5212\uff0cASM \u6700\u7ec8\u5c06\u88ab\u5b8c\u5168\u4ece JDK \u4e2d\u5220\u9664\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u63d0\u6848\u5185\u5bb9\u6307\u51fa\uff0c\u7c7b\u6587\u4ef6\u751f\u6210\u3001\u89e3\u6790\u548c\u68c0\u6d4b\u5728 Java \u751f\u6001\u7cfb\u7edf\u4e2d\u65e0\u5904\u4e0d\u5728\uff1b\u8bb8\u591a\u5de5\u5177\u548c\u5e93\u9700\u8981\u80fd\u591f\u5904\u7406\u7c7b\u6587\u4ef6\uff0c\u5e76\u4e14\u6846\u67b6\u901a\u5e38\u4f1a\u6267\u884c on-the-fly bytecode instrumentation\u3001transformation \u548c generation\u3002JDK \u5e94\u8be5\u4e3a\u8bfb\u53d6\u3001\u5199\u5165\u548c\u8f6c\u6362 Java \u7c7b\u6587\u4ef6\u63d0\u4f9b\u51c6\u786e\u3001\u5b8c\u6574\u3001\u6700\u65b0\u3001\u9ad8\u6027\u80fd\u7684 API\u3002<\/p>\n

\u8be5 API \u6700\u521d\u7684\u76ee\u6807\u662f\u5728\u4e0d\u9020\u6210\u4e0d\u53ef\u63a5\u53d7\u7684\u6027\u80fd\u635f\u5931\u7684\u60c5\u51b5\u4e0b\uff0c\u53d6\u4ee3 ASM \u4f5c\u4e3a JDK \u7684\u4e00\u4e2a\u8fd0\u884c\u65f6\u4f9d\u8d56\u9879\u3002\u4e14\u4f5c\u4e3a\u4e00\u4e2a\u6269\u5c55\u76ee\u6807\uff0c\u6700\u597d\u8fd8\u80fd\u8fdb\u4e00\u6b65\u53d6\u4ee3\u7f16\u8bd1\u5668\u548c JDK \u5de5\u5177\u6240\u4f7f\u7528\u7684\u5185\u90e8 \"classreader\" \u5e93\u3002\u6700\u7ec8\uff0c\u671f\u671b\u80fd\u591f\u6709\u5927\u91cf\u7684\u5e94\u7528\u7a0b\u5e8f\u548c\u6846\u67b6\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e2a\u5e93\u6765\u6709\u6548\u5730\u66ff\u4ee3 ASM\u3001cglib \u6216\u5176\u4ed6\u5b57\u8282\u7801\u5e93\u3002\u8bbe\u8ba1\u76ee\u6807\u548c\u539f\u5219\u5305\u62ec\u8ba9\u6240\u6709 Class file entities\uff08\u4f8b\u5982\u65b9\u6cd5\u548c\u5b57\u6bb5\uff09\u7531 immutable objects \u8868\u793a\u4ee5\u53ca\u7528\u6237\u9a71\u52a8\u7684 navigation \u7b49\u3002<\/p>\n

\"\"<\/p>\n

\u5176\u840c\u53d1\u7684\u52a8\u673a\u5728\u4e8e\uff1a<\/strong><\/span><\/div>\n
  • JDK \u6574\u5408\u3002JDK \u672c\u8eab\u5728\u5904\u7406\u7c7b\u6587\u4ef6\u65b9\u9762\u5f88\u91cd\u8981\u3002JDK \u4f7f\u7528 ASM \u5b58\u5728\u56fa\u6709\u7684\u5ef6\u8fdf\uff0cJDK \u5f00\u53d1\u4eba\u5458\u9700\u8981\u4e00\u4e2a\u4e0e JVMS \u4fdd\u6301\u540c\u6b65\u7684\u5b57\u8282\u7801\u5e93\u3002<\/li>\n
  • \u6846\u67b6\u548c\u8fd0\u884c JDK \u4e4b\u95f4\u7684\u7248\u672c\u504f\u5dee\u3002\u5904\u7406\u7c7b\u6587\u4ef6\u7684\u5e94\u7528\u7a0b\u5e8f\u548c\u6846\u67b6\u901a\u5e38\u6346\u7ed1\u4e00\u4e2a\u7c7b\u6587\u4ef6\u5e93\uff0c\u4f8b\u5982 ASM\u3001cglib \u7b49\u3002\u4f46\u662f\u7531\u4e8e\u65b0\u7684\u7c7b\u6587\u4ef6\u529f\u80fd\u53ef\u4ee5\u51fa\u73b0\u5728\u4efb\u4f55 JDK \u7248\u672c\u4e2d\uff0c\u4e14\u5728 Java 9 \u4e4b\u540e JDK \u7684\u53d1\u5e03\u901f\u5ea6\u5927\u5927\u52a0\u5feb\uff0c\u5e94\u7528\u7a0b\u5e8f\u548c\u6846\u67b6\u66f4\u9891\u7e41\u5730\u9047\u5230\u6bd4\u5b83\u4eec\u6346\u7ed1\u7684\u5e93\u66f4\u65b0\u7684\u7c7b\u6587\u4ef6\uff0c\u4ece\u800c\u5bfc\u81f4\u8fd0\u884c\u65f6\u9519\u8bef\uff08\u6216\u8005\u66f4\u7cdf\u7cd5\u7684\u662f\uff0c\u6846\u67b6\u8bd5\u56fe \u201c\u4ece\u672a\u6765\u201d \u89e3\u6790\u7c7b\u6587\u4ef6\u683c\u5f0f\uff09\u3002\u5f00\u53d1\u4eba\u5458\u9700\u8981\u4e00\u4e2a\u4e0e\u8fd0\u884c JDK \u4fdd\u6301\u540c\u6b65\u7684\u7c7b\u6587\u4ef6\u5e93\u3002<\/li>\n
  • JVM \u8fdb\u5316\u3002\u4e0e Java \u65e9\u671f\u76f8\u6bd4\uff0cJVM \u548c\u7c7b\u6587\u4ef6\u683c\u5f0f\u73b0\u5728\u7684\u53d1\u5c55\u901f\u5ea6\u8981\u5feb\u5f97\u591a\u3002\u867d\u7136\u6709\u4e9b\u6f14\u53d8\u5f88\u7b80\u5355\uff0c\u4f46\u6709\u4e9b\u6f14\u53d8\u66f4\u590d\u6742\uff0c\u4f8b\u5982 Project Valhalla \u5e26\u6765\u4e86\u65b0\u7684\u5b57\u8282\u7801\u3001\u5b57\u6bb5\u63cf\u8ff0\u7b26\u548c\u9a8c\u8bc1\u89c4\u5219\u3002\u5728\u67d0\u4e9b\u65f6\u5019\uff0c\u6539\u8fdb\u73b0\u6709\u5e93\u4ee5\u652f\u6301\u8fd9\u4e9b\u65b0\u529f\u80fd\u53ef\u80fd\u4f1a\u4ee3\u4ef7\u5f88\u5927\u6216\u5f88\u590d\u6742\u3002<\/li>\n
  • \u8bed\u8a00\u6539\u8fdb\u3002\u81ea\u4ece\u7f16\u5199 ASM \u4ee5\u6765\uff0c\u8be5\u8bed\u8a00\u5df2\u7ecf\u6709\u4e86\u5f88\u5927\u7684\u6539\u8fdb\uff0c\u8fd9\u610f\u5473\u7740\u5728 2002 \u5e74\u53ef\u80fd\u662f\u6700\u597d\u7684 API \u4e60\u60ef\u7528\u6cd5\u5728 20 \u5e74\u540e\u5374\u53ef\u80fd\u5e76\u4e0d\u7406\u60f3\u3002<\/li>\n","protected":false},"excerpt":{"rendered":"

    \u63d0\u6848\u5185\u5bb9\u6307\u51fa\uff0c\u7c7b\u6587\u4ef6\u751f\u6210\u3001\u89e3\u6790\u548c\u68c0\u6d4b\u5728 Java \u751f\u6001\u7cfb\u7edf\u4e2d\u65e0\u5904\u4e0d\u5728\uff1b\u8bb8\u591a\u5de5\u5177\u548c\u5e93\u9700\u8981\u80fd\u591f\u5904\u7406\u7c7b\u6587\u4ef6\uff0c\u5e76\u4e14\u6846\u67b6 […]<\/p>\n","protected":false},"author":1479,"featured_media":92147,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-246426","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/246426","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1479"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=246426"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/246426\/revisions"}],"predecessor-version":[{"id":246739,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/246426\/revisions\/246739"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/92147"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=246426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=246426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=246426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}