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

Unified Diff: src/runtime/runtime-function.cc

Issue 1970503004: [wasm] Differentiate unnamed and empty names (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@add-utf8-check
Patch Set: minor doc fix Created 4 years, 7 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/runtime/runtime-function.cc
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc
index 7d7b81109284cc88a597d2f05214076fe26aca17..eb5cf9311d7c213c11f51c0cb5097ed82ec3bdd6 100644
--- a/src/runtime/runtime-function.cc
+++ b/src/runtime/runtime-function.cc
@@ -307,10 +307,15 @@ RUNTIME_FUNCTION(Runtime_WasmGetFunctionName) {
HandleScope scope(isolate);
DCHECK_EQ(2, args.length());
- CONVERT_ARG_HANDLE_CHECKED(JSObject, wasm, 0);
+ CONVERT_ARG_HANDLE_CHECKED(Object, wasm, 0);
CONVERT_SMI_ARG_CHECKED(func_index, 1);
- return *wasm::GetWasmFunctionName(wasm, func_index);
+ RUNTIME_ASSERT(wasm->IsUndefined() || wasm->IsJSObject());
+ Handle<Object> funName =
+ wasm->IsUndefined()
+ ? wasm
+ : wasm::GetWasmFunctionName(Handle<JSObject>::cast(wasm), func_index);
+ return *funName;
}
} // namespace internal

Powered by Google App Engine
This is Rietveld 408576698