Changeset 159462 in webkit


Ignore:
Timestamp:
Nov 18, 2013 3:19:53 PM (10 years ago)
Author:
fpizlo@apple.com
Message:

put_to_scope[5] should not point to the structure if it's a variable access, but it should point to the WatchpointSet
https://bugs.webkit.org/show_bug.cgi?id=124539

Reviewed by Mark Hahnenberg.

This is in preparation for getting put_to_scope to directly invalidate the watchpoint set
on stores, which will allow us to run constant inference on all globals.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::finalizeUnconditionally):

  • bytecode/Instruction.h:
  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):

  • runtime/JSScope.cpp:

(JSC::abstractAccess):
(JSC::JSScope::abstractResolve):

  • runtime/JSScope.h:

(JSC::ResolveOp::ResolveOp):

  • runtime/SymbolTable.h:

(JSC::SymbolTableEntry::watchpointSet):

Location:
trunk/Source/JavaScriptCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r159459 r159462  
     12013-11-18  Filip Pizlo  <fpizlo@apple.com>
     2
     3        put_to_scope[5] should not point to the structure if it's a variable access, but it should point to the WatchpointSet
     4        https://bugs.webkit.org/show_bug.cgi?id=124539
     5
     6        Reviewed by Mark Hahnenberg.
     7       
     8        This is in preparation for getting put_to_scope to directly invalidate the watchpoint set
     9        on stores, which will allow us to run constant inference on all globals.
     10
     11        * bytecode/CodeBlock.cpp:
     12        (JSC::CodeBlock::CodeBlock):
     13        (JSC::CodeBlock::finalizeUnconditionally):
     14        * bytecode/Instruction.h:
     15        * dfg/DFGByteCodeParser.cpp:
     16        (JSC::DFG::ByteCodeParser::parseBlock):
     17        * runtime/JSScope.cpp:
     18        (JSC::abstractAccess):
     19        (JSC::JSScope::abstractResolve):
     20        * runtime/JSScope.h:
     21        (JSC::ResolveOp::ResolveOp):
     22        * runtime/SymbolTable.h:
     23        (JSC::SymbolTableEntry::watchpointSet):
     24
    1252013-11-18  Mark Hahnenberg  <mhahnenberg@apple.com>
    226
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r159141 r159462  
    18831883
    18841884            instructions[i + 4].u.operand = ResolveModeAndType(modeAndType.mode(), op.type).operand();
    1885             if (op.structure)
     1885            if (op.type == GlobalVar || op.type == GlobalVarWithVarInjectionChecks) {
     1886                ASSERT(!op.structure);
     1887                instructions[i + 5].u.watchpointSet = op.watchpointSet;
     1888            } else if (op.structure)
    18861889                instructions[i + 5].u.structure.set(*vm(), ownerExecutable, op.structure);
    18871890            instructions[i + 6].u.pointer = reinterpret_cast<void*>(op.operand);
     
    22752278            case op_get_from_scope:
    22762279            case op_put_to_scope: {
     2280                ResolveModeAndType modeAndType =
     2281                    ResolveModeAndType(curInstruction[4].u.operand);
     2282                if (modeAndType.type() == GlobalVar || modeAndType.type() == GlobalVarWithVarInjectionChecks)
     2283                    continue;
    22772284                WriteBarrierBase<Structure>& structure = curInstruction[5].u.structure;
    22782285                if (!structure || Heap::isMarked(structure.get()))
  • trunk/Source/JavaScriptCore/bytecode/Instruction.h

    r156511 r159462  
    116116        ArrayAllocationProfile* arrayAllocationProfile;
    117117        ObjectAllocationProfile* objectAllocationProfile;
     118        WatchpointSet* watchpointSet;
    118119        void* pointer;
    119120        bool* predicatePointer;
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r159394 r159462  
    31283128            {
    31293129                ConcurrentJITLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
    3130                 structure = currentInstruction[5].u.structure.get();
     3130                if (resolveType == GlobalVar || resolveType == GlobalVarWithVarInjectionChecks)
     3131                    structure = 0;
     3132                else
     3133                    structure = currentInstruction[5].u.structure.get();
    31313134                operand = reinterpret_cast<uintptr_t>(currentInstruction[6].u.pointer);
    31323135            }
  • trunk/Source/JavaScriptCore/runtime/JSScope.cpp

    r155143 r159462  
    5454        if (ident == exec->propertyNames().arguments) {
    5555            // We know the property will be at this activation scope, but we don't know how to cache it.
    56             op = ResolveOp(Dynamic, 0, 0, 0);
     56            op = ResolveOp(Dynamic, 0, 0, 0, 0);
    5757            return true;
    5858        }
     
    6161        if (entry.isReadOnly() && getOrPut == Put) {
    6262            // We know the property will be at this activation scope, but we don't know how to cache it.
    63             op = ResolveOp(Dynamic, 0, 0, 0);
     63            op = ResolveOp(Dynamic, 0, 0, 0, 0);
    6464            return true;
    6565        }
    6666
    6767        if (!entry.isNull()) {
    68             op = ResolveOp(makeType(ClosureVar, needsVarInjectionChecks), depth, activation->structure(), entry.getIndex());
     68            op = ResolveOp(makeType(ClosureVar, needsVarInjectionChecks), depth, activation->structure(), 0, entry.getIndex());
    6969            return true;
    7070        }
     
    8181                if (entry.isReadOnly()) {
    8282                    // We know the property will be at global scope, but we don't know how to cache it.
    83                     op = ResolveOp(Dynamic, 0, 0, 0);
     83                    op = ResolveOp(Dynamic, 0, 0, 0, 0);
    8484                    return true;
    8585                }
     
    8989            }
    9090
    91             op = ResolveOp(makeType(GlobalVar, needsVarInjectionChecks), depth, globalObject->structure(),
     91            op = ResolveOp(
     92                makeType(GlobalVar, needsVarInjectionChecks), depth, 0, entry.watchpointSet(),
    9293                reinterpret_cast<uintptr_t>(globalObject->registerAt(entry.getIndex()).slot()));
    9394            return true;
     
    101102            // We know the property will be at global scope, but we don't know how to cache it.
    102103            ASSERT(!scope->next());
    103             op = ResolveOp(makeType(GlobalProperty, needsVarInjectionChecks), depth, 0, 0);
     104            op = ResolveOp(makeType(GlobalProperty, needsVarInjectionChecks), depth, 0, 0, 0);
    104105            return true;
    105106        }
    106107
    107         op = ResolveOp(makeType(GlobalProperty, needsVarInjectionChecks), depth, globalObject->structure(), slot.cachedOffset());
     108        op = ResolveOp(makeType(GlobalProperty, needsVarInjectionChecks), depth, globalObject->structure(), 0, slot.cachedOffset());
    108109        return true;
    109110    }
    110111
    111     op = ResolveOp(Dynamic, 0, 0, 0);
     112    op = ResolveOp(Dynamic, 0, 0, 0, 0);
    112113    return true;
    113114}
     
    147148ResolveOp JSScope::abstractResolve(ExecState* exec, JSScope* scope, const Identifier& ident, GetOrPut getOrPut, ResolveType unlinkedType)
    148149{
    149     ResolveOp op(Dynamic, 0, 0, 0);
     150    ResolveOp op(Dynamic, 0, 0, 0, 0);
    150151    if (unlinkedType == Dynamic)
    151152        return op;
  • trunk/Source/JavaScriptCore/runtime/JSScope.h

    r156802 r159462  
    3232
    3333class ScopeChainIterator;
     34class WatchpointSet;
    3435
    3536enum ResolveMode {
     
    9697
    9798struct ResolveOp {
    98     ResolveOp(ResolveType type, size_t depth, Structure* structure, uintptr_t operand)
     99    ResolveOp(ResolveType type, size_t depth, Structure* structure, WatchpointSet* watchpointSet, uintptr_t operand)
    99100        : type(type)
    100101        , depth(depth)
    101102        , structure(structure)
     103        , watchpointSet(watchpointSet)
    102104        , operand(operand)
    103105    {
     
    107109    size_t depth;
    108110    Structure* structure;
     111    WatchpointSet* watchpointSet;
    109112    uintptr_t operand;
    110113};
  • trunk/Source/JavaScriptCore/runtime/SymbolTable.h

    r159395 r159462  
    235235    WatchpointSet* watchpointSet()
    236236    {
     237        if (!isFat())
     238            return 0;
    237239        return fatEntry()->m_watchpoints.get();
    238240    }
Note: See TracChangeset for help on using the changeset viewer.