From a78afeb6cd9da579b2fbaa641bf44dee1bd7a345 Mon Sep 17 00:00:00 2001 From: neis Date: Tue, 11 Oct 2016 09:28:54 -0700 Subject: [PATCH] [modules] Add internal printer method for JSModuleNamespace. R=adamk@chromium.org BUG=v8:1569 Review-Url: https://codereview.chromium.org/2410003002 Cr-Commit-Position: refs/heads/master@{#40181} --- src/objects-printer.cc | 9 +++++++++ src/objects.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/objects-printer.cc b/src/objects-printer.cc index 9054371e84..48182152a3 100644 --- a/src/objects-printer.cc +++ b/src/objects-printer.cc @@ -166,6 +166,9 @@ void HeapObject::HeapObjectPrint(std::ostream& os) { // NOLINT case JS_WEAK_SET_TYPE: JSWeakSet::cast(this)->JSWeakSetPrint(os); break; + case JS_MODULE_NAMESPACE_TYPE: + JSModuleNamespace::cast(this)->JSModuleNamespacePrint(os); + break; case FOREIGN_TYPE: Foreign::cast(this)->ForeignPrint(os); break; @@ -1168,6 +1171,12 @@ void Module::ModulePrint(std::ostream& os) { // NOLINT os << "\n"; } +void JSModuleNamespace::JSModuleNamespacePrint(std::ostream& os) { // NOLINT + HeapObject::PrintHeader(os, "JSModuleNamespace"); + os << "\n - module: " << Brief(module()); + os << "\n"; +} + void PrototypeInfo::PrototypeInfoPrint(std::ostream& os) { // NOLINT HeapObject::PrintHeader(os, "PrototypeInfo"); os << "\n - prototype users: " << Brief(prototype_users()); diff --git a/src/objects.h b/src/objects.h index f77ac4bc8e..d02c04dbc0 100644 --- a/src/objects.h +++ b/src/objects.h @@ -7881,6 +7881,7 @@ class JSGeneratorObject: public JSObject { class JSModuleNamespace : public JSObject { public: DECLARE_CAST(JSModuleNamespace) + DECLARE_PRINTER(JSModuleNamespace) DECLARE_VERIFIER(JSModuleNamespace) // The actual module whose namespace is being represented.