Commit 5a04c5ce authored by Janusz Majnert's avatar Janusz Majnert Committed by Commit Bot

Make torque emit structs in classes in order

Torque compiler emits a C++ class definition header
class-definitions-tq.h. Unfortunately it does so in a manner that
introduces randomness into the ordering of some structs. This means that
every full build of V8 may yield a different header.
Since this header is included in a lot of files in V8, it causes a lot
of ccache misses (over a 1000).

This commit makes sure that the structs are emitted in lexical order.

Bug: v8:10310
Change-Id: Ie39066d36e41583ff990bc639f7f241462351585
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2093500
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66645}
parent 9d3cca1c
......@@ -104,6 +104,7 @@ Isiah Meadows <impinball@gmail.com>
Jaime Bernardo <jaime@janeasystems.com>
Jan de Mooij <jandemooij@gmail.com>
Jan Krems <jan.krems@gmail.com>
Janusz Majnert <jmajnert@gmail.com>
Jay Freeman <saurik@saurik.com>
James Pike <g00gle@chilon.net>
James M Snell <jasnell@gmail.com>
......
......@@ -3888,7 +3888,7 @@ void ImplementationVisitor::GenerateClassDefinitions(
NamespaceScope implementation_namespaces(implementation,
{"v8", "internal"});
std::unordered_set<const StructType*> structs_used_in_classes;
std::set<const StructType*, TypeLess> structs_used_in_classes;
for (const ClassType* type : TypeOracle::GetClasses()) {
std::stringstream& header = (type->IsExtern() || type->ShouldExport())
......
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