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

Unified Diff: src/messages.cc

Issue 1970503004: [wasm] Differentiate unnamed and empty names (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@add-utf8-check
Patch Set: Yang's last comments 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
« no previous file with comments | « src/js/messages.js ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.cc
diff --git a/src/messages.cc b/src/messages.cc
index 6e7c495643aa55816300fed8141a009937ac3e23..74f4729b1f5f5627976b02dc3a147af0751c1de0 100644
--- a/src/messages.cc
+++ b/src/messages.cc
@@ -205,12 +205,13 @@ Handle<Object> CallSite::GetFileName() {
Handle<Object> CallSite::GetFunctionName() {
if (IsWasm()) {
- if (wasm_obj_->IsUndefined()) return isolate_->factory()->null_value();
- // wasm_obj_ can be a String if we generate WASM code directly in a test
- // case.
- if (wasm_obj_->IsString()) return wasm_obj_;
- return wasm::GetWasmFunctionName(Handle<JSObject>::cast(wasm_obj_),
- wasm_func_index_);
+ MaybeHandle<String> name;
+ if (!wasm_obj_->IsUndefined()) {
+ name = wasm::GetWasmFunctionName(Handle<JSObject>::cast(wasm_obj_),
+ wasm_func_index_);
+ }
+ if (name.is_null()) return isolate_->factory()->null_value();
+ return name.ToHandleChecked();
}
Handle<String> result = JSFunction::GetName(fun_);
if (result->length() != 0) return result;
« no previous file with comments | « src/js/messages.js ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698