Skip to content

Improve offset_front()#785

Merged
ia0 merged 7 commits into
google:dev/fast-interpfrom
zhouwfang:offset_front
Mar 20, 2025
Merged

Improve offset_front()#785
ia0 merged 7 commits into
google:dev/fast-interpfrom
zhouwfang:offset_front

Conversation

@zhouwfang

Copy link
Copy Markdown
Contributor

#46

@zhouwfang
zhouwfang requested a review from ia0 as a code owner March 8, 2025 04:52
Comment thread crates/interpreter/src/util.rs Outdated
Comment thread crates/interpreter/src/exec.rs Outdated
Comment thread crates/interpreter/src/util.rs Outdated
@zhouwfang zhouwfang changed the title Make offset_front() generic Improve offset_front() Mar 12, 2025
@zhouwfang
zhouwfang requested a review from ia0 March 12, 2025 03:10
@zhouwfang

zhouwfang commented Mar 12, 2025

Copy link
Copy Markdown
Contributor Author

Could you first take a look at the new offset functions? I'll apply them later. Thanks.

@ia0 ia0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, I've simplified a bit.

Comment thread crates/interpreter/src/util.rs Outdated
Comment thread crates/interpreter/src/util.rs Outdated
Comment thread crates/interpreter/src/util.rs Outdated
Comment thread crates/interpreter/src/util.rs Outdated
Comment thread crates/interpreter/src/util.rs Outdated
@zhouwfang
zhouwfang requested a review from ia0 March 15, 2025 22:54
@zhouwfang

Copy link
Copy Markdown
Contributor Author

After this PR is merged, can we merge dev/fast-interp into main?

@ia0 ia0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! I've changed the logic to have the information at the right place (essentially func_body should be in Expr).

Comment thread crates/interpreter/src/exec.rs Outdated
side_table,
0,
#[cfg(feature = "toctou")]
&[],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this not parser.save()?

Comment thread crates/interpreter/src/valid.rs Outdated
globals: Vec<GlobalType>,
elems: Vec<RefType>,
datas: Option<usize>,
func_body: &'m [u8],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need this?

Comment thread crates/interpreter/src/valid.rs Outdated
// SAFETY: This function is only called after parsing an End instruction.
target.parser = offset_front(target.parser, -1);
// This function is only called after parsing an End instruction.
target.parser = offset_front_check(self.context.func_body, target.parser, -1)?;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't need a check here, since it's not based on user input.

@ia0

ia0 commented Mar 20, 2025

Copy link
Copy Markdown
Member

After this PR is merged, can we merge dev/fast-interp into main?

Yes, I'll create a PR from a fork of this branch in my repo to avoid the PR getting double CI (once for push and once for pull_request).

@ia0
ia0 merged commit 5995cd2 into google:dev/fast-interp Mar 20, 2025
@zhouwfang

Copy link
Copy Markdown
Contributor Author

After this PR is merged, can we merge dev/fast-interp into main?

Yes, I'll create a PR from a fork of this branch in my repo to avoid the PR getting double CI (once for push and once for pull_request).

Do you mind explaining the differences in more detail? You are ahead of me. Thanks!

@ia0

ia0 commented Mar 20, 2025

Copy link
Copy Markdown
Member

Do you mind explaining the differences in more detail? You are ahead of me. Thanks!

#737 is the PR where I merged the dev/opensk branch into main. You can see (if you click View details near the end) that there were 40 checks, while in this PR it's 21. There were twice more checks because for each commit I pushed to the branch after the PR was created, a push for dev/opensk and a pull_request for main workflow was created. You can see this in the checks job (which appears twice like almost all other jobs):

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