[torque] Remove objects.h include from class-verifiers

and replace it with forward declarations of all occuring classes.

R=tebbi@chromium.org

Bug: v8:7793
Change-Id: I337b069ef10d52e7e42332c977284b4d2ae8fafb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1609836
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61479}
This commit is contained in:
Sigurd Schneider 2019-05-14 10:16:57 +02:00 committed by Commit Bot
parent 758a668b18
commit cd574c152d

View File

@ -3050,7 +3050,7 @@ void ImplementationVisitor::GenerateClassVerifiers(
h_contents << enabled_check;
cc_contents << enabled_check;
h_contents << "\n#include \"src/objects.h\"\n";
cc_contents << "\n#include \"src/objects.h\"\n";
for (const std::string& include_path : GlobalContext::CppIncludes()) {
cc_contents << "#include " << StringLiteralQuote(include_path) << "\n";
@ -3067,9 +3067,17 @@ void ImplementationVisitor::GenerateClassVerifiers(
h_contents << namespaces;
cc_contents << namespaces;
// Generate forward declarations to avoid including any headers.
h_contents << "class Isolate;\n";
for (auto i : GlobalContext::GetClasses()) {
ClassType* type = i.second;
if (!type->IsExtern() || !type->ShouldGenerateVerify()) continue;
h_contents << "class " << type->name() << ";\n";
}
const char* verifier_class = "ClassVerifiersFromDSL";
h_contents << "class " << verifier_class << "{\n";
h_contents << "class " << verifier_class << " {\n";
h_contents << " public:\n";
for (auto i : GlobalContext::GetClasses()) {