Title: [151848] branches/dfgFourthTier
Revision
151848
Author
[email protected]
Date
2013-06-21 12:25:48 -0700 (Fri, 21 Jun 2013)

Log Message

Merge trunk r146548.

Source/_javascript_Core: 

    2013-03-21  Filip Pizlo  <[email protected]>
    
    JSC profiler should have an at-a-glance report of the success of DFG optimization
    https://bugs.webkit.org/show_bug.cgi?id=112988
    
    Reviewed by Geoffrey Garen.
    
    * dfg/DFGByteCodeParser.cpp:
    (JSC::DFG::ByteCodeParser::handleCall):
    (JSC::DFG::ByteCodeParser::handleGetById):
    (JSC::DFG::ByteCodeParser::parseBlock):
    * profiler/ProfilerCompilation.cpp:
    (JSC::Profiler::Compilation::Compilation):
    (JSC::Profiler::Compilation::toJS):
    * profiler/ProfilerCompilation.h:
    (JSC::Profiler::Compilation::noticeInlinedGetById):
    (JSC::Profiler::Compilation::noticeInlinedPutById):
    (JSC::Profiler::Compilation::noticeInlinedCall):
    (Compilation):
    * runtime/CommonIdentifiers.h:

Tools: 

    2013-03-21  Filip Pizlo  <[email protected]>
    
    JSC profiler should have an at-a-glance report of the success of DFG optimization
    https://bugs.webkit.org/show_bug.cgi?id=112988
    
    Reviewed by Geoffrey Garen.
    
    * Scripts/display-profiler-output:

Modified Paths

Diff

Modified: branches/dfgFourthTier/Source/_javascript_Core/ChangeLog (151847 => 151848)


--- branches/dfgFourthTier/Source/_javascript_Core/ChangeLog	2013-06-21 18:47:33 UTC (rev 151847)
+++ branches/dfgFourthTier/Source/_javascript_Core/ChangeLog	2013-06-21 19:25:48 UTC (rev 151848)
@@ -1,3 +1,28 @@
+2013-06-21  Filip Pizlo  <[email protected]>
+
+        Merge trunk r146548.
+
+    2013-03-21  Filip Pizlo  <[email protected]>
+    
+            JSC profiler should have an at-a-glance report of the success of DFG optimization
+            https://bugs.webkit.org/show_bug.cgi?id=112988
+    
+            Reviewed by Geoffrey Garen.
+    
+            * dfg/DFGByteCodeParser.cpp:
+            (JSC::DFG::ByteCodeParser::handleCall):
+            (JSC::DFG::ByteCodeParser::handleGetById):
+            (JSC::DFG::ByteCodeParser::parseBlock):
+            * profiler/ProfilerCompilation.cpp:
+            (JSC::Profiler::Compilation::Compilation):
+            (JSC::Profiler::Compilation::toJS):
+            * profiler/ProfilerCompilation.h:
+            (JSC::Profiler::Compilation::noticeInlinedGetById):
+            (JSC::Profiler::Compilation::noticeInlinedPutById):
+            (JSC::Profiler::Compilation::noticeInlinedCall):
+            (Compilation):
+            * runtime/CommonIdentifiers.h:
+    
 2013-06-20  Filip Pizlo  <[email protected]>
 
         fourthTier: Structure should have a dump()

Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (151847 => 151848)


--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2013-06-21 18:47:33 UTC (rev 151847)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2013-06-21 19:25:48 UTC (rev 151848)
@@ -1189,10 +1189,15 @@
             // the inputs must be kept alive whatever exits the intrinsic may do.
             addToGraph(Phantom, callTarget);
             emitArgumentPhantoms(registerOffset, argumentCountIncludingThis, kind);
+            if (m_graph.compilation())
+                m_graph.compilation()->noticeInlinedCall();
             return;
         }
-    } else if (handleInlining(callTarget, resultOperand, callLinkStatus, registerOffset, argumentCountIncludingThis, nextOffset, kind))
+    } else if (handleInlining(callTarget, resultOperand, callLinkStatus, registerOffset, argumentCountIncludingThis, nextOffset, kind)) {
+        if (m_graph.compilation())
+            m_graph.compilation()->noticeInlinedCall();
         return;
+    }
     
     addCall(currentInstruction, op);
 }
@@ -1675,6 +1680,8 @@
     // execution if it doesn't have a prediction, so we do it manually.
     if (prediction == SpecNone)
         addToGraph(ForceOSRExit);
+    else if (m_graph.compilation())
+        m_graph.compilation()->noticeInlinedGetById();
     
     Node* originalBaseForBaselineJIT = base;
                 
