Title: [186985] trunk/Source/_javascript_Core
Revision
186985
Author
[email protected]
Date
2015-07-17 22:49:32 -0700 (Fri, 17 Jul 2015)

Log Message

Remove DFG::DesiredWriteBarriers because it's just a very difficult way of saying "please barrier the machine code block owner"
https://bugs.webkit.org/show_bug.cgi?id=147030

Reviewed by Andreas Kling.
        
All of the users of DesiredWriteBarriers were just using it to request that Plan
finalization executes a barrier on codeBlock->ownerExecutable. Indeed, that's the only
owning cell in the heap that compilation affects. So, we might as well just have Plan
unconditionally execute that barrier and then we don't need DesiredWriteBarriers at
all.

* CMakeLists.txt:
* _javascript_Core.vcxproj/_javascript_Core.vcxproj:
* _javascript_Core.xcodeproj/project.pbxproj:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
* dfg/DFGDesiredWriteBarriers.cpp: Removed.
* dfg/DFGDesiredWriteBarriers.h: Removed.
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::registerFrozenValues):
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::reallyAdd):
(JSC::DFG::Plan::notifyCompiling):
(JSC::DFG::Plan::finalizeWithoutNotifyingCallback):
(JSC::DFG::Plan::checkLivenessAndVisitChildren):
(JSC::DFG::Plan::cancel):
* dfg/DFGPlan.h:

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/_javascript_Core/CMakeLists.txt (186984 => 186985)


--- trunk/Source/_javascript_Core/CMakeLists.txt	2015-07-18 05:20:47 UTC (rev 186984)
+++ trunk/Source/_javascript_Core/CMakeLists.txt	2015-07-18 05:49:32 UTC (rev 186985)
@@ -161,7 +161,6 @@
     dfg/DFGDesiredTransitions.cpp
     dfg/DFGDesiredWatchpoints.cpp
     dfg/DFGDesiredWeakReferences.cpp
-    dfg/DFGDesiredWriteBarriers.cpp
     dfg/DFGDisassembler.cpp
     dfg/DFGDoesGC.cpp
     dfg/DFGDominators.cpp

Modified: trunk/Source/_javascript_Core/ChangeLog (186984 => 186985)


--- trunk/Source/_javascript_Core/ChangeLog	2015-07-18 05:20:47 UTC (rev 186984)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-07-18 05:49:32 UTC (rev 186985)
@@ -1,3 +1,33 @@
+2015-07-16  Filip Pizlo  <[email protected]>
+
+        Remove DFG::DesiredWriteBarriers because it's just a very difficult way of saying "please barrier the machine code block owner"
+        https://bugs.webkit.org/show_bug.cgi?id=147030
+
+        Reviewed by Andreas Kling.
+        
+        All of the users of DesiredWriteBarriers were just using it to request that Plan
+        finalization executes a barrier on codeBlock->ownerExecutable. Indeed, that's the only
+        owning cell in the heap that compilation affects. So, we might as well just have Plan
+        unconditionally execute that barrier and then we don't need DesiredWriteBarriers at
+        all.
+
+        * CMakeLists.txt:
+        * _javascript_Core.vcxproj/_javascript_Core.vcxproj:
+        * _javascript_Core.xcodeproj/project.pbxproj:
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
+        * dfg/DFGDesiredWriteBarriers.cpp: Removed.
+        * dfg/DFGDesiredWriteBarriers.h: Removed.
+        * dfg/DFGGraph.cpp:
+        (JSC::DFG::Graph::registerFrozenValues):
+        * dfg/DFGPlan.cpp:
+        (JSC::DFG::Plan::reallyAdd):
+        (JSC::DFG::Plan::notifyCompiling):
+        (JSC::DFG::Plan::finalizeWithoutNotifyingCallback):
+        (JSC::DFG::Plan::checkLivenessAndVisitChildren):
+        (JSC::DFG::Plan::cancel):
+        * dfg/DFGPlan.h:
+
 2015-07-17  Yusuke Suzuki  <[email protected]>
 
         Integrate automatic microtask draining into JSC framework and re-enable Promise

Modified: trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj (186984 => 186985)


--- trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj	2015-07-18 05:20:47 UTC (rev 186984)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj	2015-07-18 05:49:32 UTC (rev 186985)
@@ -399,7 +399,6 @@
     <ClCompile Include="..\dfg\DFGDesiredTransitions.cpp" />
     <ClCompile Include="..\dfg\DFGDesiredWatchpoints.cpp" />
     <ClCompile Include="..\dfg\DFGDesiredWeakReferences.cpp" />
