Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(500)

Unified Diff: src/compiler/wasm-compiler.cc

Issue 1698133002: [wasm] Clean up handling of function names. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/wasm-compiler.cc
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc
index 2aed3ce878cb39af7d645011fbaed618455a7d03..aabd778b14061862807a3117a770bf49ce18a89a 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -2072,15 +2072,11 @@ Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, wasm::ModuleEnv* module,
// Helper function to compile a single function.
Handle<Code> CompileWasmFunction(wasm::ErrorThrower& thrower, Isolate* isolate,
wasm::ModuleEnv* module_env,
- const wasm::WasmFunction& function,
- int index) {
+ const wasm::WasmFunction& function) {
if (FLAG_trace_wasm_compiler || FLAG_trace_wasm_decode_time) {
- // TODO(titzer): clean me up a bit.
OFStream os(stdout);
- os << "Compiling WASM function #" << index << ":";
- if (function.name_offset > 0) {
- os << module_env->module->GetName(function.name_offset);
- }
+ os << "Compiling WASM function "
+ << wasm::WasmFunctionName(&function, module_env) << std::endl;
os << std::endl;
}
// Initialize the function environment for decoding.
@@ -2115,7 +2111,8 @@ Handle<Code> CompileWasmFunction(wasm::ErrorThrower& thrower, Isolate* isolate,
}
// Add the function as another context for the exception
ScopedVector<char> buffer(128);
- SNPrintF(buffer, "Compiling WASM function #%d:%s failed:", index,
+ SNPrintF(buffer, "Compiling WASM function #%d:%s failed:",
+ function.func_index,
module_env->module->GetName(function.name_offset));
thrower.Failed(buffer.start(), result);
return Handle<Code>::null();
@@ -2132,7 +2129,7 @@ Handle<Code> CompileWasmFunction(wasm::ErrorThrower& thrower, Isolate* isolate,
Vector<char> buffer;
if (debugging) {
buffer = Vector<char>::New(128);
- SNPrintF(buffer, "WASM_function_#%d:%s", index,
+ SNPrintF(buffer, "WASM_function_#%d:%s", function.func_index,
module_env->module->GetName(function.name_offset));
func_name = buffer.start();
}
@@ -2145,7 +2142,7 @@ Handle<Code> CompileWasmFunction(wasm::ErrorThrower& thrower, Isolate* isolate,
}
if (!code.is_null()) {
RecordFunctionCompilation(
- Logger::FUNCTION_TAG, &info, "WASM_function", index,
+ Logger::FUNCTION_TAG, &info, "WASM_function", function.func_index,
module_env->module->GetName(function.name_offset));
}
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | src/wasm/module-decoder.cc » ('j') | src/wasm/wasm-module.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698