Title: [112320] trunk/Source/_javascript_Core
Revision
112320
Author
[email protected]
Date
2012-03-27 14:54:40 -0700 (Tue, 27 Mar 2012)

Log Message

DFG OSR exit should not generate an exit for variables of inlinees if the
inlinees are not in scope
https://bugs.webkit.org/show_bug.cgi?id=82312

Reviewed by Oliver Hunt.
        
* bytecode/CodeBlock.h:
(JSC::baselineCodeBlockForInlineCallFrame):
(JSC):
(JSC::baselineCodeBlockForOriginAndBaselineCodeBlock):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::computeNumVariablesForCodeOrigin):
(DFG):
(JSC::DFG::OSRExit::OSRExit):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (112319 => 112320)


--- trunk/Source/_javascript_Core/ChangeLog	2012-03-27 21:39:35 UTC (rev 112319)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-03-27 21:54:40 UTC (rev 112320)
@@ -1,3 +1,20 @@
+2012-03-27  Filip Pizlo  <[email protected]>
+
+        DFG OSR exit should not generate an exit for variables of inlinees if the
+        inlinees are not in scope
+        https://bugs.webkit.org/show_bug.cgi?id=82312
+
+        Reviewed by Oliver Hunt.
+        
+        * bytecode/CodeBlock.h:
+        (JSC::baselineCodeBlockForInlineCallFrame):
+        (JSC):
+        (JSC::baselineCodeBlockForOriginAndBaselineCodeBlock):
+        * dfg/DFGOSRExit.cpp:
+        (JSC::DFG::computeNumVariablesForCodeOrigin):
+        (DFG):
+        (JSC::DFG::OSRExit::OSRExit):
+
 2012-03-27  Matt Lilek  <[email protected]>
 
         Stop compiling Interpreter.cpp with -fno-var-tracking

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.h (112319 => 112320)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.h	2012-03-27 21:39:35 UTC (rev 112319)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.h	2012-03-27 21:54:40 UTC (rev 112320)
@@ -1385,13 +1385,18 @@
 #endif
     };
 
+    inline CodeBlock* baselineCodeBlockForInlineCallFrame(InlineCallFrame* inlineCallFrame)
+    {
+        ASSERT(inlineCallFrame);
+        ExecutableBase* executable = inlineCallFrame->executable.get();
+        ASSERT(executable->structure()->classInfo() == &FunctionExecutable::s_info);
+        return static_cast<FunctionExecutable*>(executable)->baselineCodeBlockFor(inlineCallFrame->isCall ? CodeForCall : CodeForConstruct);
+    }
+    
     inline CodeBlock* baselineCodeBlockForOriginAndBaselineCodeBlock(const CodeOrigin& codeOrigin, CodeBlock* baselineCodeBlock)
     {
-        if (codeOrigin.inlineCallFrame) {
-            ExecutableBase* executable = codeOrigin.inlineCallFrame->executable.get();
-            ASSERT(executable->structure()->classInfo() == &FunctionExecutable::s_info);
-            return static_cast<FunctionExecutable*>(executable)->baselineCodeBlockFor(codeOrigin.inlineCallFrame->isCall ? CodeForCall : CodeForConstruct);
-        }
+        if (codeOrigin.inlineCallFrame)
+            return baselineCodeBlockForInlineCallFrame(codeOrigin.inlineCallFrame);
         return baselineCodeBlock;
     }
     

Modified: trunk/Source/_javascript_Core/dfg/DFGOSRExit.cpp (112319 => 112320)


--- trunk/Source/_javascript_Core/dfg/DFGOSRExit.cpp	2012-03-27 21:39:35 UTC (rev 112319)
+++ trunk/Source/_javascript_Core/dfg/DFGOSRExit.cpp	2012-03-27 21:54:40 UTC (rev 112320)
@@ -33,6 +33,16 @@
 
 namespace JSC { namespace DFG {
 
+static unsigned computeNumVariablesForCodeOrigin(
+    CodeBlock* codeBlock, const CodeOrigin& codeOrigin)
+{
+    if (!codeOrigin.inlineCallFrame)
+        return codeBlock->m_numCalleeRegisters;
+    return
+        codeOrigin.inlineCallFrame->stackOffset +
+        baselineCodeBlockForInlineCallFrame(codeOrigin.inlineCallFrame)->m_numCalleeRegisters;
+}
+
 OSRExit::OSRExit(ExitKind kind, JSValueSource jsValueSource, MethodOfGettingAValueProfile valueProfile, MacroAssembler::Jump check, SpeculativeJIT* jit, unsigned recoveryIndex)
     : m_jsValueSource(jsValueSource)
     , m_valueProfile(valueProfile)
@@ -43,7 +53,7 @@
     , m_kind(kind)
     , m_count(0)
     , m_arguments(jit->m_arguments.size())
-    , m_variables(jit->m_variables.size())
+    , m_variables(computeNumVariablesForCodeOrigin(jit->m_jit.graph().m_profiledBlock, jit->m_codeOriginForOSR))
     , m_lastSetOperand(jit->m_lastSetOperand)
 {
     ASSERT(m_codeOrigin.isSet());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to