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
compiler: remove embedding of pointers of jump tables #650
Conversation
@@ -8,69 +8,47 @@ import ( | |||
"github.com/tetratelabs/wazero/internal/asm" | |||
) | |||
|
|||
type constPool struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consolidated constPool impls into asm/assembler.go
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice cleanup!
@@ -53,11 +53,63 @@ type ConstantValue = int64 | |||
|
|||
// StaticConst represents an arbitrary constant bytes which are pooled and emitted by assembler into the binary. | |||
// These constants can be referenced by instructions. | |||
type StaticConst = []byte | |||
type StaticConst struct { | |||
Raw []byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand that raw means we don't know the encoding because it could be anything? ex string iee754 etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah can be any
This removes the embedding of pointers of jump tables (uintptr of []byte)
used by BrTable operations. That is the last usage of unsafe.Pointer in
compiler implementations.
Alternatively, we treat jump tables as asm.StaticConst and emit them
into the constPool already implemented and used by various places.
Notably, now the native code compiled by compilers can be reusable
across multiple processes, meaning that they are independent of
any runtime pointers.
part of #618
Signed-off-by: Takeshi Yoneda takeshi@tetrate.io