-    <ClCompile Include="..\dfg\DFGDesiredWriteBarriers.cpp" />
     <ClCompile Include="..\dfg\DFGDisassembler.cpp" />
     <ClCompile Include="..\dfg\DFGDoesGC.cpp" />
     <ClCompile Include="..\dfg\DFGDominators.cpp" />
@@ -1086,7 +1085,6 @@
     <ClInclude Include="..\dfg\DFGDesiredTransitions.h" />
     <ClInclude Include="..\dfg\DFGDesiredWatchpoints.h" />
     <ClInclude Include="..\dfg\DFGDesiredWeakReferences.h" />
-    <ClInclude Include="..\dfg\DFGDesiredWriteBarriers.h" />
     <ClInclude Include="..\dfg\DFGDisassembler.h" />
     <ClInclude Include="..\dfg\DFGDoesGC.h" />
     <ClInclude Include="..\dfg\DFGDominators.h" />

Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (186984 => 186985)


--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2015-07-18 05:20:47 UTC (rev 186984)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2015-07-18 05:49:32 UTC (rev 186985)
@@ -1618,8 +1618,6 @@
 		C288B2DE18A54D3E007BE40B /* DateTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = C288B2DD18A54D3E007BE40B /* DateTests.mm */; };
 		C2981FD817BAEE4B00A3BC98 /* DFGDesiredWeakReferences.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2981FD617BAEE4B00A3BC98 /* DFGDesiredWeakReferences.cpp */; };
 		C2981FD917BAEE4B00A3BC98 /* DFGDesiredWeakReferences.h in Headers */ = {isa = PBXBuildFile; fileRef = C2981FD717BAEE4B00A3BC98 /* DFGDesiredWeakReferences.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		C2981FDC17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2981FDA17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp */; };
