Skip to content

Add support for atomic.fence from the threads proposal - #1231

Merged
binji merged 1 commit into
WebAssembly:masterfrom
wingo:atomic-fence
Apr 20, 2020
Merged

binji merged 1 commit into
WebAssembly:masterfrom
wingo:atomic-fence

Conversation

@wingo

@wingo wingo commented Nov 18, 2019

Copy link
Copy Markdown
Contributor

See WebAssembly/threads#141 for the binary encoding. This patch does add a field to AtomicFenceExpr for the consistency model, though without a type for the time being.

@sbc100 sbc100 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.

lgtm, with a couple of comments

Comment thread src/token.def
WABT_TOKEN(Try, "try")
WABT_TOKEN(Unary, "UNARY")
WABT_TOKEN(Unreachable, "unreachable")
WABT_TOKEN_FIRST(Opcode, AtomicLoad)

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.

Was AtomicLoad not supposed to be here at all?

@wingo wingo Apr 20, 2020 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Mmm, I think this was a bad change that snuck in. I will make sure it's not there in the revised patch and regenerate the lexer. EDIT: Actually this patch is the right thing. WABT_TOKEN_FIRST specifies the first Opcode token. It was AtomicLoad, but I added AtomicFence before it, so here I replace the operand.

Comment thread src/type-checker.cc
return Result::Error;
}
return Result::Ok;
}

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.

Is the type checker the right place for this? i.e. is this a more general validation thing than a type checking thing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hooo, finally picking up this patch again. Rebasing and re-uploading, but yes you are right -- will include this check in the validator rather than the type checker.

@wingo wingo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressing comments before rebase

Comment thread src/type-checker.cc
return Result::Error;
}
return Result::Ok;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hooo, finally picking up this patch again. Rebasing and re-uploading, but yes you are right -- will include this check in the validator rather than the type checker.

Comment thread src/token.def
WABT_TOKEN(Try, "try")
WABT_TOKEN(Unary, "UNARY")
WABT_TOKEN(Unreachable, "unreachable")
WABT_TOKEN_FIRST(Opcode, AtomicLoad)

@wingo wingo Apr 20, 2020 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Mmm, I think this was a bad change that snuck in. I will make sure it's not there in the revised patch and regenerate the lexer. EDIT: Actually this patch is the right thing. WABT_TOKEN_FIRST specifies the first Opcode token. It was AtomicLoad, but I added AtomicFence before it, so here I replace the operand.

See WebAssembly/threads#141 for the binary
encoding.  This patch does add a field to AtomicFenceExpr for the
consistency model, though without a type for the time being.

@binji binji 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 for doing this! lgtm

@binji
binji merged commit d041025 into WebAssembly:master Apr 20, 2020
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