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

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

Issue 1709893002: [wasm] names for wasm stubs (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/wasm-compiler.cc
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc
index 109bfedd364f57069b811099b9b98136d981049c..6742d987fff873f8574c5aeedac492b3bf4454ee 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -2007,9 +2007,29 @@ Handle<JSFunction> CompileJSToWasmWrapper(
&zone, false, params + 1, CallDescriptor::kNoFlags);
// TODO(titzer): this is technically a WASM wrapper, not a wasm function.
Code::Flags flags = Code::ComputeFlags(Code::WASM_FUNCTION);
- CompilationInfo info("js-to-wasm", isolate, &zone, flags);
+ bool debugging =
+#if DEBUG
+ true;
+#else
+ FLAG_print_opt_code || FLAG_trace_turbo || FLAG_trace_turbo_graph;
+#endif
+ const char* func_name = "js-to-wasm";
+
+ static unsigned id = 0;
+ Vector<char> buffer;
+ if (debugging) {
+ buffer = Vector<char>::New(128);
+ SNPrintF(buffer, "js-to-wasm#%d", id);
+ func_name = buffer.start();
+ }
+
+ CompilationInfo info(func_name, isolate, &zone, flags);
Handle<Code> code =
Pipeline::GenerateCodeForTesting(&info, incoming, &graph, nullptr);
+ if (debugging) {
+ buffer.Dispose();
+ }
+
RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, "js-to-wasm", index,
module->module->GetName(func->name_offset));
// Set the JSFunction's machine code.
@@ -2069,8 +2089,26 @@ Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, wasm::ModuleEnv* module,
CallDescriptor* incoming = module->GetWasmCallDescriptor(&zone, func->sig);
// TODO(titzer): this is technically a WASM wrapper, not a wasm function.
Code::Flags flags = Code::ComputeFlags(Code::WASM_FUNCTION);
- CompilationInfo info("wasm-to-js", isolate, &zone, flags);
+ bool debugging =
+#if DEBUG
+ true;
+#else
+ FLAG_print_opt_code || FLAG_trace_turbo || FLAG_trace_turbo_graph;
+#endif
+ const char* func_name = "wasm-to-js";
+ static unsigned id = 0;
+ Vector<char> buffer;
+ if (debugging) {
+ buffer = Vector<char>::New(128);
+ SNPrintF(buffer, "wasm-to-js#%d", id);
+ func_name = buffer.start();
+ }
+
+ CompilationInfo info(func_name, isolate, &zone, flags);
code = Pipeline::GenerateCodeForTesting(&info, incoming, &graph, nullptr);
+ if (debugging) {
+ buffer.Dispose();
+ }
RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, "wasm-to-js", index,
module->module->GetName(func->name_offset));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698