Commit 1d9be5dc authored by Camillo Bruni's avatar Camillo Bruni Committed by V8 LUCI CQ

[runtime][printer] Fix JSGlobalProxy short printing

Change-Id: Ia3170ef243a988c05f5892893b80b5b0a4f43b0a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3008895
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75589}
parent 1a60e929
......@@ -2626,7 +2626,7 @@ void JSObject::JSObjectShortPrint(StringStream* accumulator) {
!heap->Contains(HeapObject::cast(constructor))) {
accumulator->Add("!!!INVALID CONSTRUCTOR!!!");
} else {
bool global_object = IsJSGlobalProxy();
bool is_global_proxy = IsJSGlobalProxy();
if (constructor.IsJSFunction()) {
if (!heap->Contains(JSFunction::cast(constructor).shared())) {
accumulator->Add("!!!INVALID SHARED ON CONSTRUCTOR!!!");
......@@ -2634,7 +2634,7 @@ void JSObject::JSObjectShortPrint(StringStream* accumulator) {
String constructor_name =
JSFunction::cast(constructor).shared().Name();
if (constructor_name.length() > 0) {
accumulator->Add(global_object ? "<GlobalObject " : "<");
accumulator->Add(is_global_proxy ? "<GlobalObject " : "<");
accumulator->Put(constructor_name);
accumulator->Add(" %smap = %p",
map_of_this.is_deprecated() ? "deprecated-" : "",
......@@ -2643,11 +2643,18 @@ void JSObject::JSObjectShortPrint(StringStream* accumulator) {
}
}
} else if (constructor.IsFunctionTemplateInfo()) {
accumulator->Add(global_object ? "<RemoteObject>" : "<RemoteObject>");
accumulator->Add("<RemoteObject>");
printed = true;
}
if (!printed) {
accumulator->Add("<JS%sObject", global_object ? "Global " : "");
accumulator->Add("<JS");
if (is_global_proxy) {
accumulator->Add("GlobalProxy");
} else if (IsJSGlobalObject()) {
accumulator->Add("GlobalObject");
} else {
accumulator->Add("Object");
}
}
}
if (IsJSPrimitiveWrapper()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment