-
Notifications
You must be signed in to change notification settings - Fork 739
Add support for metadata.code.call_targets section #4664
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
base: main
Are you sure you want to change the base?
Changes from all commits
ed551fe
4500f7b
a426b7d
1474a8d
163b8ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -752,7 +752,7 @@ struct WASMFunction { | |
| #endif | ||
| #endif | ||
|
|
||
| #if WASM_ENABLE_BRANCH_HINTS != 0 | ||
| #if WASM_ENABLE_BRANCH_HINTS != 0 || WASM_ENABLE_COMPILATION_HINTS != 0 | ||
| uint8 *code_body_begin; | ||
| #endif | ||
| }; | ||
|
|
@@ -765,21 +765,31 @@ struct WASMTag { | |
| }; | ||
| #endif | ||
|
|
||
| #if WASM_ENABLE_BRANCH_HINTS != 0 | ||
| #if WASM_ENABLE_BRANCH_HINTS != 0 || WASM_ENABLE_COMPILATION_HINTS != 0 | ||
| enum WASMCompilationHintType { | ||
| DUMMY = 0, | ||
| WASM_COMPILATION_BRANCH_HINT = 0, | ||
| WASM_COMPILATION_HINT_BRANCH = 1, | ||
| WASM_COMPILATION_HINT_CALL_TARGETS = 2, | ||
| }; | ||
| struct WASMCompilationHint { | ||
| struct WASMCompilationHint *next; | ||
| enum WASMCompilationHintType type; | ||
| uint32 offset; | ||
| bool used; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. more or less. It is definitely a hint that something is wrong if a hint is not used. We apply hints to all branch instructions, so if it is not used, we either missed it, or the referenced instruction does not exist (meaning an invalid compilation hint section). However, since these hints are not mission-critical, I didn't want to assert that this is true. |
||
| }; | ||
| struct WASMCompilationHintBranchHint { | ||
| struct WASMCompilationHint *next; | ||
| enum WASMCompilationHintType type; | ||
| uint32 offset; | ||
| struct WASMCompilationHint common; | ||
| bool is_likely; | ||
| }; | ||
| struct WASMCompilationHintCallTargetsHint { | ||
| uint32 func_idx; | ||
| uint32 call_frequency; | ||
| }; | ||
| struct WASMCompilationHintCallTargets { | ||
| struct WASMCompilationHint common; | ||
| size_t target_count; | ||
| struct WASMCompilationHintCallTargetsHint *hints; | ||
| }; | ||
| #endif | ||
|
|
||
| struct WASMGlobal { | ||
|
|
@@ -1070,7 +1080,7 @@ struct WASMModule { | |
| const uint8 *name_section_buf_end; | ||
| #endif | ||
|
|
||
| #if WASM_ENABLE_BRANCH_HINTS != 0 | ||
| #if WASM_ENABLE_BRANCH_HINTS != 0 || WASM_ENABLE_COMPILATION_HINTS != 0 | ||
| struct WASMCompilationHint **function_hints; | ||
| #endif | ||
|
|
||
|
|
||
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.
is this function ubiquitously available?
i suspect it isn't.
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.
Can you please elaborate a bit more on that? I don't understand what your concern is, since I'm not sure whether you are hinting at the availability of the MD5Hash function, which is part of LLVM's MD5.h support header, or something else.