-		C2981FDD17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.h in Headers */ = {isa = PBXBuildFile; fileRef = C2981FDB17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		C29ECB031804D0ED00D2CBB4 /* CurrentThisInsideBlockGetterTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = C29ECB011804D0ED00D2CBB4 /* CurrentThisInsideBlockGetterTest.mm */; };
 		C2A7F688160432D400F76B98 /* JSDestructibleObject.h in Headers */ = {isa = PBXBuildFile; fileRef = C2A7F687160432D400F76B98 /* JSDestructibleObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		C2B6D75318A33793004A9301 /* WriteBarrierInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2B6D75218A33793004A9301 /* WriteBarrierInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -3380,8 +3378,6 @@
 		C288B2DD18A54D3E007BE40B /* DateTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DateTests.mm; path = API/tests/DateTests.mm; sourceTree = "<group>"; };
 		C2981FD617BAEE4B00A3BC98 /* DFGDesiredWeakReferences.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredWeakReferences.cpp; path = dfg/DFGDesiredWeakReferences.cpp; sourceTree = "<group>"; };
 		C2981FD717BAEE4B00A3BC98 /* DFGDesiredWeakReferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGDesiredWeakReferences.h; path = dfg/DFGDesiredWeakReferences.h; sourceTree = "<group>"; };
-		C2981FDA17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredWriteBarriers.cpp; path = dfg/DFGDesiredWriteBarriers.cpp; sourceTree = "<group>"; };
-		C2981FDB17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGDesiredWriteBarriers.h; path = dfg/DFGDesiredWriteBarriers.h; sourceTree = "<group>"; };
 		C29ECB011804D0ED00D2CBB4 /* CurrentThisInsideBlockGetterTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CurrentThisInsideBlockGetterTest.mm; path = API/tests/CurrentThisInsideBlockGetterTest.mm; sourceTree = "<group>"; };
 		C29ECB021804D0ED00D2CBB4 /* CurrentThisInsideBlockGetterTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CurrentThisInsideBlockGetterTest.h; path = API/tests/CurrentThisInsideBlockGetterTest.h; sourceTree = "<group>"; };
 		C2A7F687160432D400F76B98 /* JSDestructibleObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDestructibleObject.h; sourceTree = "<group>"; };
@@ -4938,8 +4934,6 @@
 				0FE8534A1723CDA500B618F5 /* DFGDesiredWatchpoints.h */,
 				C2981FD617BAEE4B00A3BC98 /* DFGDesiredWeakReferences.cpp */,
 				C2981FD717BAEE4B00A3BC98 /* DFGDesiredWeakReferences.h */,
-				C2981FDA17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp */,
-				C2981FDB17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.h */,
 				0FF427611591A1C9004CB9FF /* DFGDisassembler.cpp */,
 				0FF427621591A1C9004CB9FF /* DFGDisassembler.h */,
 				0F5A1271192D9FDF008764A3 /* DFGDoesGC.cpp */,
@@ -5835,7 +5829,6 @@
 				C2C0F7CE17BBFC5B00464FE4 /* DFGDesiredTransitions.h in Headers */,
 				0FE8534C1723CDA500B618F5 /* DFGDesiredWatchpoints.h in Headers */,
 				C2981FD917BAEE4B00A3BC98 /* DFGDesiredWeakReferences.h in Headers */,
-				C2981FDD17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.h in Headers */,
 				0FF427651591A1CE004CB9FF /* DFGDisassembler.h in Headers */,
 				0FD81AD3154FB4F000983E72 /* DFGDominators.h in Headers */,
 				0F1E3A471534CBB9000F9456 /* DFGDoubleFormatState.h in Headers */,
@@ -7146,7 +7139,6 @@
 				C2C0F7CD17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp in Sources */,
 				0FE8534B1723CDA500B618F5 /* DFGDesiredWatchpoints.cpp in Sources */,
 				C2981FD817BAEE4B00A3BC98 /* DFGDesiredWeakReferences.cpp in Sources */,
-				C2981FDC17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp in Sources */,
 				0FF427641591A1CC004CB9FF /* DFGDisassembler.cpp in Sources */,
 				0FD81AD2154FB4EE00983E72 /* DFGDominators.cpp in Sources */,
 				0FD3C82614115D4000FD81CB /* DFGDriver.cpp in Sources */,

Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (186984 => 186985)


--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2015-07-18 05:20:47 UTC (rev 186984)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2015-07-18 05:49:32 UTC (rev 186985)
@@ -4034,13 +4034,9 @@
         
         m_inlineCallFrame = byteCodeParser->m_graph.m_plan.inlineCallFrames->add();
         byteCodeParser->m_graph.freeze(codeBlock->ownerExecutable());
-        initializeLazyWriteBarrierForInlineCallFrameExecutable(
-            byteCodeParser->m_graph.m_plan.writeBarriers,
-            m_inlineCallFrame->executable,
-            byteCodeParser->m_codeBlock,
-            m_inlineCallFrame,
-            byteCodeParser->m_codeBlock->ownerExecutable(),
-            codeBlock->ownerExecutable());
+        // The owner is the machine code block, and we already have a barrier on that when the
+        // plan finishes.
+        m_inlineCallFrame->executable.setWithoutWriteBarrier(codeBlock->ownerExecutable());
         m_inlineCallFrame->setStackOffset(inlineCallFrameStart.offset() - JSStack::CallFrameHeaderSize);
         if (callee) {
             m_inlineCallFrame->calleeRecovery = ValueRecovery::constant(callee);

Deleted: trunk/Source/_javascript_Core/dfg/DFGDesiredWriteBarriers.cpp (186984 => 186985)


--- trunk/Source/_javascript_Core/dfg/DFGDesiredWriteBarriers.cpp	2015-07-18 05:20:47 UTC (rev 186984)
+++ trunk/Source/_javascript_Core/dfg/DFGDesiredWriteBarriers.cpp	2015-07-18 05:49:32 UTC (rev 186985)
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "DFGDesiredWriteBarriers.h"
-
-#if ENABLE(DFG_JIT)
-
-#include "CodeBlock.h"
-#include "JSCInlines.h"
-
-namespace JSC { namespace DFG {
-
-DesiredWriteBarrier::DesiredWriteBarrier(Type type, CodeBlock* codeBlock, unsigned index, JSCell* owner)
-    : m_owner(owner)
-    , m_type(type)
-    , m_codeBlock(codeBlock)
-{
-    m_which.index = index;
-}
-
-DesiredWriteBarrier::DesiredWriteBarrier(Type type, CodeBlock* codeBlock, InlineCallFrame* inlineCallFrame, JSCell* owner)
-    : m_owner(owner)
-    , m_type(type)
-    , m_codeBlock(codeBlock)
-{
-    m_which.inlineCallFrame = inlineCallFrame;
-}
-
-void DesiredWriteBarrier::trigger(VM& vm)
-{
-    switch (m_type) {
-    case ConstantType: {
-        WriteBarrier<Unknown>& barrier = m_codeBlock->constants()[m_which.index];
-        barrier.set(vm, m_owner, barrier.get());
-        return;
-    }
-
-    case InlineCallFrameExecutableType: {
-        InlineCallFrame* inlineCallFrame = m_which.inlineCallFrame;
-        WriteBarrier<ScriptExecutable>& executable = inlineCallFrame->executable;
-        executable.set(vm, m_owner, executable.get());
-        return;
-    } }
-    RELEASE_ASSERT_NOT_REACHED();
-}
-
-void DesiredWriteBarrier::visitChildren(SlotVisitor& visitor)
-{
-    switch (m_type) {
-    case ConstantType: {
-        WriteBarrier<Unknown>& barrier = m_codeBlock->constants()[m_which.index];
-        visitor.append(&barrier);
-        return;
-    }
-        
-    case InlineCallFrameExecutableType: {
-        InlineCallFrame* inlineCallFrame = m_which.inlineCallFrame;
-        WriteBarrier<ScriptExecutable>& executable = inlineCallFrame->executable;
-        visitor.append(&executable);
-        return;
-    } }
-    RELEASE_ASSERT_NOT_REACHED();
-}
-
-DesiredWriteBarriers::DesiredWriteBarriers()
-{
-}
-
-DesiredWriteBarriers::~DesiredWriteBarriers()
-{
-}
-
-void DesiredWriteBarriers::trigger(VM& vm)
-{
-    for (unsigned i = 0; i < m_barriers.size(); i++)
-        m_barriers[i].trigger(vm);
-}
-
-void DesiredWriteBarriers::visitChildren(SlotVisitor& visitor)
-{
-    for (unsigned i = 0; i < m_barriers.size(); i++)
-        m_barriers[i].visitChildren(visitor);
-}
-
-} } // namespace JSC::DFG
-
-#endif // ENABLE(DFG_JIT)

Deleted: trunk/Source/_javascript_Core/dfg/DFGDesiredWriteBarriers.h (186984 => 186985)


--- trunk/Source/_javascript_Core/dfg/DFGDesiredWriteBarriers.h	2015-07-18 05:20:47 UTC (rev 186984)
+++ trunk/Source/_javascript_Core/dfg/DFGDesiredWriteBarriers.h	2015-07-18 05:49:32 UTC (rev 186985)
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef DFGDesiredWriteBarriers_h
-#define DFGDesiredWriteBarriers_h
-
-#include "WriteBarrier.h"
-#include <wtf/Vector.h>
-
-#if ENABLE(DFG_JIT)
-
-namespace JSC {
-
-class JSFunction;
-class ScriptExecutable;
-class SlotVisitor;
-class VM;
-struct InlineCallFrame;
-
-namespace DFG {
-
-class DesiredWriteBarrier {
-public:
-    enum Type {
-        ConstantType,
-        InlineCallFrameExecutableType,
-    };
-    DesiredWriteBarrier(Type, CodeBlock*, unsigned index, JSCell* owner);
-    DesiredWriteBarrier(Type, CodeBlock*, InlineCallFrame*, JSCell* owner);
-
-    void trigger(VM&);
-    
-    void visitChildren(SlotVisitor&);
-
-private:
-    JSCell* m_owner;
-    Type m_type;
-    CodeBlock* m_codeBlock;
-    union {
-        unsigned index;
-        InlineCallFrame* inlineCallFrame;
-    } m_which;
-};
-
-class DesiredWriteBarriers {
-public:
-    DesiredWriteBarriers();
-    ~DesiredWriteBarriers();
-
-    DesiredWriteBarrier& add(DesiredWriteBarrier::Type type, CodeBlock* codeBlock, unsigned index, JSCell* owner)
-    {
-        m_barriers.append(DesiredWriteBarrier(type, codeBlock, index, owner));
-        return m_barriers.last();
-    }
-    DesiredWriteBarrier& add(DesiredWriteBarrier::Type type, CodeBlock* codeBlock, InlineCallFrame* inlineCallFrame, JSCell* owner)
-    {
-        m_barriers.append(DesiredWriteBarrier(type, codeBlock, inlineCallFrame, owner));
-        return m_barriers.last();
-    }
-
-    void trigger(VM&);
-    
-    void visitChildren(SlotVisitor&);
-
-private:
-    Vector<DesiredWriteBarrier> m_barriers;
-};
-
-inline void initializeLazyWriteBarrierForInlineCallFrameExecutable(DesiredWriteBarriers& barriers, WriteBarrier<ScriptExecutable>& barrier, CodeBlock* codeBlock, InlineCallFrame* inlineCallFrame, JSCell* owner, ScriptExecutable* value)
-{
-    DesiredWriteBarrier& desiredBarrier = barriers.add(DesiredWriteBarrier::InlineCallFrameExecutableType, codeBlock, inlineCallFrame, owner);
-    barrier = WriteBarrier<ScriptExecutable>(desiredBarrier, value);
-}
-
-inline void initializeLazyWriteBarrierForConstant(DesiredWriteBarriers& barriers, WriteBarrier<Unknown>& barrier, CodeBlock* codeBlock, unsigned index, JSCell* owner, JSValue value)
-{
-    DesiredWriteBarrier& desiredBarrier = barriers.add(DesiredWriteBarrier::ConstantType, codeBlock, index, owner);
-    barrier = WriteBarrier<Unknown>(desiredBarrier, value);
-}
-
-} } // namespace JSC::DFG
-
-#endif // ENABLE(DFG_JIT)
-
-#endif // DFGDesiredWriteBarriers_h

Modified: trunk/Source/_javascript_Core/dfg/DFGGraph.cpp (186984 => 186985)


--- trunk/Source/_javascript_Core/dfg/DFGGraph.cpp	2015-07-18 05:20:47 UTC (rev 186984)
+++ trunk/Source/_javascript_Core/dfg/DFGGraph.cpp	2015-07-18 05:49:32 UTC (rev 186985)
@@ -1121,13 +1121,8 @@
         }
         case StrongValue: {
             unsigned constantIndex = m_codeBlock->addConstantLazily();
-            initializeLazyWriteBarrierForConstant(
-                m_plan.writeBarriers,
-                m_codeBlock->constants()[constantIndex],
-                m_codeBlock,
-                constantIndex,
-                m_codeBlock->ownerExecutable(),
-                value->value());
+            // We already have a barrier on the code block.
+            m_codeBlock->constants()[constantIndex].setWithoutWriteBarrier(value->value());
             break;
         } }
     }

