⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 179863 in webkit


Ignore:
Timestamp:
Feb 9, 2015, 8:46:53 PM (12 years ago)
Author:
fpizlo@apple.com
Message:

DFG::StackLayoutPhase should always set the scopeRegister to VirtualRegister() because the DFG doesn't do anything to make its value valid
https://bugs.webkit.org/show_bug.cgi?id=141412

Reviewed by Michael Saboff.

StackLayoutPhase was attempting to ensure that the register that
CodeBlock::scopeRegister() points to is the right one for the DFG. But the DFG did nothing
else to maintain the validity of the scopeRegister(). It wasn't captured as far as I can
tell. StackLayoutPhase didn't explicitly mark it live. PreciseLocalClobberize didn't mark
it as being live. So, by the time we got here the register referred to by
CodeBlock::scopeRegister() would have been junk. Moreover, CodeBlock::scopeRegister() was
not used for DFG code blocks, and was hardly ever used outside of bytecode generation.

So, this patch just removes the code to manipulate this field and replaces it with an
unconditional setScopeRegister(VirtualRegister()). Setting it to the invalid register
ensures that any attempst to read the scopeRegister in a DFG or FTL frame immediately
punts.

  • dfg/DFGStackLayoutPhase.cpp:

(JSC::DFG::StackLayoutPhase::run):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r179862 r179863  
     12015-02-09  Filip Pizlo  <fpizlo@apple.com>
     2
     3        DFG::StackLayoutPhase should always set the scopeRegister to VirtualRegister() because the DFG doesn't do anything to make its value valid
     4        https://bugs.webkit.org/show_bug.cgi?id=141412
     5
     6        Reviewed by Michael Saboff.
     7       
     8        StackLayoutPhase was attempting to ensure that the register that
     9        CodeBlock::scopeRegister() points to is the right one for the DFG. But the DFG did nothing
     10        else to maintain the validity of the scopeRegister(). It wasn't captured as far as I can
     11        tell. StackLayoutPhase didn't explicitly mark it live. PreciseLocalClobberize didn't mark
     12        it as being live. So, by the time we got here the register referred to by
     13        CodeBlock::scopeRegister() would have been junk. Moreover, CodeBlock::scopeRegister() was
     14        not used for DFG code blocks, and was hardly ever used outside of bytecode generation.
     15       
     16        So, this patch just removes the code to manipulate this field and replaces it with an
     17        unconditional setScopeRegister(VirtualRegister()). Setting it to the invalid register
     18        ensures that any attempst to read the scopeRegister in a DFG or FTL frame immediately
     19        punts.
     20
     21        * dfg/DFGStackLayoutPhase.cpp:
     22        (JSC::DFG::StackLayoutPhase::run):
     23
    1242015-02-09  Filip Pizlo  <fpizlo@apple.com>
    225
  • trunk/Source/JavaScriptCore/dfg/DFGStackLayoutPhase.cpp

    r179015 r179863  
    169169        }
    170170       
    171         if (codeBlock()->scopeRegister().isValid()) {
    172             unsigned scopeRegisterAllocation = allocation[codeBlock()->scopeRegister().toLocal()];
    173             codeBlock()->setScopeRegister(scopeRegisterAllocation == UINT_MAX ? VirtualRegister() : virtualRegisterForLocal(scopeRegisterAllocation));
    174         }
     171        // This register is never valid for DFG code blocks.
     172        codeBlock()->setScopeRegister(VirtualRegister());
    175173
    176174        for (unsigned i = m_graph.m_inlineVariableData.size(); i--;) {
Note: See TracChangeset for help on using the changeset viewer.