| Differences between
and this patch
- Source/JavaScriptCore/ChangeLog +24 lines
Lines 1-3 Source/JavaScriptCore/ChangeLog_sec1
1
2013-11-24  Filip Pizlo  <fpizlo@apple.com>
2
3
        Create a new SymbolTable every time code is loaded so that the watchpoints don't get reused
4
        https://bugs.webkit.org/show_bug.cgi?id=124824
5
6
        Reviewed by NOBODY (OOPS!).
7
        
8
        This helps with one shot closure inference as well as closure variable constant
9
        inference, since without this, if code was reloaded from the cache then we would
10
        think that the first run was actually an Nth run. This would cause us to think that
11
        the watchpoint(s) should all be invalidated.
12
13
        * bytecode/CodeBlock.cpp:
14
        (JSC::CodeBlock::CodeBlock):
15
        (JSC::CodeBlock::stronglyVisitStrongReferences):
16
        * bytecode/CodeBlock.h:
17
        (JSC::CodeBlock::symbolTable):
18
        * runtime/Executable.cpp:
19
        (JSC::FunctionExecutable::symbolTable):
20
        * runtime/Executable.h:
21
        * runtime/SymbolTable.cpp:
22
        (JSC::SymbolTable::clone):
23
        * runtime/SymbolTable.h:
24
1
2013-11-23  Filip Pizlo  <fpizlo@apple.com>
25
2013-11-23  Filip Pizlo  <fpizlo@apple.com>
2
26
3
        Fix more fallout from failed attempts at div/mod DFG strength reductions
27
        Fix more fallout from failed attempts at div/mod DFG strength reductions
