diff options
author | Gus Caplan <me@gus.host> | 2018-08-17 17:26:34 -0500 |
---|---|---|
committer | Gus Caplan <me@gus.host> | 2018-10-06 17:33:25 -0500 |
commit | 4c37df779cf944b5666fc72e2a27fbf2e745881f (patch) | |
tree | 80d135f6cbd7cd9545bee950c280659985c276b8 /src/env.h | |
parent | 124a8e21238f8452028614625fe491b3049f7244 (diff) | |
download | android-node-v8-4c37df779cf944b5666fc72e2a27fbf2e745881f.tar.gz android-node-v8-4c37df779cf944b5666fc72e2a27fbf2e745881f.tar.bz2 android-node-v8-4c37df779cf944b5666fc72e2a27fbf2e745881f.zip |
vm: add dynamic import support
PR-URL: https://github.com/nodejs/node/pull/22381
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Diffstat (limited to 'src/env.h')
-rw-r--r-- | src/env.h | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -47,6 +47,10 @@ struct nghttp2_rcbuf; namespace node { +namespace contextify { +class ContextifyScript; +} + namespace fs { class FileHandleReadWrap; } @@ -674,7 +678,13 @@ class Environment { // List of id's that have been destroyed and need the destroy() cb called. inline std::vector<double>* destroy_async_id_list(); - std::unordered_multimap<int, loader::ModuleWrap*> module_map; + std::unordered_multimap<int, loader::ModuleWrap*> hash_to_module_map; + std::unordered_map<uint32_t, loader::ModuleWrap*> id_to_module_map; + std::unordered_map<uint32_t, contextify::ContextifyScript*> + id_to_script_map; + + inline uint32_t get_next_module_id(); + inline uint32_t get_next_script_id(); std::unordered_map<std::string, const loader::PackageConfig> package_json_cache; @@ -924,6 +934,9 @@ class Environment { std::shared_ptr<EnvironmentOptions> options_; + uint32_t module_id_counter_ = 0; + uint32_t script_id_counter_ = 0; + AliasedBuffer<uint32_t, v8::Uint32Array> should_abort_on_uncaught_toggle_; int should_not_abort_scope_counter_ = 0; |