Modified: trunk/Source/_javascript_Core/dfg/DFGPlan.cpp (186984 => 186985)


--- trunk/Source/_javascript_Core/dfg/DFGPlan.cpp	2015-07-18 05:20:47 UTC (rev 186984)
+++ trunk/Source/_javascript_Core/dfg/DFGPlan.cpp	2015-07-18 05:49:32 UTC (rev 186985)
@@ -529,7 +529,6 @@
     identifiers.reallyAdd(vm, commonData);
     weakReferences.reallyAdd(vm, commonData);
     transitions.reallyAdd(vm, commonData);
-    writeBarriers.trigger(vm);
 }
 
 void Plan::notifyCompiling()
@@ -550,6 +549,9 @@
 
 CompilationResult Plan::finalizeWithoutNotifyingCallback()
 {
+    // We will establish new references from the code block to things. So, we need a barrier.
+    vm.heap.writeBarrier(codeBlock->ownerExecutable());
+    
     if (!isStillValid())
         return CompilationInvalidated;
 
@@ -605,7 +607,6 @@
     codeBlocks.mark(profiledDFGCodeBlock.get());
     
     weakReferences.visitChildren(visitor);
-    writeBarriers.visitChildren(visitor);
     transitions.visitChildren(visitor);
 }
 
@@ -633,7 +634,6 @@
     watchpoints = DesiredWatchpoints();
     identifiers = DesiredIdentifiers();
     weakReferences = DesiredWeakReferences();
-    writeBarriers = DesiredWriteBarriers();
     transitions = DesiredTransitions();
     callback = nullptr;
     stage = Cancelled;

Modified: trunk/Source/_javascript_Core/dfg/DFGPlan.h (186984 => 186985)


--- trunk/Source/_javascript_Core/dfg/DFGPlan.h	2015-07-18 05:20:47 UTC (rev 186984)
+++ trunk/Source/_javascript_Core/dfg/DFGPlan.h	2015-07-18 05:49:32 UTC (rev 186985)
@@ -33,7 +33,6 @@
 #include "DFGDesiredTransitions.h"
 #include "DFGDesiredWatchpoints.h"
 #include "DFGDesiredWeakReferences.h"
-#include "DFGDesiredWriteBarriers.h"
 #include "DFGFinalizer.h"
 #include "DeferredCompilationCallback.h"
 #include "Operands.h"
@@ -94,7 +93,6 @@
     DesiredWatchpoints watchpoints;
     DesiredIdentifiers identifiers;
     DesiredWeakReferences weakReferences;
-    DesiredWriteBarriers writeBarriers;
     DesiredTransitions transitions;
     
     bool willTryToTierUp;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to