[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:09:32 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 3a68b4e67b236f66170113db6a398aec58db8440
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 5 22:24:25 2003 +0000

            Reviewed by Ken.
    
    	- fixed 3474756 - Creating HTML event listeners takes 5% of time on particular slow intel page
    
            * khtml/ecma/kjs_window.h: Make jsEventListeners a hashtable keyed
    	by listener object, not a list.
            * khtml/ecma/kjs_window.cpp:
            (Window::getJSEventListener): Do hashtable lookup for existing listener instead of
    	walking list.
            * khtml/ecma/kjs_events.cpp:
            (JSEventListener::JSEventListener): Use hashtable insert instead of list append.
            (JSEventListener::~JSEventListener): Use hashtable remove instead of list removeRef.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5394 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 5413fb2..86bb2f9 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,18 @@
+2003-11-05  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Ken.
+
+	- fixed 3474756 - Creating HTML event listeners takes 5% of time on particular slow intel page
+	
+        * khtml/ecma/kjs_window.h: Make jsEventListeners a hashtable keyed
+	by listener object, not a list.
+        * khtml/ecma/kjs_window.cpp:
+        (Window::getJSEventListener): Do hashtable lookup for existing listener instead of
+	walking list.
+        * khtml/ecma/kjs_events.cpp:
+        (JSEventListener::JSEventListener): Use hashtable insert instead of list append.
+        (JSEventListener::~JSEventListener): Use hashtable remove instead of list removeRef.
+
 2003-11-05  Darin Adler  <darin at apple.com>
 
         Reviewed by Maciej.
diff --git a/WebCore/khtml/ecma/kjs_events.cpp b/WebCore/khtml/ecma/kjs_events.cpp
index bbea601..04aaf20 100644
--- a/WebCore/khtml/ecma/kjs_events.cpp
+++ b/WebCore/khtml/ecma/kjs_events.cpp
@@ -41,12 +41,12 @@ JSEventListener::JSEventListener(Object _listener, const Object &_win, bool _htm
     //fprintf(stderr,"JSEventListener::JSEventListener this=%p listener=%p\n",this,listener.imp());
     html = _html;
     win = _win;
-    static_cast<Window*>(win.imp())->jsEventListeners.append(this);
+    static_cast<Window*>(win.imp())->jsEventListeners.insert(_listener.imp(), this);
 }
 
 JSEventListener::~JSEventListener()
 {
-    static_cast<Window*>(win.imp())->jsEventListeners.removeRef(this);
+    static_cast<Window*>(win.imp())->jsEventListeners.remove(listener.imp());
     //fprintf(stderr,"JSEventListener::~JSEventListener this=%p listener=%p\n",this,listener.imp());
 }
 
diff --git a/WebCore/khtml/ecma/kjs_window.cpp b/WebCore/khtml/ecma/kjs_window.cpp
index a7fc843..9ea270e 100644
--- a/WebCore/khtml/ecma/kjs_window.cpp
+++ b/WebCore/khtml/ecma/kjs_window.cpp
@@ -1024,10 +1024,9 @@ JSEventListener *Window::getJSEventListener(const Value& val, bool html)
     return 0;
   ObjectImp *listenerObject = static_cast<ObjectImp *>(val.imp());
 
-  QPtrListIterator<JSEventListener> it(jsEventListeners);
-  for (; it.current(); ++it)
-    if (it.current()->listenerObjImp() == listenerObject)
-      return it.current();
+  JSEventListener *existingListener = jsEventListeners[listenerObject];
+  if (existingListener)
+    return existingListener;
 
   // Note that the JSEventListener constructor adds it to our jsEventListeners list
   return new JSEventListener(Object(listenerObject), Object(this), html);
diff --git a/WebCore/khtml/ecma/kjs_window.h b/WebCore/khtml/ecma/kjs_window.h
index 621f763..110fdea 100644
--- a/WebCore/khtml/ecma/kjs_window.h
+++ b/WebCore/khtml/ecma/kjs_window.h
@@ -106,7 +106,7 @@ namespace KJS {
     // Set the current "event" object
     void setCurrentEvent( DOM::Event *evt );
 
-    QPtrList<JSEventListener> jsEventListeners;
+    QPtrDict<JSEventListener> jsEventListeners;
     virtual const ClassInfo* classInfo() const { return &info; }
     static const ClassInfo info;
     enum { Closed, Crypto, DefaultStatus, Status, Document, Node, EventCtor, Range,

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list