- Source/JavaScriptCore/bytecode/CodeBlock.cpp +8 lines
Lines 1481-1486 CodeBlock::CodeBlock(CopyParsedBlockTag, Source/JavaScriptCore/bytecode/CodeBlock.cpp_sec1
1481
#endif
1481
#endif
1482
{
1482
{
1483
    ASSERT(m_heap->isDeferred());
1483
    ASSERT(m_heap->isDeferred());
1484
    
1485
    if (SymbolTable* symbolTable = other.symbolTable())
1486
        m_symbolTable.set(*m_vm, m_ownerExecutable.get(), symbolTable);
1487
    
1484
    setNumParameters(other.numParameters());
1488
    setNumParameters(other.numParameters());
1485
    optimizeAfterWarmUp();
1489
    optimizeAfterWarmUp();
1486
    jitAfterWarmUp();
1490
    jitAfterWarmUp();
Lines 1527-1532 CodeBlock::CodeBlock(ScriptExecutable* o Source/JavaScriptCore/bytecode/CodeBlock.cpp_sec2
1527
{
1531
{
1528
    ASSERT(m_heap->isDeferred());
1532
    ASSERT(m_heap->isDeferred());
1529
1533
1534
    if (SymbolTable* symbolTable = unlinkedCodeBlock->symbolTable())
1535
        m_symbolTable.set(*m_vm, m_ownerExecutable.get(), symbolTable->clone(*m_vm));
1536
    
1530
    ASSERT(m_source);
1537
    ASSERT(m_source);
1531
    setNumParameters(unlinkedCodeBlock->numParameters());
1538
    setNumParameters(unlinkedCodeBlock->numParameters());
1532
1539
Lines 2338-2343 void CodeBlock::stronglyVisitStrongRefer Source/JavaScriptCore/bytecode/CodeBlock.cpp_sec3
2338
{
2345
{
2339
    visitor.append(&m_globalObject);
2346
    visitor.append(&m_globalObject);
2340
    visitor.append(&m_ownerExecutable);
2347
    visitor.append(&m_ownerExecutable);
2348
    visitor.append(&m_symbolTable);
2341
    visitor.append(&m_unlinkedCode);
2349
    visitor.append(&m_unlinkedCode);
2342
    if (m_rareData)
2350
    if (m_rareData)
2343
        m_rareData->m_evalCodeCache.visitAggregate(visitor);
2351
        m_rareData->m_evalCodeCache.visitAggregate(visitor);
- Source/JavaScriptCore/bytecode/CodeBlock.h -1 / +2 lines
Lines 722-728 public: Source/JavaScriptCore/bytecode/CodeBlock.h_sec1
722
    StringJumpTable& stringSwitchJumpTable(int tableIndex) { RELEASE_ASSERT(m_rareData); return m_rareData->m_stringSwitchJumpTables[tableIndex]; }
722
    StringJumpTable& stringSwitchJumpTable(int tableIndex) { RELEASE_ASSERT(m_rareData); return m_rareData->m_stringSwitchJumpTables[tableIndex]; }
723
723
724
724
725
    SymbolTable* symbolTable() const { return m_unlinkedCode->symbolTable(); }
725
    SymbolTable* symbolTable() const { return m_symbolTable.get(); }
726
726
727
    EvalCodeCache& evalCodeCache() { createRareDataIfNecessary(); return m_rareData->m_evalCodeCache; }
727
    EvalCodeCache& evalCodeCache() { createRareDataIfNecessary(); return m_rareData->m_evalCodeCache; }
728
728
Lines 1039-1044 private: Source/JavaScriptCore/bytecode/CodeBlock.h_sec2
1039
    VM* m_vm;
1039
    VM* m_vm;
1040
1040
1041
    RefCountedArray<Instruction> m_instructions;
1041
    RefCountedArray<Instruction> m_instructions;
1042
    WriteBarrier<SymbolTable> m_symbolTable;
1042
    VirtualRegister m_thisRegister;
1043
    VirtualRegister m_thisRegister;
1043
    VirtualRegister m_argumentsRegister;
1044
    VirtualRegister m_argumentsRegister;
1044
    VirtualRegister m_activationRegister;
1045
    VirtualRegister m_activationRegister;
- Source/JavaScriptCore/runtime/Executable.cpp +5 lines
Lines 533-538 void FunctionExecutable::visitChildren(J Source/JavaScriptCore/runtime/Executable.cpp_sec1
533
    visitor.append(&thisObject->m_unlinkedExecutable);
533
    visitor.append(&thisObject->m_unlinkedExecutable);
534
}
534
}
535
535
536
SymbolTable* FunctionExecutable::symbolTable(CodeSpecializationKind kind)
537
{
538
    return codeBlockFor(kind)->symbolTable();
539
}
540
536
void FunctionExecutable::clearCodeIfNotCompiling()
541
void FunctionExecutable::clearCodeIfNotCompiling()
537
{
542
{
538
    if (isCompiling())
543
    if (isCompiling())
- Source/JavaScriptCore/runtime/Executable.h -1 / +1 lines
Lines 639-645 public: Source/JavaScriptCore/runtime/Executable.h_sec1
639
    JSString* nameValue() const { return m_unlinkedExecutable->nameValue(); }
639
    JSString* nameValue() const { return m_unlinkedExecutable->nameValue(); }
640
    size_t parameterCount() const { return m_unlinkedExecutable->parameterCount(); } // Excluding 'this'!
640
    size_t parameterCount() const { return m_unlinkedExecutable->parameterCount(); } // Excluding 'this'!
641
    String paramString() const;
641
    String paramString() const;
642
    SymbolTable* symbolTable(CodeSpecializationKind kind) const { return m_unlinkedExecutable->symbolTable(kind); }
642
    SymbolTable* symbolTable(CodeSpecializationKind kind);
643
643
644
    void clearCodeIfNotCompiling();
644
    void clearCodeIfNotCompiling();
645
    void clearUnlinkedCodeForRecompilationIfNotCompiling();
645
    void clearUnlinkedCodeForRecompilationIfNotCompiling();
- Source/JavaScriptCore/runtime/SymbolTable.cpp +26 lines
Lines 109-113 SymbolTable::SymbolTable(VM& vm) Source/JavaScriptCore/runtime/SymbolTable.cpp_sec1
109
109
110
SymbolTable::~SymbolTable() { }
110
SymbolTable::~SymbolTable() { }
111
111
112
SymbolTable* SymbolTable::clone(VM& vm)
113
{
114
    SymbolTable* result = SymbolTable::create(vm);
115
    
116
    result->m_parameterCountIncludingThis = m_parameterCountIncludingThis;
117
    result->m_usesNonStrictEval = m_usesNonStrictEval;
118
    result->m_captureStart = m_captureStart;
119
    result->m_captureEnd = m_captureEnd;
120
    
121
    Map::iterator iter = m_map.begin();
122
    Map::iterator end = m_map.end();
123
    for (; iter != end; ++iter) {
124
        result->m_map.add(
125
            iter->key,
126
            SymbolTableEntry(iter->value.getIndex(), iter->value.getAttributes()));
127
    }
128
    
129
    if (m_slowArguments) {
130
        result->m_slowArguments = std::make_unique<SlowArgument[]>(parameterCount());
131
        for (unsigned i = parameterCount(); i--;)
132
            result->m_slowArguments[i] = m_slowArguments[i];
133
    }
134
    
135
    return result;
136
}
137
112
} // namespace JSC
138
} // namespace JSC
113
139
- Source/JavaScriptCore/runtime/SymbolTable.h +2 lines
Lines 465-470 public: Source/JavaScriptCore/runtime/SymbolTable.h_sec1
465
    // 0 if we don't capture any arguments; parameterCount() in length if we do.
465
    // 0 if we don't capture any arguments; parameterCount() in length if we do.
466
    const SlowArgument* slowArguments() { return m_slowArguments.get(); }
466
    const SlowArgument* slowArguments() { return m_slowArguments.get(); }
467
    void setSlowArguments(std::unique_ptr<SlowArgument[]> slowArguments) { m_slowArguments = std::move(slowArguments); }
467
    void setSlowArguments(std::unique_ptr<SlowArgument[]> slowArguments) { m_slowArguments = std::move(slowArguments); }
468
    
469
    SymbolTable* clone(VM&);
468
470
469
    DECLARE_EXPORT_INFO;
471
    DECLARE_EXPORT_INFO;
470
472

Return to Bug 124824