{"id":461343,"date":"2025-05-28T21:00:31","date_gmt":"2025-05-28T21:00:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=461343"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=461343","title":{"rendered":"<span>\u041e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u0438: \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u043e\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0431\u0435\u0434\u044b<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<blockquote>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0432\u0430\u0441, \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432\u0430\u043c \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 <a href=\"https:\/\/habr.com\/ru\/articles\/913726\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e<\/a> \u043c\u043e\u0435\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u0442\u0435\u0439.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u044f \u043f\u0438\u0448\u0443 \u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0435, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430, \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430\u0445 \u0438 Dart.<\/p>\n<p>\u0412\u0441\u0435 \u0447\u0430\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/913726\/\" rel=\"noopener noreferrer nofollow\">\u0427\u0430\u0441\u0442\u044c 1: \u041e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u0438: \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/913728\/\" rel=\"noopener noreferrer nofollow\">\u0427\u0430\u0441\u0442\u044c 2: \u041e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u0438: \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u043e\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0431\u0435\u0434\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/913730\/\" rel=\"noopener noreferrer nofollow\">\u0427\u0430\u0441\u0442\u044c 3: \u041e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u0438: \u0444\u0438\u043d\u0430\u043b<\/a><\/p>\n<\/li>\n<\/ul>\n<\/blockquote>\n<h2>\u041e\u0431 \u0430\u0432\u0442\u043e\u0440\u0435<\/h2>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043d\u0442\u043e\u043d, \u0438 \u044f \u2014 \u0447\u0430\u0439\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442-\u0434\u0430\u043e\u0441.<br \/> \u042f 10 \u043b\u0435\u0442 \u043f\u0438\u0448\u0443 \u043a\u043e\u0434 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445, \u0443\u0432\u043b\u0435\u043a\u0430\u044e\u0441\u044c \u0434\u0430\u043e\u0441\u0438\u0437\u043c\u043e\u043c, \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u043c \u0447\u0430\u0435\u043c \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b\u0445 (\u043a\u0440\u043e\u043c\u0435 \u043c\u0435\u043d\u044f) \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u043e\u0432.<br \/> \u0427\u0443\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431\u043e \u043c\u043d\u0435 <a href=\"https:\/\/habr.com\/ru\/articles\/913726\/\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<h2>\u0428\u0430\u0433 1. \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c Dart VM.<\/h2>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439. Dart SDK \u0432\u0435\u0441\u0438\u0442 \u043c\u043d\u043e\u0433\u043e.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0436\u0435 \u043c\u0435\u0441\u0442\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 3D-\u0438\u0433\u0440\u044b \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0430\u0441\u0441\u0435\u0442\u0430\u043c\u0438.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0438 \u0441\u0431\u043e\u0440\u043a\u0435.<\/p>\n<p>\u041a\u0430\u043a \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u044f \u0440\u0435\u0448\u0438\u043b: &#171;\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f? \u0414\u0430 \u043d\u0443, \u044f \u0436\u0435 \u0437\u043d\u0430\u044e \u0432\u0441\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0431\u043e\u0440\u043a\u0438!&#187;<\/p>\n<p>\u0421\u043f\u043e\u0439\u043b\u0435\u0440: \u043d\u0435 \u0437\u043d\u0430\u043b.<\/p>\n<pre><code class=\"bash\">10:45:20 anton@anton-lin arch-x86_64 ~\/development\/laboratory\/dart main (\ud83e\udd8a) make make: *** No targets specified and no makefile found.  Stop. 10:45:21 anton@anton-lin arch-x86_64 ~\/development\/laboratory\/dart main (\ud83e\udd8a) cmake . CMake Warning: Ignoring extra path from command line: \".\" CMake Error: The source directory \"\/home\/anton\/development\/laboratory\/dart\" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. 10:45:24 anton@anton-lin arch-x86_64 ~\/development\/laboratory\/dart main (\ud83e\udd8a) ninja ninja: error: loading 'build.ninja': No such file or directory 10:45:31 anton@anton-lin arch-x86_64 ~\/development\/laboratory\/dart main (\ud83e\udd8a) .\/configure bash: .\/configure: No such file or directory 10:45:36 anton@anton-lin arch-x86_64 ~\/development\/laboratory\/dart main (\ud83e\udd8a) .\/gradlew bash: .\/gradlew: No such file or directory 10:46:06 anton@anton-lin arch-x86_64 ~\/development\/laboratory\/dart main (\ud83e\udd8a) .\/build.sh bash: .\/build.sh: No such file or directory 10:46:10 anton@anton-lin arch-x86_64 ~\/development\/laboratory\/dart main (\ud83e\udd8a)  <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0444\u043e\u0440\u043c\u0430\u043d\u0441\u0430 \u044f \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u043b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e.<\/p>\n<p>\u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u044f\u0437\u044b\u043a, \u043d\u0443\u0436\u0435\u043d \u0434\u0440\u0443\u0433\u043e\u0439:<\/p>\n<blockquote>\n<p>Dart SDK requires Python 3 to build.<\/p>\n<\/blockquote>\n<p>\u0417\u0430\u0431\u0430\u0432\u043d\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 JVM, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0443\u0436\u0435\u043d C++ \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u043d\u043e \u0432\u043e\u0442 Dart \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0435\u0449\u0451 \u0438 Python.<\/p>\n<p>\u0425\u043e\u0442\u044f, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0438 JVM \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 Python \u2014 \u0434\u0430\u0432\u043d\u043e \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b.<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0441\u0451. \u041f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435.<\/p>\n<blockquote>\n<p>Install Chromium&#8217;s <a href=\"https:\/\/commondatastorage.googleapis.com\/chrome-infra-docs\/flat\/depot_tools\/docs\/html\/depot_tools_tutorial.html#_setting_up\" rel=\"noopener noreferrer nofollow\">depot tools<\/a>:<\/p>\n<\/blockquote>\n<p>\u0418 \u0432\u043e\u0442 \u043e\u043d\u0430, \u0440\u0430\u0437\u0433\u0430\u0434\u043a\u0430 \u2014 \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u044b Python \u0438 Chromium depot tools. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, Dart \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Google-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0431\u043e\u0440\u043a\u0438 GN (\u0434\u0430-\u0434\u0430, \u0442\u0443 \u0441\u0430\u043c\u0443\u044e, \u0447\u0442\u043e \u0438 \u0432 Chromium).<\/p>\n<blockquote>\n<p>Dart SDK uses <code>gclient<\/code> to manage dependencies which are described in the <code>DEPS<\/code> file. If you switch branches or update <code>sdk<\/code> checkout you need to run <code>gclient sync<\/code> to bring dependencies in sync with the SDK version.<\/p>\n<\/blockquote>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u043a\u044d\u043f. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u044f\u0441\u043d\u043e.<\/p>\n<blockquote>\n<p><strong>IMPORTANT: You must follow instructions for <\/strong><a href=\"#source\" rel=\"noopener noreferrer nofollow\"><strong>Getting the source<\/strong><\/a><strong> before attempting to build. Just cloning a GitHub repo or downloading and unpacking a ZIP of the SDK repository would not work.<\/strong><\/p>\n<\/blockquote>\n<p>\u0422\u0430\u043a, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u043b\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c? \u0422\u0430\u043a \u0432\u043e\u0442, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c ! \u0410 \u044f \u0432\u0441\u0435 <code>make<\/code> \u0434\u0430 <code>ninja<\/code>&#8230;<\/p>\n<blockquote>\n<p>.\/tools\/build.py &#8212;mode release &#8212;arch x64 create_sdk<\/p>\n<\/blockquote>\n<blockquote>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0440\u0435\u043c\u0430\u0440\u043a\u0430, \u0432\u043e\u0442 \u0441\u0442\u0430\u0442\u044b \u043c\u043e\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u043b \u0438 \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0438\u0440\u0430\u043b Dart \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437:<\/p>\n<p>OS: Arch Linux x86_64<br \/> Host: ASUSTeK COMPUTER INC. ROG STRIX B650E-I GAMING WIFI<br \/> Kernel: 6.14.0-3-cachyos<br \/> Uptime: 1 hour, 2 mins<br \/> Packages: 1279 (pacman)<br \/> Shell: bash 5.2.37<br \/> Resolution: 3840&#215;2160, 3840&#215;2160, 3840&#215;2160<br \/> WM: Hyprland<br \/> Theme: Colloid-Dark [GTK2\/3]<br \/> Icons: Colloid-Dark [GTK2\/3]<br \/> Terminal: kitty<br \/> Terminal Font: CaskaydiaCove Nerd Font Mono 15.0<br \/> CPU: AMD Ryzen 9 7950X3D (32) @ 5.763GHz<br \/> GPU: AMD ATI Raphael<br \/> GPU: NVIDIA GeForce RTX 4090<br \/> Memory: 15602MiB \/ 63425MiB<br \/> \u041d\u0435 \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b.<\/p>\n<\/blockquote>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u043f\u043e\u043b\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0443 \u0432 Release \u0440\u0435\u0436\u0438\u043c\u0435: <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/f97\/145\/1c6\/f971451c630652a355e54ffd836f4243.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/f97\/145\/1c6\/f971451c630652a355e54ffd836f4243.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/f97\/145\/1c6\/f971451c630652a355e54ffd836f4243.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0410 \u0432\u043e\u0442 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0445\u043e\u0434\u0438\u043b\u043e \u043d\u0430 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0443 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 C++ header \u0444\u0430\u0439\u043b\u0435 \u0432 debug \u0440\u0435\u0436\u0438\u043c\u0435: <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/026\/08d\/d9d\/02608dd9d8ea98281a5b70e5c411176e.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/026\/08d\/d9d\/02608dd9d8ea98281a5b70e5c411176e.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/026\/08d\/d9d\/02608dd9d8ea98281a5b70e5c411176e.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u043e\u0447\u0442\u0438 10 \u043c\u0438\u043d\u0443\u0442 \u0436\u0434\u0438, \u0435\u0441\u043b\u0438 \u0442\u044b \u0432 debug \u0440\u0435\u0436\u0438\u043c\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0448\u044c \u0447\u0442\u043e-\u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u0445 \u0432 Dart VM C++ \u043a\u043e\u0434\u0435.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u043b\u044c\u0448\u0435 \u043f\u043e \u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0447\u0442\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438 Dart \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u044f (\u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e). \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, debug Dart \u0434\u043e\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0430\u043c \u0441\u0435\u0431\u044f \u0447\u0435\u043c release Dart.<\/p>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0430 Dart. \u041f\u0440\u043e\u0441\u0442\u0438 \u043c\u0435\u043d\u044f, \u043c\u043e\u0439 \u0432\u0435\u0440\u043d\u044b\u0439 Ryzen: <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/791\/969\/ae9\/791969ae95101ed1c763846cc0805e17.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/791\/969\/ae9\/791969ae95101ed1c763846cc0805e17.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/791\/969\/ae9\/791969ae95101ed1c763846cc0805e17.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h2>\u0428\u0430\u0433 2. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 Dart VM<\/h2>\n<p>\u0425\u043e\u0447\u0443 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c: \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u0438 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b\u043c, \u043d\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0448\u0430\u0433 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0432\u044b\u044f\u0441\u043d\u044f\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043f\u0440\u043e\u0431 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0432 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u0435 \u0437\u0434\u043e\u0440\u043e\u0432\u043e \u043f\u043e\u043c\u043e\u0433\u043b\u0438 &#8212; \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u043b \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0448\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>dart:fibers<\/code> \u0432\u043e \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u043a\u043e\u0434\u0430.<\/p>\n<h3>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0432 Dart SDK<\/h3>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 <code>sdk\/lib<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 <code>fiber<\/code><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0444\u0430\u0439\u043b \u0441\u0431\u043e\u0440\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c <code>fiber_sources.gni<\/code><\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">fiber_sdk_sources = [   \"fiber.dart\", ] <\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438: <\/p>\n<ul>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c <code>fiber.dart<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e:<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<pre><code class=\"dart\">library dart.fiber; \/\/ \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f  class Fiber { } <\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 core:<\/p>\n<ul>\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c <code>sdk\/lib\/core\/core.dart<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u043a\u0441\u043f\u043e\u0440\u0442: <code>export \"dart:fiber\" show Fiber;<\/code><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u044b:<\/p>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 <code>runtime\/tests\/vm\/dart<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 <code>fiber<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c <code>fiber_test.dart<\/code> \u0441 \u0442\u0435\u0441\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Fiber<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u043c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0431\u043e\u0440\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c <code>runtime\/vm\/BUILD.gn<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u044b:<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">import(\"..\/..\/sdk\/lib\/fiber\/fiber_sources.gni\") import(\"..\/lib\/fiber_sources.gni\") <\/code><\/pre>\n<ul>\n<li>\n<p>\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u0430\u0439\u043b\u044b \u0432 \u0441\u0431\u043e\u0440\u043a\u0443: <code>+ fiber_runtime_cc_files<\/code> \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <code>allsources = ...<\/code><\/p>\n<\/li>\n<\/ul>\n<ol start=\"7\">\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e SDK:<\/p>\n<ul>\n<li>\n<p>\u0412 <code>sdk\/BUILD.gn<\/code> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c <code>\"fiber\"<\/code> \u0432 <code>_fiber_runtime_cc_files<\/code><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c <code>sdk\/lib\/_internal\/sdk_library_metadata\/lib\/libraries.dart<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u0435\u043a\u0446\u0438\u044e <code>const Map&lt;String, LibraryInfo&gt; libraries<\/code> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<pre><code class=\"dart\">'fiber': const LibraryInfo(   'fiber\/fiber.dart',   categories: 'Client,Server,Embedded',   maturity: Maturity.STABLE,   dart2jsPatchPath: '_internal\/js_runtime\/lib\/fiber_patch.dart', ), <\/code><\/pre>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 dart2jsPatchPath \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/p>\n<\/blockquote>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0448\u0430\u0433\u043e\u0432 Dart \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u043e\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0443 VSCode Dart \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442, \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u0447\u0435\u0437\u0430\u044e\u0442 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0432\u0435\u043d\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u044d\u0442\u0430 \u0441\u0445\u0435\u043c\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u0434\u043e\u0447\u0451\u0442\u044b \u2014 \u043d\u0435 \u0441\u0443\u0434\u0438\u0442\u0435 \u0441\u0442\u0440\u043e\u0433\u043e.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 Dart SDK \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0430\u0443\u0437\u0443 \u0438 \u0437\u0430\u0434\u0443\u043c\u0430\u0435\u043c\u0441\u044f \u043d\u0430\u0434 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c: \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 Dart SDK \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u0440\u0443\u0442\u0438\u043d?<\/p>\n<p>\u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0434\u0445\u043e\u0434 <a href=\"https:\/\/habr.com\/ru\/articles\/850970\/\" rel=\"noopener noreferrer nofollow\">stackless<\/a> \u043a\u043e\u0440\u0443\u0442\u0438\u043d, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439.<\/p>\n<p>\u041d\u043e \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0443\u0442\u044c \u2014 stackfull \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0441 \u0436\u0451\u0441\u0442\u043a\u0438\u043c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Dart ASM. \u041f\u043e\u0447\u0435\u043c\u0443? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e stackless-\u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0432 Dart \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u2014 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0435 Future \u0441 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u043c async-await.<\/p>\n<p>\u0420\u0430\u0437 \u0443\u0436 \u044f \u043f\u043e\u0448\u0451\u043b \u044d\u0442\u0438\u043c \u043f\u0443\u0442\u0451\u043c, \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0440\u0435\u0448\u0438\u0442\u044c \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443: \u043d\u0430\u0443\u0447\u0438\u0442\u044c Dart \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u0435\u043a\u0430\u043c\u0438 \u043a\u043e\u0440\u0443\u0442\u0438\u043d. \u0410 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 Dart VM.<\/p>\n<h3>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0432 Dart VM<\/h3>\n<ol>\n<li>\n<p><strong>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/strong><br \/> \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c <code>runtime\/vm\/symbols.h<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 <code>V(DartFiber, \"dart:fiber\")<\/code>. \u042d\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442.<\/p>\n<\/li>\n<li>\n<p><strong>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 ObjectStore<\/strong><br \/> \u0412 <code>runtime\/vm\/object_store.h<\/code> \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c:<\/p>\n<ul>\n<li>\n<p><code>M(Fiber, fiber)<\/code> \u2014 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0442\u0438\u043f\u0430 Fiber<\/p>\n<\/li>\n<li>\n<p><code>RW(Library, fiber_library)<\/code> \u2014 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/p>\n<\/li>\n<\/ul>\n<p>ObjectStore \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u0440\u043e\u043b\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0435\u0441\u0442\u0440\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043a \u0433\u0440\u0443\u043f\u043f\u0435 <a href=\"https:\/\/habr.com\/ru\/articles\/848166\/\" rel=\"noopener noreferrer nofollow\">\u0438\u0437\u043e\u043b\u044f\u0442<\/a>.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a<\/strong><br \/> \u0412 <code>runtime\/vm\/object.h<\/code> (\u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0435\u0433\u043e \u0432\u043d\u0443\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 13595 \u0441\u0442\u0440\u043e\u043a) \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">static LibraryPtr FiberLibrary(); <\/code><\/pre>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/strong><br \/> \u0412 <code>runtime\/vm\/object.cc<\/code> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<pre><code class=\"cpp\">lib = Library::LookupLibrary(thread, Symbols::DartFiber()); if (lib.IsNull()) {     lib = Library::NewLibraryHelper(Symbols::DartFiber(), true);     lib.SetLoadRequested();     lib.Register(thread); } object_store-&gt;set_bootstrap_library(ObjectStore::kFiber, lib); ASSERT(!lib.IsNull()); ASSERT(lib.ptr() == Library::FiberLibrary()); <\/code><\/pre>\n<\/li>\n<li>\n<p><strong>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Native-\u0432\u044b\u0437\u043e\u0432\u043e\u0432<\/strong><br \/> \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440\u044b \u0434\u043b\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<pre><code class=\"cpp\">library = Library::FiberLibrary(); ASSERT(!library.IsNull()); library.set_native_entry_resolver(resolver); library.set_native_entry_symbol_resolver(symbol_resolver); <\/code><\/pre>\n<\/li>\n<\/ol>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u0442\u043e\u0439 \u0436\u0435 \u043b\u043e\u0433\u0438\u043a\u0435 \u2014 \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p><strong>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0448\u0442\u0440\u0438\u0445: \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u0438<\/strong><br \/> \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043a\u043e\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u0447\u0430\u0441\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <code>@patch<\/code>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u043c patch-\u0444\u0430\u0439\u043b\u044b \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 Dart:<\/p>\n<ul>\n<li>\n<p>VM: <code>sdk\/lib\/_internal\/vm\/lib\/fiber_patch.dart<\/code><\/p>\n<\/li>\n<li>\n<p>WASM: <code>sdk\/lib\/_internal\/wasm\/lib\/fiber_patch.dart<\/code><\/p>\n<\/li>\n<li>\n<p>js_runtime: <code>sdk\/lib\/_internal\/js_runtime\/lib\/fiber_patch.dart<\/code><\/p>\n<\/li>\n<li>\n<p>js_dev_runtime: <code>sdk\/lib\/_internal\/js_dev_runtime\/lib\/fiber_patch.dart<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e Fiber API.<\/p>\n<h2>\u0428\u0430\u0433 3. \u041c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u043c API<\/h2>\n<p>\u041c\u044b \u043f\u043e\u0434\u043e\u0448\u043b\u0438 \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443 \u044d\u0442\u0430\u043f\u0443 \u2014 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e Fiber API. \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 Dart SDK \u0438 VM \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u044b, \u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0442\u044c \u0432\u043e\u043b\u044e \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u043e\u0439 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0438.<\/p>\n<pre><code class=\"dart\">class Fiber { \/\/ \u041f\u043e \u0444\u0430\u043a\u0442\u0443 \u0431\u0443\u0434\u0435\u0442 extension type, \u043d\u043e \u044d\u0442\u043e \u0434\u0435\u0442\u0430\u043b\u0438   \/\/ \u041a\u0430\u043a\u0438\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 Fiber API?    \/\/ \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 - \u0437\u0430\u043f\u0443\u0441\u043a \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e (\u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e) Fiber   static Fiber launch(void Function() entry, { int size = _kDefaultStackSize, Object? argument}) \/\/ size \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0442\u0435\u043a \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b    \/\/ \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u043a\u043e\u0440\u0443\u0442\u0438\u043d   static Fiber spawn(void Function() entry, {      bool persistent = false, \/\/ \u0444\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f     int size = _kDefaultStackSize,      String? name,      Object? argument   })    \/\/ \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c   static void suspend() \/\/ \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 Fiber, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c caller'\u0443   static void schedule(Fiber fiber) \/\/ \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e Fiber   static void reschedule() \/\/ \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 Fiber \u0441 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430    \/\/ \u041c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0438\u043d\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0446\u0438\u0438   int get index \/\/ \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440   int get size \/\/ \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0435\u043a\u0430   String get name \/\/ \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440   FiberState get state \/\/ \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 (Created, Running \u0438 \u0442.\u0434.)   FiberAttributes get attributes \/\/ \u0444\u043b\u0430\u0433\u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f   FiberArgument get argument \/\/ \u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 } <\/code><\/pre>\n<blockquote>\n<p>\u0411\u043e\u043d\u0443\u0441\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u0440\u043e\u0434\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438:<\/p>\n<p><code>static void sleep(Duration time) \/\/ \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 Fiber \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f <\/code> <\/p>\n<p>\u0420\u0430\u0431\u043e\u0447\u0438\u0439, \u043d\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u044b\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b. \u0415\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u2014 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043f\u0440\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e.<\/p>\n<\/blockquote>\n<p>\u0422\u0430\u043a\u043e\u0433\u043e API \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0439 \u0432\u0440\u043e\u0434\u0435 <a href=\"https:\/\/www.tarantool.io\/en\/doc\/latest\/reference\/reference_lua\/fiber\/#fiber-channel\" rel=\"noopener noreferrer nofollow\">\u043a\u0430\u043d\u0430\u043b\u043e\u0432<\/a> \u0438 <a href=\"https:\/\/www.tarantool.io\/en\/doc\/latest\/reference\/reference_lua\/fiber\/#fiber-cond\" rel=\"noopener noreferrer nofollow\">\u0443\u0441\u043b\u043e\u0432\u0438\u0439<\/a>.<\/p>\n<h2>\u0428\u0430\u0433 4. \u041f\u0438\u0448\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e<\/h2>\n<p>\u0421\u0430\u043c\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c: \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u0440\u0443\u0442\u0438\u043d<\/p>\n<blockquote>\n<p><em>\u0414\u0435\u043b\u0430\u0435\u043c \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0439 \u0432\u0434\u043e\u0445, \u0441\u0435\u0439\u0447\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0442\u044f\u0436\u043a\u043e \u0438 \u0434\u0443\u0448\u043d\u043e<\/em><\/p>\n<\/blockquote>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0434, \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c: \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430 \u2014 \u044d\u0442\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u0432 C++, \u0442\u0430\u043a \u0438 \u0432 Dart-\u043a\u043e\u0434\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0432 \u043e\u0431\u0435\u0438\u0445 \u0447\u0430\u0441\u0442\u044f\u0445.<\/p>\n<p>\u041a\u043b\u0430\u0441\u0441 <code>_Coroutine<\/code> \u0432 <code>runtimne\/vm\/object.h<\/code> \u0438 \u0432<code>sdk\/lib\/_internal\/vm\/lib\/fiber_patch.dart<\/code>:<\/p>\n<pre><code class=\"dart\">@patch @pragma(\"vm:entry-point\") class _Coroutine {   \/\/ \u0424\u0430\u0431\u0440\u0438\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b   @pragma(\"vm:external-name\", \"Coroutine_factory\")   external factory _Coroutine._(int size, Function trampoline);    \/\/ \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u0438 \u043c\u0435\u0442\u043e\u0434\u044b:   @pragma(\"vm:recognized\", \"other\")   external void Function() get _entry;   @pragma(\"vm:recognized\", \"other\")   external set _entry(void Function() value);    @pragma(\"vm:recognized\", \"other\")   external void Function() get _trampoline;   @pragma(\"vm:recognized\", \"other\")   external set _trampoline(void Function() value);    @pragma(\"vm:recognized\", \"other\")   external Object? get _argument;   @pragma(\"vm:recognized\", \"other\")   external set _argument(Object? value);    \/\/ \u0421\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430\u043c\u0438   @pragma(\"vm:recognized\", \"other\")   external _Coroutine get _caller;   @pragma(\"vm:recognized\", \"other\")   external set _caller(_Coroutine value);    \/\/ \u041a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f   @pragma(\"vm:recognized\", \"other\")   external static void _initialize(_Coroutine root);    @pragma(\"vm:recognized\", \"other\")   external static void _transfer(_Coroutine from, _Coroutine to);    @pragma(\"vm:recognized\", \"other\")   external static void _fork(_Coroutine from, _Coroutine to);    \/\/ \u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u0430\u044f \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430   @pragma(\"vm:recognized\", \"other\")   external static _Coroutine? get _current; } <\/code><\/pre>\n<p><em>\u0427\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u043d\u043e:<\/em><\/p>\n<ul>\n<li>\n<p><code>@pragma<\/code> \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 VM<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435 \u043f\u043e\u043b\u044f \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u043a\u0430\u043a <code>external<\/code> \u2014 \u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439<\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0430\u0441\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c<\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0430\u0441\u0441 <code>Coroutine<\/code> \u0432 <code>runtimne\/vm\/object.h<\/code> (\u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u0441\u043a\u0440\u044b\u0442\u044b):<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cpp\">class Coroutine : public Instance {  public:   static CoroutinePtr New(uintptr_t size, FunctionPtr trampoline);    void HandleJumpToFrame(Thread* thread, uword stack_pointer);   void HandleRootEnter(Thread* thread, Zone* zone);   void HandleRootExit(Thread* thread, Zone* zone);   void HandleForkedEnter(Thread* thread, Zone* zone);   void HandleForkedExit(Thread* thread, Zone* zone);    void recycle(Zone* zone);   void dispose(Thread* thread, Zone* zone, bool remove_from_registry = true);    ClosurePtr entry();   static uword entry_offset();    intptr_t attributes();   static uword attributes_offset();   void set_attributes(intptr_t value);   void or_attribute(intptr_t value);   void and_attribute(intptr_t value);   void change_state(intptr_t from_value, intptr_t to_value);    ObjectPtr argument();   static uword argument_offset();    CoroutinePtr caller();   static uword caller_offset();    uword native_stack_base();   static uword native_stack_base_offset();    uword stack_root();   static uword stack_root_offset();    uword stack_base();   static uword stack_base_offset();    uword stack_limit();   static uword stack_limit_offset();    uword overflow_stack_limit();   static uword overflow_stack_limit_offset(); }; <\/code><\/pre>\n<p>\u0417\u0430\u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c &#8212; \u0437\u0430\u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438, \u0442\u0435\u043f\u0435\u0440\u044c \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/c44\/a71\/f57\/c44a71f57e612a5c42b70838a3d5c063.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/c44\/a71\/f57\/c44a71f57e612a5c42b70838a3d5c063.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/c44\/a71\/f57\/c44a71f57e612a5c42b70838a3d5c063.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0412\u0441\u0435\u0433\u043e 59 \u0444\u0430\u0439\u043b\u043e\u0432. \u0412 \u043a\u0430\u0436\u0434\u043e\u043c \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 Dart VM.<\/p>\n<p>\u041d\u0430 1808 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u0443 Dart VM \u0435\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 C++ \u043a\u043e\u0434\u0430 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u043e\u043d \u0442\u0430\u043c \u0432\u0441\u044f\u043a\u043e\u0435 \u0442\u0432\u043e\u0440\u0438\u0442.<\/p>\n<p>\u041f\u043e\u0441\u0442\u0443\u043f\u0438\u043c \u0442\u0430\u043a: \u044f \u0432\u044b\u0434\u0435\u043b\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u0432 \u043a\u043e\u0434\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u043d\u0438\u0445.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0431\u044b \u0445\u043e\u0442\u0435\u043b \u043a\u0440\u0430\u0442\u043a\u043e \u043f\u043e\u044f\u0441\u043d\u0438\u0442\u044c \u043f\u0440\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 &#171;\u043e\u0441\u043e\u0431\u044b\u0445&#187; \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 Dart. \u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435:<\/p>\n<ul>\n<li>\n<p><code>vm:external-name<\/code> &#8212; \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0432 C++ \u043a\u043e\u0434\u0435 \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0437 Dart \u043a\u043e\u0434\u0430. \u0414\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>extern<\/code> \u0438 <code>vm:external-name<\/code>.<\/p>\n<\/li>\n<li>\n<p><code>RuntimeEntry<\/code> &#8212; \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0432 C++ \u043a\u043e\u0434\u0435 \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u0437\u0430\u0433\u043b\u0443\u0448\u0435\u043a. \u0414\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>DEFINE_RUNTIME_ENTRY<\/code>, <code>DEFINE_LEAF_RUNTIME_ENTRY<\/code> \u0438 <code>DEFINE_RAW_LEAF_RUNTIME_ENTRY<\/code>.<\/p>\n<\/li>\n<li>\n<p><code>vm:recognized<\/code> &#8212; \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c Dart \u043a\u043e\u0434\u0435, \u043d\u043e \u0438\u0445 \u0442\u0435\u043b\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 C++ \u043a\u043e\u0434\u0435. \u041d\u0438\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cpp\">case MethodRecognizer::kCoroutineInitialize: {   body += LoadLocal(parsed_function_-&gt;RawParameterVariable(0));   body += CoroutineInitialize();   body += NullConstant();   break; } <\/code><\/pre>\n<ul>\n<li>\n<p><code>vm:entry-point<\/code> &#8212; \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0432 Dart \u043a\u043e\u0434\u0435, \u043f\u0440\u043e \u043d\u0438\u0445 \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e <a href=\"https:\/\/mrale.ph\/dartvm\/compiler\/aot\/entry_point_pragma.html\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a><\/p>\n<\/li>\n<li>\n<p><code>@Native<\/code> &#8212; \u043f\u043e \u0438\u0434\u0435\u0435 \u044d\u0442\u043e \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u043c\u0435\u043d\u0430 <code>vm:external-name<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f <a href=\"https:\/\/dart.dev\/interop\/c-interop\" rel=\"noopener noreferrer nofollow\">FFI<\/a> \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430, \u043d\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>vm:external-name<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e, \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u043b\u0433\u043e \u043d\u0430 \u043d\u0438\u0445 \u0437\u0430\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<h3>\u0421\u0443\u0449\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>\u0416\u0438\u0432\u0443\u0442 \u043e\u043d\u0438 \u0432 <code>coroutine<\/code>, <code>bootstrap_natives<\/code>, <code>object<\/code> \u0438 <code>raw_object<\/code>.<\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430: \u0441\u043e\u0437\u0434\u0430\u0442\u044c C++ \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0447\u0435\u0440\u0435\u0437 Dart \u043a\u043e\u0434. \u0423 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>external factory _Coroutine._(int size, Function trampoline);<\/code>, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0435\u0451 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c<\/p>\n<pre><code class=\"cpp\">DEFINE_NATIVE_ENTRY(Coroutine_factory, 0, 3) {   GET_NON_NULL_NATIVE_ARGUMENT(Smi, size, arguments-&gt;NativeArgAt(1));   GET_NON_NULL_NATIVE_ARGUMENT(Closure, trampoline, arguments-&gt;NativeArgAt(2));   return Coroutine::New(size.Value(), trampoline.function()); \/\/ \u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u0432 object.h. \u0412 \u043d\u0435\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e\u0434 \u0441\u0442\u0435\u043a \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u0435\u0439 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b. } <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e <code>object<\/code> \u0438 <code>raw_object<\/code>. \u0412\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b Dart, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437 \u043a\u043e\u0434\u0430 C++ \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u044d\u0442\u0438\u0445 \u0444\u0430\u0439\u043b\u0430\u0445. \u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u0445 \u0434\u0432\u0430 ?<\/p>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 Dart \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e Dart \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u0435\u0445\u043d\u0438\u043a\u0443 <a href=\"https:\/\/github.com\/dart-lang\/sdk\/blob\/main\/runtime\/docs\/gc.md\" rel=\"noopener noreferrer nofollow\">Tagged \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439<\/a>:<\/p>\n<ul>\n<li>\n<p><code>Tagged<\/code> &#8212; \u0442\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442. \u0427\u0442\u043e\u0431\u044b &#171;\u0434\u043e\u0441\u0442\u0430\u0442\u044c&#187; \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c <code>untag()<\/code><\/p>\n<\/li>\n<li>\n<p><code>Untagged<\/code> &#8212; &#171;\u0441\u044b\u0440\u043e\u0435&#187; \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 <code>object<\/code> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f <code>Tagged<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0432 <code>raw_object<\/code> &#8212; <code>Untagged<\/code>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u0440\u0443\u0442\u0438\u043d.<\/p>\n<hr\/>\n<h3>\u0424\u0443\u043d\u043a\u0446\u0438\u0438<\/h3>\n<h4>HandleJumpToFrame<\/h4>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 Dart VM \u0437\u0430\u0445\u043e\u0447\u0435\u0442 &#171;\u043f\u0440\u044b\u0433\u043d\u0443\u0442\u044c&#187; \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u0430\u0434\u0440 \u0441\u0442\u0435\u043a\u0430.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u0432\u0430\u0441 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u043b \u0432\u044b\u0431\u0440\u043e\u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0438 Dart \u0434\u043e\u043b\u0436\u0435\u043d \u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, &#171;\u043f\u0440\u044b\u0433\u043d\u0443\u0442\u044c&#187; \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 <code>catch<\/code> \u0438\u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 &#171;\u0443\u043b\u0435\u0442\u0435\u0442\u044c&#187; \u0438\u0437 Dart \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0422\u0430\u043a\u0438\u0435 &#171;\u043f\u0440\u044b\u0436\u043a\u0438&#187; \u043c\u043e\u0433\u0443\u0442 \u0441\u043f\u0440\u043e\u0432\u043e\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043c\u0435\u043d\u0443 \u043a\u043e\u0440\u0443\u0442\u0438\u043d, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0441\u0432\u043e\u0439 \u0441\u0442\u0435\u043a. \u0418 \u044d\u0442\u0438 \u0441\u043c\u0435\u043d\u044b \u0441\u0442\u0435\u043a\u043e\u0432 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0421\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435:<\/p>\n<ul>\n<li>\n<p>\u043c\u044b \u043d\u0435 \u043d\u0430\u0448\u043b\u0438 \u0441\u0442\u0435\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f &#171;\u043f\u0440\u044b\u0436\u043e\u043a&#187; &#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c <code>HandleRootExit<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0432\u044b\u043f\u0440\u044b\u0433\u043d\u0443\u043b\u0438 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0442\u0435\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u0430\u0448\u0443 \u043f\u0435\u0440\u0432\u0443\u044e \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443<\/p>\n<\/li>\n<li>\n<p>\u043c\u044b &#171;\u043f\u0440\u044b\u0433\u0430\u0435\u043c&#187; \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0441\u0442\u0435\u043a\u0430 &#8212; \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u043c<\/p>\n<\/li>\n<li>\n<p>\u043c\u044b &#171;\u043f\u0440\u044b\u0433\u043d\u0443\u043b\u0438&#187; \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443 &#8212; \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443 \u043c\u044b \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0435\u043c (\u043b\u0438\u0431\u043e \u0438\u0434\u0435\u043c \u0432 <code>recycle<\/code>, \u043b\u0438\u0431\u043e \u0432 <code>dispose<\/code>), \u0430 \u043d\u043e\u0432\u0443\u044e \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443 &#171;\u043f\u0440\u043e\u0431\u0443\u0436\u0434\u0430\u0435\u043c&#187; \u0438 \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043d\u0435\u0451.<\/p>\n<\/li>\n<\/ul>\n<h4>HandleRootEnter \u0438 HandleForkedEnter<\/h4>\n<p>\u0414\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439) \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u043f\u043e\u0442\u043e\u043a\u0430 (Thread) \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443.<\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432 Dart VM \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u043b\u0438\u043d\u044b \u0441\u0442\u0435\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u043b\u0435 <code>stack_limit_<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043f\u043e\u0442\u043e\u043a\u0430, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u044d\u0442\u043e \u043f\u043e\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0440\u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 \u0441\u0442\u0435\u043a\u0430 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0432 \u0440\u043e\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e.<\/p>\n<h4>HandleRootExit \u0438 HandleForkedExit<\/h4>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0438 \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u0432\u0435\u0440\u043d\u0443\u0442\u0441\u044f \u043a \u043e\u0431\u044b\u0447\u043d\u043e\u043c\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e \u043f\u043e\u0442\u043e\u043a\u0430 \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 &#171;\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439&#187; \u0441\u0442\u0435\u043a.<\/p>\n<p>\u0412\u0442\u043e\u0440\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f &#8212; \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0434\u043e\u0447\u0435\u0440\u043d\u044f\u044f \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c.<\/p>\n<p>\u0423 \u043d\u0430\u0441 \u043c\u043e\u0433\u0443\u0442 \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u043e\u0440\u0443\u0442\u0438\u043d, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043a\u043e\u0440\u043d\u0435\u0432\u0430\u044f \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u0442\u044c.<\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u0435, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0435 \u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \u0441\u0442\u0435\u043a\u0430, \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u043f\u043e\u0442\u043e\u043a\u0430.<\/p>\n<h4>recycle \u0438 dispose<\/h4>\n<p>\u041e\u0431\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430 \u0443\u0436\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u0430.<\/p>\n<p>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <code>recycle<\/code> \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u0442 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 <code>disposed<\/code>, \u043d\u043e \u043d\u0435 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u0442 \u0435\u0451 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u043f\u0430\u043c\u044f\u0442\u044c, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u0434 \u0441\u0442\u0435\u043a. \u0412\u0442\u043e\u0440\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0435\u0442 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443 \u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0441 \u043d\u0435\u0439 \u0441\u0442\u0435\u043a.<\/p>\n<hr\/>\n<h3>\u041f\u043e\u043b\u044f \u0438 \u043c\u0435\u0442\u0430<\/h3>\n<p>\u0424\u0430\u0439\u043b\u044b: <code>raw_object_fields<\/code>, <code>slot<\/code>, <code>runtime_offsets_list<\/code>, <code>runtime_offsets_extracted<\/code>, <code>runtime_api<\/code>.<\/p>\n<p>\u042d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u043e\u0431\u0449\u0438\u0439 \u0444\u0430\u043a\u0442: \u043e\u043d\u0438 &#8212; \u0442\u0430 \u0435\u0449\u0451 \u0437\u0430\u043d\u043e\u0437\u0430 \ud83d\ude42<\/p>\n<p>\u0420\u0430\u0441\u0448\u0438\u0444\u0440\u0443\u044e: \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u043b\u044f \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b, \u044f \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u044d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b.<\/p>\n<h4>raw_object_fields<\/h4>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u0440\u0443\u0442\u0438\u043d.<\/p>\n<p>\u041f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044e, \u0447\u0442\u043e \u044f \u043d\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043b\u0443\u0447\u0448\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 Dart Team:<\/p>\n<pre><code>\/\/ This file (and \"raw_object_fields.cc\") provide a kind of reflection that \/\/ allows us to identify the name of fields in hand-written \"Raw...\" classes \/\/ (from \"raw_object.h\") given the class and the offset within the object. This \/\/ is used for example by the snapshot profile writer (\"v8_snapshot_writer.h\") \/\/ to show the property names of these built-in objects in the snapshot profile. <\/code><\/pre>\n<h4>slot<\/h4>\n<p>\u0412 \u0441\u043b\u043e\u0442\u0430\u0445 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0438\u0445 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0438: <code>TAGGED<\/code>, <code>UNTAGGED<\/code>, <code>NULLABLE<\/code>, <code>NONULLABLE<\/code> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435.<\/p>\n<p>\u0421\u043b\u043e\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0432 IL \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0435: \u043e\u043d \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0438\u0437 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f Dart VM <a href=\"https:\/\/chromium.googlesource.com\/external\/github.com\/dart-lang\/kernel\/+\/8e2b2c03c2a22d9fdf581a8e3ce798f189531081\/README.md\" rel=\"noopener noreferrer nofollow\">Kernel<\/a> \u0432 ASM \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n<h4>runtime_offsets_list \u0438 runtime_offsets_extracted<\/h4>\n<p>\u0410 \u0432\u043e\u0442 \u044d\u0442\u0443 \u043f\u0430\u0440\u043e\u0447\u043a\u0443 \u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u043e\u0431\u043e\u0436\u0430\u044e.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u043f\u043e\u043b\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438, \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d <code>offset<\/code> \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u044f. \u0412\u043e\u043e\u0431\u0449\u0435, \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 <code>slot<\/code> \u0438 <code>runtime_offset<\/code> \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u044e\u0442 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430.<\/p>\n<p>\u042f \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b \u0442\u0430\u043a: <code>slot<\/code> \u0434\u043b\u044f IL, <code>runtime_offset<\/code> \u0434\u043b\u044f ASM. \u041f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438 \u044f \u0432\u0441\u0435 \u043d\u0430\u0432\u0440\u0430\u043b.<\/p>\n<p>\u0410 \u0438 \u0435\u0449\u0451, \u0435\u0441\u043b\u0438 \u044f \u043d\u0435 \u043e\u0448\u0438\u0431\u0441\u044f, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u043e\u043b\u044f \u0432 <code>runtime_offsets_list<\/code>, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 <a href=\"https:\/\/github.com\/dart-lang\/sdk\/wiki\/Snapshots\/6d632de97aa5711f37f7b43bd06882148ddf4720\" rel=\"noopener noreferrer nofollow\">Dart Snapshot<\/a>.<\/p>\n<p>\u041a\u0430\u043a \u0441 \u044d\u0442\u0438\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c ? \u0412 <code>runtime_offsets_list<\/code> \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 <code>FIELD(Coroutine, name_offset)<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f <code>.\/tools\/run_offsets_extractor.dart<\/code> \u0440\u0443\u043a\u0430\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u0441\u0435\u0439 \u0443\u0436\u0430\u0441 \u043d\u0430 13\u041a \u0441\u0442\u0440\u043e\u0447\u0435\u043a:<\/p>\n<pre><code class=\"cpp\">... static constexpr dart::compiler::target::word AOT_InstructionsSection_HeaderSize = 0x40; static constexpr dart::compiler::target::word AOT_InstructionsTable_InstanceSize = 0x30; static constexpr dart::compiler::target::word AOT_Int32x4_InstanceSize = 0x18; static constexpr dart::compiler::target::word AOT_Integer_InstanceSize = 0x8; static constexpr dart::compiler::target::word AOT_KernelProgramInfo_InstanceSize = 0x60; static constexpr dart::compiler::target::word AOT_LanguageError_InstanceSize = 0x30; static constexpr dart::compiler::target::word AOT_Library_InstanceSize = 0x88; static constexpr dart::compiler::target::word AOT_LibraryPrefix_InstanceSize = 0x28; static constexpr dart::compiler::target::word AOT_LinkedHashBase_InstanceSize = 0x38; static constexpr dart::compiler::target::word AOT_LocalHandle_InstanceSize = 0x8; static constexpr dart::compiler::target::word AOT_MegamorphicCache_InstanceSize = 0x30; ... <\/code><\/pre>\n<h4>runtime_api<\/h4>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043c\u044b \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u0435\u043c \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c offset-\u044b &#8212; \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0435\u0439.<\/p>\n<pre><code class=\"cpp\">class Coroutine : public AllStatic {  public:   ...   static word name_offset();   static word index_offset();   static word entry_offset();   static word trampoline_offset();   ...   static word InstanceSize();   FINAL_CLASS(); }; <\/code><\/pre>\n<p>\u0418 \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432:<\/p>\n<pre><code>\/\/ This header defines the API that compiler can use to interact with the \/\/ underlying Dart runtime that it is embedded into. \/\/ \/\/ Compiler is not allowed to directly interact with any objects - it can only \/\/ use classes like dart::Object, dart::Code, dart::Function and similar as \/\/ opaque handles. All interactions should be done through helper methods \/\/ provided by this header. \/\/ \/\/ This header also provides ways to get word sizes, frame layout, field \/\/ offsets for the target runtime. Note that these can be different from \/\/ those on the host. Helpers providing access to these values live \/\/ in compiler::target namespace. <\/code><\/pre>\n<hr\/>\n<h3>\u0411\u0440\u0430\u0442\u044c\u044f \u0438\u0437\u043e\u043b\u044f\u0442\u044b \u0438 \u043f\u043e\u0442\u043e\u043a\u0438<\/h3>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u043c\u0443\u0441\u043e\u0440\u0430. \u0412 \u0438\u0437\u043e\u043b\u044f\u0442:<\/p>\n<pre><code class=\"cpp\">void Isolate::VisitStackPointers(ObjectPointerVisitor* visitor, ValidationPolicy validate_frames) {   if (mutator_thread_ != nullptr) {     if (mutator_thread_-&gt;has_coroutine()) { \/\/ \u0412\u043e\u0442 \u044d\u0442\u043e\u0442 \u043a\u0443\u0441\u043e\u043a       mutator_thread_-&gt;VisitObjectPointersCoroutine(this, visitor, validate_frames);       return;     }     mutator_thread_-&gt;VisitObjectPointers(visitor, validate_frames);   } } <\/code><\/pre>\n<p>\u0410 \u0432 \u043f\u043e\u0442\u043e\u043a \u0432 \u044d\u0442\u0443 \u0436\u0435\u0441\u0442\u044c&#8230;<\/p>\n<pre><code class=\"cpp\">... visitor-&gt;set_gc_root_type(\"frame\"); while (frame != nullptr) {   frame-&gt;VisitObjectPointers(visitor);   frame = thread_frames_iterator.NextFrame();   if (frame != nullptr &amp;&amp; StubCode::InCoroutineForkStub(frame-&gt;GetCallerPc())) {     frame-&gt;VisitObjectPointers(visitor);     break;   }   if (frame != nullptr &amp;&amp; StubCode::InCoroutineInitializeStub(frame-&gt;GetCallerPc())) {     const uword stub_fp = *reinterpret_cast&lt;uword*&gt;(coroutine_-&gt;untag()-&gt;native_stack_base());     StackFrameIterator native_coroutine_frames_iterator(stub_fp, validation_policy, this, cross_thread_policy, StackFrameIterator::kStackOwnerCoroutine);     StackFrame* frame = native_coroutine_frames_iterator.NextFrame();     while (frame != nullptr) {       frame-&gt;VisitObjectPointers(visitor);       frame = native_coroutine_frames_iterator.NextFrame();     }     break;   } } auto coroutines = isolate-&gt;coroutines_registry().untag()-&gt;data(); auto coroutines_count = Smi::Value(isolate-&gt;coroutines_registry().untag()-&gt;length()); for (auto index = 0; index &lt; coroutines_count; index++) {   auto item = Coroutine::RawCast(coroutines.untag()-&gt;element(index));   if ((item-&gt;untag()-&gt;attributes() &amp; (Coroutine::CoroutineAttributes::suspended)) != 0) {     UntaggedCoroutine::VisitStack(item, visitor);   } } visitor-&gt;clear_gc_root_type(); ... <\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 \u043d\u043e\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>VisitObjectPointersCoroutine<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u0442\u0435\u043a\u0430 \u0432\u0441\u0435\u0445 \u043a\u043e\u0440\u0443\u0442\u0438\u043d \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043c\u0443\u0441\u043e\u0440\u0430.<\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 <code>RestoreWriteBarrierInvariantCoroutine<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 <a href=\"https:\/\/github.com\/dart-lang\/sdk\/blob\/main\/runtime\/docs\/gc.md#write-barrier-elimination\" rel=\"noopener noreferrer nofollow\">\u0431\u0430\u0440\u044c\u0435\u0440\u043e\u0432 \u0437\u0430\u043f\u0438\u0441\u0438<\/a>.<\/p>\n<p>\u041b\u043e\u0433\u0438\u043a\u0430 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u0441\u0435\u0442\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u0430\u0434\u0440 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0441\u0442\u0435\u043a\u0430 (\u0441\u0442\u0435\u043a\u0430 \u043f\u043e\u0442\u043e\u043a\u0430), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043a\u0443\u0449\u0438\u043c (\u043d\u0430 \u043d\u0435\u0433\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 <code>RSP<\/code>)<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0434\u043e\u0445\u043e\u0434\u0438\u043c \u0434\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0439 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b (<code>CoroutineFork<\/code>), \u0442\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0434\u043e\u0445\u043e\u0434\u0438\u043c \u0434\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b (<code>CoroutineInitialize<\/code>), \u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e (\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e) \u0441\u0442\u0435\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 (<code>UntaggedCoroutine::VisitStack<\/code>) \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 &#171;suspended&#187; \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b<\/p>\n<\/li>\n<li>\n<p>\u041f\u0441\u0438\u0445\u0443\u0435\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442&#8230; \u0442\u043e\u0447\u043d\u0435\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/p>\n<\/li>\n<\/ol>\n<hr\/>\n<h3>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0441\u043e\u0431\u0435\u0440\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e<\/h3>\n<p>\u0415\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b &#8212; <code>recognized_method_list<\/code>.<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u0441\u043c\u0435\u0448\u043d\u043e\u0439 \u0444\u0430\u0439\u043b \u0432 \u043c\u043e\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u0432\u044b\u0448\u0435 \u044f \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u043f\u0440\u043e <code>vm:recognized<\/code> ? \u0422\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0443\u0436\u043d\u043e \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b, \u043d\u043e \u0432\u0441\u0435 \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<\/p>\n<ol>\n<li>\n<p>\u0414\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u0435\u0448\u044c Dart \u043c\u0435\u0442\u043e\u0434 \u0441 <code>vm:recognized<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u0435\u0448\u044c \u0432 <code>recognized_method_list<\/code> \u0441\u0442\u0440\u043e\u0447\u043a\u0443: <code>V(_Coroutine, _initialize, CoroutineInitialize, 0)<\/code><\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0448\u044c \u0441\u0431\u043e\u0440\u043a\u0443<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0448\u044c \u043e\u0448\u0438\u0431\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435<\/p>\n<\/li>\n<\/ol>\n<pre><code>... s\/0x00000000\/0x12345678\/ ... <\/code><\/pre>\n<ol start=\"5\">\n<li>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u0448\u044c \u043a\u0443\u0441\u043e\u043a \u0441 <code>s\/<\/code> \u0432 \u0444\u0430\u0439\u043b \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0448\u044c <code>sed<\/code> \u043d\u0430 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0438 <code>runtime\/vm\/compiler\/recognized_methods_list.h<\/code><\/p>\n<\/li>\n<\/ol>\n<p>\u042f \u044d\u0442\u043e \u043d\u0435 \u044f \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b, \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0441\u044e\u0434\u0430:<\/p>\n<pre><code class=\"cpp\">\/\/ object.cc: CheckSourceFingerprint if (SourceFingerprint() != fp) {   \/\/ This output can be copied into a file, then used with sed   \/\/ to replace the old values.   \/\/ sed -i.bak -f \/tmp\/newkeys \\   \/\/    runtime\/vm\/compiler\/recognized_methods_list.h   THR_Print(\"s\/0x%08x\/0x%08x\/\\n\", fp, SourceFingerprint());   return false; } <\/code><\/pre>\n<p>\u041e\u0431\u043e\u0436\u0430\u044e \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u043f\u0440\u0438 \u0435\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438, \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u0442\u044c 1000+ \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<hr\/>\n<h3>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440<\/h3>\n<p>\u0412 Dart \u0432\u0435\u0440\u0445\u043d\u0435\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0435\u043d \u0432 <code>il<\/code> \u0438 <code>kernel_to_il<\/code>.<\/p>\n<p>\u0412 \u043c\u043e\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0440\u0443\u0442\u0438\u043d \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0440\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p><code>CoroutineInitialize<\/code> &#8212; \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0442\u0435\u043a\u0430 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0438 \u0432\u044b\u0437\u043e\u0432 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0439 (entry) \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p><code>CoroutineFork<\/code> &#8212; \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0442\u0435\u043a\u0430 \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0439 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b, \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0434\u043e\u0447\u0435\u0440\u043d\u044e\u044e \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432\u044b\u0445\u043e\u0434\u0430 \u0438\u0437 \u043d\u0435\u0435<\/p>\n<\/li>\n<li>\n<p><code>CoroutineTransfer<\/code> &#8212; \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u043c\u0435\u043d\u0443 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 (\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0435\u043a\u0430) \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430\u043c\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Dart \u0437\u0430\u0433\u043b\u0443\u0448\u0435\u043a, \u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 Dart IL. \u042f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 <code>CoroutineInitialize<\/code> \u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0432 Dart.<\/p>\n<p>\u0412 <code>il.h<\/code> \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"cpp\">class CoroutineInitializeInstr : public TemplateDefinition&lt;1, Throws&gt; {  public:   CoroutineInitializeInstr(Value* root, intptr_t deopt_id) : TemplateDefinition(InstructionSource(TokenPosition::kNoSource), deopt_id) {     SetInputAt(0, root);   }   Value* root() const { return inputs_[0]; }   virtual bool CanCallDart() const { return true; }   virtual bool ComputeCanDeoptimize() const { return false; }   virtual bool ComputeCanDeoptimizeAfterCall() const { return !CompilerState::Current().is_aot(); }   virtual bool HasUnknownSideEffects() const { return true; }   virtual intptr_t NumberOfInputsConsumedBeforeCall() const { return InputCount(); }   virtual bool MayCreateUnsafeUntaggedPointer() const { return true; }   DECLARE_INSTRUCTION(CoroutineInitialize);   PRINT_OPERANDS_TO_SUPPORT   DECLARE_EMPTY_SERIALIZATION(CoroutineInitializeInstr, TemplateDefinition)  private:   DISALLOW_COPY_AND_ASSIGN(CoroutineInitializeInstr); }; <\/code><\/pre>\n<p>\u0412 <code>il.cc<\/code> \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0430\u0440\u043e\u0447\u043a\u0443 \u043d\u0443\u0436\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<pre><code class=\"cpp\">LocationSummary* CoroutineInitializeInstr::MakeLocationSummary(Zone* zone, bool opt) const {   const intptr_t kNumInputs = 1;   const intptr_t kNumTemps = 0;   LocationSummary* locs = new (zone)LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);   locs-&gt;set_in(0, Location::RegisterLocation(CoroutineInitializeABI::kCoroutineReg));   return locs; }  void CoroutineInitializeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {   compiler-&gt;GenerateStubCall(source(), StubCode::CoroutineInitialize(),  UntaggedPcDescriptors::kOther, locs(), deopt_id(), env()); } <\/code><\/pre>\n<p>\u0418\u0434\u0435\u044f \u044d\u0442\u0438\u0445 \u043f\u0440\u0430\u0432\u043e\u043a \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438 <code>StubCode::CoroutineInitialize<\/code>, \u043e\u0431\u0435\u0440\u043d\u0443\u0432 \u0435\u0433\u043e \u0432 IL \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0432\u044f\u0436\u0435\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0438 \u043d\u0430\u0448 <code>vm:recognized<\/code> \u043c\u0435\u0442\u043e\u0434 <code>CoroutineInitialize<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>kernel_to_il<\/code>:<\/p>\n<pre><code class=\"cpp\">Fragment FlowGraphBuilder::CoroutineInitialize() {   CoroutineInitializeInstr* instr = new (Z) CoroutineInitializeInstr(Pop(), GetNextDeoptId());   return Fragment(instr); }  ... case MethodRecognizer::kCoroutineInitialize: {   body += LoadLocal(parsed_function_-&gt;RawParameterVariable(0));   body += CoroutineInitialize();   body += NullConstant();   break; } ... <\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: \u0432\u044b\u0437\u043e\u0432 <code>CoroutineInitialize<\/code> \u0432 Dart \u043a\u043e\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0435\u043d \u043d\u0430 \u0432\u044b\u0437\u043e\u0432 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438 <code>CoroutineInitialize<\/code>.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u044f \u0432\u0430\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u0432\u0441\u0435 \u0442\u0440\u0438 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e.<\/p>\n<hr\/>\n<h3>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u0442\u044f\u0436\u0435\u043b\u0435\u0435<\/h3>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c <code>constants_x64<\/code>, <code>stub_code_List<\/code>, <code>stub_code_compiler<\/code> \u0438 <code>stub_code_compiler_x64<\/code>.<\/p>\n<p>\u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e Dart \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 ? \u041d\u0443\u0436\u0435\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043e\u0432\u0435\u0442\u0441\u043a\u0438\u0439&#8230; <code>stub_code_compiler<\/code>.<\/p>\n<p>\u041d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0445\u043e\u0447\u0443 \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u043d\u0430\u0448\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<pre><code class=\"dart\">  external static void _initialize(_Coroutine root); \/\/ \u041e\u0434\u0438\u043d \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442   external static void _transfer(_Coroutine from, _Coroutine to); \/\/ \u0414\u0432\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430   external static void _fork(_Coroutine from, _Coroutine to); \/\/ \u0422\u043e\u0436\u0435 \u0434\u0432\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 <\/code><\/pre>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 <code>constants_x64<\/code>:<\/p>\n<pre><code class=\"cpp\">struct CoroutineInitializeABI {   static constexpr Register kCoroutineReg = RDI; \/\/ \u041e\u0434\u0438\u043d \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 };  struct CoroutineForkABI {   static constexpr Register kCallerCoroutineReg = RSI; \/\/ \u041f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442   static constexpr Register kForkedCoroutineReg = RDI; \/\/ \u0412\u0442\u043e\u0440\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 };  struct CoroutineTransferABI {   static constexpr Register kFromCoroutineReg = RDI; \/\/ \u041f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442   static constexpr Register kToCoroutineReg = RSI; \/\/ \u0412\u0442\u043e\u0440\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442   static constexpr Register kToStackLimitReg = RDX; \/\/ \u041f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 }; <\/code><\/pre>\n<p>\u0423\u043a\u0430\u0436\u0435\u043c \u0438\u043c\u0435\u043d\u0430 \u043d\u0430\u0448\u0438\u0445 \u0437\u0430\u0433\u043b\u0443\u0448\u0435\u043a \u0432 <code>stub_code_List<\/code>:<\/p>\n<pre><code class=\"cpp\">V(CoroutineTransfer) V(CoroutineInitialize) V(CoroutineFork) <\/code><\/pre>\n<p>\u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432 <code>stub_code_compiler<\/code>:<\/p>\n<pre><code class=\"cpp\">void StubCodeCompiler::GenerateCoroutineInitializeStub() {    const Register kCoroutine = CoroutineInitializeABI::kCoroutineReg;   __ EnterStubFrame();   __ PushObject(compiler::NullObject());   __ PushRegister(kCoroutine);   __ CallRuntime(kEnterCoroutineRuntimeEntry, 1);   __ PopRegister(kCoroutine);   __ Drop(1);   __ PushRegister(FPREG);   __ StoreCompressedIntoObjectOffset(kCoroutine, Coroutine::native_stack_base_offset(), SPREG);   __ LoadFieldFromOffset(SPREG, kCoroutine, Coroutine::stack_base_offset());   __ PushRegister(kCoroutine);   __ LoadCompressedFieldFromOffset(FUNCTION_REG, kCoroutine, Coroutine::trampoline_offset());   __ Call(compiler::FieldAddress(FUNCTION_REG, Function::entry_point_offset()));   __ PopRegister(kCoroutine);   __ StoreCompressedIntoObjectOffset(kCoroutine, Coroutine::stack_base_offset(), SPREG);   __ LoadFieldFromOffset(SPREG, kCoroutine, Coroutine::native_stack_base_offset());   __ PopRegister(FPREG);   __ PushObject(compiler::NullObject());   __ CallRuntime(kExitCoroutineRuntimeEntry, 0);   __ Drop(1);   __ LeaveStubFrame();   __ Ret(); }  void StubCodeCompiler::GenerateCoroutineForkStub() {   const Register kCallerCoroutine = CoroutineForkABI::kCallerCoroutineReg;   const Register kForkedCoroutine = CoroutineForkABI::kForkedCoroutineReg;   __ EnterStubFrame();   __ PushObject(compiler::NullObject());   __ PushRegister(kForkedCoroutine);   __ CallRuntime(kEnterForkedCoroutineRuntimeEntry, 1);   __ PopRegister(kForkedCoroutine);   __ Drop(1);   __ LoadCompressedFieldFromOffset(kCallerCoroutine, kForkedCoroutine, Coroutine::caller_offset());   __ PushRegister(FPREG);   __ StoreCompressedIntoObjectOffset(kCallerCoroutine, Coroutine::stack_base_offset(), SPREG);   __ LoadFieldFromOffset(SPREG, kForkedCoroutine, Coroutine::stack_base_offset());   __ PushRegister(kForkedCoroutine);   __ LoadCompressedFieldFromOffset(FUNCTION_REG, kForkedCoroutine, Coroutine::trampoline_offset());   __ LoadCompressedField(TMP, compiler::FieldAddress(FUNCTION_REG, Function::entry_point_offset()));   __ call(TMP);   __ PopRegister(kForkedCoroutine);   __ StoreCompressedIntoObjectOffset(kForkedCoroutine, Coroutine::stack_base_offset(), SPREG);   __ LoadCompressedFieldFromOffset(kCallerCoroutine, kForkedCoroutine, Coroutine::caller_offset());   __ LoadFieldFromOffset(SPREG, kCallerCoroutine, Coroutine::stack_base_offset());   __ PopRegister(FPREG);   __ PushObject(compiler::NullObject());   __ CallRuntime(kExitForkedCoroutineRuntimeEntry, 0);   __ Drop(1);   __ LeaveStubFrame();   __ Ret(); }  void StubCodeCompiler::GenerateCoroutineTransferStub() {   const Register kFromCoroutine = CoroutineTransferABI::kFromCoroutineReg;   const Register kToCoroutine = CoroutineTransferABI::kToCoroutineReg;   const Register kToStackLimit = CoroutineTransferABI::kToStackLimitReg;   __ EnterStubFrame();   __ LoadFieldFromOffset(TMP, kFromCoroutine, Coroutine::attributes_offset());   __ AndImmediate(TMP, ~Coroutine::CoroutineAttributes::running);   __ OrImmediate(TMP, Coroutine::CoroutineAttributes::suspended);   __ StoreFieldToOffset(TMP, kFromCoroutine, Coroutine::attributes_offset());   __ LoadFieldFromOffset(TMP, kToCoroutine, Coroutine::attributes_offset());   __ AndImmediate(TMP, ~Coroutine::CoroutineAttributes::suspended);   __ OrImmediate(TMP, Coroutine::CoroutineAttributes::running);   __ StoreFieldToOffset(TMP, kToCoroutine, Coroutine::attributes_offset());   __ PushRegister(FPREG);   __ StoreCompressedIntoObjectOffset(kFromCoroutine, Coroutine::stack_base_offset(), SPREG);   __ LoadFieldFromOffset(SPREG, kToCoroutine, Coroutine::stack_base_offset());   __ PopRegister(FPREG);   __ LoadFieldFromOffset(kToStackLimit, kToCoroutine,  Coroutine::overflow_stack_limit_offset());   __ StoreToOffset(kToCoroutine, THR, Thread::coroutine_offset());   __ StoreToOffset(kToStackLimit, THR, Thread::saved_stack_limit_offset());   compiler::Label scheduled_interrupts;   __ LoadFromOffset(TMP, THR, Thread::stack_limit_offset());   __ testq(TMP, compiler::Immediate(Thread::kInterruptsMask));   __ BranchIf(ZERO, &amp;scheduled_interrupts);   __ StoreToOffset(kToStackLimit, THR, Thread::stack_limit_offset());   __ Bind(&amp;scheduled_interrupts);   __ LeaveStubFrame();   __ Ret(); } <\/code><\/pre>\n<p>\u0421\u0442\u0440\u0430\u0448\u043d\u043e ? \u041c\u043d\u0435 \u0432\u043e\u0442 \u043e\u0447\u0435\u043d\u044c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0437\u0430\u0447\u0435\u043c.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e \u0434\u0432\u0430 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430: <code>RBP<\/code> \u0438 <code>RSP<\/code>.<\/p>\n<p><code>RSP<\/code> (<code>SPREG<\/code> \u0432 \u043d\u0435\u0439\u043c\u0438\u043d\u0433\u0435 Dart) &#8212; \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u0442\u0435\u043a.<\/p>\n<p><code>RBP<\/code> (<code>FPREG<\/code> \u0432 \u043d\u0435\u0439\u043c\u0438\u043d\u0433\u0435 Dart) &#8212; \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u0442\u0435\u043a \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 &#171;\u043a\u0430\u0434\u0440&#187; \u0441\u0442\u0435\u043a\u0430).<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u0449\u0438\u0435 \u0447\u0430\u0441\u0442\u0438:<\/p>\n<pre><code class=\"cpp\">__ EnterStubFrame(); \/\/ \u041f\u0440\u043e\u043b\u043e\u0433 \u0444\u0443\u043d\u043a\u0446\u0438\u0439-\u0437\u0430\u0433\u043b\u0443\u0448\u0435\u043a, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 RBP \u043d\u0430 \u0441\u0442\u0435\u043a \u0438 \u043c\u0435\u043d\u044f\u0435\u0442 \u044d\u0442\u043e\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u043d\u0430 RSP __ LeaveStubFrame(); \/\/ \u0412\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0435\u043a \u0438\u0437 RBP \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0438 \u0434\u043e\u0441\u0442\u0430\u0435\u0442 RBP \u0438\u0437 \u0441\u0442\u0435\u043a\u0430 __ Ret(); \/\/ \u0412\u043e\u0437\u0432\u0440\u0430\u0442 \u043a \u0442\u043e\u043c\u0443, \u043a\u0442\u043e \u043d\u0430\u0441 \u0432\u044b\u0437\u0432\u0430\u043b <\/code><\/pre>\n<h4>CoroutineInitialize<\/h4>\n<ol>\n<li>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c <code>EnterCoroutineRuntimeEntry<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 <code>RBP<\/code> \u043d\u0430 \u0441\u0442\u0435\u043a, \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c <code>RSP<\/code> \u0432 \u043f\u043e\u043b\u0435 <code>native_stack_base<\/code><\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u043a, \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 <code>stack_base<\/code> \u0432 <code>RSP<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443 \u043d\u0430 \u0441\u0442\u0435\u043a<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c trampoline-\u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0435\u0439<\/p>\n<\/li>\n<\/ol>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f &#171;\u0436\u0438\u0437\u043d\u044c&#187; \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0442\u0441\u044f \u0432\u0441\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b.<\/p>\n<ol start=\"6\">\n<li>\n<p>\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443 \u0438\u0437 \u0441\u0442\u0435\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u0443\u043b\u044f\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u0442\u0435\u043a \u0432 <code>stack_base<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0435\u043a, \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044f <code>RSP<\/code> \u0438\u0437 <code>native_stack_base<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <code>RBP<\/code><\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 <code>ExitCoroutineRuntimeEntry<\/code><\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041f\u0440\u043e trampoline-\u0444\u0443\u043d\u043a\u0446\u0438\u044e<\/strong><br \/> \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043c\u043d\u0435 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043d\u0438\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"dart\">static void _run() =&gt; _Coroutine._current!._entry();   <\/code><\/pre>\n<h4>CoroutineFork<\/h4>\n<ol>\n<li>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c <code>EnterForkedCoroutineRuntimeEntry<\/code>, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0432 <code>kForkedCoroutine<\/code> (\u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430)<\/p>\n<\/li>\n<li>\n<p>\u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c <code>kForkedCoroutine<\/code> \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0437 \u043d\u0435\u0451 <code>kCallerCoroutine<\/code><\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>callee-saved<\/code> \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b, \u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0448\u0438\u043b \u043d\u0435 \u0440\u0438\u0441\u043a\u043e\u0432\u0430\u0442\u044c \u2014 <code>RuntimeEntry<\/code> \u044d\u0442\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 C++ \u043a\u043e\u0434, \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u043c.<\/p>\n<ol start=\"3\">\n<li>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c <code>RBP<\/code> \u043d\u0430 \u0441\u0442\u0435\u043a<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u0442\u0435\u043a \u043d\u043e\u0432\u043e\u0439 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b, \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044f <code>stack_base<\/code> \u0432 <code>RSP<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c <code>kForkedCoroutine<\/code> \u043d\u0430 \u043d\u043e\u0432\u043e\u043c \u0441\u0442\u0435\u043a\u0435<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e <code>CoroutineInitialize<\/code>, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c trampoline<\/p>\n<\/li>\n<\/ol>\n<p>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043d\u0451\u0442\u0441\u044f \u0441\u044e\u0434\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0439 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b.<\/p>\n<ol start=\"7\">\n<li>\n<p>\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <code>kForkedCoroutine<\/code> \u0438\u0437 \u0441\u0442\u0435\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u0443\u043b\u044f\u0435\u043c <code>stack_base<\/code> \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0441\u0442\u0430\u0451\u043c <code>kCallerCoroutine<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0442\u0435\u043a \u0438\u0437 <code>caller<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <code>RBP<\/code><\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u0447\u0435\u0440\u0435\u0437 <code>ExitForkedCoroutineRuntimeEntry<\/code><\/p>\n<\/li>\n<\/ol>\n<h4>CoroutineTransfer<\/h4>\n<p>\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432 \u043d\u0430 <code>RuntimeEntry<\/code>.<\/p>\n<ol>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b: <code>running -&gt; suspended<\/code><\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b: <code>suspended -&gt; running<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c <code>RBP<\/code> \u043d\u0430 \u0441\u0442\u0435\u043a<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 <code>RSP<\/code> \u0432 <code>stack_base<\/code> \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0441\u0442\u0435\u043a, \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044f <code>RSP<\/code> \u0438\u0437 <code>stack_base<\/code> \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <code>RBP<\/code><\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c <code>saved_stack_limit<\/code> \u0438 <code>coroutine<\/code> \u0432 <code>Thread<\/code><\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f: \u0435\u0441\u043b\u0438 <code>stack_limit<\/code> \u043f\u043e\u0442\u043e\u043a\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u043c\u0430\u0441\u043a\u043e\u0439 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439, \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u043c \u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b <code>Thread<\/code> \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/li>\n<\/ol>\n<p>\u0417\u0434\u0435\u0441\u044c \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0432\u043e\u0442 \u043a\u0430\u043a\u0443\u044e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c. \u0412 Tarantool \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430\u0445 \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">void coro_transfer (coro_context *prev, coro_context *next) {   pushq %rbp   pushq %rbx   pushq %r12   pushq %r13   pushq %r14   pushq %r15   movq %rsp, (%rdi)   movq (%rsi), %rsp   popq %r15   popq %r14   popq %r13   popq %r12   popq %rbx   popq %rbp   popq %rcx   jmpq *%rcx } <\/code><\/pre>\n<p>\u0412\u043e\u043f\u0440\u043e\u0441: \u043f\u043e\u0447\u0435\u043c\u0443 \u044f \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e \u044f\u0432\u043d\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u043d\u0430 \u0441\u0442\u0435\u043a ? \u041f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0432\u0430\u0448\u0438 \u0434\u043e\u0433\u0430\u0434\u043a\u0438.<\/p>\n<p>\u0427\u0443\u0442\u044c \u043d\u0435 \u0437\u0430\u0431\u044b\u043b \u043f\u0440\u043e <code>stub_code_compiler_x64<\/code>. \u0414\u0430\u0436\u0435 \u0432 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0430\u0445 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 <code>JumpToFrame<\/code> \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438:<\/p>\n<pre><code class=\"cpp\">void StubCodeCompiler::GenerateJumpToFrameStub() {   ...   Label no_coroutine;   __ Load(TMP, compiler::Address(THR, compiler::target::Thread::coroutine_offset()));   __ CompareObject(TMP, NullObject());   __ BranchIf(EQUAL, &amp;no_coroutine);   __ MoveRegister(TMP, RSP);   __ SmiTag(TMP);   __ PushRegister(CallingConventions::kArg1Reg);   __ PushObject(NullObject());   __ PushRegister(TMP);   __ CallRuntime(kJumpToFrameCoroutineRuntimeEntry, 1);   __ Drop(2);   __ PopRegister(CallingConventions::kArg1Reg);   __ Bind(&amp;no_coroutine);   ... } <\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0432\u0435\u0449\u044c: \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>JumpToFrameCoroutineRuntimeEntry<\/code>, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430 \u0432 \u043f\u043e\u0442\u043e\u043a\u0435.<\/p>\n<hr\/>\n<h3>\u041d\u0435\u0443\u0436\u0435\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u0434<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c: \u043d\u0430\u0448\u0438 <code>RuntimeEntry<\/code>. \u041e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 <code>runtime_entry<\/code> \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">DEFINE_RUNTIME_ENTRY(EnterCoroutine, 1) {   auto&amp; coroutine = Coroutine::CheckedHandle(zone, arguments.ArgAt(0));   coroutine.HandleRootEnter(thread, zone); } DEFINE_RUNTIME_ENTRY(ExitCoroutine, 0) {   auto&amp; coroutine = Coroutine::CheckedHandle(zone, thread-&gt;coroutine());   coroutine.HandleRootExit(thread, zone); } DEFINE_RUNTIME_ENTRY(EnterForkedCoroutine, 1) {   auto&amp; coroutine = Coroutine::CheckedHandle(zone, arguments.ArgAt(0));   coroutine.HandleForkedEnter(thread, zone); } DEFINE_RUNTIME_ENTRY(ExitForkedCoroutine, 0) {   auto&amp; coroutine = Coroutine::CheckedHandle(zone, thread-&gt;coroutine());   coroutine.HandleForkedExit(thread, zone); } DEFINE_RUNTIME_ENTRY(JumpToFrameCoroutine, 1) {   Coroutine::Handle(Thread::Current()-&gt;coroutine()).HandleJumpToFrame(thread, Smi::Value(Smi::RawCast(arguments.ArgAt(0)))); } <\/code><\/pre>\n<p>\u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u043a\u0441\u0438-\u0444\u0443\u043d\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u044e\u0442 \u0432\u044b\u0437\u043e\u0432 \u0432 <code>object.cc<\/code>.<\/p>\n<h2>\u0428\u0430\u0433 5. \u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c<\/h2>\n<p>\u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0442\u0435\u0441\u0442\u043e\u0432. \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043a\u043e\u0440\u0443\u0442\u0438\u043d. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<h4>Test Suite: launch<\/h4>\n<p>\u0417\u0434\u0435\u0441\u044c \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>testEmpty &#8212; \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0443\u0441\u0442\u0443\u044e \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443<\/p>\n<\/li>\n<li>\n<p>testTerminated &#8212; \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430 disposed<\/p>\n<\/li>\n<li>\n<p>testFunction &#8212; \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443-\u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>testClosure &#8212; \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443-\u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0435 \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>testFork &#8212; \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0434\u043d\u0443 \u0434\u043e\u0447\u0435\u0440\u043d\u044e\u044e \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443<\/p>\n<\/li>\n<li>\n<p>testForks &#8212; \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443<\/p>\n<\/li>\n<\/ul>\n<h4>Test Suite: captures<\/h4>\n<p>\u0417\u0434\u0435\u0441\u044c \u0442\u0435\u0441\u0442\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u043d\u0435 \u043a\u043e\u0440\u0443\u0442\u0438\u043d:<\/p>\n<ul>\n<li>\n<p>testGlobalState &#8212; \u043c\u0435\u043d\u044f\u0435\u043c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/p>\n<\/li>\n<li>\n<p>testClosureState &#8212; \u043c\u0435\u043d\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u043d\u0435 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b-\u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ul>\n<h4>Test Suite: flow<\/h4>\n<p>\u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u044b \u0438\u0437 \u043a\u043e\u0440\u0443\u0442\u0438\u043d \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445:<\/p>\n<ol>\n<li>\n<p>\u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u0438 \u0432\u0435\u0440\u043d\u0443\u043b\u0430\u0441\u044c \u043a \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044e (\u0438\u043b\u0438 \u0432 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a)<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430 \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0438 \u0432\u043e\u0437\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0438\u0437 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f<\/p>\n<\/li>\n<li>\n<p>\u0434\u0432\u0435 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u0432\u043e\u0437\u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f<\/p>\n<\/li>\n<\/ol>\n<h4>Test Suite: lifecycle<\/h4>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <code>recycle()<\/code> \u0438 <code>dispose()<\/code>.<\/p>\n<h4>Test Suite: state<\/h4>\n<p>\u0412 \u043c\u043e\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0438\u0438 \u0435\u0441\u0442\u044c \u0440\u0435\u0435\u0441\u0442\u0440 \u043a\u043e\u0440\u0443\u0442\u0438\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u042d\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0437\u0434\u0435\u0441\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442\u0441\u044f.<\/p>\n<h4>Test Suite: exceptions<\/h4>\n<p>\u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 c \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439:<\/p>\n<ul>\n<li>\n<p>\u0432\u044b\u0431\u0440\u043e\u0441 \u043d\u0430\u0440\u0443\u0436\u0443 \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0431\u0440\u043e\u0441 \u0438\u0437 \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0439 \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0431\u0440\u043e\u0441\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u0432\u043e\u0437\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ul>\n<h4>Test Suite: stress<\/h4>\n<p>\u042d\u0442\u043e\u0442 \u0442\u0435\u0441\u0442 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u0442\u0440\u0435\u0441\u0441\u043e\u043c. \u0418\u043c\u0435\u043d\u043d\u043e \u043e\u043d &#8212; \u043f\u0440\u0438\u0447\u0438\u043d\u0430, \u043f\u043e\u0447\u0435\u043c\u0443 \u044f \u043d\u0430\u0437\u0432\u0430\u043b \u044d\u0442\u0443 \u0447\u0430\u0441\u0442\u044c &#171;\u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u043e\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0431\u0435\u0434\u044b&#187;.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0442\u0435\u0441\u0442\u0435 \u044f \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 Dart VM \u0438 Dart GC: \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0438 \u0443\u043c\u0438\u0440\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0440\u0443\u0442\u0438\u043d (&gt;100000), \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0442\u0435\u0441\u0442\u0430 &#8212; \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0439\u0442\u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430. \u0415\u0441\u043b\u0438 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0440\u0443\u0442\u0438\u043d \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0441\u0431\u043e\u0440\u043a\u0443 \u043c\u0443\u0441\u043e\u0440\u0430, \u0442\u0435\u0441\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043f\u0430\u0434\u0435\u0442 \u0438\u0437-\u0437\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>\u0418 \u043e\u043d \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0430\u0434\u0430\u043b. \u041c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e.<\/p>\n<h2>\u0428\u0430\u0433 6. \u0421\u0442\u0440\u0430\u0434\u0430\u0435\u043c.<\/h2>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u044f\u0441\u043d\u0438\u0442\u044c, \u0437\u0430\u0447\u0435\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u042f \u043d\u0435 \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a Dart Team \u043e\u0446\u0435\u043d\u0438\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c, \u0441\u0440\u043e\u043a\u0438 \u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u041d\u043e \u0432\u0430\u0436\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0435 \u2014 \u044f \u043d\u0435 \u0447\u0430\u0441\u0442\u044c Dart Team \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0432\u0437\u044f\u043b\u0441\u044f \u0437\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442 \u2014 \u043d\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u043f\u043e\u0445\u0432\u0430\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u0438\u043b\u0438 \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0415\u0433\u043e \u0446\u0435\u043b\u044c \u2014 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a &#171;\u0441\u043b\u043e\u0436\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435&#187; \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043d\u0430\u0448\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435.<\/p>\n<p>\u041b\u0438\u0447\u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u0432\u0441\u044f \u044d\u0442\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0441 Dart \u0432\u044b\u0437\u0432\u0430\u043b\u0430 \u0433\u0440\u0435\u043c\u0443\u0447\u0443\u044e \u0441\u043c\u0435\u0441\u044c: \u0433\u043d\u0435\u0432, \u043e\u0431\u0438\u0434\u0430, \u043e\u0442\u0447\u0430\u044f\u043d\u0438\u0435 \u0438 \u0432\u044b\u0433\u043e\u0440\u0430\u043d\u0438\u0435.<\/p>\n<p>\u042d\u0442\u043e \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0448\u044c \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u0442\u044c\u0441\u044f: <em>&#171;\u0410 \u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a? \u041c\u043e\u0436\u0435\u0442, \u044f \u043e\u0448\u0438\u0431\u0441\u044f \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0435\u0439?&#187;<\/em><\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443? \u041d\u0443 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u2014 \u0431\u044b\u0432\u0430\u0435\u0442, \u0436\u0438\u0432\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435?<\/p>\n<p>\u041d\u043e \u043e\u0442\u0432\u0435\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u0435\u0440\u0437\u043a\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u043e \u043c\u043d\u043e\u0433\u0438\u043c. \u0418 \u0447\u0430\u0441\u0442\u043e \u043c\u044b \u0438\u0449\u0435\u043c \u0435\u0433\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0443 \u0432 \u0441\u0435\u0431\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u043e\u0442 \u0432\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430\u043c\u0438, \u043d\u043e \u0438 \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435.<\/p>\n<p>\u0422\u043e, \u0447\u0442\u043e \u044f \u0447\u0443\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u043b, \u0432\u044b\u0437\u0432\u0430\u043d\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c\u0438 \u0444\u0430\u043a\u0442\u043e\u0440\u0430\u043c\u0438, \u043d\u043e \u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c\u044e, \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u043e\u0434\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u0435\u0433\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e\u043c, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c\u044e \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0441\u0442\u044c\u044e<\/p>\n<\/li>\n<li>\n<p>\u0430 \u0442\u0430\u043a\u0436\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0438 \u043d\u0430\u0432\u044b\u043a\u0430\u043c\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0443\u043c\u0430\u0439\u0442\u0435, \u0434\u0440\u0443\u0437\u044c\u044f&#8230;<\/p>\n<p>\u0410\u0445 \u0434\u0430, \u044f \u0436\u0435 \u0445\u043e\u0442\u0435\u043b \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0440\u0435\u0448\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438. \u0417\u0434\u0435\u0441\u044c \u043e\u043d \u0443\u043f\u0430\u043b \u0434\u043e <strong>10%<\/strong>. \u0411\u044b\u043b\u043e \u0441\u0438\u043b\u044c\u043d\u043e\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0432\u0441\u0451 \u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0438 \u0443\u0439\u0442\u0438 \u0432 \u0434\u043e\u043b\u0433\u0438\u0439 \u043f\u0435\u0440\u0435\u0440\u044b\u0432.<\/p>\n<h2>\u0428\u0430\u0433 7. \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c, \u043f\u043e\u0434\u044b\u0448\u0430\u043b\u0438, \u043f\u043e\u0448\u043b\u0438 \u0434\u0430\u043b\u044c\u0448\u0435.<\/h2>\n<p>\u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0443 \u043c\u0435\u043d\u044f \u0432 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0431\u044b\u043b\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0442\u0435\u043c, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u043b\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c. \u0417\u0434\u0435\u0441\u044c \u044f \u0438 \u0440\u0435\u0448\u0438\u043b \u0432\u0437\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u0440\u044b\u0432.<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0431\u044b\u043b \u0441\u043c\u0435\u0448\u043d\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 &#8212; \u043c\u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u0441\u0442\u044b\u0434\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043e\u0431 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u043d\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u043e\u0434\u0445\u043e\u0434.<\/p>\n<p>\u041d\u0435 \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 100%, \u043d\u043e, \u0435\u0441\u043b\u0438 \u0447\u0435\u0441\u0442\u043d\u043e, \u043c\u043d\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u2014 \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u043a\u0430 \u0431\u0443\u0434\u0443 \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>\u041d\u0430\u0439\u0434\u0435\u0442\u0435 \u0431\u0430\u0433 &#8212; \u043c\u043d\u0435 \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0435, \u043b\u0443\u0447\u0448\u0435 \u0441\u0440\u0430\u0437\u0443 PR \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0439\u0442\u0435.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0441\u043e \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u043c. \u0421\u043f\u043e\u0439\u043b\u0435\u0440: \u0441\u0442\u0440\u0435\u0441\u0441 \u0442\u0435\u0441\u0442 \u043f\u0440\u043e\u0448\u0435\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u0418 \u043c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u0440\u043e \u044d\u0442\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0431\u044b\u043b\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e\u0439.<\/p>\n<h2>\u0428\u0430\u0433 8. \u0412\u043e\u0441\u0441\u0442\u0430\u0451\u043c \u0438\u0437 \u043f\u0435\u043f\u043b\u0430 \u0430\u043a\u0438 \u0444\u0435\u043d\u0438\u043a\u0441<\/h2>\n<p>\u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0441\u0435\u0439\u0447\u0430\u0441.<\/p>\n<ol>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u0437\u043d\u0430\u0447\u0438\u0442 \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u0434\u0435 (\u0438 Dart, \u0438 C++) \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0435\u0442.<\/p>\n<\/li>\n<li>\n<p>\u041c\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0435\u043a \u0432\u0441\u0435\u0445 \u043a\u043e\u0440\u0443\u0442\u0438\u043d \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0441\u0442\u0435\u043a\u0443 \u043f\u043e\u0442\u043e\u043a\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 \u0442\u043e\u0433\u0434\u0430 \u0441\u0442\u0440\u0435\u0441\u0441 \u0442\u0435\u0441\u0442 \u043d\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 ? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f.<\/p>\n<\/li>\n<\/ol>\n<h3>GC \u2014 \u0434\u0430\u0440 \u0438 \u043f\u0440\u043e\u043a\u043b\u044f\u0442\u0438\u0435.<\/h3>\n<p>\u041f\u043e-\u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0440\u0430\u0437\u0434\u0435\u043b \u0441\u0442\u0430\u0442\u044c\u0438 \u0432 \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0442\u043e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430 \u0438 \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430 \u0432 Dart. \u041d\u043e \u044f \u043b\u0435\u043d\u0438\u0432\u044b\u0439 \u043a\u043e\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <a href=\"https:\/\/github.com\/dart-lang\/sdk\/blob\/main\/runtime\/docs\/gc.md\" rel=\"noopener noreferrer nofollow\">\u0434\u0435\u0440\u0436\u0438\u0442\u0435<\/a>.<\/p>\n<p>\u0411\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u044b \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438.<\/p>\n<p>\u042f \u0436\u0435 \u043d\u0430\u043f\u0438\u0448\u0443 \u043f\u0440\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0442\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u043c\u0443\u0441\u043e\u0440\u0430 \u0432 Dart, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u0442\u0440\u0435\u0441\u0441 \u0442\u0435\u0441\u0442\u0430.<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 Dart:<\/p>\n<h3>\u0412 \u043d\u0435\u043c \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432<\/h3>\n<pre><code class=\"cpp\">... P(compactor_tasks, int, 2,\"The number of tasks to use for parallel compaction.\") P(concurrent_mark, bool, true, \"Concurrent mark for old generation.\") P(concurrent_sweep, bool, true, \"Concurrent sweep for old generation.\") ... <\/code><\/pre>\n<p>\u042d\u0442\u043e \u0444\u043b\u0430\u0433\u0438 \u0438\u0437 <code>flag_list<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0433\u0443\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u0439 <code>mark<\/code> \u0438 <code>sweep<\/code>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u043e\u043c <code>compaction<\/code>.<\/p>\n<p>\u042f \u043f\u044b\u0442\u0430\u043b\u0441\u044f &#171;\u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f&#187; \u0441 \u044d\u0442\u0438\u043c\u0438 \u0444\u043b\u0430\u0433\u0430\u043c\u0438, \u0438 \u043c\u043d\u0435 \u0434\u0430\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u0438 \u043e\u0434\u043d\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u044b\u043c, \u0442\u043e \u0441\u0442\u0440\u0435\u0441\u0441 \u0442\u0435\u0441\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442. \u0425\u043e\u0442\u044f \u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043c\u0435\u043d\u044f\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u2014 \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u0444\u0430\u043a\u0442.<\/p>\n<h3>\u041e\u043d \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u0435\u043a<\/h3>\n<p>\u0412 <code>Isolate<\/code> \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>VisitStackPointers<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u0443\u0441\u043e\u0440\u0430 (\u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u0430\u0437).<\/p>\n<p>\u0412 \u043d\u0435\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0442\u0435\u043a\u0430 \u0434\u043b\u044f <code>mutator_thread_<\/code> (\u043f\u043e\u0442\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u0441\u0443\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u0434).<\/p>\n<h3>\u041e\u043d \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0431\u0430\u0440\u044c\u0435\u0440\u0430\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u0438<\/h3>\n<p>\u041f\u0440\u043e \u0431\u0430\u0440\u044c\u0435\u0440\u044b \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/github.com\/dart-lang\/sdk\/blob\/main\/runtime\/docs\/gc.md\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u0412 Dart \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043f\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u044d\u0442\u0438\u043c\u0438 \u0431\u0430\u0440\u044c\u0435\u0440\u0430\u043c\u0438. \u041a\u043e\u0440\u0443\u0442\u0438\u043d \u044d\u0442\u0438 \u0431\u0430\u0440\u044c\u0435\u0440\u044b \u043a\u0430\u0441\u0430\u044e\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>Thread::RestoreWriteBarrierInvariant<\/code>.<\/p>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u0435\u0441\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code>\/\/ Write barrier elimination assumes that all live temporaries will be \/\/ in the remembered set after a scavenge triggered by a non-Dart-call \/\/ instruction (see Instruction::CanCallDart()), and additionally they will be \/\/ in the deferred marking stack if concurrent marking started. Specifically, \/\/ this includes any instruction which will always create an exit frame \/\/ below the current frame before any other Dart frames. \/\/ \/\/ Therefore, to support this assumption, we scan the stack after a scavenge \/\/ or when concurrent marking begins and add all live temporaries in \/\/ Dart frames preceding an exit frame to the store buffer or deferred \/\/ marking stack. <\/code><\/pre>\n<p>\u041a\u0440\u0430\u0442\u043a\u043e \u043f\u0440\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e: \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u043b\u044f <a href=\"https:\/\/github.com\/dart-lang\/sdk\/blob\/main\/runtime\/docs\/gc.md#write-barrier-elimination\" rel=\"noopener noreferrer nofollow\">\u0431\u0430\u0440\u044c\u0435\u0440\u043e\u0432 \u0437\u0430\u043f\u0438\u0441\u0438<\/a> \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0444\u0430\u0437 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u0443\u0441\u043e\u0440\u0430 \u0431\u0430\u0440\u044c\u0435\u0440\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438, \u0438 GC \u043d\u0438\u0447\u0435\u0433\u043e \u0431\u044b \u043d\u0435 \u0443\u043f\u0443\u0441\u0442\u0438\u043b.<\/p>\n<p>\u042f \u0431\u044b \u043c\u043e\u0433 \u043d\u0430 \u044d\u0442\u043e\u043c \u0448\u0430\u0433\u0435 \u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0418\u0418 \u0438 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442\u044c: &#171;\u0412\u043e\u0442 \u0442\u0435\u0431\u0435 \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0434\u0430\u0439 \u043c\u043d\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u044c\u0438&#187;.<\/p>\n<p>\u041d\u043e \u044f \u043d\u0435 \u0445\u043e\u0447\u0443 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u0432 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u043c\u0443\u0441\u043e\u0440\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u044d\u0442\u043e\u0442 \u043d\u0435 \u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u044b\u0445, \u0430 \u043c\u043d\u0435 \u0435\u0449\u0435 \u043d\u0430\u0434\u043e \u0432\u0430\u043c \u043f\u0440\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0430\u0433\u0430 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c.<\/p>\n<h3>\u041e\u043d \u0434\u043e\u043b\u0436\u0435\u043d &#171;\u0437\u043d\u0430\u0442\u044c&#187; \u043f\u0440\u043e \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b Dart<\/h3>\n<p>\u0427\u0442\u043e \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 Dart \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0443 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u0441\u0431\u043e\u0440\u0449\u0438\u043a ?<\/p>\n<p>\u041a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0431\u043e\u0440\u043a\u0430\u0445 \u044d\u0442\u043e\u0442 \u0432\u0430\u0448 \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0435 \u0431\u044b\u043b \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e GC \u043d\u0435 \u0441\u043c\u043e\u0433 \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u043d\u0435\u0433\u043e \u0441\u0441\u044b\u043b\u043e\u043a ?<\/p>\n<p>\u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443\u044f\u0441\u044c \u044d\u0442\u0438\u043c\u0438 \u043c\u044b\u0441\u043b\u044f\u043c\u0438, \u044f \u0431\u044b\u043b \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443 \u043a\u0430\u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 Dart \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<p>\u0418 \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u043e\u0435, \u043e\u0442 \u0447\u0435\u0433\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u0432 \u0438\u0442\u043e\u0433\u0435 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f (\u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e).<\/p>\n<h2>\u0428\u0430\u0433 9. \u0423\u0431\u0438\u0440\u0430\u0435\u043c \u043b\u0438\u0448\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b<\/h2>\n<p>\u042f \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u043a\u0430\u043a\u0438\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 (\u0434\u0430\u0436\u0435 \u0444\u0430\u043d\u0442\u0430\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435), \u0438\u0437-\u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443 \u043c\u0435\u043d\u044f \u043f\u0430\u0434\u0430\u0435\u0442 \u0442\u0435\u0441\u0442. \u0412\u043e\u0442 \u043c\u043e\u0438 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0438:<\/p>\n<ol>\n<li>\n<p>\u0421\u0431\u043e\u0440\u0449\u0438\u043a \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0438 \u0443\u0434\u0430\u043b\u0438\u043b \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u0442\u0435\u043a<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043a\u043e\u0440\u0443\u0442\u0438\u043d \u0432\u044b\u0437\u0432\u0430\u043b\u0438\u0441\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043a\u043e\u0440\u0443\u0442\u0438\u043d (recycle\/dispose)<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043a\u043e\u0440\u0443\u0442\u0438\u043d \u0431\u044b\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u043d\u044b: <code>CoroutineFork<\/code> \u0438\u043b\u0438 <code>CoroutineTransfer<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0442\u0435\u043a\u043e\u0432 \u0431\u044b\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u043d\u044b: <code>CoroutineFork<\/code> \u0438\u043b\u0438 <code>CoroutineTransfer<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043b\u0438 \u044f \u043c\u0435\u0441\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u0442\u0435\u043a\u0430 ? \u0412\u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f <code>_SuspendState<\/code>  \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0444\u0440\u0435\u0439\u043c\u0430 \u0441\u0442\u0435\u043a\u0430 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>_SuspendState<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412 &#171;\u043f\u044c\u044f\u043d\u043e\u043c&#187; \u043d\u043e\u0447\u043d\u043e\u043c \u0443\u0433\u0430\u0440\u0435 \u044f \u0435\u0449\u0451 \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0440\u043e\u0432\u0430\u043b, \u043d\u043e \u0432\u0441\u0435 \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0432 \u043d\u043e\u0447\u043d\u043e\u043c \u043a\u043e\u0434\u0438\u043d\u0433\u0435, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u043e\u0447\u043d\u043e\u043c \u043a\u043e\u0434\u0438\u043d\u0433\u0435&#8230;<\/p>\n<\/li>\n<\/ol>\n<p>\u042f \u0440\u0435\u0448\u0438\u043b \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439 \u0440\u0430\u0434\u0438\u043a\u0430\u043b\u044c\u043d\u043e. \u0418 \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u044f \u0441\u0434\u0435\u043b\u0430\u043b &#8212; \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0438\u0437 Dart \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u043a\u0443\u0441\u043e\u043a <code>C++<\/code> \u043f\u0430\u043c\u044f\u0442\u0438, \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u0443\u0441\u043e\u043a:<\/p>\n<pre><code class=\"cpp\">class Coroutine {   ...   Coroutine* caller_;   uword owner_;   uword trampoline_;   uword stack_size_;   uword native_stack_base_;   uword stack_root_;   uword stack_base_;   uword stack_limit_;   uword overflow_stack_limit_;   uword attributes_;   uword index_;   ... } <\/code><\/pre>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438 \u0437\u0434\u0435\u0441\u044c \u0442\u0435 \u0436\u0435 \u043f\u043e\u043b\u044f, \u043d\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0436\u0435 \u043d\u0435 Dart \u043e\u0431\u044a\u0435\u043a\u0442, \u0430 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 &#171;\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439&#187;. \u0418 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0442 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 Dart \u043e\u0431\u044a\u0435\u043a\u0442\u044b.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u2014 &#171;\u0430 \u043a\u0430\u043a \u0441 \u043d\u0438\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438\u0437 Dart ?&#187;.<\/p>\n<p>\u0410 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"dart\">extension type _Coroutine(int handle) {} external _Coroutine? _Coroutine_create(int size, int owner_index, Object owner, int attributes, Function trampoline); external void _Coroutine_idle(int timeout); external void _Coroutine_initialize(_Coroutine root); external void _Coroutine_transfer(_Coroutine from, _Coroutine to); external void _Coroutine_fork(_Coroutine from, _Coroutine to); external _Coroutine? _Coroutine_current(); external int _Coroutine_getIndex(_Coroutine coroutine); external int _Coroutine_getOwner(_Coroutine coroutine); external int _Coroutine_getAttributes(_Coroutine coroutine); external void _Coroutine_setAttributes(_Coroutine coroutine, int attributes); external _Coroutine? _Coroutine_getCaller(_Coroutine coroutine); external void _Coroutine_setCaller(_Coroutine coroutine, _Coroutine caller); <\/code><\/pre>\n<p>C++ \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u044d\u0442\u043e Dart int. \u0414\u043b\u044f \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 \u044f \u0441\u0434\u0435\u043b\u0430\u043b <a href=\"https:\/\/dart.dev\/language\/extension-types\" rel=\"noopener noreferrer nofollow\">extension type<\/a>.<\/p>\n<p>\u041d\u043e, \u043f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435, \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0447\u0435\u0440\u0435\u0437 <code>NATIVE_ENTRY<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u043c, \u0430 \u0432\u043e\u0442 \u0432\u0441\u0435 \u044d\u0442\u0438 <code>_getIndex<\/code> \u0438 \u043f\u0440\u043e\u0447\u0435\u0435 &#8212; \u044d\u0442\u043e \u0447\u0442\u043e, \u0431\u0443\u0434\u0443\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 <code>NATIVE_ENTRY<\/code> ?<\/p>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438 \u0442\u0430\u043a, \u043d\u043e \u044f \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0432\u0435\u0440\u044e \u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c <code>NATIVE_ENTRY<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0439\u0442\u0438 \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u043f\u0443\u0442\u0435\u043c:<\/p>\n<pre><code class=\"cpp\">case MethodRecognizer::kCoroutine_getAttributes: {   body += LoadLocal(parsed_function_-&gt;RawParameterVariable(0));   body += UnboxTruncate(kUnboxedAddress);   body += ConvertUnboxedToUntagged();   body += LoadNativeField(Slot::Coroutine_attributes());   body += Box(kUnboxedInt64);   break; } case MethodRecognizer::kCoroutine_setAttributes: {   body += LoadLocal(parsed_function_-&gt;RawParameterVariable(0));   body += UnboxTruncate(kUnboxedAddress);   body += ConvertUnboxedToUntagged();   body += LoadLocal(parsed_function_-&gt;RawParameterVariable(1));   body += UnboxTruncate(kUnboxedInt64);   body += StoreNativeField(Slot::Coroutine_attributes());   body += NullConstant();   break; } <\/code><\/pre>\n<p>\u0422\u0430\u043a \u0432\u0435\u0434\u044c \u0432\u0435\u0441\u0435\u043b\u0435\u0435, \u043f\u0440\u0430\u0432\u0434\u0430 ? \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c <code>Boxed<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 <code>int<\/code>, \u0434\u0435\u043b\u0430\u0435\u043c \u0438\u0437 \u043d\u0435\u0433\u043e <code>Unboxed<\/code>, \u0430 \u043f\u043e\u0442\u043e\u043c \u044d\u0442\u043e\u0442 <code>Unboxed<\/code> \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043a <code>Untagged<\/code> (\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 C++ \u043e\u0431\u044a\u0435\u043a\u0442).<\/p>\n<p>\u0418 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e + \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044e (<code>Slot::Coroutine_attributes<\/code>) \u0431\u0435\u0440\u0435\u043c \u043d\u0443\u0436\u043d\u043e\u0435 \u043d\u0430\u043c \u043f\u043e\u043b\u0435. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0441 <code>_Coroutine_setAttributes<\/code>, \u043d\u043e \u0442\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<p>\u041a\u0430\u043a \u0434\u0443\u043c\u0430\u0435\u0442\u0435, \u044d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 <code>NATIVE_ENTRY<\/code> ? \u041f\u0438\u0448\u0438\u0442\u0435 \u0441\u0432\u043e\u0438 \u043c\u044b\u0441\u043b\u0438, \u0430 \u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0440\u044f \u044f \u044d\u0442\u043e \u0432\u0441\u0435.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0442\u0440\u0438\u0445: \u043a\u0430\u043a \u0434\u043e\u0441\u0442\u0430\u0442\u044c Fiber (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0447\u0438\u0441\u0442\u043e Dart \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c) \u0438\u0437 Coroutine (\u043a\u043e\u0442\u043e\u0440\u0430\u044f C++ \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c) ?<\/p>\n<p>\u041d\u0435 \u0441\u043c\u0435\u0439\u0442\u0435\u0441\u044c:<\/p>\n<pre><code class=\"dart\">class _FiberPool {   final List&lt;Fiber?&gt; _fibers = [];    Fiber allocate() {     final fiber = Fiber(_fibers.length);     _fibers.add(fiber);     return fiber;   }    Fiber get(int index) =&gt; _fibers[index]!;    void free(int index) =&gt; _fibers[index] = null;    void clear() =&gt; _fibers.clear(); }  final _pool = _FiberPool(); <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0441\u0438\u043b \u0436\u0435, \u043d\u0435 \u0441\u043c\u0435\u0439\u0442\u0435\u0441\u044c \ud83d\ude42 \u0414\u0430, \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043c\u0435\u0442\u044c Dart \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 Fiber \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0438 \u0432 Coroutine \u0445\u0440\u0430\u043d\u0438\u0442\u044c <code>owner<\/code> &#8212; \u0438\u043d\u0434\u0435\u043a\u0441 Dart Fiber.<\/p>\n<p>\u041d\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0435 \u043c\u043d\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u043e \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043f\u0440\u0435\u0436\u0434\u0435\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u043e \u0434\u043e\u0431\u0440\u0430 \u043d\u0435 \u0434\u043e\u0432\u043e\u0434\u0438\u0442, \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0435 \u0440\u0438\u0441\u043a\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u0432\u0443\u0445 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d, \u043d\u043e \u043c\u043d\u0435 \u043d\u0435 \u0434\u043e \u0442\u043e\u0433\u043e \u0431\u044b\u043b\u043e. \u041d\u0435 \u0434\u0443\u043c\u0430\u043b \u043f\u0440\u043e \u044d\u0442\u043e.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u044f \u0438\u0437\u0431\u0430\u0432\u0438\u043b\u0441\u044f \u043e\u0442 \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0432\u0441\u0435 \u0435\u0449\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u044d\u0442\u043e \u0440\u0430\u0434\u0443\u0435\u0442. \u041f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0438\u0441\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445, \u043d\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044f \u0437\u0434\u0435\u0441\u044c \u0443\u043a\u0430\u0437\u0430\u043b.<\/p>\n<h2>\u0428\u0430\u0433 10. \u0412\u043d\u0435\u0434\u0440\u044f\u0435\u043c \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u0443\u044e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/h2>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430 \u043c\u0443\u0441\u043e\u0440\u0430 \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041d\u043e \u043a\u0430\u043a \u0431\u044b\u0442\u044c \u0441 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u043e\u0439 ?<\/p>\n<p>\u041a\u0430\u043a\u0438\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u0435\u0441\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u0443\u0441\u043e\u0440\u0430 ?<\/p>\n<p>Dart VM \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/dart-lang\/sdk\/blob\/main\/runtime\/docs\/gc.md#safepoints\" rel=\"noopener noreferrer nofollow\">SafePoint<\/a>, \u043d\u043e \u0435\u0449\u0451 \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0435 \u0434\u043e\u0431\u0440\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 Mutex-\u044b. \u042f \u0432\u044b\u0431\u0440\u0430\u043b \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 SafePoint \u0432 <code>CoroutineFork<\/code>:<\/p>\n<pre><code class=\"cpp\">\u0442\u0443\u0442 \u0441\u0442\u0440\u0430\u0448\u043d\u044b\u0439 \u043a\u043e\u0434 __ EnterFullSafepoint(); \/\/ \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u0435\u0437\u043b\u043e, \u0447\u0442\u043e \u0432 Dart \u0431\u044b\u043b\u0430 \u0433\u043e\u0442\u043e\u0432\u0430\u044f \u0442\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f: \u0432\u0445\u043e\u0434\u0438\u043c __ PopRegister(kForkedCoroutine); __ StoreToOffset(SPREG, kForkedCoroutine, Coroutine::stack_base_offset()); __ LoadFromOffset(kCallerCoroutine, kForkedCoroutine, Coroutine::caller_offset()); __ LoadFromOffset(SPREG, kCallerCoroutine, Coroutine::stack_base_offset()); __ PopRegister(FPREG); __ movq(PP, compiler::Address(THR, Thread::global_object_pool_offset())); __ ExitFullSafepoint(false); \/\/ \u0438 \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u0442\u0443\u0442 \u0442\u043e\u0436\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u044b\u0439 \u043a\u043e\u0434 <\/code><\/pre>\n<p>\u0413\u043b\u044f\u0434\u044f \u043d\u0430 \u044d\u0442\u043e, \u043c\u043d\u0435 \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u0437 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e\u0433\u043e \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u0430: <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/793\/935\/6c3\/7939356c306c5d6d6ccdadc197c3e0d3.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/793\/935\/6c3\/7939356c306c5d6d6ccdadc197c3e0d3.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/793\/935\/6c3\/7939356c306c5d6d6ccdadc197c3e0d3.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041d\u0435 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0439\u0442\u0435&#8230; \u041c\u043e\u0439 \u043c\u043e\u0437\u0433 \u043f\u043e\u0441\u043b\u0435 \u0431\u0438\u0442\u0432\u044b \u0441 Dart GC \u0435\u0449\u0451 \u043d\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f.<\/p>\n<p>\u041d\u043e SafePoint \u0437\u0434\u0435\u0441\u044c \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u043c\u0430\u043b\u043e, \u043c\u043e\u044f \u043f\u0430\u0440\u0430\u043d\u043e\u0439\u044f \u0433\u043e\u0432\u043e\u0440\u0438\u0442: \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0439 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e !<\/p>\n<p>\u0414\u0435\u0440\u0436\u0438\u0442\u0435:<\/p>\n<pre><code class=\"cpp\">MutexLocker lock(isolate-&gt;group()-&gt;coroutine_mutex()); <\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 Mutex \u044f \u0445\u0440\u0430\u043d\u044e \u0432 IsolateGroup, \u043f\u0440\u043e \u0433\u0440\u0443\u043f\u043f\u044b <a href=\"https:\/\/dart.dev\/language\/concurrency#performance-and-isolate-groups\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0441 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043a\u0430\u043a \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043c\u0443\u0441\u043e\u0440\u0430, \u0442\u0430\u043a \u0438 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0430\u0434 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430\u043c\u0438.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438:<\/p>\n<ol>\n<li>\n<p><code>Thread::VisitObjectPointersCoroutine<\/code> &#8212; \u0437\u0434\u0435\u0441\u044c \u0438\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0442\u0435\u043a\u043e\u0432 \u043a\u043e\u0440\u0443\u0442\u0438\u043d<\/p>\n<\/li>\n<li>\n<p><code>Thread::RestoreWriteBarrierInvariantCoroutine<\/code> &#8212; \u0437\u0434\u0435\u0441\u044c \u0442\u043e\u0436\u0435 \u0438\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0442\u0435\u043a\u043e\u0432 \u043a\u043e\u0440\u0443\u0442\u0438\u043d<\/p>\n<\/li>\n<li>\n<p><code>Coroutine::HandleJumpToFrame<\/code> &#8212; \u0442\u0443\u0442 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043e\u0440\u0443\u0442\u0438\u043d<\/p>\n<\/li>\n<li>\n<p><code>Coroutine::HandleRootEnter<\/code> &#8212; \u0442\u0443\u0442 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043e\u0440\u0443\u0442\u0438\u043d<\/p>\n<\/li>\n<li>\n<p><code>Coroutine::HandleRootExit<\/code> &#8212; \u0442\u0443\u0442 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043e\u0440\u0443\u0442\u0438\u043d<\/p>\n<\/li>\n<li>\n<p><code>Coroutine::HandleForkedEnter<\/code> &#8212; \u0442\u0443\u0442 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043e\u0440\u0443\u0442\u0438\u043d<\/p>\n<\/li>\n<li>\n<p><code>Coroutine::HandleForkedExit<\/code> &#8212; \u0442\u0443\u0442 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043e\u0440\u0443\u0442\u0438\u043d<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u043b\u0438\u044f\u0435\u0442 \u043b\u0438 \u044d\u0442\u043e \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c ? \u041a\u043e\u043d\u0435\u0447\u043d\u043e! \u0410 \u0432\u044b \u0447\u0442\u043e \u0434\u0443\u043c\u0430\u043b\u0438, \u0447\u0442\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u044d\u0442\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e ?<\/p>\n<p>\u041d\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0438 \u043c\u0435\u043d\u044f \u043c\u0430\u043b\u043e \u0432\u043e\u043b\u043d\u043e\u0432\u0430\u043b\u0438 \u043d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<p>\u0418\u0442\u043e\u0433\u043e:<\/p>\n<ol>\n<li>\n<p>\u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0441\u043c\u0443\u0449\u0430\u0442\u044c GC<\/p>\n<\/li>\n<li>\n<p>\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0432\u0441\u0435, \u0447\u0442\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043c\u043e\u043b\u0438\u043c\u0441\u044f<\/p>\n<\/li>\n<\/ol>\n<h2>\u0428\u0430\u0433 11. \u0421 \u0437\u0430\u043c\u0438\u0440\u0430\u043d\u0438\u0435\u043c \u0441\u0435\u0440\u0434\u0446\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u044b<\/h2>\n<p><code>exit<\/code> &#8212; \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0442\u0435\u0441\u0442 \u0434\u043e\u0448\u0435\u043b \u0434\u043e \u043a\u043e\u043d\u0446\u0430<\/p>\n<pre><code class=\"bash\">(\ud83e\udd8a) \/home\/anton\/development\/dart-sdk-upstream\/sdk\/runtime\/tests\/vm\/dart\/fiber\/fiber_stress.exe exit <\/code><\/pre>\n<p>\u0412\u044b \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0435, \u0447\u0442\u043e \u044f \u043e\u0449\u0443\u0442\u0438\u043b \u0432 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0435\u0449\u0451 \u0440\u0430\u0437, \u043f\u043e\u0442\u043e\u043c \u0435\u0449\u0451 \u0438 \u0435\u0449\u0451. \u041d\u0435 \u043f\u0430\u0434\u0430\u0435\u0442!<\/p>\n<blockquote>\n<p>\u0423\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0439 \u0427\u0438\u0442\u0430\u0442\u0435\u043b\u044c, \u0435\u0441\u043b\u0438 \u0442\u044b \u043f\u043e\u0439\u0434\u0435\u0448\u044c \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c, \u0438 \u043e\u043d \u0443 \u0442\u0435\u0431\u044f \u0443\u043f\u0430\u0434\u0435\u0442, &#8212; \u043d\u0435 \u0440\u0430\u0441\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0439 \u0443\u0441\u0442\u0430\u0432\u0448\u0435\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u044f \u0445\u043e\u0447\u0443 \u0441\u043f\u0430\u0442\u044c \u044d\u0442\u043e\u0439 \u043d\u043e\u0447\u044c\u044e !<\/p>\n<\/blockquote>\n<p>\u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u0440\u0430\u0434 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u0441\u043b\u043e\u043c\u0430\u0442\u044c \u0442\u0435\u043c \u0436\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043b\u043e\u043c\u0430\u043b\u043e\u0441\u044c \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430.<\/p>\n<p>\u041d\u0435 \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u044f \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0432\u0435\u0440\u0438\u043b \u0432 \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e \u0434\u0435\u0440\u0436\u0438\u0442\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043c\u0430\u043d\u0443\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043c\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u0410 \u043d\u0430\u043c \u043f\u043e\u0440\u0430 \u0437\u0430\u043a\u0440\u0443\u0433\u043b\u044f\u0442\u044c\u0441\u044f. <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/d5e\/f78\/91f\/d5ef7891fa1adfd3d0c8684a184e80bd.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/d5e\/f78\/91f\/d5ef7891fa1adfd3d0c8684a184e80bd.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/d5e\/f78\/91f\/d5ef7891fa1adfd3d0c8684a184e80bd.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h2>\u0428\u0430\u0433 12. \u0424\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435<\/h2>\n<p>\u0420\u0435\u0448\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u0435\u0440\u043d\u0443\u043b\u0430\u0441\u044c \u043a 100%. \u042f \u0441\u043d\u043e\u0432\u0430 \u0441\u0442\u0430\u043b \u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043c\u043e\u0433\u0443 \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0434\u043e \u043a\u043e\u043d\u0446\u0430.<\/p>\n<p>\u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c, \u0447\u0442\u043e \u044f \u043f\u043e\u0447\u0438\u043d\u0438\u043b \u0432\u0441\u0435 \u0431\u0430\u0433\u0438. \u042f \u0434\u0430\u0436\u0435 \u043d\u0435 \u0431\u0443\u0434\u0443 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c, \u0447\u0442\u043e GC \u0441 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>\u041d\u043e \u044f \u0443\u0441\u043f\u043e\u043a\u043e\u0438\u043b\u0441\u044f. \u0422\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442, \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0433\u0440\u0443\u0437\u0430 \u043d\u0435\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u043b\u0430 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u0442.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0448\u0430\u0433 \u0432\u043b\u0435\u0432\u043e, \u0448\u0430\u0433 \u0432\u043f\u0440\u0430\u0432\u043e \u0438 \u044f (\u0438\u043b\u0438 \u0442\u044b! \u0434\u0430\u0432\u0430\u0439, \u043d\u0430\u0439\u0434\u0438 \u0431\u0430\u0433, \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u044c \u043c\u043e\u0439 \u0441\u043e\u043d \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e) \u0441\u043d\u043e\u0432\u0430 \u043d\u0430\u0439\u0434\u0443 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0431\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u043d\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0435 \u0432\u043e\u0432\u043b\u0435\u043a\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u041f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 &#8212; \u043f\u043e\u0439\u0434\u0443 \u0438\u0441\u043a\u0430\u0442\u044c \u0431\u0430\u0433\u0438 \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u0442\u0440\u0435\u0441\u0441 \u0442\u0435\u0441\u0442\u044b \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u043f\u043e\u0434\u0440\u044f\u0434.<\/p>\n<p>\u041d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435. \u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430, \u0432 <a href=\"https:\/\/habr.com\/ru\/articles\/913730\/\" rel=\"noopener noreferrer nofollow\">\u0444\u0438\u043d\u0430\u043b\u0435<\/a> \u044f \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e \u0441\u043c\u044b\u0441\u043b \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0435\u0439 \u0438 \u043f\u043e\u0434\u0432\u043e\u0436\u0443 \u0447\u0435\u0440\u0442\u0443 \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u043e\u0432\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 !<\/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\/913728\/\"> https:\/\/habr.com\/ru\/articles\/913728\/<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<blockquote>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0432\u0430\u0441, \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432\u0430\u043c \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 <a href=\"https:\/\/habr.com\/ru\/articles\/913726\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e<\/a> \u043c\u043e\u0435\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u0442\u0435\u0439.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u044f \u043f\u0438\u0448\u0443 \u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0435, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430, \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430\u0445 \u0438 Dart.<\/p>\n<p>\u0412\u0441\u0435 \u0447\u0430\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/913726\/\" rel=\"noopener noreferrer nofollow\">\u0427\u0430\u0441\u0442\u044c 1: \u041e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u0438: \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/913728\/\" rel=\"noopener noreferrer nofollow\">\u0427\u0430\u0441\u0442\u044c 2: \u041e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u0438: \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u043e\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0431\u0435\u0434\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/913730\/\" rel=\"noopener noreferrer nofollow\">\u0427\u0430\u0441\u0442\u044c 3: \u041e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u0438: \u0444\u0438\u043d\u0430\u043b<\/a><\/p>\n<\/li>\n<\/ul>\n<\/blockquote>\n<h2>\u041e\u0431 \u0430\u0432\u0442\u043e\u0440\u0435<\/h2>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043d\u0442\u043e\u043d, \u0438 \u044f \u2014 \u0447\u0430\u0439\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442-\u0434\u0430\u043e\u0441.<br \/> \u042f 10 \u043b\u0435\u0442 \u043f\u0438\u0448\u0443 \u043a\u043e\u0434 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445, \u0443\u0432\u043b\u0435\u043a\u0430\u044e\u0441\u044c \u0434\u0430\u043e\u0441\u0438\u0437\u043c\u043e\u043c, \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u043c \u0447\u0430\u0435\u043c \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b\u0445 (\u043a\u0440\u043e\u043c\u0435 \u043c\u0435\u043d\u044f) \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u043e\u0432.<br \/> \u0427\u0443\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431\u043e \u043c\u043d\u0435 <a href=\"https:\/\/habr.com\/ru\/articles\/913726\/\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<h2>\u0428\u0430\u0433 1. \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c Dart VM.<\/h2>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439. Dart SDK \u0432\u0435\u0441\u0438\u0442 \u043c\u043d\u043e\u0433\u043e.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0436\u0435 \u043c\u0435\u0441\u0442\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 3D-\u0438\u0433\u0440\u044b \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0430\u0441\u0441\u0435\u0442\u0430\u043c\u0438.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0438 \u0441\u0431\u043e\u0440\u043a\u0435.<\/p>\n<p>\u041a\u0430\u043a \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u044f \u0440\u0435\u0448\u0438\u043b: &#171;\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f? \u0414\u0430 \u043d\u0443, \u044f \u0436\u0435 \u0437\u043d\u0430\u044e \u0432\u0441\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0431\u043e\u0440\u043a\u0438!&#187;<\/p>\n<p>\u0421\u043f\u043e\u0439\u043b\u0435\u0440: \u043d\u0435 \u0437\u043d\u0430\u043b.<\/p>\n<pre><code class=\"bash\">10:45:20 anton@anton-lin arch-x86_64 ~\/development\/laboratory\/dart main (\ud83e\udd8a) make make: *** No targets specified and no makefile found.  Stop. 10:45:21 anton@anton-lin arch-x86_64 ~\/development\/laboratory\/dart main (\ud83e\udd8a) cmake . CMake Warning: Ignoring extra path from command line: \".\" CMake Error: The source directory \"\/home\/anton\/development\/laboratory\/dart\" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. 10:45:24 anton@anton-lin arch-x86_64 ~\/development\/laboratory\/dart main (\ud83e\udd8a) ninja ninja: error: loading 'build.ninja': No such file or directory 10:45:31 anton@anton-lin arch-x86_64 ~\/development\/laboratory\/dart main (\ud83e\udd8a) .\/configure bash: .\/configure: No such file or directory 10:45:36 anton@anton-lin arch-x86_64 ~\/development\/laboratory\/dart main (\ud83e\udd8a) .\/gradlew bash: .\/gradlew: No such file or directory 10:46:06 anton@anton-lin arch-x86_64 ~\/development\/laboratory\/dart main (\ud83e\udd8a) .\/build.sh bash: .\/build.sh: No such file or directory 10:46:10 anton@anton-lin arch-x86_64 ~\/development\/laboratory\/dart main (\ud83e\udd8a)  <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0444\u043e\u0440\u043c\u0430\u043d\u0441\u0430 \u044f \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u043b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e.<\/p>\n<p>\u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u044f\u0437\u044b\u043a, \u043d\u0443\u0436\u0435\u043d \u0434\u0440\u0443\u0433\u043e\u0439:<\/p>\n<blockquote>\n<p>Dart SDK requires Python 3 to build.<\/p>\n<\/blockquote>\n<p>\u0417\u0430\u0431\u0430\u0432\u043d\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 JVM, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0443\u0436\u0435\u043d C++ \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u043d\u043e \u0432\u043e\u0442 Dart \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0435\u0449\u0451 \u0438 Python.<\/p>\n<p>\u0425\u043e\u0442\u044f, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0438 JVM \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 Python \u2014 \u0434\u0430\u0432\u043d\u043e \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b.<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0441\u0451. \u041f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435.<\/p>\n<blockquote>\n<p>Install Chromium&#8217;s <a href=\"https:\/\/commondatastorage.googleapis.com\/chrome-infra-docs\/flat\/depot_tools\/docs\/html\/depot_tools_tutorial.html#_setting_up\" rel=\"noopener noreferrer nofollow\">depot tools<\/a>:<\/p>\n<\/blockquote>\n<p>\u0418 \u0432\u043e\u0442 \u043e\u043d\u0430, \u0440\u0430\u0437\u0433\u0430\u0434\u043a\u0430 \u2014 \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u044b Python \u0438 Chromium depot tools. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, Dart \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Google-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0431\u043e\u0440\u043a\u0438 GN (\u0434\u0430-\u0434\u0430, \u0442\u0443 \u0441\u0430\u043c\u0443\u044e, \u0447\u0442\u043e \u0438 \u0432 Chromium).<\/p>\n<blockquote>\n<p>Dart SDK uses <code>gclient<\/code> to manage dependencies which are described in the <code>DEPS<\/code> file. If you switch branches or update <code>sdk<\/code> checkout you need to run <code>gclient sync<\/code> to bring dependencies in sync with the SDK version.<\/p>\n<\/blockquote>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u043a\u044d\u043f. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u044f\u0441\u043d\u043e.<\/p>\n<blockquote>\n<p><strong>IMPORTANT: You must follow instructions for <\/strong><a href=\"#source\" rel=\"noopener noreferrer nofollow\"><strong>Getting the source<\/strong><\/a><strong> before attempting to build. Just cloning a GitHub repo or downloading and unpacking a ZIP of the SDK repository would not work.<\/strong><\/p>\n<\/blockquote>\n<p>\u0422\u0430\u043a, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u043b\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c? \u0422\u0430\u043a \u0432\u043e\u0442, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c ! \u0410 \u044f \u0432\u0441\u0435 <code>make<\/code> \u0434\u0430 <code>ninja<\/code>&#8230;<\/p>\n<blockquote>\n<p>.\/tools\/build.py &#8212;mode release &#8212;arch x64 create_sdk<\/p>\n<\/blockquote>\n<blockquote>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0440\u0435\u043c\u0430\u0440\u043a\u0430, \u0432\u043e\u0442 \u0441\u0442\u0430\u0442\u044b \u043c\u043e\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u043b \u0438 \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0438\u0440\u0430\u043b Dart \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437:<\/p>\n<p>OS: Arch Linux x86_64<br \/> Host: ASUSTeK COMPUTER INC. ROG STRIX B650E-I GAMING WIFI<br \/> Kernel: 6.14.0-3-cachyos<br \/> Uptime: 1 hour, 2 mins<br \/> Packages: 1279 (pacman)<br \/> Shell: bash 5.2.37<br \/> Resolution: 3840&#215;2160, 3840&#215;2160, 3840&#215;2160<br \/> WM: Hyprland<br \/> Theme: Colloid-Dark [GTK2\/3]<br \/> Icons: Colloid-Dark [GTK2\/3]<br \/> Terminal: kitty<br \/> Terminal Font: CaskaydiaCove Nerd Font Mono 15.0<br \/> CPU: AMD Ryzen 9 7950X3D (32) @ 5.763GHz<br \/> GPU: AMD ATI Raphael<br \/> GPU: NVIDIA GeForce RTX 4090<br \/> Memory: 15602MiB \/ 63425MiB<br \/> \u041d\u0435 \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b.<\/p>\n<\/blockquote>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u043f\u043e\u043b\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0443 \u0432 Release \u0440\u0435\u0436\u0438\u043c\u0435: <\/p>\n<figure class=\"\"><\/figure>\n<p>\u0410 \u0432\u043e\u0442 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0445\u043e\u0434\u0438\u043b\u043e \u043d\u0430 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0443 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 C++ header \u0444\u0430\u0439\u043b\u0435 \u0432 debug \u0440\u0435\u0436\u0438\u043c\u0435: <\/p>\n<figure class=\"\"><\/figure>\n<p>\u041f\u043e\u0447\u0442\u0438 10 \u043c\u0438\u043d\u0443\u0442 \u0436\u0434\u0438, \u0435\u0441\u043b\u0438 \u0442\u044b \u0432 debug \u0440\u0435\u0436\u0438\u043c\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0448\u044c \u0447\u0442\u043e-\u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u0445 \u0432 Dart VM C++ \u043a\u043e\u0434\u0435.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u043b\u044c\u0448\u0435 \u043f\u043e \u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0447\u0442\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438 Dart \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u044f (\u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e). \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, debug Dart \u0434\u043e\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0430\u043c \u0441\u0435\u0431\u044f \u0447\u0435\u043c release Dart.<\/p>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0430 Dart. \u041f\u0440\u043e\u0441\u0442\u0438 \u043c\u0435\u043d\u044f, \u043c\u043e\u0439 \u0432\u0435\u0440\u043d\u044b\u0439 Ryzen: <\/p>\n<figure class=\"\"><\/figure>\n<h2>\u0428\u0430\u0433 2. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 Dart VM<\/h2>\n<p>\u0425\u043e\u0447\u0443 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c: \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u0438 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b\u043c, \u043d\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0448\u0430\u0433 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0432\u044b\u044f\u0441\u043d\u044f\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043f\u0440\u043e\u0431 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0432 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u0435 \u0437\u0434\u043e\u0440\u043e\u0432\u043e \u043f\u043e\u043c\u043e\u0433\u043b\u0438 &#8212; \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u043b \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0448\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>dart:fibers<\/code> \u0432\u043e \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u043a\u043e\u0434\u0430.<\/p>\n<h3>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0432 Dart SDK<\/h3>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 <code>sdk\/lib<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 <code>fiber<\/code><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0444\u0430\u0439\u043b \u0441\u0431\u043e\u0440\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c <code>fiber_sources.gni<\/code><\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">fiber_sdk_sources = [   \"fiber.dart\", ] <\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438: <\/p>\n<ul>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c <code>fiber.dart<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e:<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<pre><code class=\"dart\">library dart.fiber; \/\/ \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f  class Fiber { } <\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 core:<\/p>\n<ul>\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c <code>sdk\/lib\/core\/core.dart<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u043a\u0441\u043f\u043e\u0440\u0442: <code>export \"dart:fiber\" show Fiber;<\/code><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u044b:<\/p>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 <code>runtime\/tests\/vm\/dart<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 <code>fiber<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c <code>fiber_test.dart<\/code> \u0441 \u0442\u0435\u0441\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Fiber<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u043c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0431\u043e\u0440\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c <code>runtime\/vm\/BUILD.gn<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u044b:<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">import(\"..\/..\/sdk\/lib\/fiber\/fiber_sources.gni\") import(\"..\/lib\/fiber_sources.gni\") <\/code><\/pre>\n<ul>\n<li>\n<p>\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u0430\u0439\u043b\u044b \u0432 \u0441\u0431\u043e\u0440\u043a\u0443: <code>+ fiber_runtime_cc_files<\/code> \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <code>allsources = ...<\/code><\/p>\n<\/li>\n<\/ul>\n<ol start=\"7\">\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e SDK:<\/p>\n<ul>\n<li>\n<p>\u0412 <code>sdk\/BUILD.gn<\/code> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c <code>\"fiber\"<\/code> \u0432 <code>_fiber_runtime_cc_files<\/code><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c <code>sdk\/lib\/_internal\/sdk_library_metadata\/lib\/libraries.dart<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u0435\u043a\u0446\u0438\u044e <code>const Map&lt;String, LibraryInfo&gt; libraries<\/code> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<pre><code class=\"dart\">'fiber': const LibraryInfo(   'fiber\/fiber.dart',   categories: 'Client,Server,Embedded',   maturity: Maturity.STABLE,   dart2jsPatchPath: '_internal\/js_runtime\/lib\/fiber_patch.dart', ), <\/code><\/pre>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 dart2jsPatchPath \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/p>\n<\/blockquote>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0448\u0430\u0433\u043e\u0432 Dart \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u043e\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0443 VSCode Dart \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442, \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u0447\u0435\u0437\u0430\u044e\u0442 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0432\u0435\u043d\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u044d\u0442\u0430 \u0441\u0445\u0435\u043c\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u0434\u043e\u0447\u0451\u0442\u044b \u2014 \u043d\u0435 \u0441\u0443\u0434\u0438\u0442\u0435 \u0441\u0442\u0440\u043e\u0433\u043e.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 Dart SDK \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0430\u0443\u0437\u0443 \u0438 \u0437\u0430\u0434\u0443\u043c\u0430\u0435\u043c\u0441\u044f \u043d\u0430\u0434 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c: \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 Dart SDK \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u0440\u0443\u0442\u0438\u043d?<\/p>\n<p>\u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0434\u0445\u043e\u0434 <a href=\"https:\/\/habr.com\/ru\/articles\/850970\/\" rel=\"noopener noreferrer nofollow\">stackless<\/a> \u043a\u043e\u0440\u0443\u0442\u0438\u043d, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439.<\/p>\n<p>\u041d\u043e \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0443\u0442\u044c \u2014 stackfull \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0441 \u0436\u0451\u0441\u0442\u043a\u0438\u043c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Dart ASM. \u041f\u043e\u0447\u0435\u043c\u0443? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e stackless-\u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0432 Dart \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u2014 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0435 Future \u0441 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u043c async-await.<\/p>\n<p>\u0420\u0430\u0437 \u0443\u0436 \u044f \u043f\u043e\u0448\u0451\u043b \u044d\u0442\u0438\u043c \u043f\u0443\u0442\u0451\u043c, \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0440\u0435\u0448\u0438\u0442\u044c \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443: \u043d\u0430\u0443\u0447\u0438\u0442\u044c Dart \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u0435\u043a\u0430\u043c\u0438 \u043a\u043e\u0440\u0443\u0442\u0438\u043d. \u0410 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 Dart VM.<\/p>\n<h3>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0432 Dart VM<\/h3>\n<ol>\n<li>\n<p><strong>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/strong><br \/> \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c <code>runtime\/vm\/symbols.h<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 <code>V(DartFiber, \"dart:fiber\")<\/code>. \u042d\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442.<\/p>\n<\/li>\n<li>\n<p><strong>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 ObjectStore<\/strong><br \/> \u0412 <code>runtime\/vm\/object_store.h<\/code> \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c:<\/p>\n<ul>\n<li>\n<p><code>M(Fiber, fiber)<\/code> \u2014 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0442\u0438\u043f\u0430 Fiber<\/p>\n<\/li>\n<li>\n<p><code>RW(Library, fiber_library)<\/code> \u2014 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/p>\n<\/li>\n<\/ul>\n<p>ObjectStore \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u0440\u043e\u043b\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0435\u0441\u0442\u0440\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043a \u0433\u0440\u0443\u043f\u043f\u0435 <a href=\"https:\/\/habr.com\/ru\/articles\/848166\/\" rel=\"noopener noreferrer nofollow\">\u0438\u0437\u043e\u043b\u044f\u0442<\/a>.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a<\/strong><br \/> \u0412 <code>runtime\/vm\/object.h<\/code> (\u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0435\u0433\u043e \u0432\u043d\u0443\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 13595 \u0441\u0442\u0440\u043e\u043a) \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">static LibraryPtr FiberLibrary(); <\/code><\/pre>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/strong><br \/> \u0412 <code>runtime\/vm\/object.cc<\/code> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<pre><code class=\"cpp\">lib = Library::LookupLibrary(thread, Symbols::DartFiber()); if (lib.IsNull()) {     lib = Library::NewLibraryHelper(Symbols::DartFiber(), true);     lib.SetLoadRequested();     lib.Register(thread); } object_store-&gt;set_bootstrap_library(ObjectStore::kFiber, lib); ASSERT(!lib.IsNull()); ASSERT(lib.ptr() == Library::FiberLibrary()); <\/code><\/pre>\n<\/li>\n<li>\n<p><strong>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Native-\u0432\u044b\u0437\u043e\u0432\u043e\u0432<\/strong><br \/> \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440\u044b \u0434\u043b\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<pre><code class=\"cpp\">library = Library::FiberLibrary(); ASSERT(!library.IsNull()); library.set_native_entry_resolver(resolver); library.set_native_entry_symbol_resolver(symbol_resolver); <\/code><\/pre>\n<\/li>\n<\/ol>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u0442\u043e\u0439 \u0436\u0435 \u043b\u043e\u0433\u0438\u043a\u0435 \u2014 \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p><strong>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0448\u0442\u0440\u0438\u0445: \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u0438<\/strong><br \/> \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043a\u043e\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u0447\u0430\u0441\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <code>@patch<\/code>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u043c patch-\u0444\u0430\u0439\u043b\u044b \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 Dart:<\/p>\n<ul>\n<li>\n<p>VM: <code>sdk\/lib\/_internal\/vm\/lib\/fiber_patch.dart<\/code><\/p>\n<\/li>\n<li>\n<p>WASM: <code>sdk\/lib\/_internal\/wasm\/lib\/fiber_patch.dart<\/code><\/p>\n<\/li>\n<li>\n<p>js_runtime: <code>sdk\/lib\/_internal\/js_runtime\/lib\/fiber_patch.dart<\/code><\/p>\n<\/li>\n<li>\n<p>js_dev_runtime: <code>sdk\/lib\/_internal\/js_dev_runtime\/lib\/fiber_patch.dart<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e Fiber API.<\/p>\n<h2>\u0428\u0430\u0433 3. \u041c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u043c API<\/h2>\n<p>\u041c\u044b \u043f\u043e\u0434\u043e\u0448\u043b\u0438 \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443 \u044d\u0442\u0430\u043f\u0443 \u2014 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e Fiber API. \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 Dart SDK \u0438 VM \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u044b, \u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0442\u044c \u0432\u043e\u043b\u044e \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u043e\u0439 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0438.<\/p>\n<pre><code class=\"dart\">class Fiber { \/\/ \u041f\u043e \u0444\u0430\u043a\u0442\u0443 \u0431\u0443\u0434\u0435\u0442 extension type, \u043d\u043e \u044d\u0442\u043e \u0434\u0435\u0442\u0430\u043b\u0438   \/\/ \u041a\u0430\u043a\u0438\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 Fiber API?    \/\/ \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 - \u0437\u0430\u043f\u0443\u0441\u043a \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e (\u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e) Fiber   static Fiber launch(void Function() entry, { int size = _kDefaultStackSize, Object? argument}) \/\/ size \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0442\u0435\u043a \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b    \/\/ \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u043a\u043e\u0440\u0443\u0442\u0438\u043d   static Fiber spawn(void Function() entry, {      bool persistent = false, \/\/ \u0444\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f     int size = _kDefaultStackSize,      String? name,      Object? argument   })    \/\/ \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c   static void suspend() \/\/ \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 Fiber, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c caller'\u0443   static void schedule(Fiber fiber) \/\/ \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e Fiber   static void reschedule() \/\/<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-461343","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/461343","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=461343"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/461343\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=461343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=461343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=461343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}