Commit e57a6b5f authored by jiepan's avatar jiepan Committed by V8 LUCI CQ

[wasm][turbofan] Use non-empty function name only

If the name of a wasm function is empty, use wasm-function#id instead.

Change-Id: Ifdfb969a4d0ba5329fea0325397938e8274cf3db
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3566229Reviewed-by: 's avatarManos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Jie Pan <jie.pan@intel.com>
Cr-Commit-Position: refs/heads/main@{#79790}
parent f3dfbe59
...@@ -8420,10 +8420,12 @@ base::Vector<const char> GetDebugName(Zone* zone, ...@@ -8420,10 +8420,12 @@ base::Vector<const char> GetDebugName(Zone* zone,
FLAG_trace_turbo_graph || FLAG_print_wasm_code)) { FLAG_trace_turbo_graph || FLAG_print_wasm_code)) {
wasm::WireBytesRef name = module->lazily_generated_names.LookupFunctionName( wasm::WireBytesRef name = module->lazily_generated_names.LookupFunctionName(
module_bytes.value(), index); module_bytes.value(), index);
int name_len = name.length(); if (!name.is_empty()) {
char* index_name = zone->NewArray<char>(name_len); int name_len = name.length();
memcpy(index_name, module_bytes->start() + name.offset(), name.length()); char* index_name = zone->NewArray<char>(name_len);
return base::Vector<const char>(index_name, name_len); memcpy(index_name, module_bytes->start() + name.offset(), name_len);
return base::Vector<const char>(index_name, name_len);
}
} }
constexpr int kBufferLength = 24; constexpr int kBufferLength = 24;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment