gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. ee91b0365076c50d865e


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. ee91b0365076c50d865e6748b5ad2d42ad0f47d0
Date: Fri, 01 Oct 2010 13:21:09 +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, master has been updated
       via  ee91b0365076c50d865e6748b5ad2d42ad0f47d0 (commit)
       via  b837797e82abafc69651cb340d6ebedacd08ddaf (commit)
       via  afaa2d52a0e948dfa108734fd568cf1e53940223 (commit)
      from  003dc38e09b6e28dbebb8eb264456ee19e13d33a (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=ee91b0365076c50d865e6748b5ad2d42ad0f47d0


commit ee91b0365076c50d865e6748b5ad2d42ad0f47d0
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 1 14:44:43 2010 +0200

    Add more object information.

diff --git a/libcore/as_value.cpp b/libcore/as_value.cpp
index 32c77d8..4ded229 100644
--- a/libcore/as_value.cpp
+++ b/libcore/as_value.cpp
@@ -1052,11 +1052,10 @@ operator<<(std::ostream& o, const as_value& v)
         {
             as_object* obj = v.getObj();
             assert(obj);
-            const char* desc = obj->array() ? "array" : "object";
-            boost::format ret =
-                boost::format("[%s(%s):%p]") % desc % typeName(*obj) %
-                                              static_cast<void*>(obj);
-            return o << ret.str();
+            const std::string desc = obj->array() ? "array" :
+                obj->relay() ? typeName(*obj->relay()) : typeName(*obj);
+            return o << "[object(" << desc << "):" << static_cast<void*>(obj)
+                                                       << "]";
         }
         case as_value::STRING:
             return o << "[string:" + v.getStr() + "]";
diff --git a/libcore/vm/ASHandlers.cpp b/libcore/vm/ASHandlers.cpp
index c57023d..d6fd368 100644
--- a/libcore/vm/ASHandlers.cpp
+++ b/libcore/vm/ASHandlers.cpp
@@ -1831,7 +1831,7 @@ ActionPushData(ActionExec& thread)
         "register",    // 4
         "bool",        // 5
         "double",    // 6
-        "boost::int32_t",    // 7
+        "int",    // 7
         "dict8",    // 8
         "dict16"    // 9
     };

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


commit b837797e82abafc69651cb340d6ebedacd08ddaf
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 1 13:35:26 2010 +0200

    Use ostream operator directly.

diff --git a/libcore/as_value.cpp b/libcore/as_value.cpp
index 0f8fa25..32c77d8 100644
--- a/libcore/as_value.cpp
+++ b/libcore/as_value.cpp
@@ -676,65 +676,6 @@ as_value::strictly_equals(const as_value& v) const
     return equalsSameType(v);
 }
 
-std::string
-as_value::toDebugString() const
-{
-    boost::format ret;
-
-    switch (_type)
-    {
-        case UNDEFINED:
-            return "[undefined]";
-        case NULLTYPE:
-            return "[null]";
-        case BOOLEAN:
-            ret = boost::format("[bool:%s]") % (getBool() ? "true" : "false");
-            return ret.str();
-        case OBJECT:
-        {
-            as_object* obj = getObj();
-            assert(obj);
-            const char* desc = obj->array() ? "array" : "object";
-            ret = boost::format("[%s(%s):%p]") % desc % typeName(*obj) %
-                                              static_cast<void*>(obj);
-            return ret.str();
-        }
-        case STRING:
-            return "[string:" + getStr() + "]";
-        case NUMBER:
-        {
-            std::stringstream stream;
-            stream << getNum();
-            return "[number:" + stream.str() + "]";
-        }
-        case DISPLAYOBJECT:
-        {
-            const CharacterProxy& sp = getCharacterProxy();
-            if (sp.isDangling()) {
-                DisplayObject* rebound = sp.get();
-                if (rebound) {
-                    ret = boost::format("[rebound %s(%s):%p]") % 
-                        typeName(*rebound) % sp.getTarget() %
-                        static_cast<void*>(rebound);
-                }
-                else {
-                    ret = boost::format("[dangling DisplayObject:%s]") % 
-                        sp.getTarget();
-                }
-            }
-            else {
-                DisplayObject* ch = sp.get();
-                ret = boost::format("[%s(%s):%p]") % typeName(*ch) %
-                                sp.getTarget() % static_cast<void*>(ch);
-            }
-            return ret.str();
-        }
-        default:
-            if (is_exception()) return "[exception]";
-            std::abort();
-    }
-}
-
 void
 as_value::setReachable() const
 {
@@ -1093,6 +1034,63 @@ truncateToInt(double d)
 
 } // unnamed namespace
 
