GeezerVison is showing github.com — fs: move fs_use_promises_symbol to per-isolate symbols · nodejs/node@edf46c1
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 |
|---|
@@ -330,6 +330,11 @@ void IsolateData::DeserializeProperties(const IsolateDataSerializeInfo* info) { | 330 | 330 | size_t i = 0; | 331 | 331 | HandleScope handle_scope(isolate_); | 332 | 332 |
| | 333 | + if (per_process::enabled_debug_list.enabled(DebugCategory::MKSNAPSHOT)) { | | 334 | + fprintf(stderr, "deserializing IsolateDataSerializeInfo...\n"); | | 335 | + std::cerr << *info << "\n"; | | 336 | + } | | 337 | + | 333 | 338 | #define VP(PropertyName, StringValue) V(Private, PropertyName) | 334 | 339 | #define VY(PropertyName, StringValue) V(Symbol, PropertyName) | 335 | 340 | #define VS(PropertyName, StringValue) V(String, PropertyName) | @@ -1648,6 +1653,11 @@ void Environment::RunDeserializeRequests() { | 1648 | 1653 | void Environment::DeserializeProperties(const EnvSerializeInfo* info) { | 1649 | 1654 | Local<Context> ctx = context(); | 1650 | 1655 |
| | 1656 | + if (enabled_debug_list_.enabled(DebugCategory::MKSNAPSHOT)) { | | 1657 | + fprintf(stderr, "deserializing EnvSerializeInfo...\n"); | | 1658 | + std::cerr << *info << "\n"; | | 1659 | + } | | 1660 | + | 1651 | 1661 | RunDeserializeRequests(); | 1652 | 1662 |
| 1653 | 1663 | builtins_in_snapshot = info->builtins; | @@ -1661,11 +1671,6 @@ void Environment::DeserializeProperties(const EnvSerializeInfo* info) { | 1661 | 1671 | should_abort_on_uncaught_toggle_.Deserialize(ctx); | 1662 | 1672 |
| 1663 | 1673 | principal_realm_->DeserializeProperties(&info->principal_realm); | 1664 | | - | 1665 | | - if (enabled_debug_list_.enabled(DebugCategory::MKSNAPSHOT)) { | 1666 | | - fprintf(stderr, "deserializing...\n"); | 1667 | | - std::cerr << *info << "\n"; | 1668 | | - } | 1669 | 1674 | } | 1670 | 1675 |
| 1671 | 1676 | 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") \ | | 386 | 387 | V(domexception_function, v8::Function) \ | 387 | 388 | V(enhance_fatal_stack_after_inspector, v8::Function) \ | 388 | 389 | V(enhance_fatal_stack_before_inspector, v8::Function) \ | 389 | | - V(fs_use_promises_symbol, v8::Symbol) \ | 390 | 390 | V(get_source_map_error_source, v8::Function) \ | 391 | 391 | V(host_import_module_dynamically_callback, v8::Function) \ | 392 | 392 | V(host_initialize_import_meta_object_callback, v8::Function) \ | |
Collapse file Copy file name to clipboardExpand all lines: src/node_file.cc +1-6Lines changed: 1 addition & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -70,7 +70,6 @@ using v8::Object; | 70 | 70 | using v8::ObjectTemplate; | 71 | 71 | using v8::Promise; | 72 | 72 | using v8::String; | 73 | | -using v8::Symbol; | 74 | 73 | using v8::Undefined; | 75 | 74 | using v8::Value; | 76 | 75 |
| @@ -2792,13 +2791,9 @@ void Initialize(Local<Object> target, | 2792 | 2791 | fdcloset->SetInternalFieldCount(FSReqBase::kInternalFieldCount); | 2793 | 2792 | env->set_fdclose_constructor_template(fdcloset); | 2794 | 2793 |
| 2795 | | - Local<Symbol> use_promises_symbol = | 2796 | | - Symbol::New(isolate, | 2797 | | - FIXED_ONE_BYTE_STRING(isolate, "use promises")); | 2798 | | - env->set_fs_use_promises_symbol(use_promises_symbol); | 2799 | 2794 | target->Set(context, | 2800 | 2795 | FIXED_ONE_BYTE_STRING(isolate, "kUsePromises"), | 2801 | | - use_promises_symbol).Check(); | | 2796 | + env->fs_use_promises_symbol()).Check(); | 2802 | 2797 | } | 2803 | 2798 |
| 2804 | 2799 | BindingData* FSReqBase::binding_data() { | |
|