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

Refactor - Removes the dense function registry from loaders #25

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

Lichtso
Copy link
Collaborator

@Lichtso Lichtso commented Jan 30, 2025

No description provided.

@Lichtso Lichtso force-pushed the refactor/removes_dense_function_registry branch 2 times, most recently from 75135da to 3f9244d Compare January 30, 2025 09:12
@Lichtso Lichtso requested a review from LucasSte January 30, 2025 09:39
src/program.rs Outdated
@@ -304,13 +275,9 @@ impl<C: ContextObject> BuiltinProgram<C> {
/// Get the function registry depending on the SBPF version
pub fn get_function_registry(
&self,
sbpf_version: SBPFVersion,
_sbpf_version: SBPFVersion,
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about removing the unused parameter?

$function_registry
.register_function_hashed($location.as_bytes(), $syscall_function)
.unwrap();
(register, $loader:expr, $location:expr => $syscall_function:expr) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about calling name instead of location?

};
($source:tt, $config:tt, $mem:tt, ($($location:expr => $syscall_function:expr),* $(,)?), $context_object:expr, $expected_result:expr $(,)?) => {
($source:expr, $config:expr, $mem:expr, ($($location:expr => $syscall_function:expr),* $(,)?), $context_object:expr, $expected_result:expr $(,)?) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Name instead of location?

test_interpreter_and_jit!(executable, $mem, $context_object, $expected_result);
}
};
($source:tt, $mem:tt, ($($location:expr => $syscall_function:expr),* $(,)?), $context_object:expr, $expected_result:expr $(,)?) => {
($source:expr, $mem:expr, ($($location:expr => $syscall_function:expr),* $(,)?), $context_object:expr, $expected_result:expr $(,)?) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here as well

@Lichtso Lichtso force-pushed the refactor/removes_dense_function_registry branch from 3f9244d to 7fd164c Compare January 30, 2025 15:21
Comment on lines +13 to 15
use solana_sbpf::program::SBPFVersion;
use solana_sbpf::vm::Config;
use solana_sbpf::{assembler::assemble, ebpf, program::BuiltinProgram};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not for this PR, but we could configure cargo fmt to group imports as we do in the Agave repo.

@Lichtso Lichtso merged commit ac6ba8d into main Jan 30, 2025
11 checks passed
@Lichtso Lichtso deleted the refactor/removes_dense_function_registry branch January 30, 2025 15:45
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.

2 participants