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

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

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 | « BUILD.gn ('k') | src/objects.h » ('j') | 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 8c11d9628bfc5a6aa75b0ae4a2be0df62c823b95..4fa1cdd2235b3b0805caf536b32640952358884b 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -2977,7 +2977,24 @@ Handle<Code> CompileWasmFunction(wasm::ErrorThrower* thrower, Isolate* isolate,
}
buffer.Dispose();
+
if (!code.is_null()) {
+ DCHECK(code->deoptimization_data() == nullptr ||
+ code->deoptimization_data()->length() == 0);
+ Handle<FixedArray> deopt_data =
+ isolate->factory()->NewFixedArray(2, TENURED);
+ if (!module_env->instance->js_object.is_null()) {
+ deopt_data->set(0, *module_env->instance->js_object);
+ deopt_data->set(1, Smi::FromInt(function->func_index));
+ } else if (func_name.start() != nullptr) {
+ MaybeHandle<String> maybe_name =
+ isolate->factory()->NewStringFromUtf8(func_name);
+ if (!maybe_name.is_null())
+ deopt_data->set(0, *maybe_name.ToHandleChecked());
+ }
+ deopt_data->set_length(2);
+ code->set_deoptimization_data(*deopt_data);
+
RecordFunctionCompilation(
Logger::FUNCTION_TAG, &info, "WASM_function", function->func_index,
module_env->module->GetName(function->name_offset,
« no previous file with comments | « BUILD.gn ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698