Title: [110536] trunk/Source/WebCore
Revision
110536
Author
[email protected]
Date
2012-03-12 21:20:00 -0700 (Mon, 12 Mar 2012)

Log Message

[V8][Refactoring] Remove getCachedWrapperSlow() from V8Bindings.cpp
https://bugs.webkit.org/show_bug.cgi?id=80924

Reviewed by Adam Barth.

getCachedWrapperSlow() is called by getCachedWrapper() only,
and getCachedWrapperSlow() just calls getCachedWrapperInline().
Thus, this patch expands getCachedWrapperInline() into getCachedWrapper(),
and removes getCachedWrapperSlow().

No tests. No change in behavior.

* bindings/v8/V8DOMWrapper.cpp:
* bindings/v8/V8DOMWrapper.h:
(WebCore::V8DOMWrapper::getCachedWrapper):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (110535 => 110536)


--- trunk/Source/WebCore/ChangeLog	2012-03-13 04:03:27 UTC (rev 110535)
+++ trunk/Source/WebCore/ChangeLog	2012-03-13 04:20:00 UTC (rev 110536)
@@ -1,5 +1,23 @@
 2012-03-12  Kentaro Hara  <[email protected]>
 
+        [V8][Refactoring] Remove getCachedWrapperSlow() from V8Bindings.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=80924
+
+        Reviewed by Adam Barth.
+
+        getCachedWrapperSlow() is called by getCachedWrapper() only,
+        and getCachedWrapperSlow() just calls getCachedWrapperInline().
+        Thus, this patch expands getCachedWrapperInline() into getCachedWrapper(),
+        and removes getCachedWrapperSlow().
+
+        No tests. No change in behavior.
+
+        * bindings/v8/V8DOMWrapper.cpp:
+        * bindings/v8/V8DOMWrapper.h:
+        (WebCore::V8DOMWrapper::getCachedWrapper):
+
+2012-03-12  Kentaro Hara  <[email protected]>
+
         [V8][Refactoring] Remove existingWrapper() from generated code
         https://bugs.webkit.org/show_bug.cgi?id=80927
 

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp (110535 => 110536)


--- trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp	2012-03-13 04:03:27 UTC (rev 110535)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp	2012-03-13 04:20:00 UTC (rev 110536)
@@ -32,7 +32,6 @@
 #include "V8DOMWrapper.h"
 
 #include "ArrayBufferView.h"
-#include "DOMDataStore.h"
 #include "DocumentLoader.h"
 #include "EventTargetHeaders.h"
 #include "EventTargetInterfaces.h"
@@ -41,13 +40,11 @@
 #include "V8AbstractEventListener.h"
 #include "V8Binding.h"
 #include "V8Collection.h"
-#include "V8DOMMap.h"
 #include "V8EventListener.h"
 #include "V8EventListenerList.h"
 #include "V8HTMLCollection.h"
 #include "V8HTMLDocument.h"
 #include "V8HiddenPropertyName.h"
-#include "V8IsolatedContext.h"
 #include "V8Location.h"
 #include "V8NamedNodeMap.h"
 #include "V8NodeFilterCondition.h"
@@ -69,20 +66,6 @@
 
 namespace WebCore {
 
-static ALWAYS_INLINE v8::Handle<v8::Object> getCachedWrapperInline(Node* node)
-{
-    V8IsolatedContext* context = V8IsolatedContext::getEntered();
-    if (LIKELY(!context)) {
-        v8::Persistent<v8::Object>* wrapper = node->wrapper();
-        if (!wrapper)
-            return v8::Handle<v8::Object>();
-        return *wrapper;
-    }
-    DOMDataStore* store = context->world()->domDataStore();
-    DOMNodeMapping& domNodeMap = node->isActiveNode() ? store->activeDomNodeMap() : store->domNodeMap();
-    return domNodeMap.get(node);
-}
-
 // The caller must have increased obj's ref count.
 void V8DOMWrapper::setJSWrapperForDOMObject(void* object, v8::Persistent<v8::Object> wrapper)
 {
@@ -303,11 +286,6 @@
     return typeInfo == type;
 }
 
-v8::Handle<v8::Object> V8DOMWrapper::getCachedWrapperSlow(Node* node)
-{
-    return getCachedWrapperInline(node);
-}
-
 #define TRY_TO_WRAP_WITH_INTERFACE(interfaceName) \
     if (eventNames().interfaceFor##interfaceName == desiredInterface) \
         return toV8(static_cast<interfaceName*>(target));

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h (110535 => 110536)


--- trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h	2012-03-13 04:03:27 UTC (rev 110535)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h	2012-03-13 04:20:00 UTC (rev 110536)
@@ -31,6 +31,7 @@
 #ifndef V8DOMWrapper_h
 #define V8DOMWrapper_h
 
+#include "DOMDataStore.h"
 #include "Event.h"
 #include "IsolatedWorld.h"
 #include "Node.h"
@@ -38,6 +39,7 @@
 #include "PlatformString.h"
 #include "V8CustomXPathNSResolver.h"
 #include "V8Event.h"
+#include "V8IsolatedContext.h"
 #include "V8Utilities.h"
 #include "V8XPathNSResolver.h"
 #include "WrapperTypeInfo.h"
@@ -132,11 +134,18 @@
                 if (LIKELY(!!wrapper))
                     return *wrapper;
             }
-            return getCachedWrapperSlow(node);
+
+            V8IsolatedContext* context = V8IsolatedContext::getEntered();
+            if (LIKELY(!context)) {
+                v8::Persistent<v8::Object>* wrapper = node->wrapper();
+                if (!wrapper)
+                    return v8::Handle<v8::Object>();
+                return *wrapper;
+            }
+            DOMDataStore* store = context->world()->domDataStore();
+            DOMNodeMapping& domNodeMap = node->isActiveNode() ? store->activeDomNodeMap() : store->domNodeMap();
+            return domNodeMap.get(node);
         }
-
-    private:
-        static v8::Handle<v8::Object> getCachedWrapperSlow(Node*);
     };
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to