Title: [163259] trunk
Revision
163259
Author
[email protected]
Date
2014-02-01 22:38:51 -0800 (Sat, 01 Feb 2014)

Log Message

JSC profiler's stub info profiling support should work again
https://bugs.webkit.org/show_bug.cgi?id=128057

Reviewed by Mark Lam.

Source/_javascript_Core: 

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::printGetByIdCacheStatus): We want to know if the cache was ever reset by GC, since the DFG uses this information.
(JSC::CodeBlock::printLocationAndOp): This shouldn't have been inline.
(JSC::CodeBlock::printLocationOpAndRegisterOperand): Ditto.
(JSC::CodeBlock::dumpBytecode): Dump the profiling field, and make sure that the caller can pass a StubInfoMap, which is necessary for dumping StructureStubInfo profiling.
* bytecode/CodeBlock.h: Out-of-line some methods and add the StubInfoMap parameter.
* profiler/ProfilerBytecodeSequence.cpp:
(JSC::Profiler::BytecodeSequence::BytecodeSequence): Create a StubInfoMap before dumping bytecodes.

Tools: 

* Scripts/display-profiler-output: Just make sure that there's always a space between the origin stack dump and the top bytecode index.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (163258 => 163259)


--- trunk/Source/_javascript_Core/ChangeLog	2014-02-02 06:38:18 UTC (rev 163258)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-02-02 06:38:51 UTC (rev 163259)
@@ -1,5 +1,21 @@
 2014-02-01  Filip Pizlo  <[email protected]>
 