@@ -2378,8 +2385,11 @@
                 m_currentIndex,
                 m_graph.identifiers()[identifierNumber]);
 
-            if (!putByIdStatus.isSet())
+            bool canCountAsInlined = true;
+            if (!putByIdStatus.isSet()) {
                 addToGraph(ForceOSRExit);
+                canCountAsInlined = false;
+            }
             
             bool hasExitSite =
                 m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache)
@@ -2459,7 +2469,11 @@
                     addToGraph(PutByIdDirect, OpInfo(identifierNumber), base, value);
                 else
                     addToGraph(PutById, OpInfo(identifierNumber), base, value);
+                canCountAsInlined = false;
             }
+            
+            if (canCountAsInlined && m_graph.compilation())
+                m_graph.compilation()->noticeInlinedPutById();
 
             NEXT_OPCODE(op_put_by_id);
         }

Modified: branches/dfgFourthTier/Source/_javascript_Core/profiler/ProfilerCompilation.cpp (151847 => 151848)


--- branches/dfgFourthTier/Source/_javascript_Core/profiler/ProfilerCompilation.cpp	2013-06-21 18:47:33 UTC (rev 151847)
+++ branches/dfgFourthTier/Source/_javascript_Core/profiler/ProfilerCompilation.cpp	2013-06-21 19:25:48 UTC (rev 151848)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -37,6 +37,9 @@
 Compilation::Compilation(Bytecodes* bytecodes, CompilationKind kind)
     : m_bytecodes(bytecodes)
     , m_kind(kind)
+    , m_numInlinedGetByIds(0)
+    , m_numInlinedPutByIds(0)
+    , m_numInlinedCalls(0)
 {
 }
 
@@ -124,6 +127,10 @@
         exits->putDirectIndex(exec, i, m_osrExits[i].toJS(exec));
     result->putDirect(exec->vm(), exec->propertyNames().osrExits, exits);
     
+    result->putDirect(exec->vm(), exec->propertyNames().numInlinedGetByIds, jsNumber(m_numInlinedGetByIds));
+    result->putDirect(exec->vm(), exec->propertyNames().numInlinedPutByIds, jsNumber(m_numInlinedPutByIds));
+    result->putDirect(exec->vm(), exec->propertyNames().numInlinedCalls, jsNumber(m_numInlinedCalls));
+    
     return result;
 }
 

Modified: branches/dfgFourthTier/Source/_javascript_Core/profiler/ProfilerCompilation.h (151847 => 151848)


--- branches/dfgFourthTier/Source/_javascript_Core/profiler/ProfilerCompilation.h	2013-06-21 18:47:33 UTC (rev 151847)
+++ branches/dfgFourthTier/Source/_javascript_Core/profiler/ProfilerCompilation.h	2013-06-21 19:25:48 UTC (rev 151848)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -55,6 +55,10 @@
     unsigned profiledBytecodesSize() const { return m_profiledBytecodes.size(); }
     const ProfiledBytecodes& profiledBytecodesAt(unsigned i) const { return m_profiledBytecodes[i]; }
     
+    void noticeInlinedGetById() { m_numInlinedGetByIds++; }
+    void noticeInlinedPutById() { m_numInlinedPutByIds++; }
+    void noticeInlinedCall() { m_numInlinedCalls++; }
+    
     Bytecodes* bytecodes() const { return m_bytecodes; }
     CompilationKind kind() const { return m_kind; }
     
@@ -73,6 +77,9 @@
     HashMap<OriginStack, OwnPtr<ExecutionCounter> > m_counters;
     Vector<OSRExitSite> m_osrExitSites;
     SegmentedVector<OSRExit> m_osrExits;
+    unsigned m_numInlinedGetByIds;
+    unsigned m_numInlinedPutByIds;
+    unsigned m_numInlinedCalls;
 };
 
 } } // namespace JSC::Profiler

Modified: branches/dfgFourthTier/Source/_javascript_Core/runtime/CommonIdentifiers.h (151847 => 151848)


--- branches/dfgFourthTier/Source/_javascript_Core/runtime/CommonIdentifiers.h	2013-06-21 18:47:33 UTC (rev 151847)
+++ branches/dfgFourthTier/Source/_javascript_Core/runtime/CommonIdentifiers.h	2013-06-21 19:25:48 UTC (rev 151848)
@@ -73,6 +73,9 @@
     macro(multiline) \
     macro(name) \
     macro(now) \
+    macro(numInlinedGetByIds) \
+    macro(numInlinedPutByIds) \
+    macro(numInlinedCalls) \
     macro(Object) \
     macro(opcode) \
     macro(origin) \

Modified: branches/dfgFourthTier/Tools/ChangeLog (151847 => 151848)


