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

Unified Diff: test/cctest/wasm/wasm-run-utils.h

Issue 1912103002: [wasm] Store function names in the wasm object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@wasm-offset-table-2
Patch Set: rebase Created 4 years, 8 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 | « src/wasm/wasm-module.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/wasm-run-utils.h
diff --git a/test/cctest/wasm/wasm-run-utils.h b/test/cctest/wasm/wasm-run-utils.h
index ce7ccb7dc0337d656aefa34aa1d312fa1b61188c..1d0fd7110d6eff801a6e3549d3850f8ad998ef4f 100644
--- a/test/cctest/wasm/wasm-run-utils.h
+++ b/test/cctest/wasm/wasm-run-utils.h
@@ -487,13 +487,29 @@ class WasmFunctionCompiler : public HandleAndZoneScope,
Code::ComputeFlags(Code::WASM_FUNCTION));
v8::base::SmartPointer<CompilationJob> job(Pipeline::NewWasmCompilationJob(
&info, graph(), desc, &source_position_table_));
- Handle<Code> code = Handle<Code>::null();
- if (job->OptimizeGraph() == CompilationJob::SUCCEEDED &&
- job->GenerateCode() == CompilationJob::SUCCEEDED) {
- code = info.code();
+ if (job->OptimizeGraph() != CompilationJob::SUCCEEDED ||
+ job->GenerateCode() != CompilationJob::SUCCEEDED)
+ return Handle<Code>::null();
+
+ Handle<Code> code = info.code();
+
+ // Length is always 2, since usually <wasm_obj, func_index> is stored in the
+ // deopt data. Here, we store <func_name, undef> instead.
+ DCHECK(code->deoptimization_data() == nullptr ||
+ code->deoptimization_data()->length() == 0);
+ Handle<FixedArray> deopt_data =
+ isolate()->factory()->NewFixedArray(2, TENURED);
+ if (debug_name_.start() != nullptr) {
+ MaybeHandle<String> maybe_name =
+ isolate()->factory()->NewStringFromUtf8(debug_name_, TENURED);
+ if (!maybe_name.is_null())
+ deopt_data->set(0, *maybe_name.ToHandleChecked());
}
+ deopt_data->set_length(2);
+ code->set_deoptimization_data(*deopt_data);
+
#ifdef ENABLE_DISASSEMBLER
- if (!code.is_null() && FLAG_print_opt_code) {
+ if (FLAG_print_opt_code) {
OFStream os(stdout);
code->Disassemble("wasm code", os);
}
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698