gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, objecturi, updated. 9d8a897354e14faf0


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, objecturi, updated. 9d8a897354e14faf06cd0582604cc691ca8eb552
Date: Wed, 22 Sep 2010 19:11:31 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, objecturi has been updated
       via  9d8a897354e14faf06cd0582604cc691ca8eb552 (commit)
       via  bb616d8c7dca540e4ce5d5fa2f8b69630f9735bc (commit)
       via  fd4b77363d75839cc1b4cf0dd98847d801431762 (commit)
       via  ab817f7606120886af9585f20ee297eb81b71f55 (commit)
       via  4e394d0a2e5bf7fd1dd4ac269541daff6538c9c1 (commit)
       via  95ba9f446c7d2de9a5ce48e93a737f689ce324c0 (commit)
       via  0daf55e4c76aae0db63a7c3644c82502cac08382 (commit)
       via  a19876b5223ac5e4ab155b12912a93cc307ad06e (commit)
      from  7479110c129f0f2b61a4e0254305f65a4a8ea4c0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=9d8a897354e14faf06cd0582604cc691ca8eb552


commit 9d8a897354e14faf06cd0582604cc691ca8eb552
Author: Sandro Santilli <address@hidden>
Date:   Wed Sep 22 20:28:42 2010 +0200

    More proxying of noCase

