Title: [95219] trunk/Source/_javascript_Core
Revision
95219
Author
fpi...@apple.com
Date
2011-09-15 12:56:21 -0700 (Thu, 15 Sep 2011)

Log Message

Value profiles collect no information for global variables
https://bugs.webkit.org/show_bug.cgi?id=68143

Reviewed by Geoffrey Garen.
        
17% speed-up on string-fasta.  Neutral elsewhere.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::getStrongPrediction):
(JSC::DFG::ByteCodeParser::stronglyPredict):
(JSC::DFG::ByteCodeParser::parseBlock):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_get_global_var):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (95218 => 95219)


--- trunk/Source/_javascript_Core/ChangeLog	2011-09-15 19:49:53 UTC (rev 95218)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-09-15 19:56:21 UTC (rev 95219)
@@ -1,3 +1,19 @@
+2011-09-14  Filip Pizlo  <fpi...@apple.com>
+
+        Value profiles collect no information for global variables
+        https://bugs.webkit.org/show_bug.cgi?id=68143
+
+        Reviewed by Geoffrey Garen.
+        
+        17% speed-up on string-fasta.  Neutral elsewhere.
+
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::getStrongPrediction):
+        (JSC::DFG::ByteCodeParser::stronglyPredict):
+        (JSC::DFG::ByteCodeParser::parseBlock):
+        * jit/JITPropertyAccess.cpp:
+        (JSC::JIT::emit_op_get_global_var):
+
 2011-09-15  Eric Seidel  <e...@webkit.org>
 
         Remove ENABLE_SVG_ANIMATION as all major ports have it on by default

Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (95218 => 95219)


--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2011-09-15 19:49:53 UTC (rev 95218)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2011-09-15 19:56:21 UTC (rev 95219)
@@ -474,21 +474,29 @@
         } while (!m_reusableNodeStack.isEmpty());
     }
     
-    void stronglyPredict(NodeIndex nodeIndex, unsigned bytecodeIndex)
+    PredictedType getStrongPrediction(NodeIndex nodeIndex, unsigned bytecodeIndex)
     {
+        UNUSED_PARAM(nodeIndex);
+        UNUSED_PARAM(bytecodeIndex);
+        
 #if ENABLE(DYNAMIC_OPTIMIZATION)
         ValueProfile* profile = ""
         ASSERT(profile);
-        m_graph[nodeIndex].predict(profile->computeUpdatedPrediction() & ~PredictionTagMask, StrongPrediction);
+        PredictedType prediction = profile->computeUpdatedPrediction();
 #if ENABLE(DFG_DEBUG_VERBOSE)
-        printf("Dynamic [%u, %u] prediction: %s\n", nodeIndex, bytecodeIndex, predictionToString(m_graph[nodeIndex].getPrediction()));
+        printf("Dynamic [%u, %u] prediction: %s\n", nodeIndex, bytecodeIndex, predictionToString(prediction));
 #endif
+        return prediction;
 #else
-        UNUSED_PARAM(nodeIndex);
-        UNUSED_PARAM(bytecodeIndex);
+        return PredictNone;
 #endif
     }
     
+    void stronglyPredict(NodeIndex nodeIndex, unsigned bytecodeIndex)
+    {
+        m_graph[nodeIndex].predict(getStrongPrediction(nodeIndex, bytecodeIndex) & ~PredictionTagMask, StrongPrediction);
+    }
+    
     void stronglyPredict(NodeIndex nodeIndex)
     {
         stronglyPredict(nodeIndex, m_currentIndex);
@@ -988,6 +996,7 @@
         case op_get_global_var: {
             NodeIndex getGlobalVar = addToGraph(GetGlobalVar, OpInfo(currentInstruction[2].u.operand));
             set(currentInstruction[1].u.operand, getGlobalVar);
+            m_graph.predictGlobalVar(currentInstruction[2].u.operand, getStrongPrediction(getGlobalVar, m_currentIndex) & ~PredictionTagMask, StrongPrediction);
             NEXT_OPCODE(op_get_global_var);
         }
 

Modified: trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp (95218 => 95219)


--- trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp	2011-09-15 19:49:53 UTC (rev 95218)
+++ trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp	2011-09-15 19:56:21 UTC (rev 95219)
@@ -1004,6 +1004,7 @@
     JSVariableObject* globalObject = m_codeBlock->globalObject();
     loadPtr(&globalObject->m_registers, regT0);
     loadPtr(Address(regT0, currentInstruction[2].u.operand * sizeof(Register)), regT0);
+    emitValueProfilingSite(FirstProfilingSite);
     emitPutVirtualRegister(currentInstruction[1].u.operand);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to