+std::ostream&
+operator<<(std::ostream& o, const as_value& v)
+{
+
+    switch (v._type)
+    {
+        case as_value::UNDEFINED:
+            return o << "[undefined]";
+        case as_value::NULLTYPE:
+            return o << "[null]";
+        case as_value::BOOLEAN:
+        {
+            return o << "[bool:" << std::boolalpha << v.getBool() << "]";
+        }
+        case as_value::OBJECT:
+        {
+            as_object* obj = v.getObj();
+            assert(obj);
+            const char* desc = obj->array() ? "array" : "object";
+            boost::format ret =
+                boost::format("[%s(%s):%p]") % desc % typeName(*obj) %
+                                              static_cast<void*>(obj);
+            return o << ret.str();
+        }
+        case as_value::STRING:
+            return o << "[string:" + v.getStr() + "]";
+        case as_value::NUMBER:
+            return o << "[number:" << v.getNum() << "]";
+        case as_value::DISPLAYOBJECT:
+        {
+            boost::format ret;
+            const CharacterProxy& sp = v.getCharacterProxy();
+            if (sp.isDangling()) {
+                DisplayObject* rebound = sp.get();
+                if (rebound) {
+                    ret = boost::format("[rebound %s(%s):%p]") % 
+                        typeName(*rebound) % sp.getTarget() %
+                        static_cast<void*>(rebound);
+                }
+                else {
+                    ret = boost::format("[dangling DisplayObject:%s]") % 
+                        sp.getTarget();
+                }
+            }
+            else {
+                DisplayObject* ch = sp.get();
+                ret = boost::format("[%s(%s):%p]") % typeName(*ch) %
+                                sp.getTarget() % static_cast<void*>(ch);
+            }
+            return o << ret.str();
+        }
+        default:
+            assert(v.is_exception());
+            return o << "[exception]";
+    }
+}
+
 
 } // namespace gnash
 
diff --git a/libcore/as_value.h b/libcore/as_value.h
index b9d62cd..4b91ba8 100644
--- a/libcore/as_value.h
+++ b/libcore/as_value.h
@@ -185,13 +185,14 @@ public:
         set_as_object(obj);
     }
     
-
     /// Assign to an as_value.
     DSOEXPORT void operator=(const as_value& v)
     {
         _type = v._type;
         _value = v._value;
     }
+
+    friend std::ostream& operator<<(std::ostream& o, const as_value&);
     
     /// Return the primitive type of this value as a string.
     const char* typeOf() const;
@@ -288,10 +289,6 @@ public:
     /// Note that this performs no conversion, so returns 0 if the as_value
     /// is not a function.
     as_function* to_function() const;
-
-    // Used for operator<< to give useful information about an
-    // as_value object.
-    DSOEXPORT std::string toDebugString() const;
     
     AsType defaultPrimitive(int version) const;
     
@@ -498,9 +495,8 @@ as_value& convertToBoolean(as_value& v, VM& vm);
 /// Convert to primitive type
 as_value& convertToPrimitive(as_value& v, VM& vm);
 
-inline std::ostream& operator<< (std::ostream& os, const as_value& v) {
-       return os << v.toDebugString();
-}
+/// Stream operator.
+std::ostream& operator<<(std::ostream& os, const as_value& v);
 
 /// Convert numeric value to string value, following ECMA-262 specification
 //
diff --git a/libcore/vm/fn_call.h b/libcore/vm/fn_call.h
index 9dfeff0..fe39834 100644
--- a/libcore/vm/fn_call.h
+++ b/libcore/vm/fn_call.h
@@ -204,8 +204,8 @@ public:
     /// Dump arguments to given output stream
     void dump_args(std::ostream& os) const {
         for (size_t i = 0; i < nargs; ++i) {
-            if ( i ) os << ", ";
-            os << arg(i).toDebugString();
+            if (i) os << ", ";
+            os << arg(i);
         }
        }
     
diff --git a/testsuite/misc-ming.all/DragDropTestRunner.cpp 
b/testsuite/misc-ming.all/DragDropTestRunner.cpp
index e46d971..3ce42a2 100644
--- a/testsuite/misc-ming.all/DragDropTestRunner.cpp
+++ b/testsuite/misc-ming.all/DragDropTestRunner.cpp
@@ -174,7 +174,7 @@ main(int /*argc*/, char** /*argv*/)
        check(endOfTestFound);
        if ( endOfTestFound )
        {
-               cerr << eot.toDebugString() << endl;
+               cerr << eot << endl;
                check_equals(eot.to_bool(), true);
        }
        else
diff --git a/testsuite/misc-ming.all/PrototypeEventListenersTestRunner.cpp 
b/testsuite/misc-ming.all/PrototypeEventListenersTestRunner.cpp
index fb0244d..6908256 100644
--- a/testsuite/misc-ming.all/PrototypeEventListenersTestRunner.cpp
+++ b/testsuite/misc-ming.all/PrototypeEventListenersTestRunner.cpp
@@ -77,7 +77,7 @@ main(int /*argc*/, char** /*argv*/)
 
        if ( endOfTestFound )
        {
-               cerr << eot.toDebugString() << endl;
+               cerr << eot << endl;
                check_equals(eot.to_bool(), true);
        }
        else
