[turbofan] fix block mapping in code comments
authordcarney@chromium.org <dcarney@chromium.org>
Wed, 15 Oct 2014 08:23:24 +0000 (08:23 +0000)
committerdcarney@chromium.org <dcarney@chromium.org>
Wed, 15 Oct 2014 08:23:24 +0000 (08:23 +0000)
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
src/compiler/instruction.h

index bb0ef1b..d1faeb0 100644 (file)
@@ -107,8 +107,7 @@ void CodeGenerator::AssembleInstruction(Instruction* instr) {
     if (FLAG_code_comments) {
       // TODO(titzer): these code comments are a giant memory leak.
       Vector<char> buffer = Vector<char>::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());
index 72ea043..fc4778f 100644 (file)
@@ -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_;
 };