GeezerVison is showing github.com — src: merge NativeModuleEnv into NativeModuleLoader · nodejs/node@9f9d00c
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: node.gyp -2Lines changed: 0 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 516 | 516 | 'src/node_messaging.cc', | 517 | 517 | 'src/node_metadata.cc', | 518 | 518 | 'src/node_native_module.cc', | 519 | | - 'src/node_native_module_env.cc', | 520 | 519 | 'src/node_options.cc', | 521 | 520 | 'src/node_os.cc', | 522 | 521 | 'src/node_perf.cc', | | 621 | 620 | 'src/node_metadata.h', | 622 | 621 | 'src/node_mutex.h', | 623 | 622 | 'src/node_native_module.h', | 624 | | - 'src/node_native_module_env.h', | 625 | 623 | 'src/node_object_wrap.h', | 626 | 624 | 'src/node_options.h', | 627 | 625 | 'src/node_options-inl.h', | |
Collapse file Copy file name to clipboardExpand all lines: src/api/environment.cc +4-5Lines changed: 4 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 | #include "node_context_data.h" | 3 | 3 | #include "node_errors.h" | 4 | 4 | #include "node_internals.h" | 5 | | -#include "node_native_module_env.h" | | 5 | +#include "node_native_module.h" | 6 | 6 | #include "node_options-inl.h" | 7 | 7 | #include "node_platform.h" | 8 | 8 | #include "node_v8_platform-inl.h" | @@ -442,9 +442,8 @@ MaybeLocal<Value> LoadEnvironment( | 442 | 442 |
| 443 | 443 | // TODO(addaleax): Avoid having a global table for all scripts. | 444 | 444 | std::string name = "embedder_main_" + std::to_string(env->thread_id()); | 445 | | - native_module::NativeModuleEnv::Add( | 446 | | - name.c_str(), | 447 | | - UnionBytes(**main_utf16, main_utf16->length())); | | 445 | + native_module::NativeModuleLoader::Add( | | 446 | + name.c_str(), UnionBytes(**main_utf16, main_utf16->length())); | 448 | 447 | env->set_main_utf16(std::move(main_utf16)); | 449 | 448 | std::vector<Local<String>> params = { | 450 | 449 | env->process_string(), | @@ -698,7 +697,7 @@ Maybe<bool> InitializePrimordials(Local<Context> context) { | 698 | 697 | global_string, exports_string, primordials_string}; | 699 | 698 | Local<Value> arguments[] = {context->Global(), exports, primordials}; | 700 | 699 | MaybeLocal<Function> maybe_fn = | 701 | | - native_module::NativeModuleEnv::LookupAndCompile( | | 700 | + native_module::NativeModuleLoader::LookupAndCompile( | 702 | 701 | context, *module, ¶meters, nullptr); | 703 | 702 | Local<Function> fn; | 704 | 703 | if (!maybe_fn.ToLocal(&fn)) { | |
Collapse file Copy file name to clipboardExpand all lines: src/node.cc +4-5Lines changed: 4 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 32 | 32 | #include "node_internals.h" | 33 | 33 | #include "node_main_instance.h" | 34 | 34 | #include "node_metadata.h" | 35 | | -#include "node_native_module_env.h" | | 35 | +#include "node_native_module.h" | 36 | 36 | #include "node_options-inl.h" | 37 | 37 | #include "node_perf.h" | 38 | 38 | #include "node_process-inl.h" | | 125 | 125 |
| 126 | 126 | namespace node { | 127 | 127 |
| 128 | | -using native_module::NativeModuleEnv; | | 128 | +using native_module::NativeModuleLoader; | 129 | 129 |
| 130 | 130 | using v8::EscapableHandleScope; | 131 | 131 | using v8::Function; | @@ -178,7 +178,7 @@ MaybeLocal<Value> ExecuteBootstrapper(Environment* env, | 178 | 178 | std::vector<Local<Value>>* arguments) { | 179 | 179 | EscapableHandleScope scope(env->isolate()); | 180 | 180 | MaybeLocal<Function> maybe_fn = | 181 | | - NativeModuleEnv::LookupAndCompile(env->context(), id, parameters, env); | | 181 | + NativeModuleLoader::LookupAndCompile(env->context(), id, parameters, env); | 182 | 182 |
| 183 | 183 | Local<Function> fn; | 184 | 184 | if (!maybe_fn.ToLocal(&fn)) { | @@ -1196,8 +1196,7 @@ int Start(int argc, char** argv) { | 1196 | 1196 | uv_loop_configure(uv_default_loop(), UV_METRICS_IDLE_TIME); | 1197 | 1197 |
| 1198 | 1198 | if (snapshot_data != nullptr) { | 1199 | | - native_module::NativeModuleEnv::RefreshCodeCache( | 1200 | | - snapshot_data->code_cache); | | 1199 | + NativeModuleLoader::RefreshCodeCache(snapshot_data->code_cache); | 1201 | 1200 | } | 1202 | 1201 | NodeMainInstance main_instance(snapshot_data, | 1203 | 1202 | uv_default_loop(), | |
Collapse file Copy file name to clipboardExpand all lines: src/node_binding.cc +4-3Lines changed: 4 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 3 | 3 | #include "env-inl.h" | 4 | 4 | #include "node_errors.h" | 5 | 5 | #include "node_external_reference.h" | 6 | | -#include "node_native_module_env.h" | | 6 | +#include "node_native_module.h" | 7 | 7 | #include "util.h" | 8 | 8 |
| 9 | 9 | #include <string> | @@ -598,13 +598,14 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) { | 598 | 598 | exports->SetPrototype(env->context(), Null(env->isolate())).FromJust()); | 599 | 599 | DefineConstants(env->isolate(), exports); | 600 | 600 | } else if (!strcmp(*module_v, "natives")) { | 601 | | - exports = native_module::NativeModuleEnv::GetSourceObject(env->context()); | | 601 | + exports = | | 602 | + native_module::NativeModuleLoader::GetSourceObject(env->context()); | 602 | 603 | // Legacy feature: process.binding('natives').config contains stringified | 603 | 604 | // config.gypi | 604 | 605 | CHECK(exports | 605 | 606 | ->Set(env->context(), | 606 | 607 | env->config_string(), | 607 | | - native_module::NativeModuleEnv::GetConfigString( | | 608 | + native_module::NativeModuleLoader::GetConfigString( | 608 | 609 | env->isolate())) | 609 | 610 | .FromJust()); | 610 | 611 | } else { | |
Collapse file Copy file name to clipboardExpand all lines: src/node_config.cc +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 | #include "memory_tracker.h" | 3 | 3 | #include "node.h" | 4 | 4 | #include "node_i18n.h" | 5 | | -#include "node_native_module_env.h" | | 5 | +#include "node_native_module.h" | 6 | 6 | #include "node_options.h" | 7 | 7 | #include "util-inl.h" | 8 | 8 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/node_main_instance.cc +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 6 | 6 | #include "debug_utils-inl.h" | 7 | 7 | #include "node_external_reference.h" | 8 | 8 | #include "node_internals.h" | 9 | | -#include "node_native_module_env.h" | | 9 | +#include "node_native_module.h" | 10 | 10 | #include "node_options-inl.h" | 11 | 11 | #include "node_snapshot_builder.h" | 12 | 12 | #include "node_snapshotable.h" | |
|