Commit 5da538d9 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[turbolizer] Fix bug in graph visualizer

Bug: chromium:846000
Change-Id: If74749f11c7e1e112090a18f79ebed1819535d24
Reviewed-on: https://chromium-review.googlesource.com/1071671Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53338}
parent 37f46e28
......@@ -93,6 +93,7 @@ void JsonPrintFunctionSource(std::ostream& os, int source_id,
int SourceIdAssigner::GetIdFor(Handle<SharedFunctionInfo> shared) {
for (unsigned i = 0; i < printed_.size(); i++) {
if (printed_.at(i).is_identical_to(shared)) {
source_ids_.push_back(i);
return i;
}
}
......
......@@ -131,6 +131,19 @@ TEST(NodeNetworkOfDummiesReachableFromEnd) {
os << AsJSON(graph, &table, &table2);
}
TEST(TestSourceIdAssigner) {
Handle<SharedFunctionInfo> shared1;
Handle<SharedFunctionInfo> shared2;
SourceIdAssigner assigner(2);
const int source_id1 = assigner.GetIdFor(shared1);
const int source_id2 = assigner.GetIdFor(shared2);
CHECK_EQ(source_id1, source_id2);
CHECK_EQ(source_id1, assigner.GetIdAt(0));
CHECK_EQ(source_id2, assigner.GetIdAt(1));
}
} // namespace compiler
} // namespace internal
} // namespace v8
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