Changeset 207222 in webkit


Ignore:
Timestamp:
Oct 12, 2016 9:56:34 AM (8 years ago)
Author:
fpizlo@apple.com
Message:

Remove JITWriteBarrier.h
https://bugs.webkit.org/show_bug.cgi?id=163334

Reviewed by Mark Lam.

I guess that the idea of JITWriteBarrier was to make sure that if you slap some heap pointer
bits into machine code, then you better execute a barrier on the code block. But it's a
complicated piece of code, and I can never remember how it quite works. These days it looks
vestigial, particularly since only the CallLinkInfo patchable callee immediate uses it. It's
not really necessary to have something like this, since our convention is that any pointer
stored in machine code must always be shadowed in the GC heap. I think that convention has
won by overwhelming majority, so we should finally remove JITWriteBarrier.

A practical outcome of this change is that it makes it easier to implement DirectCall ICs,
which will have to store the callee in the CallLinkInfo but not in the machine code.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • assembler/AbstractMacroAssembler.h:
  • bytecode/CallLinkInfo.cpp:

(JSC::CallLinkInfo::setCallee):
(JSC::CallLinkInfo::clearCallee):

  • bytecode/CallLinkInfo.h:

(JSC::CallLinkInfo::setCallee): Deleted.
(JSC::CallLinkInfo::clearCallee): Deleted.

  • heap/SlotVisitor.h:
  • jit/JITWriteBarrier.h: Removed.
