Changeset 163210 in webkit


Ignore:
Timestamp:
Jan 31, 2014 3:18:15 PM (10 years ago)
Author:
mark.lam@apple.com
Message:

Don't need a JSNameScope for the callee name just for the debugger.
<https://webkit.org/b/128024>

Reviewed by Geoffrey Garen.

Currently, in the bytecode for a function, we push a JSNamedScope for
the name of the function when a debugger is attached. The name scope for
the function name is only needed for evals which can redefine the name
to resolve to something else, and can later delete the redefined name
which should revert the resolution of the name to the original function.
The debugger does not need this feature because it declares all new vars
in a temporary nested scope. Hence, we can remove the presence of the
debugger as a criteria for pushing the JSNameScope.

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::resolveCallee):
(JSC::BytecodeGenerator::addCallee):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r163207 r163210  
     12014-01-31  Mark Lam  <mark.lam@apple.com>
     2
     3        Don't need a JSNameScope for the callee name just for the debugger.
     4        <https://webkit.org/b/128024>
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Currently, in the bytecode for a function, we push a JSNamedScope for
     9        the name of the function when a debugger is attached. The name scope for
     10        the function name is only needed for evals which can redefine the name
     11        to resolve to something else, and can later delete the redefined name
     12        which should revert the resolution of the name to the original function.
     13        The debugger does not need this feature because it declares all new vars
     14        in a temporary nested scope. Hence, we can remove the presence of the
     15        debugger as a criteria for pushing the JSNameScope.
     16
     17        * bytecompiler/BytecodeGenerator.cpp:
     18        (JSC::BytecodeGenerator::resolveCallee):
     19        (JSC::BytecodeGenerator::addCallee):
     20
    1212014-01-31  Filip Pizlo  <fpizlo@apple.com>
    222
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r163197 r163210  
    491491
    492492    // If non-strict eval is in play, we use a separate object in the scope chain for the callee's name.
    493     if ((m_codeBlock->usesEval() && !m_codeBlock->isStrictMode()) || m_shouldEmitDebugHooks)
     493    if (m_codeBlock->usesEval() && !m_codeBlock->isStrictMode())
    494494        emitPushNameScope(functionBodyNode->ident(), &m_calleeRegister, ReadOnly | DontDelete);
    495495
     
    507507
    508508    // If non-strict eval is in play, we use a separate object in the scope chain for the callee's name.
    509     if ((m_codeBlock->usesEval() && !m_codeBlock->isStrictMode()) || m_shouldEmitDebugHooks)
     509    if (m_codeBlock->usesEval() && !m_codeBlock->isStrictMode())
    510510        return;
    511511
Note: See TracChangeset for help on using the changeset viewer.