-
Notifications
You must be signed in to change notification settings - Fork 727
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
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 |
|---|---|---|
|
|
@@ -433,3 +433,9 @@ aot_compress_aot_func_names(AOTCompContext *comp_ctx, uint32 *p_size) | |
| *p_size = compressed_str_len; | ||
| return compressed_str; | ||
| } | ||
|
|
||
| uint64_t | ||
| aot_func_name_hash(const char *name) | ||
| { | ||
| return MD5Hash(StringRef(name)); | ||
|
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 function ubiquitously available? |
||
| } | ||
| 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,41 @@ 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; | ||
|
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 |
||
| }; | ||
| struct WASMCompilationHintBranchHint { | ||
| struct WASMCompilationHint *next; | ||
| enum WASMCompilationHintType type; | ||
| uint32 offset; | ||
| bool used; | ||
|
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. i feel it's simpler to have |
||
|
|
||
| // custom field | ||
| bool is_likely; | ||
| }; | ||
| struct WASMCompilationHintCallTargetsHint { | ||
| uint32 func_idx; | ||
| uint32 call_frequency; | ||
| }; | ||
| struct WASMCompilationHintCallTargets { | ||
| struct WASMCompilationHint *next; | ||
| enum WASMCompilationHintType type; | ||
| uint32 offset; | ||
| bool used; | ||
|
|
||
| // custom fields | ||
| size_t target_count; | ||
| struct WASMCompilationHintCallTargetsHint *hints; | ||
| }; | ||
| #endif | ||
|
|
||
| struct WASMGlobal { | ||
|
|
@@ -1070,7 +1090,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.
no need to cast as the
usedfield is in WASMCompilationHint as well.