Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
e5a684bd
Commit
e5a684bd
authored
Dec 02, 2025
by
Luke Sandberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter self as well
parent
7e7440f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
manager.rs
turbopack/crates/turbo-tasks/src/manager.rs
+6
-1
native_function.rs
turbopack/crates/turbo-tasks/src/native_function.rs
+5
-0
registry.rs
turbopack/crates/turbo-tasks/src/registry.rs
+9
-2
No files found.
turbopack/crates/turbo-tasks/src/manager.rs
View file @
e5a684bd
...
@@ -670,7 +670,12 @@ impl<B: Backend + 'static> TurboTasks<B> {
...
@@ -670,7 +670,12 @@ impl<B: Backend + 'static> TurboTasks<B> {
persistence
:
TaskPersistence
,
persistence
:
TaskPersistence
,
)
->
RawVc
{
)
->
RawVc
{
let
arg
=
trait_impl
.arg_meta
.filter_owned
(
arg
);
let
arg
=
trait_impl
.arg_meta
.filter_owned
(
arg
);
return
self
.dynamic_call
(
trait_impl
,
Some
(
this
),
arg
,
persistence
);
return
self
.dynamic_call
(
trait_impl
,
(
!
trait_impl
.filters_this
)
.then_some
(
this
),
arg
,
persistence
,
);
}
}
pub
fn
trait_call
(
pub
fn
trait_call
(
...
...
turbopack/crates/turbo-tasks/src/native_function.rs
View file @
e5a684bd
...
@@ -156,6 +156,8 @@ pub struct NativeFunction {
...
@@ -156,6 +156,8 @@ pub struct NativeFunction {
// The globally unique name for this function, used when persisting
// The globally unique name for this function, used when persisting
pub
(
crate
)
global_name
:
&
'static
str
,
pub
(
crate
)
global_name
:
&
'static
str
,
pub
(
crate
)
filters_this
:
bool
,
}
}
impl
Debug
for
NativeFunction
{
impl
Debug
for
NativeFunction
{
...
@@ -181,6 +183,7 @@ impl NativeFunction {
...
@@ -181,6 +183,7 @@ impl NativeFunction {
global_name
,
global_name
,
arg_meta
:
ArgMeta
::
new
::
<
Inputs
>
(),
arg_meta
:
ArgMeta
::
new
::
<
Inputs
>
(),
implementation
:
Box
::
new
(
implementation
.into_task_fn
()),
implementation
:
Box
::
new
(
implementation
.into_task_fn
()),
filters_this
:
false
,
}
}
}
}
...
@@ -203,6 +206,7 @@ impl NativeFunction {
...
@@ -203,6 +206,7 @@ impl NativeFunction {
ArgMeta
::
new
::
<
Inputs
>
()
ArgMeta
::
new
::
<
Inputs
>
()
},
},
implementation
:
Box
::
new
(
implementation
.into_task_fn
()),
implementation
:
Box
::
new
(
implementation
.into_task_fn
()),
filters_this
:
true
,
}
}
}
}
...
@@ -226,6 +230,7 @@ impl NativeFunction {
...
@@ -226,6 +230,7 @@ impl NativeFunction {
ArgMeta
::
new
::
<
Inputs
>
()
ArgMeta
::
new
::
<
Inputs
>
()
},
},
implementation
:
Box
::
new
(
implementation
.into_task_fn_with_this
()),
implementation
:
Box
::
new
(
implementation
.into_task_fn_with_this
()),
filters_this
:
false
,
}
}
}
}
...
...
turbopack/crates/turbo-tasks/src/registry.rs
View file @
e5a684bd
...
@@ -202,8 +202,9 @@ static DEVIRTUALIZED_TRAIT_METHODS: Lazy<FxHashMap<&'static TraitMethod, &'stati
...
@@ -202,8 +202,9 @@ static DEVIRTUALIZED_TRAIT_METHODS: Lazy<FxHashMap<&'static TraitMethod, &'stati
trait_method_to_impls
.entry
(
tm
)
.or_default
()
.push
(
nf
);
trait_method_to_impls
.entry
(
tm
)
.or_default
()
.push
(
nf
);
}
}
}
}
let
num_trait_methods
=
trait_method_to_impls
.len
();
trait_method_to_impls
let
devirtualized
=
trait_method_to_impls
.into_iter
()
.into_iter
()
.filter_map
(|(
k
,
v
)|
{
.filter_map
(|(
k
,
v
)|
{
if
let
Impls
::
One
(
f
)
=
v
{
if
let
Impls
::
One
(
f
)
=
v
{
...
@@ -212,7 +213,13 @@ static DEVIRTUALIZED_TRAIT_METHODS: Lazy<FxHashMap<&'static TraitMethod, &'stati
...
@@ -212,7 +213,13 @@ static DEVIRTUALIZED_TRAIT_METHODS: Lazy<FxHashMap<&'static TraitMethod, &'stati
None
None
}
}
})
})
.collect
()
.collect
::
<
FxHashMap
<
_
,
_
>>
();
eprintln!
(
"devirtualized {} out of {} trait methods"
,
devirtualized
.len
(),
num_trait_methods
,
);
devirtualized
});
});
pub
fn
get_devirtualized_trait_impl
(
pub
fn
get_devirtualized_trait_impl
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment