GeezerVison is showing github.com — fs: move fs_use_promises_symbol to per-isolate symbols · nodejs/node@a0da234
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: src/env.cc +10-5Lines changed: 10 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -347,6 +347,11 @@ void IsolateData::DeserializeProperties(const IsolateDataSerializeInfo* info) { | 347 | 347 | size_t i = 0; | 348 | 348 | HandleScope handle_scope(isolate_); | 349 | 349 |
| | 350 | + if (per_process::enabled_debug_list.enabled(DebugCategory::MKSNAPSHOT)) { | | 351 | + fprintf(stderr, "deserializing IsolateDataSerializeInfo...\n"); | | 352 | + std::cerr << *info << "\n"; | | 353 | + } | | 354 | + | 350 | 355 | #define VP(PropertyName, StringValue) V(Private, PropertyName) | 351 | 356 | #define VY(PropertyName, StringValue) V(Symbol, PropertyName) | 352 | 357 | #define VS(PropertyName, StringValue) V(String, PropertyName) | @@ -1704,6 +1709,11 @@ void Environment::RunDeserializeRequests() { | 1704 | 1709 | void Environment::DeserializeProperties(const EnvSerializeInfo* info) { | 1705 | 1710 | Local<Context> ctx = context(); | 1706 | 1711 |
| | 1712 | + if (enabled_debug_list_.enabled(DebugCategory::MKSNAPSHOT)) { | | 1713 | + fprintf(stderr, "deserializing EnvSerializeInfo...\n"); | | 1714 | + std::cerr << *info << "\n"; | | 1715 | + } | | 1716 | + | 1707 | 1717 | RunDeserializeRequests(); | 1708 | 1718 |
| 1709 | 1719 | async_hooks_.Deserialize(ctx); | @@ -1716,11 +1726,6 @@ void Environment::DeserializeProperties(const EnvSerializeInfo* info) { | 1716 | 1726 | should_abort_on_uncaught_toggle_.Deserialize(ctx); | 1717 | 1727 |
| 1718 | 1728 | principal_realm_->DeserializeProperties(&info->principal_realm); | 1719 | | - | 1720 | | - if (enabled_debug_list_.enabled(DebugCategory::MKSNAPSHOT)) { | 1721 | | - fprintf(stderr, "deserializing...\n"); | 1722 | | - std::cerr << *info << "\n"; | 1723 | | - } | 1724 | 1729 | } | 1725 | 1730 |
| 1726 | 1731 | uint64_t GuessMemoryAvailableToTheProcess() { | |
Collapse file Copy file name to clipboardExpand all lines: src/env_properties.h +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 30 | 30 | // Symbols are per-isolate primitives but Environment proxies them | 31 | 31 | // for the sake of convenience. | 32 | 32 | #define PER_ISOLATE_SYMBOL_PROPERTIES(V) \ | | 33 | + V(fs_use_promises_symbol, "fs_use_promises_symbol") \ | 33 | 34 | V(async_id_symbol, "async_id_symbol") \ | 34 | 35 | V(handle_onclose_symbol, "handle_onclose") \ | 35 | 36 | V(no_message_symbol, "no_message_symbol") \ | | 390 | 391 | V(domexception_function, v8::Function) \ | 391 | 392 | V(enhance_fatal_stack_after_inspector, v8::Function) \ | 392 | 393 | V(enhance_fatal_stack_before_inspector, v8::Function) \ | 393 | | - V(fs_use_promises_symbol, v8::Symbol) \ | 394 | 394 | V(get_source_map_error_source, v8::Function) \ | 395 | 395 | V(host_import_module_dynamically_callback, v8::Function) \ | 396 | 396 | V(host_initialize_import_meta_object_callback, v8::Function) \ | |
Collapse file Copy file name to clipboardExpand all lines: src/node_file.cc +1-5Lines changed: 1 addition & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2939,13 +2939,9 @@ void Initialize(Local<Object> target, | 2939 | 2939 | fdcloset->SetInternalFieldCount(FSReqBase::kInternalFieldCount); | 2940 | 2940 | env->set_fdclose_constructor_template(fdcloset); | 2941 | 2941 |
| 2942 | | - Local<Symbol> use_promises_symbol = | 2943 | | - Symbol::New(isolate, | 2944 | | - FIXED_ONE_BYTE_STRING(isolate, "use promises")); | 2945 | | - env->set_fs_use_promises_symbol(use_promises_symbol); | 2946 | 2942 | target->Set(context, | 2947 | 2943 | FIXED_ONE_BYTE_STRING(isolate, "kUsePromises"), | 2948 | | - use_promises_symbol).Check(); | | 2944 | + env->fs_use_promises_symbol()).Check(); | 2949 | 2945 | } | 2950 | 2946 |
| 2951 | 2947 | BindingData* FSReqBase::binding_data() { | |
|