Location:
trunk/Source/JavaScriptCore
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r207213 r207222  
     12016-10-12  Filip Pizlo  <fpizlo@apple.com>
     2
     3        Remove JITWriteBarrier.h
     4        https://bugs.webkit.org/show_bug.cgi?id=163334
     5
     6        Reviewed by Mark Lam.
     7       
     8        I guess that the idea of JITWriteBarrier was to make sure that if you slap some heap pointer
     9        bits into machine code, then you better execute a barrier on the code block. But it's a
     10        complicated piece of code, and I can never remember how it quite works. These days it looks
     11        vestigial, particularly since only the CallLinkInfo patchable callee immediate uses it. It's
     12        not really necessary to have something like this, since our convention is that any pointer
     13        stored in machine code must always be shadowed in the GC heap. I think that convention has
     14        won by overwhelming majority, so we should finally remove JITWriteBarrier.
     15       
     16        A practical outcome of this change is that it makes it easier to implement DirectCall ICs,
     17        which will have to store the callee in the CallLinkInfo but not in the machine code.
     18
     19        * JavaScriptCore.xcodeproj/project.pbxproj:
     20        * assembler/AbstractMacroAssembler.h:
     21        * bytecode/CallLinkInfo.cpp:
     22        (JSC::CallLinkInfo::setCallee):
     23        (JSC::CallLinkInfo::clearCallee):
     24        * bytecode/CallLinkInfo.h:
     25        (JSC::CallLinkInfo::setCallee): Deleted.
     26        (JSC::CallLinkInfo::clearCallee): Deleted.
     27        * heap/SlotVisitor.h:
     28        * jit/JITWriteBarrier.h: Removed.
     29
    1302016-10-12  Csaba Osztrogonác  <ossy@webkit.org>
    231
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r207179 r207222  
    17701770                A76C51761182748D00715B05 /* JSInterfaceJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = A76C51741182748D00715B05 /* JSInterfaceJIT.h */; settings = {ATTRIBUTES = (Private, ); }; };
    17711771                A76F279415F13C9600517D67 /* UnlinkedCodeBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A79E781E15EECBA80047C855 /* UnlinkedCodeBlock.cpp */; };
    1772                 A76F54A313B28AAB00EF2BCE /* JITWriteBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = A76F54A213B28AAB00EF2BCE /* JITWriteBarrier.h */; settings = {ATTRIBUTES = (Private, ); }; };
    17731772                A77A423D17A0BBFD00A8DB81 /* DFGAbstractHeap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A77A423617A0BBFD00A8DB81 /* DFGAbstractHeap.cpp */; };
    17741773                A77A423E17A0BBFD00A8DB81 /* DFGAbstractHeap.h in Headers */ = {isa = PBXBuildFile; fileRef = A77A423717A0BBFD00A8DB81 /* DFGAbstractHeap.h */; };
     
    40784077                A767B5B417A0B9650063D940 /* DFGLoopPreHeaderCreationPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGLoopPreHeaderCreationPhase.h; path = dfg/DFGLoopPreHeaderCreationPhase.h; sourceTree = "<group>"; };
    40794078                A76C51741182748D00715B05 /* JSInterfaceJIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInterfaceJIT.h; sourceTree = "<group>"; };
    4080                 A76F54A213B28AAB00EF2BCE /* JITWriteBarrier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITWriteBarrier.h; sourceTree = "<group>"; };
    40814079                A77A423617A0BBFD00A8DB81 /* DFGAbstractHeap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGAbstractHeap.cpp; path = dfg/DFGAbstractHeap.cpp; sourceTree = "<group>"; };
    40824080                A77A423717A0BBFD00A8DB81 /* DFGAbstractHeap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGAbstractHeap.h; path = dfg/DFGAbstractHeap.h; sourceTree = "<group>"; };
     
    52805278                                DC0184171D10C1870057B053 /* JITWorklist.cpp */,
    52815279                                DC0184181D10C1870057B053 /* JITWorklist.h */,
    5282                                 A76F54A213B28AAB00EF2BCE /* JITWriteBarrier.h */,
    52835280                                A76C51741182748D00715B05 /* JSInterfaceJIT.h */,
    52845281                                792CB3471C4EED5C00D13AF3 /* PCToCodeOriginMap.cpp */,
     
    79467943                                0F5EF91F16878F7D003E5C25 /* JITThunks.h in Headers */,
    79477944                                0FC712E317CD8793008CC93C /* JITToDFGDeferredCompilationCallback.h in Headers */,
    7948                                 A76F54A313B28AAB00EF2BCE /* JITWriteBarrier.h in Headers */,
    79497945                                840480131021A1D9008E7F01 /* JSAPIValueWrapper.h in Headers */,
    79507946                                C2CF39C216E15A8100DD69BE /* JSAPIWrapperObject.h in Headers */,
  • trunk/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h

    r206525 r207222  
    5353class AbstractMacroAssembler {
    5454public:
    55     friend class JITWriteBarrierBase;
    5655    typedef AbstractMacroAssembler<AssemblerType, MacroAssemblerType> AbstractMacroAssemblerType;
    5756    typedef AssemblerType AssemblerType_T;
  • trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.cpp

    r205462 r207222  
    11/*
    2  * Copyright (C) 2012, 2013, 2014 Apple Inc. All rights reserved.
     2 * Copyright (C) 2012-2014, 2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3131#include "DFGThunks.h"
    3232#include "JSCInlines.h"
     33#include "MacroAssembler.h"
    3334#include "Opcode.h"
    3435#include "Repatch.h"
     
    9899}
    99100
     101void CallLinkInfo::setCallee(VM& vm, JSCell* owner, JSFunction* callee)
     102{
     103    MacroAssembler::repatchPointer(m_hotPathBegin, callee);
     104    m_callee.set(vm, owner, callee);
     105}
     106
     107void CallLinkInfo::clearCallee()
     108{
     109    MacroAssembler::repatchPointer(m_hotPathBegin, nullptr);
     110    m_callee.clear();
     111}
     112
    100113void CallLinkInfo::visitWeak(VM& vm)
    101114{
  • trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.h

    r206525 r207222  
    11/*
    2  * Copyright (C) 2012, 2014, 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2012, 2014-2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929#include "CodeLocation.h"
    3030#include "CodeSpecializationKind.h"
    31 #include "JITWriteBarrier.h"
    3231#include "JSFunction.h"
    3332#include "PolymorphicCallStubRoutine.h"
     
    159158    }
    160159
    161     void setCallee(VM& vm, CodeLocationDataLabelPtr location, JSCell* owner, JSFunction* callee)
    162     {
    163         m_callee.set(vm, location, owner, callee);
    164     }
    165 
    166     void clearCallee()
    167     {
    168         m_callee.clear();
    169     }
     160    void setCallee(VM&, JSCell*, JSFunction* callee);
     161
     162    void clearCallee();
    170163
    171164    JSFunction* callee()
     
    315308    CodeLocationDataLabelPtr m_hotPathBegin;
    316309    CodeLocationNearCall m_hotPathOther;
    317     JITWriteBarrier<JSFunction> m_callee;
     310    WriteBarrier<JSFunction> m_callee;
    318311    WriteBarrier<JSFunction> m_lastSeenCallee;
    319312    RefPtr<PolymorphicCallStubRoutine> m_stub;
  • trunk/Source/JavaScriptCore/heap/SlotVisitor.h

    r206525 r207222  
    3838class HeapCell;
    3939class HeapSnapshotBuilder;
    40 template<typename T> class JITWriteBarrier;
    4140class MarkedBlock;
    4241class UnconditionalFinalizer;
  • trunk/Source/JavaScriptCore/jit/Repatch.cpp

    r206779 r207222  
    567567   
    568568    ASSERT(!callLinkInfo.isLinked());
    569     callLinkInfo.setCallee(exec->callerFrame()->vm(), callLinkInfo.hotPathBegin(), callerCodeBlock, callee);
     569    callLinkInfo.setCallee(exec->callerFrame()->vm(), callerCodeBlock, callee);
    570570    callLinkInfo.setLastSeenCallee(exec->callerFrame()->vm(), callerCodeBlock, callee);
    571571    if (shouldDumpDisassemblyFor(callerCodeBlock))
Note: See TracChangeset for help on using the changeset viewer.