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

Changeset 107345 in webkit


Ignore:
Timestamp:
Feb 9, 2012, 7:14:34 PM (15 years ago)
Author:
commit-queue@webkit.org
Message:

Remove BytecodeGenerator::isLocal
https://bugs.webkit.org/show_bug.cgi?id=78241

Minor refactor to BytecodeGenerator.

Patch by Andy Wingo <wingo@igalia.com> on 2012-02-09
Reviewed by Gavin Barraclough.

  • bytecompiler/BytecodeGenerator.h:
  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::isLocal):
(JSC::BytecodeGenerator::isLocalConstant): Remove now-unused
methods.

  • bytecompiler/NodesCodegen.cpp:

(JSC::ResolveNode::isPure): Use the ResolveResult mechanism
instead of isLocal. This will recognize more resolve nodes as
being pure.
(JSC::PrefixResolveNode::emitBytecode): Use isReadOnly on the
location instead of isLocalConstant.

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r107338 r107345  
     12012-02-09  Andy Wingo  <wingo@igalia.com>
     2
     3        Remove BytecodeGenerator::isLocal
     4        https://bugs.webkit.org/show_bug.cgi?id=78241
     5
     6        Minor refactor to BytecodeGenerator.
     7
     8        Reviewed by Gavin Barraclough.
     9
     10        * bytecompiler/BytecodeGenerator.h:
     11        * bytecompiler/BytecodeGenerator.cpp:
     12        (JSC::BytecodeGenerator::isLocal):
     13        (JSC::BytecodeGenerator::isLocalConstant): Remove now-unused
     14        methods.
     15        * bytecompiler/NodesCodegen.cpp:
     16        (JSC::ResolveNode::isPure): Use the ResolveResult mechanism
     17        instead of isLocal.  This will recognize more resolve nodes as
     18        being pure.
     19        (JSC::PrefixResolveNode::emitBytecode): Use isReadOnly on the
     20        location instead of isLocalConstant.
     21
    1222012-02-09  Oliver Hunt  <oliver@apple.com>
    223
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r107338 r107345  
    560560    emitLazyNewFunction(reg, m_lazyFunctions.get(reg->index()));
    561561    return reg;
    562 }
    563 
    564 bool BytecodeGenerator::isLocal(const Identifier& ident)
    565 {
    566     if (ident == propertyNames().thisIdentifier)
    567         return true;
    568    
    569     return shouldOptimizeLocals() && symbolTable().contains(ident.impl());
    570 }
    571 
    572 bool BytecodeGenerator::isLocalConstant(const Identifier& ident)
    573 {
    574     return symbolTable().get(ident.impl()).isReadOnly();
    575562}
    576563
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h

    r106504 r107345  
    263263        RegisterID* thisRegister() { return &m_thisRegister; }
    264264
    265         bool isLocal(const Identifier&);
    266         bool isLocalConstant(const Identifier&);
    267 
    268265        // Returns the next available temporary register. Registers returned by
    269266        // newTemporary require a modified form of reference counting: any
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r106512 r107345  
    143143bool ResolveNode::isPure(BytecodeGenerator& generator) const
    144144{
    145     return generator.isLocal(m_ident);
     145    return generator.resolve(m_ident).isStatic();
    146146}
    147147
     
    793793    ResolveResult resolveResult = generator.resolve(m_ident);
    794794    if (RegisterID* local = resolveResult.local()) {
    795         if (generator.isLocalConstant(m_ident)) {
     795        if (resolveResult.isReadOnly()) {
    796796            if (dst == generator.ignoredResult())
    797797                return 0;
Note: See TracChangeset for help on using the changeset viewer.