Skip to content
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

reduce memory usage in analyser #8061

Merged
merged 6 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/turbopack-ecmascript/src/analyzer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ pub enum JsValue {
/// A constant primitive value.
Constant(ConstantValue),
/// An constant URL object.
Url(Url),
Url(Box<Url>),
/// Some kind of well-known object
/// (must not be an array, otherwise Array.concat needs to be changed)
WellKnownObject(WellKnownObjectKind),
Expand Down Expand Up @@ -3681,7 +3681,7 @@ mod tests {
let start = Instant::now();
async fn handle_args(
args: Vec<EffectArg>,
queue: &mut Vec<(usize, Effect)>,
queue: &mut Vec<(usize, Box<Effect>)>,
sokra marked this conversation as resolved.
Show resolved Hide resolved
var_graph: &VarGraph,
i: usize,
) -> Vec<JsValue> {
Expand All @@ -3704,7 +3704,7 @@ mod tests {
}
new_args
}
match effect {
match *effect {
sokra marked this conversation as resolved.
Show resolved Hide resolved
Effect::Conditional {
condition, kind, ..
} => {
Expand Down
1 change: 1 addition & 0 deletions crates/turbopack-ecmascript/src/analyzer/well_known.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ pub fn path_to_file_url(args: Vec<JsValue>) -> JsValue {
if args.len() == 1 {
if let Some(path) = args[0].as_str() {
Url::from_file_path(path)
.map(Box::new)
.map(JsValue::Url)
.unwrap_or_else(|_| {
JsValue::unknown(
Expand Down