--- branches/dfgFourthTier/Tools/ChangeLog	2013-06-21 18:47:33 UTC (rev 151847)
+++ branches/dfgFourthTier/Tools/ChangeLog	2013-06-21 19:25:48 UTC (rev 151848)
@@ -1,3 +1,16 @@
+2013-06-21  Filip Pizlo  <[email protected]>
+
+        Merge trunk r146548.
+
+    2013-03-21  Filip Pizlo  <[email protected]>
+    
+            JSC profiler should have an at-a-glance report of the success of DFG optimization
+            https://bugs.webkit.org/show_bug.cgi?id=112988
+    
+            Reviewed by Geoffrey Garen.
+    
+            * Scripts/display-profiler-output:
+    
 2013-06-09  Filip Pizlo  <[email protected]>
 
         Unreviewed, fix minor goof in profiling output layout. We weren't accounting

Modified: branches/dfgFourthTier/Tools/Scripts/display-profiler-output (151847 => 151848)


--- branches/dfgFourthTier/Tools/Scripts/display-profiler-output	2013-06-21 18:47:33 UTC (rev 151847)
+++ branches/dfgFourthTier/Tools/Scripts/display-profiler-output	2013-06-21 19:25:48 UTC (rev 151848)
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-# Copyright (C) 2012 Apple Inc. All rights reserved.
+# Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -329,7 +329,9 @@
 end
 
 class Compilation
-    attr_accessor :bytecode, :engine, :descriptions, :counters, :compilationIndex, :osrExits, :profiledBytecodes
+    attr_accessor :bytecode, :engine, :descriptions, :counters, :compilationIndex
+    attr_accessor :osrExits, :profiledBytecodes, :numInlinedGetByIds, :numInlinedPutByIds
+    attr_accessor :numInlinedCalls
     
     def initialize(json)
         @bytecode = $bytecodes[json["bytecodesID"].to_i]
@@ -379,6 +381,9 @@
             | subJson |
             @profiledBytecodes << ProfiledBytecodes.new(subJson)
         }
+        @numInlinedGetByIds = json["numInlinedGetByIds"]
+        @numInlinedPutByIds = json["numInlinedPutByIds"]
+        @numInlinedCalls = json["numInlinedCalls"]
     end
     
     def codeHashSortKey
@@ -535,6 +540,9 @@
         
         exitCountCols = 7
         remaining -= exitCountCols + 1
+        
+        recentOptsCols = 12
+        remaining -= recentOptsCols + 1
     end
     
     if remaining > 0
@@ -553,6 +561,7 @@
         print(" " + center("#Compil", compilationsCols))
         print(" " + center("Inlines", inlinesCols))
         print(" " + center("#Exits", exitCountCols))
+        print(" " + center("Last Opts", recentOptsCols))
     end
     if sourceCols
         print(" " + center("Source", sourceCols))
@@ -568,6 +577,8 @@
         print(" " + center("Base/DFG", machineCountCols))
         print(" " + (" " * compilationsCols))
         print(" " + center("Src/Total", inlinesCols))
+        print(" " + (" " * exitCountCols))
+        print(" " + center("Get/Put/Call", recentOptsCols))
     end
     puts
     $bytecodes.sort {
@@ -592,6 +603,15 @@
             print(" " + center(bytecode.compilations.size.to_s, compilationsCols))
             print(" " + center(bytecode.sourceMachineInlineSites.to_s + "/" + bytecode.totalMachineInlineSites.to_s, inlinesCols))
             print(" " + center(bytecode.totalExitCount.to_s, exitCountCols))
+            lastCompilation = bytecode.compilations[-1]
+            if lastCompilation
+                optData = [lastCompilation.numInlinedGetByIds,
+                           lastCompilation.numInlinedPutByIds,
+                           lastCompilation.numInlinedCalls]
+            else
+                optData = ["N/A"]
+            end
+            print(" " + center(optData.join('/'), recentOptsCols))
         end
         if sourceCols
             print(" " + sourceOnOneLine(bytecode.source, sourceCols))
@@ -872,6 +892,7 @@
             end
             
             puts("Compilation #{compilation}:")
+            puts("    Num inlined: GetByIds: #{compilation.numInlinedGetByIds}  PutByIds: #{compilation.numInlinedPutByIds}  Calls: #{compilation.numInlinedCalls}")
             if $showCounts
                 puts(center("Actual Counts", actualCountCols) + " " + center("Source Counts", sourceCountCols) + " " + center("Disassembly in #{compilation.engine}", screenWidth - 1 - sourceCountCols - 1 - actualCountCols))
                 puts((" " * actualCountCols) + " " + center("Base/DFG", sourceCountCols))
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to