Unreviewed, attempt to fix Windows build after r207787
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Oct 2016 00:31:05 +0000 (00:31 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Oct 2016 00:31:05 +0000 (00:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=163657

According to the similar code in WebKit, I guess that
Visual C++ requires friend class declaration is done
in the private section to access private members.

And I also changed ::instance to ::shared to align to
the existing WebCore code.

* domjit/DOMJITAbstractHeapRepository.cpp:
(WebCore::DOMJIT::AbstractHeapRepository::shared):
(WebCore::DOMJIT::AbstractHeapRepository::instance): Deleted.
* domjit/DOMJITAbstractHeapRepository.h:
* domjit/JSNodeDOMJIT.cpp:
(WebCore::NodeFirstChildDOMJIT::callDOM):
(WebCore::NodeLastChildDOMJIT::callDOM):
(WebCore::NodeNextSiblingDOMJIT::callDOM):
(WebCore::NodePreviousSiblingDOMJIT::callDOM):
(WebCore::NodeParentNodeDOMJIT::callDOM):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207793 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/domjit/DOMJITAbstractHeapRepository.cpp
Source/WebCore/domjit/DOMJITAbstractHeapRepository.h
Source/WebCore/domjit/JSNodeDOMJIT.cpp

index e0dd3bc..4dff8d6 100644 (file)
@@ -1,3 +1,26 @@
+2016-10-24  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        Unreviewed, attempt to fix Windows build after r207787
+        https://bugs.webkit.org/show_bug.cgi?id=163657
+
+        According to the similar code in WebKit, I guess that
+        Visual C++ requires friend class declaration is done
+        in the private section to access private members.
+
+        And I also changed ::instance to ::shared to align to
+        the existing WebCore code.
+
+        * domjit/DOMJITAbstractHeapRepository.cpp:
+        (WebCore::DOMJIT::AbstractHeapRepository::shared):
+        (WebCore::DOMJIT::AbstractHeapRepository::instance): Deleted.
+        * domjit/DOMJITAbstractHeapRepository.h:
+        * domjit/JSNodeDOMJIT.cpp:
+        (WebCore::NodeFirstChildDOMJIT::callDOM):
+        (WebCore::NodeLastChildDOMJIT::callDOM):
+        (WebCore::NodeNextSiblingDOMJIT::callDOM):
+        (WebCore::NodePreviousSiblingDOMJIT::callDOM):
+        (WebCore::NodeParentNodeDOMJIT::callDOM):
+
 2016-10-24  Simon Fraser  <simon.fraser@apple.com>
 
         Fix the lifetime of strings used in LOG_WITH_STREAM
index 1f4fbfa..83fba89 100644 (file)
@@ -59,7 +59,7 @@ AbstractHeapRepository::AbstractHeapRepository()
     }
 }
 
-const AbstractHeapRepository& AbstractHeapRepository::instance()
+const AbstractHeapRepository& AbstractHeapRepository::shared()
 {
     static NeverDestroyed<AbstractHeapRepository> repository;
     return repository.get();
index ec64490..119fc91 100644 (file)
@@ -47,8 +47,7 @@ namespace WebCore { namespace DOMJIT {
 class AbstractHeapRepository {
 WTF_MAKE_NONCOPYABLE(AbstractHeapRepository);
 public:
-    friend class NeverDestroyed<AbstractHeapRepository>;
-    static const AbstractHeapRepository& instance();
+    static const AbstractHeapRepository& shared();
 
     JSC::DOMJIT::HeapRange DOM;
 
@@ -57,6 +56,7 @@ public:
 #undef DOMJIT_DEFINE_MEMBER
 
 private:
+    friend class NeverDestroyed<AbstractHeapRepository>;
     AbstractHeapRepository();
 };
 
index 87f4db7..007289f 100644 (file)
@@ -104,7 +104,7 @@ Ref<JSC::DOMJIT::Patchpoint> NodeFirstChildDOMJIT::checkDOM()
 
 Ref<JSC::DOMJIT::CallDOMPatchpoint> NodeFirstChildDOMJIT::callDOM()
 {
-    const auto& heap = DOMJIT::AbstractHeapRepository::instance();
+    const auto& heap = DOMJIT::AbstractHeapRepository::shared();
     auto patchpoint = createCallDOMForOffsetAccess<Node>(CAST_OFFSET(Node*, ContainerNode*) + ContainerNode::firstChildMemoryOffset(), IsContainerGuardRequirement::Required);
     patchpoint->effect = JSC::DOMJIT::Effect::forDef(heap.Node_firstChild);
     return patchpoint;
@@ -118,7 +118,7 @@ Ref<JSC::DOMJIT::Patchpoint> NodeLastChildDOMJIT::checkDOM()
 
 Ref<JSC::DOMJIT::CallDOMPatchpoint> NodeLastChildDOMJIT::callDOM()
 {
-    const auto& heap = DOMJIT::AbstractHeapRepository::instance();
+    const auto& heap = DOMJIT::AbstractHeapRepository::shared();
     auto patchpoint = createCallDOMForOffsetAccess<Node>(CAST_OFFSET(Node*, ContainerNode*) + ContainerNode::lastChildMemoryOffset(), IsContainerGuardRequirement::Required);
     patchpoint->effect = JSC::DOMJIT::Effect::forDef(heap.Node_lastChild);
     return patchpoint;
@@ -132,7 +132,7 @@ Ref<JSC::DOMJIT::Patchpoint> NodeNextSiblingDOMJIT::checkDOM()
 
 Ref<JSC::DOMJIT::CallDOMPatchpoint> NodeNextSiblingDOMJIT::callDOM()
 {
-    const auto& heap = DOMJIT::AbstractHeapRepository::instance();
+    const auto& heap = DOMJIT::AbstractHeapRepository::shared();
     auto patchpoint = createCallDOMForOffsetAccess<Node>(Node::nextSiblingMemoryOffset(), IsContainerGuardRequirement::NotRequired);
     patchpoint->effect = JSC::DOMJIT::Effect::forDef(heap.Node_nextSibling);
     return patchpoint;
@@ -146,7 +146,7 @@ Ref<JSC::DOMJIT::Patchpoint> NodePreviousSiblingDOMJIT::checkDOM()
 
 Ref<JSC::DOMJIT::CallDOMPatchpoint> NodePreviousSiblingDOMJIT::callDOM()
 {
-    const auto& heap = DOMJIT::AbstractHeapRepository::instance();
+    const auto& heap = DOMJIT::AbstractHeapRepository::shared();
     auto patchpoint = createCallDOMForOffsetAccess<Node>(Node::previousSiblingMemoryOffset(), IsContainerGuardRequirement::NotRequired);
     patchpoint->effect = JSC::DOMJIT::Effect::forDef(heap.Node_previousSibling);
     return patchpoint;
@@ -160,7 +160,7 @@ Ref<JSC::DOMJIT::Patchpoint> NodeParentNodeDOMJIT::checkDOM()
 
 Ref<JSC::DOMJIT::CallDOMPatchpoint> NodeParentNodeDOMJIT::callDOM()
 {
-    const auto& heap = DOMJIT::AbstractHeapRepository::instance();
+    const auto& heap = DOMJIT::AbstractHeapRepository::shared();
     auto patchpoint = createCallDOMForOffsetAccess<ContainerNode>(Node::parentNodeMemoryOffset(), IsContainerGuardRequirement::NotRequired);
     patchpoint->effect = JSC::DOMJIT::Effect::forDef(heap.Node_parentNode);
     return patchpoint;