diff --git a/libcore/PropertyList.cpp b/libcore/PropertyList.cpp
index c9febac..103d52b 100644
--- a/libcore/PropertyList.cpp
+++ b/libcore/PropertyList.cpp
@@ -72,7 +72,7 @@ PropertyList::setValue(const ObjectURI& uri, const as_value& 
val,
                // create a new member
                Property a(uri, val, flagsIfMissing);
                // Non slot properties are negative ordering in insertion order
-               _props.push_back(std::make_pair(a, st.noCase(uri.name)));
+               _props.push_back(std::make_pair(a, uri.noCase(st)));
 #ifdef GNASH_DEBUG_PROPERTY
         ObjectURI::Logger l(getStringTable(_owner));
                log_debug("Simple AS property %s inserted with flags %s",
@@ -199,7 +199,7 @@ PropertyList::addGetterSetter(const ObjectURI& uri, 
as_function& getter,
                // copy flags from previous member (even if it's a normal 
member ?)
                a.setFlags(found->first.getFlags());
                a.setCache(found->first.getCache());
-               _props.replace(found, std::make_pair(a, st.noCase(uri.name)));
+               _props.replace(found, std::make_pair(a, uri.noCase(st)));
 
 #ifdef GNASH_DEBUG_PROPERTY
         ObjectURI::Logger l(getStringTable(_owner));
@@ -211,7 +211,7 @@ PropertyList::addGetterSetter(const ObjectURI& uri, 
as_function& getter,
        else
        {
                a.setCache(cacheVal);
-               _props.push_back(std::make_pair(a, st.noCase(uri.name)));
+               _props.push_back(std::make_pair(a, uri.noCase(st)));
 #ifdef GNASH_DEBUG_PROPERTY
         ObjectURI::Logger l(getStringTable(_owner));
                log_debug("AS GetterSetter %s inserted with flags %s", l(uri),
@@ -234,7 +234,7 @@ PropertyList::addGetterSetter(const ObjectURI& uri, 
as_c_function_ptr getter,
        {
                // copy flags from previous member (even if it's a normal 
member ?)
                a.setFlags(found->first.getFlags());
-               _props.replace(found, std::make_pair(a, st.noCase(uri.name)));
+               _props.replace(found, std::make_pair(a, uri.noCase(st)));
 
 #ifdef GNASH_DEBUG_PROPERTY
         ObjectURI::Logger l(getStringTable(_owner));
@@ -245,7 +245,7 @@ PropertyList::addGetterSetter(const ObjectURI& uri, 
as_c_function_ptr getter,
        }
        else
        {
-               _props.push_back(std::make_pair(a, st.noCase(uri.name)));
+               _props.push_back(std::make_pair(a, uri.noCase(st)));
 #ifdef GNASH_DEBUG_PROPERTY
                string_table& st = getStringTable(_owner);
                log_debug("Native GetterSetter %s in namespace %s inserted with 
"
@@ -273,7 +273,7 @@ PropertyList::addDestructiveGetter(const ObjectURI& uri, 
as_function& getter,
        Property a(uri, &getter, (as_function*)0, flagsIfMissing, true);
 
     string_table& st = getStringTable(_owner);
-       _props.push_back(std::make_pair(a, st.noCase(uri.name)));
+       _props.push_back(std::make_pair(a, uri.noCase(st)));
 
 #ifdef GNASH_DEBUG_PROPERTY
     ObjectURI::Logger l(getStringTable(_owner));
@@ -294,7 +294,7 @@ PropertyList::addDestructiveGetter(const ObjectURI& uri,
        // destructive getter don't need a setter
        Property a(uri, getter, (as_c_function_ptr)0, flagsIfMissing, true);
     string_table& st = getStringTable(_owner);
-       _props.push_back(std::make_pair(a, st.noCase(uri.name)));
+       _props.push_back(std::make_pair(a, uri.noCase(st)));
 
 #ifdef GNASH_DEBUG_PROPERTY
     ObjectURI::Logger l(getStringTable(_owner));

http://git.savannah.gnu.org/cgit//commit/?id=bb616d8c7dca540e4ce5d5fa2f8b69630f9735bc


commit bb616d8c7dca540e4ce5d5fa2f8b69630f9735bc
Author: Sandro Santilli <address@hidden>
Date:   Wed Sep 22 20:18:12 2010 +0200

    Query ObjectURI for noCase

diff --git a/libcore/PropertyList.cpp b/libcore/PropertyList.cpp
index e32e9f5..c9febac 100644
--- a/libcore/PropertyList.cpp
+++ b/libcore/PropertyList.cpp
@@ -53,7 +53,7 @@ iterator_find(const PropertyList::container& p, const 
ObjectURI& uri, VM& vm)
     }
         
     string_table& st = vm.getStringTable();
-    const string_table::key nocase = st.noCase(uri.name);
+    const string_table::key nocase = uri.noCase(st); 
     return p.project<0>(p.get<2>().find(nocase));
 }
 

http://git.savannah.gnu.org/cgit//commit/?id=fd4b77363d75839cc1b4cf0dd98847d801431762


commit fd4b77363d75839cc1b4cf0dd98847d801431762
Author: Sandro Santilli <address@hidden>
Date:   Wed Sep 22 20:01:08 2010 +0200

    Improved debugging stats for ObjectURI noCase calls

diff --git a/libcore/ObjectURI.h b/libcore/ObjectURI.h
index 3d4c529..e57e483 100644
--- a/libcore/ObjectURI.h
+++ b/libcore/ObjectURI.h
@@ -56,7 +56,8 @@ struct ObjectURI
         void skip() { ++skips; }
         void doit() { ++dos; }
         ~Counter () {
-            std::cerr << "Skipped " << skips << "/" << dos << " (" << 
(skips/dos)
+            std::cerr << "Skipped " << skips << "/" << (skips+dos)
+                << " (" << (double(skips)/double(skips+dos))
                 << ") calls to noCase "<< std::endl;
         }
     };

http://git.savannah.gnu.org/cgit//commit/?id=ab817f7606120886af9585f20ee297eb81b71f55


commit ab817f7606120886af9585f20ee297eb81b71f55
Author: Sandro Santilli <address@hidden>
Date:   Wed Sep 22 19:37:15 2010 +0200

    switch {get,set}DisplayObjectProperty to use ObjectURI

diff --git a/libcore/DisplayObject.cpp b/libcore/DisplayObject.cpp
index 087ecc4..d5fcb13 100644
--- a/libcore/DisplayObject.cpp
+++ b/libcore/DisplayObject.cpp
@@ -914,7 +914,7 @@ getIndexedProperty(size_t index, DisplayObject& o, 
as_value& val)
 ///    way to do it, but as it is done like this, this must be called here.
 ///    It will cause an infinite recursion otherwise.
 bool
-getDisplayObjectProperty(DisplayObject& obj, string_table::key key,
+getDisplayObjectProperty(DisplayObject& obj, const ObjectURI& uri,
         as_value& val)
 {
     
@@ -922,7 +922,7 @@ getDisplayObjectProperty(DisplayObject& obj, 
string_table::key key,
     assert(o);
 
     string_table& st = getStringTable(*o);
-    const std::string& propname = st.value(key);
+    const std::string& propname = uri.toString(st);
 
     // Check _level0.._level9
     movie_root& mr = getRoot(*getObject(&obj));
@@ -938,19 +938,19 @@ getDisplayObjectProperty(DisplayObject& obj, 
string_table::key key,
     
     MovieClip* mc = dynamic_cast<MovieClip*>(&obj);
     if (mc) {
-        DisplayObject* ch = mc->getDisplayListObject(key);
+        DisplayObject* ch = mc->getDisplayListObject(uri);
         if (ch) {
            val = getObject(ch);
            return true;
         }
     }
 
-    const string_table::key noCaseKey = st.noCase(key);
+    const string_table::key noCaseKey = uri.noCase(st);
 
     // These properties have normal case-sensitivity.
     // They are tested to exist for TextField, MovieClip, and Button
     // but do not belong to the inheritance chain.
-    switch (caseless(*o) ? noCaseKey : key)
+    switch (caseless(*o) ? noCaseKey : getName(uri))
     {
         default:
             break;
@@ -971,19 +971,19 @@ getDisplayObjectProperty(DisplayObject& obj, 
string_table::key key,
 
     // Check MovieClip such as TextField variables.
     // TODO: check if there's a better way to find these properties.
-    if (mc && mc->getTextFieldVariables(key, val)) return true;
+    if (mc && mc->getTextFieldVariables(uri, val)) return true;
 
     return false;
 }
     
 
 bool
-setDisplayObjectProperty(DisplayObject& obj, string_table::key key, 
+setDisplayObjectProperty(DisplayObject& obj, const ObjectURI& uri,
         const as_value& val)
 {
     // These magic properties are case insensitive in all versions!
     string_table& st = getStringTable(*getObject(&obj));
-    return doSet(st.noCase(key), obj, val);
+    return doSet(uri.noCase(st), obj, val);
 }
     
 DisplayObject::MaskRenderer::MaskRenderer(Renderer& r, const DisplayObject& o)
diff --git a/libcore/DisplayObject.h b/libcore/DisplayObject.h
index eb77454..ae2b52d 100644
--- a/libcore/DisplayObject.h
+++ b/libcore/DisplayObject.h
@@ -80,7 +80,7 @@ bool isReferenceable(const DisplayObject& d);
 /// @param obj      The DisplayObject whose property should be set
 /// @param val      An as_value representing the new value of the property.
 ///                 Some values may be rejected.
-bool setDisplayObjectProperty(DisplayObject& obj, string_table::key key,
+bool setDisplayObjectProperty(DisplayObject& obj, const ObjectURI& uri,
         const as_value& val);
 
 /// Get special properties
@@ -88,10 +88,10 @@ bool setDisplayObjectProperty(DisplayObject& obj, 
string_table::key key,
 /// This gets the magic properties of DisplayObjects and handles special
 /// MovieClip properties such as DisplayList members.
 //
-/// @param key      The string table key of the property to get.
+/// @param key      The uri of the property to get.
 /// @param obj      The DisplayObject whose property should be got
 /// @param val      An as_value to be set to the value of the property.
-bool getDisplayObjectProperty(DisplayObject& obj, string_table::key key,
+bool getDisplayObjectProperty(DisplayObject& obj, const ObjectURI& uri,
         as_value& val);
 
 /// Get a property by its numeric index.

http://git.savannah.gnu.org/cgit//commit/?id=4e394d0a2e5bf7fd1dd4ac269541daff6538c9c1


commit 4e394d0a2e5bf7fd1dd4ac269541daff6538c9c1
Author: Sandro Santilli <address@hidden>
Date:   Wed Sep 22 19:31:47 2010 +0200

    Improve stats counter to show hit/skips

diff --git a/libcore/ObjectURI.h b/libcore/ObjectURI.h
index 81ef02b..3d4c529 100644
--- a/libcore/ObjectURI.h
+++ b/libcore/ObjectURI.h
@@ -50,22 +50,30 @@ struct ObjectURI
 
 #ifdef GNASH_DEBUG_OBJECT_URI_NOCASE
     struct Counter {
-        Counter(): count(0) {}
-        int count;
-        void operator++() { ++count; }
+        Counter(): skips(0), dos(0) {}
+        int skips;
+        int dos;
+        void skip() { ++skips; }
+        void doit() { ++dos; }
         ~Counter () {
-            std::cerr << "Skipped " << count << " calls to noCase "<< 
std::endl;
+            std::cerr << "Skipped " << skips << "/" << dos << " (" << 
(skips/dos)
+                << ") calls to noCase "<< std::endl;
         }
     };
 #endif
 
     string_table::key noCase(string_table& st) const {
 #ifdef GNASH_DEBUG_OBJECT_URI_NOCASE
-        static Counter skips;
+        static Counter stat;
 #endif
-        if ( ! nameNoCase ) nameNoCase = st.noCase(name);
+        if ( ! nameNoCase ) {
+            nameNoCase = st.noCase(name);
 #ifdef GNASH_DEBUG_OBJECT_URI_NOCASE
-        else ++skips;
+            stat.doit();
+#endif
+        }
+#ifdef GNASH_DEBUG_OBJECT_URI_NOCASE
+        else stat.skip();
 #endif
         return nameNoCase;
     }

http://git.savannah.gnu.org/cgit//commit/?id=95ba9f446c7d2de9a5ce48e93a737f689ce324c0


commit 95ba9f446c7d2de9a5ce48e93a737f689ce324c0
Author: Sandro Santilli <address@hidden>
Date:   Wed Sep 22 19:01:47 2010 +0200

    Enable stats debugging

diff --git a/libbase/string_table.cpp b/libbase/string_table.cpp
index cb6690e..5e57e44 100644
--- a/libbase/string_table.cpp
+++ b/libbase/string_table.cpp
@@ -20,7 +20,7 @@
 #include "string_table.h"
 #include <boost/algorithm/string/case_conv.hpp>
 
-//#define DEBUG_STRING_TABLE 1
+#define DEBUG_STRING_TABLE 1
 //#define GNASH_PARANOIA_LEVEL 3
 
 #ifdef DEBUG_STRING_TABLE

http://git.savannah.gnu.org/cgit//commit/?id=0daf55e4c76aae0db63a7c3644c82502cac08382


commit 0daf55e4c76aae0db63a7c3644c82502cac08382
Author: Sandro Santilli <address@hidden>
Date:   Wed Sep 22 19:01:22 2010 +0200

    Add stats debugging

diff --git a/libcore/ObjectURI.h b/libcore/ObjectURI.h
index a90cb30..81ef02b 100644
--- a/libcore/ObjectURI.h
+++ b/libcore/ObjectURI.h
@@ -6,6 +6,12 @@
 #include <string>
 #include <ostream>
 
+#define GNASH_DEBUG_OBJECT_URI_NOCASE 1
+
+#ifdef GNASH_DEBUG_OBJECT_URI_NOCASE
+# include <iostream>
+#endif
+
 namespace gnash {
 
 /// A URI for describing as_objects.
@@ -42,8 +48,25 @@ struct ObjectURI
     }
 
 
+#ifdef GNASH_DEBUG_OBJECT_URI_NOCASE
+    struct Counter {
+        Counter(): count(0) {}
+        int count;
+        void operator++() { ++count; }
+        ~Counter () {
+            std::cerr << "Skipped " << count << " calls to noCase "<< 
std::endl;
+        }
+    };
+#endif
+
     string_table::key noCase(string_table& st) const {
+#ifdef GNASH_DEBUG_OBJECT_URI_NOCASE
+        static Counter skips;
+#endif
         if ( ! nameNoCase ) nameNoCase = st.noCase(name);
+#ifdef GNASH_DEBUG_OBJECT_URI_NOCASE
+        else ++skips;
+#endif
         return nameNoCase;
     }
 

http://git.savannah.gnu.org/cgit//commit/?id=a19876b5223ac5e4ab155b12912a93cc307ad06e


commit a19876b5223ac5e4ab155b12912a93cc307ad06e
Author: Sandro Santilli <address@hidden>
Date:   Wed Sep 22 18:06:00 2010 +0200

    Have NameEquals store query URI by ref, for having more noCase caches 
opportunities

diff --git a/libcore/DisplayList.cpp b/libcore/DisplayList.cpp
index cc6ade8..a4a7ff7 100644
--- a/libcore/DisplayList.cpp
+++ b/libcore/DisplayList.cpp
@@ -133,7 +133,7 @@ public:
 private:
     string_table& _st;
     const bool _caseless;
-    const ObjectURI _name;
+    const ObjectURI& _name;
 };
 
 } // anonymous namespace

-----------------------------------------------------------------------

Summary of changes:
 libbase/string_table.cpp  |    2 +-
 libcore/DisplayList.cpp   |    2 +-
 libcore/DisplayObject.cpp |   16 ++++++++--------
 libcore/DisplayObject.h   |    6 +++---
 libcore/ObjectURI.h       |   34 +++++++++++++++++++++++++++++++++-
 libcore/PropertyList.cpp  |   16 ++++++++--------
 6 files changed, 54 insertions(+), 22 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]