diff --git a/testsuite/misc-ming.all/loadMovieTestRunner.cpp 
b/testsuite/misc-ming.all/loadMovieTestRunner.cpp
index 6846f4b..f4cb2f3 100644
--- a/testsuite/misc-ming.all/loadMovieTestRunner.cpp
+++ b/testsuite/misc-ming.all/loadMovieTestRunner.cpp
@@ -198,7 +198,6 @@ main(int /*argc*/, char** /*argv*/)
        check(endOfTestFound);
        if ( endOfTestFound )
        {
-               //cerr << eot.toDebugString() << endl;
                check_equals(eot.to_bool(), true);
        }
 

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


commit afaa2d52a0e948dfa108734fd568cf1e53940223
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 1 13:26:03 2010 +0200

    Drop proxying function.

diff --git a/libcore/Function.cpp b/libcore/Function.cpp
index 43fa97e..4361bad 100644
--- a/libcore/Function.cpp
+++ b/libcore/Function.cpp
@@ -171,7 +171,7 @@ Function::markReachableResources() const
        _env.markReachableResources();
 
        // Invoke parent class marker
-       markAsObjectReachable(); 
+    as_object::markReachableResources(); 
 }
 
 as_object*
diff --git a/libcore/as_object.cpp b/libcore/as_object.cpp
index f560a2f..f7f9cdd 100644
--- a/libcore/as_object.cpp
+++ b/libcore/as_object.cpp
@@ -177,7 +177,7 @@ protected:
     virtual void markReachableResources() const
        {
         if (_super) _super->setReachable();
-        markAsObjectReachable();
+        as_object::markReachableResources();
        }
 
 private:
@@ -525,7 +525,6 @@ as_object::set_prototype(const as_value& proto)
     // TODO: check what happens if __proto__ is set as a user-defined 
     // getter/setter
     // TODO: check triggers !!
-    // Note that this sets __proto__ in namespace 0
     _members.setValue(NSV::PROP_uuPROTOuu, proto, as_object::DefaultFlags);
 }
 
@@ -1067,7 +1066,7 @@ as_object::unwatch(const ObjectURI& uri)
 
 #ifdef GNASH_USE_GC
 void
-as_object::markAsObjectReachable() const
+as_object::markReachableResources() const
 {
     _members.setReachable();
 
diff --git a/libcore/as_object.h b/libcore/as_object.h
index 54eca56..4d8e180 100644
--- a/libcore/as_object.h
+++ b/libcore/as_object.h
@@ -704,17 +704,11 @@ protected:
     /// Mark all reachable resources, override from GcResource.
     //
     /// The default implementation marks all properties
-    /// as being reachable, calling markAsObjectReachable().
     ///
     /// If a derived class provides access to more GC-managed
-    /// resources, it should override this method and call 
-    /// markAsObjectReachable() as the last step.
-    virtual void markReachableResources() const {
-        markAsObjectReachable();
-    }
-
-    /// Mark properties and triggers list as reachable (for the GC)
-    void markAsObjectReachable() const;
+    /// resources, it should override this function and call 
+    /// this function directly as the last step.
+    virtual void markReachableResources() const;
 
 private:
 
diff --git a/libcore/as_value.cpp b/libcore/as_value.cpp
index 3c9279a..0f8fa25 100644
--- a/libcore/as_value.cpp
+++ b/libcore/as_value.cpp
@@ -693,7 +693,9 @@ as_value::toDebugString() const
         case OBJECT:
         {
             as_object* obj = getObj();
-            ret = boost::format("[object(%s):%p]") % typeName(*obj) %
+            assert(obj);
+            const char* desc = obj->array() ? "array" : "object";
+            ret = boost::format("[%s(%s):%p]") % desc % typeName(*obj) %
                                               static_cast<void*>(obj);
             return ret.str();
         }
diff --git a/libcore/asobj/Globals.cpp b/libcore/asobj/Globals.cpp
index dbf1f8b..400a7e2 100644
--- a/libcore/asobj/Globals.cpp
+++ b/libcore/asobj/Globals.cpp
@@ -234,7 +234,7 @@ AVM1Global::markReachableResources() const
 {
     _classes.markReachableResources();
     _objectProto->setReachable();
-    markAsObjectReachable();
+    as_object::markReachableResources();
 }
 
 AVM1Global::AVM1Global(VM& vm)

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

Summary of changes:
 libcore/Function.cpp                               |    2 +-
 libcore/as_object.cpp                              |    5 +-
 libcore/as_object.h                                |   12 +--
 libcore/as_value.cpp                               |  113 ++++++++++----------
 libcore/as_value.h                                 |   12 +--
 libcore/asobj/Globals.cpp                          |    2 +-
 libcore/vm/ASHandlers.cpp                          |    2 +-
 libcore/vm/fn_call.h                               |    4 +-
 testsuite/misc-ming.all/DragDropTestRunner.cpp     |    2 +-
 .../PrototypeEventListenersTestRunner.cpp          |    2 +-
 testsuite/misc-ming.all/loadMovieTestRunner.cpp    |    1 -
 11 files changed, 72 insertions(+), 85 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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