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

Unified Diff: src/wasm/module-decoder.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/wasm/module-decoder.cc
diff --git a/src/wasm/module-decoder.cc b/src/wasm/module-decoder.cc
index fe4217d63ca81931776aa4a6a6046fb8667c973c..502d67cafa2d572a60450e8ca987b488881edab8 100644
--- a/src/wasm/module-decoder.cc
+++ b/src/wasm/module-decoder.cc
@@ -111,7 +111,7 @@ class ModuleDecoder : public Decoder {
static_cast<int>(pc_ - start_));
module->functions->push_back(
- {nullptr, 0, 0, 0, 0, 0, 0, false, false});
+ {nullptr, i, 0, 0, 0, 0, 0, 0, false, false});
WasmFunction* function = &module->functions->back();
DecodeFunctionInModule(module, function, false);
}
@@ -400,12 +400,9 @@ class ModuleDecoder : public Decoder {
void VerifyFunctionBody(uint32_t func_num, ModuleEnv* menv,
WasmFunction* function) {
if (FLAG_trace_wasm_decode_time) {
- // TODO(titzer): clean me up a bit.
OFStream os(stdout);
- os << "Verifying WASM function:";
- if (function->name_offset > 0) {
- os << menv->module->GetName(function->name_offset);
- }
+ os << "Verifying WASM function " << WasmFunctionName(function, menv)
+ << std::endl;
os << std::endl;
}
FunctionEnv fenv;
@@ -423,8 +420,7 @@ class ModuleDecoder : public Decoder {
if (result.failed()) {
// Wrap the error message from the function decoder.
std::ostringstream str;
- str << "in function #" << func_num << ": ";
- // TODO(titzer): add function name for the user?
+ str << "in function " << WasmFunctionName(function, menv) << ": ";
str << result;
std::string strval = str.str();
const char* raw = strval.c_str();
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/wasm/wasm-module.h » ('j') | src/wasm/wasm-module.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698