+        JSC profiler's stub info profiling support should work again
+        https://bugs.webkit.org/show_bug.cgi?id=128057
+
+        Reviewed by Mark Lam.
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::printGetByIdCacheStatus): We want to know if the cache was ever reset by GC, since the DFG uses this information.
+        (JSC::CodeBlock::printLocationAndOp): This shouldn't have been inline.
+        (JSC::CodeBlock::printLocationOpAndRegisterOperand): Ditto.
+        (JSC::CodeBlock::dumpBytecode): Dump the profiling field, and make sure that the caller can pass a StubInfoMap, which is necessary for dumping StructureStubInfo profiling.
+        * bytecode/CodeBlock.h: Out-of-line some methods and add the StubInfoMap parameter.
+        * profiler/ProfilerBytecodeSequence.cpp:
+        (JSC::Profiler::BytecodeSequence::BytecodeSequence): Create a StubInfoMap before dumping bytecodes.
+
+2014-02-01  Filip Pizlo  <[email protected]>
+
         JSC profiler should show reasons for jettison
         https://bugs.webkit.org/show_bug.cgi?id=128047
 

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp (163258 => 163259)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2014-02-02 06:38:18 UTC (rev 163258)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2014-02-02 06:38:51 UTC (rev 163259)
@@ -364,6 +364,9 @@
 #if ENABLE(JIT)
     if (StructureStubInfo* stubPtr = map.get(CodeOrigin(location))) {
         StructureStubInfo& stubInfo = *stubPtr;
+        if (stubInfo.resetByGC)
+            out.print(" (Reset By GC)");
+        
         if (stubInfo.seen) {
             out.printf(" jit(");
             
@@ -657,6 +660,17 @@
     out.print(name, profile->m_counter);
 }
 
+void CodeBlock::printLocationAndOp(PrintStream& out, ExecState*, int location, const Instruction*&, const char* op)
+{
+    out.printf("[%4d] %-17s ", location, op);
+}
+
+void CodeBlock::printLocationOpAndRegisterOperand(PrintStream& out, ExecState* exec, int location, const Instruction*& it, const char* op, int operand)
+{
+    printLocationAndOp(out, exec, location, it, op);
+    out.printf("%s", registerName(operand).data());
+}
+
 void CodeBlock::dumpBytecode(PrintStream& out, ExecState* exec, const Instruction* begin, const Instruction*& it, const StubInfoMap& map)
 {
     int location = it - begin;
@@ -702,7 +716,9 @@
         case op_to_this: {
             int r0 = (++it)->u.operand;
             printLocationOpAndRegisterOperand(out, exec, location, it, "to_this", r0);
-            ++it; // Skip value profile.
+            Structure* structure = (++it)->u.structure.get();
+            if (structure)
+                out.print(" cache(struct = ", RawPointer(structure), ")");
             break;
         }
         case op_new_object: {
@@ -1441,11 +1457,11 @@
     out.print("\n");
 }
 
-void CodeBlock::dumpBytecode(PrintStream& out, unsigned bytecodeOffset)
+void CodeBlock::dumpBytecode(PrintStream& out, unsigned bytecodeOffset, const StubInfoMap& map)
 {
     ExecState* exec = m_globalObject->globalExec();
     const Instruction* it = instructions().begin() + bytecodeOffset;
-    dumpBytecode(out, exec, instructions().begin(), it);
+    dumpBytecode(out, exec, instructions().begin(), it, map);
 }
 
 #define FOR_EACH_MEMBER_VECTOR(macro) \

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.h (163258 => 163259)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.h	2014-02-02 06:38:18 UTC (rev 163258)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.h	2014-02-02 06:38:51 UTC (rev 163259)
@@ -147,7 +147,7 @@
     void visitAggregate(SlotVisitor&);
 
     void dumpBytecode(PrintStream& = WTF::dataFile());
-    void dumpBytecode(PrintStream&, unsigned bytecodeOffset);
+    void dumpBytecode(PrintStream&, unsigned bytecodeOffset, const StubInfoMap& = StubInfoMap());
     void printStructures(PrintStream&, const Instruction*);
     void printStructure(PrintStream&, const char* name, const Instruction*, int operand);
 
@@ -974,17 +974,9 @@
     enum CacheDumpMode { DumpCaches, DontDumpCaches };
     void printCallOp(PrintStream&, ExecState*, int location, const Instruction*&, const char* op, CacheDumpMode, bool& hasPrintedProfiling);
     void printPutByIdOp(PrintStream&, ExecState*, int location, const Instruction*&, const char* op);
-    void printLocationAndOp(PrintStream& out, ExecState*, int location, const Instruction*&, const char* op)
-    {
-        out.printf("[%4d] %-17s ", location, op);
-    }
+    void printLocationAndOp(PrintStream&, ExecState*, int location, const Instruction*&, const char* op);
+    void printLocationOpAndRegisterOperand(PrintStream&, ExecState*, int location, const Instruction*& it, const char* op, int operand);
 
-    void printLocationOpAndRegisterOperand(PrintStream& out, ExecState* exec, int location, const Instruction*& it, const char* op, int operand)
-    {
-        printLocationAndOp(out, exec, location, it, op);
-        out.printf("%s", registerName(operand).data());
-    }
-
     void beginDumpProfiling(PrintStream&, bool& hasPrintedProfiling);
     void dumpValueProfiling(PrintStream&, const Instruction*&, bool& hasPrintedProfiling);
     void dumpArrayProfiling(PrintStream&, const Instruction*&, bool& hasPrintedProfiling);

Modified: trunk/Source/_javascript_Core/profiler/ProfilerBytecodeSequence.cpp (163258 => 163259)


--- trunk/Source/_javascript_Core/profiler/ProfilerBytecodeSequence.cpp	2014-02-02 06:38:18 UTC (rev 163258)
+++ trunk/Source/_javascript_Core/profiler/ProfilerBytecodeSequence.cpp	2014-02-02 06:38:51 UTC (rev 163259)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2012, 2013, 2014 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -48,9 +48,12 @@
         m_header.append(out.toCString());
     }
     
+    StubInfoMap stubInfos;
+    codeBlock->getStubInfoMap(stubInfos);
+    
     for (unsigned bytecodeIndex = 0; bytecodeIndex < codeBlock->instructions().size();) {
         out.reset();
-        codeBlock->dumpBytecode(out, bytecodeIndex);
+        codeBlock->dumpBytecode(out, bytecodeIndex, stubInfos);
         m_sequence.append(Bytecode(bytecodeIndex, codeBlock->vm()->interpreter->getOpcodeID(codeBlock->instructions()[bytecodeIndex].u.opcode), out.toCString()));
         bytecodeIndex += opcodeLength(
             codeBlock->vm()->interpreter->getOpcodeID(

Modified: trunk/Tools/ChangeLog (163258 => 163259)


--- trunk/Tools/ChangeLog	2014-02-02 06:38:18 UTC (rev 163258)
+++ trunk/Tools/ChangeLog	2014-02-02 06:38:51 UTC (rev 163259)
@@ -1,5 +1,14 @@
 2014-02-01  Filip Pizlo  <[email protected]>
 
+        JSC profiler's stub info profiling support should work again
+        https://bugs.webkit.org/show_bug.cgi?id=128057
+
+        Reviewed by Mark Lam.
+
+        * Scripts/display-profiler-output: Just make sure that there's always a space between the origin stack dump and the top bytecode index.
+
+2014-02-01  Filip Pizlo  <[email protected]>
+
         JSC profiler should show reasons for jettison
         https://bugs.webkit.org/show_bug.cgi?id=128047
 

Modified: trunk/Tools/Scripts/display-profiler-output (163258 => 163259)


--- trunk/Tools/Scripts/display-profiler-output	2014-02-02 06:38:18 UTC (rev 163258)
+++ trunk/Tools/Scripts/display-profiler-output	2014-02-02 06:38:51 UTC (rev 163259)
@@ -445,7 +445,7 @@
 end
 
 def originToString(origin)
-    originToPrintStack(origin).join(" ") + "bc\##{origin[-1].bytecodeIndex}"
+    (originToPrintStack(origin) + ["bc\##{origin[-1].bytecodeIndex}"]).join(" ")
 end
 
 if ARGV.length != 1
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to