Skip to content
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

Refine looking up aot function with index #3882

Merged

Conversation

wenyongh
Copy link
Contributor

No description provided.

@lum1n0us
Copy link
Collaborator

Is it because DefPointer(WASMExportFuncInstance *, export_functions); now are sorted by names instead of function indexes?

@wenyongh
Copy link
Contributor Author

Is it because DefPointer(WASMExportFuncInstance *, export_functions); now are sorted by names instead of function indexes?

No, event if the export_functions isn't sorted by names, it doesn't mean that it will be sorted by function index, it's in random order. This PR's optimization is suitable no matter whether export_functions is sorted by names or not.

@lum1n0us
Copy link
Collaborator

Totally true. It sticks to the order given by the export section context, which is based on toolchains and seems random now.

So, we now need to sort the list export_functions by name and store them in that order, and then search by both name and function index.

@wenyongh
Copy link
Contributor Author

Totally true. It sticks to the order given by the export section context, which is based on toolchains and seems random now.

So, we now need to sort the list export_functions by name and store them in that order, and then search by both name and function index.

Yes, sort export_functions by name, and create another map array whose element is <func_idx, export_ith> and sort the array by func_idx.

Copy link
Collaborator

@lum1n0us lum1n0us left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@xujuntwt95329 xujuntwt95329 left a comment

Choose a reason for hiding this comment

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

LGTM

@lum1n0us lum1n0us merged commit a3960c8 into bytecodealliance:main Oct 29, 2024
383 checks passed
lum1n0us added a commit that referenced this pull request Nov 20, 2024
* Exclude fuzz test python and npm packages in scoreboard scan (#3871)
* Fix out of bounds issues after memory.grow on non-aot non-threads builds (#3872)
* fix(ios): Remove `float-abi` flag (#3889)
* build(deps): bump github/codeql-action from 3.26.13 to 3.27.0 (#3888)
* Refine looking up aot function with index (#3882)
* Bump AOT_CURRENT_VERSION for WAMR 2.x (gc, memory64) (#3880)
* Fix mmap flags for AOT loader on non-Linux SGX platforms (#3890)
* Fix out of bounds issue in is_native_addr_in_shared_heap function (#3886)
* Refactor AOT loader to support compatible versions (#3891)
* Wasm loader enhancement: check code size in code entry  (#3892)
* Fix linked global initialization in multimodule (#3905)
* build(deps): bump github/codeql-action from 3.27.0 to 3.27.1 (#3902)
* GlobalValueSet was moved to IRPartitionLayer recently, but we have a local definition anyway (#3899)
* Fix a leak in wasm_loader_emit_br_info (#3900)
* Correct the table index calculation in aot_instantiation (#3903)
* build(deps): bump github/codeql-action from 3.27.1 to 3.27.4 (#3912)
* Support external toolchain on Windows for aot compiler (#3911)
* Fix CI wamr-ide error (#3913)

Co-authored-by: TianlongLiang <111852609+TianlongLiang@users.noreply.github.com>
Co-authored-by: Maks Litskevich <makslit@amazon.com>
Co-authored-by: Deniz Sokmen <dsokmen@amazon.com>
Co-authored-by: edoardo <48774736+xdoardo@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Co-authored-by: liang.he <liang.he@intel.com>
Co-authored-by: Fadumina Barre <bafadumi@amazon.com>
Co-authored-by: Marcin Kolny <mkolny@amazon.com>
Co-authored-by: James Ring <sjr@jdns.org>
@wenyongh wenyongh deleted the refine_lookup_aot_func_with_idx branch November 28, 2024 07:54
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