| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent eb4b932 commit fcc4bf9
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,7 +38,7 @@ | |||
| 38 | 38 | ||
| 39 | 39 | # Reset this number to 0 on major V8 upgrades. | |
| 40 | 40 | # Increment by one for each non-official patch applied to deps/v8. | |
| 41 | - 'v8_embedder_string': '-node.23', | ||
| 41 | + 'v8_embedder_string': '-node.24', | ||
| 42 | 42 | ||
| 43 | 43 | ##### V8 defaults for Node.js ##### | |
| 44 | 44 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3068,20 +3068,22 @@ Handle<SyntheticModule> Factory::NewSyntheticModule( | |||
| 3068 | 3068 | Handle<String> module_name, Handle<FixedArray> export_names, | |
| 3069 | 3069 | v8::Module::SyntheticModuleEvaluationSteps evaluation_steps) { | |
| 3070 | 3070 | ReadOnlyRoots roots(isolate()); | |
| 3071 | - Handle<SyntheticModule> module( | ||
| 3072 | - SyntheticModule::cast(New(synthetic_module_map(), AllocationType::kOld)), | ||
| 3073 | - isolate()); | ||
| 3071 | + | ||
| 3074 | 3072 | Handle<ObjectHashTable> exports = | |
| 3075 | 3073 | ObjectHashTable::New(isolate(), static_cast<int>(export_names->length())); | |
| 3076 | 3074 | Handle<Foreign> evaluation_steps_foreign = | |
| 3077 | 3075 | NewForeign(reinterpret_cast<i::Address>(evaluation_steps)); | |
| 3078 | - module->set_exports(*exports); | ||
| 3076 | + | ||
| 3077 | + Handle<SyntheticModule> module( | ||
| 3078 | + SyntheticModule::cast(New(synthetic_module_map(), AllocationType::kOld)), | ||
| 3079 | + isolate()); | ||
| 3079 | 3080 | module->set_hash(isolate()->GenerateIdentityHash(Smi::kMaxValue)); | |
| 3080 | 3081 | module->set_module_namespace(roots.undefined_value()); | |
| 3081 | 3082 | module->set_status(Module::kUninstantiated); | |
| 3082 | 3083 | module->set_exception(roots.the_hole_value()); | |
| 3083 | 3084 | module->set_name(*module_name); | |
| 3084 | 3085 | module->set_export_names(*export_names); | |
| 3086 | + module->set_exports(*exports); | ||
| 3085 | 3087 | module->set_evaluation_steps(*evaluation_steps_foreign); | |
| 3086 | 3088 | return module; | |
| 3087 | 3089 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23874,6 +23874,31 @@ TEST(CreateSyntheticModule) { | |||
| 23874 | 23874 | CHECK_EQ(i_module->status(), i::Module::kInstantiated); | |
| 23875 | 23875 | } | |
| 23876 | 23876 | ||
| 23877 | + TEST(CreateSyntheticModuleGC) { | ||
| 23878 | + // Try to make sure that CreateSyntheticModule() deals well with a GC | ||
| 23879 | + // happening during its execution. | ||
| 23880 | + i::FLAG_gc_interval = 10; | ||
| 23881 | + i::FLAG_inline_new = false; | ||
| 23882 | + | ||
| 23883 | + LocalContext env; | ||
| 23884 | + v8::Isolate* isolate = env->GetIsolate(); | ||
| 23885 | + v8::Isolate::Scope iscope(isolate); | ||
| 23886 | + v8::HandleScope scope(isolate); | ||
| 23887 | + v8::Local<v8::Context> context = v8::Context::New(isolate); | ||
| 23888 | + v8::Context::Scope cscope(context); | ||
| 23889 | + | ||
| 23890 | + std::vector<v8::Local<v8::String>> export_names{v8_str("default")}; | ||
| 23891 | + v8::Local<v8::String> module_name = | ||
| 23892 | + v8_str("CreateSyntheticModule-TestSyntheticModuleGC"); | ||
| 23893 | + | ||
| 23894 | + for (int i = 0; i < 200; i++) { | ||
| 23895 | + Local<Module> module = v8::Module::CreateSyntheticModule( | ||
| 23896 | + isolate, module_name, export_names, | ||
| 23897 | + UnexpectedSyntheticModuleEvaluationStepsCallback); | ||
| 23898 | + USE(module); | ||
| 23899 | + } | ||
| 23900 | + } | ||
| 23901 | + | ||
| 23877 | 23902 | TEST(SyntheticModuleSetExports) { | |
| 23878 | 23903 | LocalContext env; | |
| 23879 | 23904 | v8::Isolate* isolate = env->GetIsolate(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments