Bug 1026905 - IonMonkey: Remove the instruction counters from the script counters. r=bhackett, a=sledru
authorDouglas Crosher <dtc-moz@scieneer.com>
Wed, 18 Jun 2014 16:22:03 +1000
changeset 200614 bce3c9c7d8f7f951592704f5dc6cc7212011c189
parent 200613 b0b418b9709a5dcefcdd43aff4054fef62b3b1e3
child 200615 c7d17b1ecef843606092a04865ad4ae2644fc4af
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett, sledru
bugs1026905
milestone31.0
Bug 1026905 - IonMonkey: Remove the instruction counters from the script counters. r=bhackett, a=sledru
js/src/jit/CodeGenerator.cpp
js/src/jit/IonCode.h
js/src/jsopcode.cpp
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -3019,29 +3019,19 @@ CodeGenerator::maybeCreateScriptCounts()
 // Structure for managing the state tracked for a block by script counters.
 struct ScriptCountBlockState
 {
     IonBlockCounts &block;
     MacroAssembler &masm;
 
     Sprinter printer;
 
-    uint32_t instructionBytes;
-    uint32_t spillBytes;
-
-    // Pointer to instructionBytes, spillBytes, or nullptr, depending on the
-    // last instruction processed.
-    uint32_t *last;
-    uint32_t lastLength;
-
   public:
     ScriptCountBlockState(IonBlockCounts *block, MacroAssembler *masm)
-      : block(*block), masm(*masm),
-        printer(GetIonContext()->cx),
-        instructionBytes(0), spillBytes(0), last(nullptr), lastLength(0)
+      : block(*block), masm(*masm), printer(GetIonContext()->cx)
     {
     }
 
     bool init()
     {
         if (!printer.init())
             return false;
 
@@ -3053,39 +3043,29 @@ struct ScriptCountBlockState
         // Collect human readable assembly for the code generated in the block.
         masm.setPrinter(&printer);
 
         return true;
     }
 
     void visitInstruction(LInstruction *ins)
     {
-        if (last)
-            *last += masm.size() - lastLength;
-        lastLength = masm.size();
-        last = ins->isMoveGroup() ? &spillBytes : &instructionBytes;
-
         // Prefix stream of assembly instructions with their LIR instruction
         // name and any associated high level info.
         if (const char *extra = ins->extraName())
             printer.printf("[%s:%s]\n", ins->opName(), extra);
         else
             printer.printf("[%s]\n", ins->opName());
     }
 
     ~ScriptCountBlockState()
     {
         masm.setPrinter(nullptr);
 
-        if (last)
-            *last += masm.size() - lastLength;
-
         block.setCode(printer.string());
-        block.setInstructionBytes(instructionBytes);
-        block.setSpillBytes(spillBytes);
     }
 };
 
 #ifdef DEBUG
 bool
 CodeGenerator::branchIfInvalidated(Register temp, Label *invalidated)
 {
     CodeOffsetLabel label = masm.movWithPatch(ImmWord(uintptr_t(-1)), temp);
--- a/js/src/jit/IonCode.h
+++ b/js/src/jit/IonCode.h
@@ -632,21 +632,16 @@ struct IonBlockCounts
     uint32_t *successors_;
 
     // Hit count for this block.
     uint64_t hitCount_;
 
     // Text information about the code generated for this block.
     char *code_;
 
-    // Number of bytes of code generated in this block. Spill code is counted
-    // separately from other, instruction implementing code.
-    uint32_t instructionBytes_;
-    uint32_t spillBytes_;
-
   public:
 
     bool init(uint32_t id, uint32_t offset, uint32_t numSuccessors) {
         id_ = id;
         offset_ = offset;
         numSuccessors_ = numSuccessors;
         if (numSuccessors) {
             successors_ = js_pod_calloc<uint32_t>(numSuccessors);
@@ -697,32 +692,16 @@ struct IonBlockCounts
             strcpy(ncode, code);
             code_ = ncode;
         }
     }
 
     const char *code() const {
         return code_;
     }
-
-    void setInstructionBytes(uint32_t bytes) {
-        instructionBytes_ = bytes;
-    }
-
-    uint32_t instructionBytes() const {
-        return instructionBytes_;
-    }
-
-    void setSpillBytes(uint32_t bytes) {
-        spillBytes_ = bytes;
-    }
-
-    uint32_t spillBytes() const {
-        return spillBytes_;
-    }
 };
 
 // Execution information for a compiled script which may persist after the
 // IonScript is destroyed, for use during profiling.
 struct IonScriptCounts
 {
   private:
     // Any previous invalidated compilation(s) for the script.
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -224,18 +224,17 @@ js::DumpIonScriptCounts(Sprinter *sp, ji
     Sprint(sp, "IonScript [%lu blocks]:\n", ionCounts->numBlocks());
     for (size_t i = 0; i < ionCounts->numBlocks(); i++) {
         const jit::IonBlockCounts &block = ionCounts->block(i);
         if (block.hitCount() < 10)
             continue;
         Sprint(sp, "BB #%lu [%05u]", block.id(), block.offset());
         for (size_t j = 0; j < block.numSuccessors(); j++)
             Sprint(sp, " -> #%lu", block.successor(j));
-        Sprint(sp, " :: %llu hits %u instruction bytes %u spill bytes\n",
-               block.hitCount(), block.instructionBytes(), block.spillBytes());
+        Sprint(sp, " :: %llu hits\n", block.hitCount());
         Sprint(sp, "%s\n", block.code());
     }
 }
 #endif
 
 void
 js_DumpPCCounts(JSContext *cx, HandleScript script, js::Sprinter *sp)
 {
@@ -2204,23 +2203,16 @@ GetPCCountJSON(JSContext *cx, const Scri
                 AppendJSONProperty(buf, "hits");
                 NumberValueToStringBuffer(cx, DoubleValue(block.hitCount()), buf);
 
                 AppendJSONProperty(buf, "code");
                 JSString *str = JS_NewStringCopyZ(cx, block.code());
                 if (!str || !(str = StringToSource(cx, str)))
                     return false;
                 buf.append(str);
-
-                AppendJSONProperty(buf, "instructionBytes");
-                NumberValueToStringBuffer(cx, Int32Value(block.instructionBytes()), buf);
-
-                AppendJSONProperty(buf, "spillBytes");
-                NumberValueToStringBuffer(cx, Int32Value(block.spillBytes()), buf);
-
                 buf.append('}');
             }
             buf.append(']');
 
             ionCounts = ionCounts->previous();
         }
         buf.append(']');
     }