-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ext/node): fix vm memory usage and context initialization #23976
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
848dabd
reuse vm snapshot context
littledivy 21e16de
pogress
littledivy 57c7b11
Merge branch 'main' of github.com:denoland/deno into vm_snapshot_context
littledivy 2b94abc
Fixes
littledivy e248d08
x
littledivy e4adc96
use indexes
littledivy 36c264a
fixes
littledivy 8fbf099
x
littledivy 865b99f
x
littledivy 54d25c9
x
littledivy a358b69
rm lock
littledivy 216436e
Fixes
littledivy 1463137
lint
littledivy 9d64546
cleanup
littledivy b3d8fce
x
littledivy b92c236
update cache key
littledivy 4d33b55
Enable tmux session
littledivy 1674c8f
fix
littledivy a8746ab
X
littledivy b3f2282
x
littledivy 0ea5259
review
littledivy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,10 @@ mod resolution; | |
pub use ops::ipc::ChildPipeFd; | ||
pub use ops::ipc::IpcJsonStreamResource; | ||
pub use ops::v8::VM_CONTEXT_INDEX; | ||
use ops::vm; | ||
pub use ops::vm::create_v8_context; | ||
pub use ops::vm::init_global_template; | ||
pub use ops::vm::ContextInitMode; | ||
pub use package_json::PackageJson; | ||
pub use path::PathClean; | ||
pub use polyfill::is_builtin_node_module; | ||
|
@@ -641,7 +645,64 @@ deno_core::extension!(deno_node, | |
global_template_middleware = global_template_middleware, | ||
global_object_middleware = global_object_middleware, | ||
customizer = |ext: &mut deno_core::Extension| { | ||
let mut external_references = Vec::with_capacity(7); | ||
let mut external_references = Vec::with_capacity(14); | ||
|
||
vm::GETTER_MAP_FN.with(|getter| { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should try to remove this thread local hack - maybe the problem is now gone There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But not in this PR |
||
external_references.push(ExternalReference { | ||
named_getter: *getter, | ||
}); | ||
}); | ||
vm::SETTER_MAP_FN.with(|setter| { | ||
external_references.push(ExternalReference { | ||
named_setter: *setter, | ||
}); | ||
}); | ||
vm::DELETER_MAP_FN.with(|deleter| { | ||
external_references.push(ExternalReference { | ||
named_getter: *deleter, | ||
},); | ||
}); | ||
vm::ENUMERATOR_MAP_FN.with(|enumerator| { | ||
external_references.push(ExternalReference { | ||
enumerator: *enumerator, | ||
}); | ||
}); | ||
vm::DEFINER_MAP_FN.with(|definer| { | ||
external_references.push(ExternalReference { | ||
named_definer: *definer, | ||
}); | ||
}); | ||
vm::DESCRIPTOR_MAP_FN.with(|descriptor| { | ||
external_references.push(ExternalReference { | ||
named_getter: *descriptor, | ||
}); | ||
}); | ||
|
||
vm::INDEXED_GETTER_MAP_FN.with(|getter| { | ||
external_references.push(ExternalReference { | ||
indexed_getter: *getter, | ||
}); | ||
}); | ||
vm::INDEXED_SETTER_MAP_FN.with(|setter| { | ||
external_references.push(ExternalReference { | ||
indexed_setter: *setter, | ||
}); | ||
}); | ||
vm::INDEXED_DELETER_MAP_FN.with(|deleter| { | ||
external_references.push(ExternalReference { | ||
indexed_getter: *deleter, | ||
}); | ||
}); | ||
vm::INDEXED_DEFINER_MAP_FN.with(|definer| { | ||
external_references.push(ExternalReference { | ||
indexed_definer: *definer, | ||
}); | ||
}); | ||
vm::INDEXED_DESCRIPTOR_MAP_FN.with(|descriptor| { | ||
external_references.push(ExternalReference { | ||
indexed_getter: *descriptor, | ||
}); | ||
}); | ||
|
||
global::GETTER_MAP_FN.with(|getter| { | ||
external_references.push(ExternalReference { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this left on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, ive used it quite a few times for segfaults in CIs