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

Unified Diff: src/isolate.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/frames.cc ('k') | src/js/messages.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 9d3511327e63dd8592c2a33f296e6cc0308d748b..0cfac8c2df24d87ff3134456a9da9e1a3bb6828b 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -39,7 +39,7 @@
#include "src/v8.h"
#include "src/version.h"
#include "src/vm-state-inl.h"
-
+#include "src/wasm/wasm-module.h"
namespace v8 {
namespace internal {
@@ -616,11 +616,17 @@ class CaptureStackTraceHelper {
factory()->NewJSObject(isolate_->object_function());
if (!function_key_.is_null()) {
- Handle<Object> fun_name = handle(frame->function_name(), isolate_);
- if (fun_name->IsUndefined())
- fun_name = isolate_->factory()->InternalizeUtf8String(
- Vector<const char>("<WASM>"));
- JSObject::AddProperty(stack_frame, function_key_, fun_name, NONE);
+ Object* wasm_object = frame->wasm_obj();
+ Handle<String> name;
+ if (!wasm_object->IsUndefined()) {
+ Handle<JSObject> wasm = handle(JSObject::cast(wasm_object));
+ wasm::GetWasmFunctionName(wasm, frame->function_index())
+ .ToHandle(&name);
+ }
+ if (name.is_null()) {
+ name = isolate_->factory()->NewStringFromStaticChars("<WASM UNNAMED>");
+ }
+ JSObject::AddProperty(stack_frame, function_key_, name, NONE);
}
// Encode the function index as line number.
if (!line_key_.is_null()) {
« no previous file with comments | « src/frames.cc ('k') | src/js/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698