From c8a0ea9e3a7865b2aef9d1c4baba5d449f3b1e63 Mon Sep 17 00:00:00 2001 From: "dcarney@chromium.org" Date: Wed, 15 Oct 2014 08:23:24 +0000 Subject: [PATCH] [turbofan] fix block mapping in code comments R=bmeurer@chromium.org BUG= Review URL: https://codereview.chromium.org/635213003 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24616 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/compiler/code-generator.cc | 3 +-- src/compiler/instruction.h | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc index bb0ef1b..d1faeb0 100644 --- a/src/compiler/code-generator.cc +++ b/src/compiler/code-generator.cc @@ -107,8 +107,7 @@ void CodeGenerator::AssembleInstruction(Instruction* instr) { if (FLAG_code_comments) { // TODO(titzer): these code comments are a giant memory leak. Vector buffer = Vector::New(32); - // TODO(dcarney): should not be rpo number there - SNPrintF(buffer, "-- B%d (rpo) start --", current_block_.ToInt()); + SNPrintF(buffer, "-- B%d start --", block_start->id().ToInt()); masm()->RecordComment(buffer.start()); } masm()->bind(block_start->label()); diff --git a/src/compiler/instruction.h b/src/compiler/instruction.h index 72ea043..fc4778f 100644 --- a/src/compiler/instruction.h +++ b/src/compiler/instruction.h @@ -598,6 +598,7 @@ class BlockStartInstruction FINAL : public GapInstruction { public: Label* label() { return &label_; } BasicBlock::RpoNumber rpo_number() const { return rpo_number_; } + BasicBlock::Id id() const { return id_; } static BlockStartInstruction* New(Zone* zone, BasicBlock* block) { void* buffer = zone->New(sizeof(BlockStartInstruction)); @@ -612,8 +613,10 @@ class BlockStartInstruction FINAL : public GapInstruction { private: explicit BlockStartInstruction(BasicBlock* block) : GapInstruction(kBlockStartInstruction), + id_(block->id()), rpo_number_(block->GetRpoNumber()) {} + BasicBlock::Id id_; BasicBlock::RpoNumber rpo_number_; Label label_; }; -- 2.7.4