Skip to content

Conversation

wrwg
Copy link
Contributor

@wrwg wrwg commented Sep 26, 2025

Description

The values_impl::IntegerValue type introduced a rather unnecessary wrapper for integer values, creating to conversions back and force to Value. Moreover, the newtype wrapper Value for ValueImpl was unnecessary as well and created
overhead because it cannot be eliminated by the compiler when applied in iterators (as in values.into_iter().map(Value).collect()). Both have been removed.

How Has This Been Tested?

Existing tests

@wrwg wrwg mentioned this pull request Sep 26, 2025
16 tasks
Copy link
Contributor Author

wrwg commented Sep 26, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@wrwg wrwg force-pushed the wrwg/int_wrapper branch 2 times, most recently from 82a3415 to 9647ebd Compare September 26, 2025 20:06
@junxzm1990 junxzm1990 changed the base branch from jun/sint-compiler to graphite-base/17693 September 26, 2025 20:46
@wrwg wrwg marked this pull request as ready for review September 27, 2025 03:35

/// Perform a binary operation to two values at the top of the stack.
fn binop<F, T>(&mut self, f: F) -> PartialVMResult<()>
#[inline(always)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Later we'll need to run this through the profiler and see if the Rust compiler actually performs the inlining or not. FYI with the current impl, it's not inlining F.

@wrwg wrwg force-pushed the graphite-base/17693 branch from 432eb78 to 86f6df1 Compare September 27, 2025 17:19
@wrwg wrwg changed the base branch from graphite-base/17693 to jun/sint-compiler September 27, 2025 17:19
@junxzm1990 junxzm1990 changed the base branch from jun/sint-compiler to graphite-base/17693 September 27, 2025 20:11
@wrwg wrwg force-pushed the graphite-base/17693 branch from 86f6df1 to 1dc20f4 Compare September 28, 2025 03:11
@wrwg wrwg changed the base branch from graphite-base/17693 to jun/sint-compiler September 28, 2025 03:11
}

fn compare(
pub fn compare_with_depth(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and equals_with_depth can be private or pub(crate)?

@wrwg wrwg mentioned this pull request Sep 28, 2025
22 tasks
@wrwg wrwg force-pushed the jun/sint-compiler branch 2 times, most recently from b6b60fd to a71a230 Compare September 29, 2025 20:23
@wrwg wrwg force-pushed the wrwg/int_wrapper branch from 5aa57e1 to f197605 Compare October 1, 2025 19:25
@wrwg wrwg force-pushed the jun/sint-compiler branch from c186797 to 4ae9850 Compare October 1, 2025 19:25
@wrwg wrwg force-pushed the wrwg/int_wrapper branch from f197605 to fbbd9fa Compare October 1, 2025 19:29
@junxzm1990 junxzm1990 force-pushed the jun/sint-compiler branch 2 times, most recently from 901ac24 to f4a07b3 Compare October 2, 2025 15:13
@junxzm1990 junxzm1990 force-pushed the wrwg/int_wrapper branch 2 times, most recently from 38fe6d3 to 37febd6 Compare October 2, 2025 19:44
@wrwg wrwg force-pushed the jun/sint-compiler branch from 9e39a96 to 4cf379f Compare October 3, 2025 14:51
@wrwg wrwg force-pushed the wrwg/int_wrapper branch from 281400b to 93d20aa Compare October 3, 2025 14:51
@wrwg wrwg mentioned this pull request Oct 3, 2025
22 tasks
@wrwg wrwg force-pushed the wrwg/int_wrapper branch from 2bb080b to 8e68b46 Compare October 4, 2025 04:01
@wrwg wrwg force-pushed the jun/sint-compiler branch from a561800 to a464842 Compare October 4, 2025 04:01
@wrwg wrwg force-pushed the wrwg/int_wrapper branch from 8e68b46 to 2358ab3 Compare October 4, 2025 04:05
The `values_impl::IntegerValue` type introduced a rather unnecessary wrapper for integer values, creating to conversions back and force to `Value`. Moreover, the newtype wrapper `Value` for `ValueImpl` was unnecessary as well and created
overhead because it cannot be eliminated by the compiler when applied in iterators (as in `values.into_iter().map(Value).collect()`). Both have been removed.
@wrwg wrwg force-pushed the wrwg/int_wrapper branch from 2358ab3 to 8761f7b Compare October 5, 2025 03:30
@wrwg wrwg force-pushed the jun/sint-compiler branch from a464842 to 753b223 Compare October 5, 2025 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants