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) { ...@@ -2626,7 +2626,7 @@ void JSObject::JSObjectShortPrint(StringStream* accumulator) {
!heap->Contains(HeapObject::cast(constructor))) { !heap->Contains(HeapObject::cast(constructor))) {
accumulator->Add("!!!INVALID CONSTRUCTOR!!!"); accumulator->Add("!!!INVALID CONSTRUCTOR!!!");
} else { } else {
bool global_object = IsJSGlobalProxy(); bool is_global_proxy = IsJSGlobalProxy();
if (constructor.IsJSFunction()) { if (constructor.IsJSFunction()) {
if (!heap->Contains(JSFunction::cast(constructor).shared())) { if (!heap->Contains(JSFunction::cast(constructor).shared())) {
accumulator->Add("!!!INVALID SHARED ON CONSTRUCTOR!!!"); accumulator->Add("!!!INVALID SHARED ON CONSTRUCTOR!!!");
...@@ -2634,7 +2634,7 @@ void JSObject::JSObjectShortPrint(StringStream* accumulator) { ...@@ -2634,7 +2634,7 @@ void JSObject::JSObjectShortPrint(StringStream* accumulator) {
String constructor_name = String constructor_name =
JSFunction::cast(constructor).shared().Name(); JSFunction::cast(constructor).shared().Name();
if (constructor_name.length() > 0) { if (constructor_name.length() > 0) {
accumulator->Add(global_object ? "<GlobalObject " : "<"); accumulator->Add(is_global_proxy ? "<GlobalObject " : "<");
accumulator->Put(constructor_name); accumulator->Put(constructor_name);
accumulator->Add(" %smap = %p", accumulator->Add(" %smap = %p",
map_of_this.is_deprecated() ? "deprecated-" : "", map_of_this.is_deprecated() ? "deprecated-" : "",
...@@ -2643,11 +2643,18 @@ void JSObject::JSObjectShortPrint(StringStream* accumulator) { ...@@ -2643,11 +2643,18 @@ void JSObject::JSObjectShortPrint(StringStream* accumulator) {
} }
} }
} else if (constructor.IsFunctionTemplateInfo()) { } else if (constructor.IsFunctionTemplateInfo()) {
accumulator->Add(global_object ? "<RemoteObject>" : "<RemoteObject>"); accumulator->Add("<RemoteObject>");
printed = true; printed = true;
} }
if (!printed) { 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()) { 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