gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/avm2 r9723: Merge from another avm2 branch


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/avm2 r9723: Merge from another avm2 branch.
Date: Thu, 14 May 2009 18:26:38 +0200
User-agent: Bazaar (1.13.1)

------------------------------------------------------------
revno: 9723
committer: Benjamin Wolsey <address@hidden>
branch nick: avm2
timestamp: Thu 2009-05-14 18:26:38 +0200
message:
  Merge from another avm2 branch.
removed:
  libcore/asobj/flash/display/DisplayObjectContainer_as.cpp
  libcore/asobj/flash/display/DisplayObjectContainer_as.h
  libcore/asobj/flash/display/DisplayObject_as.cpp
  libcore/asobj/flash/display/DisplayObject_as.h
  libcore/asobj/flash/display/InteractiveObject_as.cpp
  libcore/asobj/flash/display/InteractiveObject_as.h
  libcore/asobj/flash/display/Sprite_as.cpp
  libcore/asobj/flash/display/Sprite_as.h
  libcore/asobj/flash/display/Stage_as.cpp
  libcore/asobj/flash/display/Stage_as.h
added:
  libcore/asBoundValues.h
  libcore/asException.h
  libcore/asMethod.cpp
  libcore/asMethod.h
  libcore/asNamespace.cpp
  libcore/asNamespace.h
modified:
  configure.ac
  libcore/Makefile.am
  libcore/Property.cpp
  libcore/abc_function.cpp
  libcore/abc_function.h
  libcore/asClass.cpp
  libcore/asClass.h
  libcore/asobj/ClassHierarchy.cpp
  libcore/asobj/ClassHierarchy.h
  libcore/asobj/flash/display_pkg.cpp
  libcore/impl.cpp
  libcore/parser/Makefile.am
  libcore/parser/abc_block.cpp
  libcore/parser/abc_block.h
  libcore/swf/SymbolClassTag.h
  libcore/swf/tag_loaders.cpp
  libcore/swf/tag_loaders.h
  libcore/vm/Machine.cpp
  libcore/vm/Machine.h
  libcore/vm/Makefile.am
  libcore/vm/VM.cpp
  libcore/vm/VM.h
  libcore/vm/asName.h
  testsuite/libcore.all/Makefile.am
  testsuite/misc-haxe.all/Makefile.am
    ------------------------------------------------------------
    revno: 9703.1.3
    committer: Benjamin Wolsey <address@hidden>
    branch nick: avm2-work
    timestamp: Thu 2009-04-16 12:10:00 +0200
    message:
      More minor cleanups.
    modified:
      libcore/asClass.cpp
      libcore/asClass.h
    ------------------------------------------------------------
    revno: 9703.1.4
    committer: Benjamin Wolsey <address@hidden>
    branch nick: avm2-work
    timestamp: Thu 2009-04-16 12:54:21 +0200
    message:
      Half-working, ugly implementation of instantiateClass with a string 
argument.
    modified:
      libcore/parser/abc_block.cpp
      libcore/vm/Machine.cpp
    ------------------------------------------------------------
    revno: 9703.1.5
    committer: Benjamin Wolsey <address@hidden>
    branch nick: avm2-work
    timestamp: Thu 2009-05-14 10:00:05 +0200
    message:
      Replace LOG_AVM2 with log_abc.
    modified:
      libcore/abc_function.cpp
      libcore/vm/Machine.cpp
      libcore/vm/Machine.h
    ------------------------------------------------------------
    revno: 9703.1.6
    committer: Benjamin Wolsey <address@hidden>
    branch nick: avm2-work
    timestamp: Thu 2009-05-14 12:26:47 +0200
    message:
      Add --enable-avm2 option. Disable the AVM2 interpreter and tag parsers
      unless avm2 is enabled at compile time.
      
      ClassHierarchy (on-demand class loading) uses asNamespace and asClass, so
      these still have to be built even when avm2 is disabled. This requires 
      ifdefs inside asClass.
      
      Split asClass file into separate files for asNamespace, asMethod, 
asException
      and asBoundValues.
    added:
      libcore/asBoundValues.h
      libcore/asException.h
      libcore/asMethod.cpp
      libcore/asMethod.h
      libcore/asNamespace.cpp
      libcore/asNamespace.h
    modified:
      configure.ac
      libcore/Makefile.am
      libcore/Property.cpp
      libcore/abc_function.h
      libcore/asClass.cpp
      libcore/asClass.h
      libcore/asobj/ClassHierarchy.cpp
      libcore/asobj/ClassHierarchy.h
      libcore/impl.cpp
      libcore/parser/Makefile.am
      libcore/swf/tag_loaders.cpp
      libcore/swf/tag_loaders.h
      libcore/vm/Makefile.am
      libcore/vm/VM.cpp
      libcore/vm/VM.h
      testsuite/libcore.all/Makefile.am
      testsuite/misc-haxe.all/Makefile.am
    ------------------------------------------------------------
    revno: 9703.1.7
    committer: Benjamin Wolsey <address@hidden>
    branch nick: avm2-work
    timestamp: Thu 2009-05-14 12:30:48 +0200
    message:
      Add copyright to split-off files.
    modified:
      libcore/asBoundValues.h
      libcore/asException.h
      libcore/asMethod.cpp
      libcore/asMethod.h
      libcore/asNamespace.cpp
      libcore/asNamespace.h
    ------------------------------------------------------------
    revno: 9703.1.8
    committer: Benjamin Wolsey <address@hidden>
    branch nick: avm2-work
    timestamp: Thu 2009-05-14 13:05:48 +0200
    message:
      Allow building with AVM2 code.
    modified:
      configure.ac
    ------------------------------------------------------------
    revno: 9703.1.9
    committer: Benjamin Wolsey <address@hidden>
    branch nick: avm2-work
    timestamp: Thu 2009-05-14 13:06:24 +0200
    message:
      Drop stubs for AS3 classes, as these can be regenerated easily in
      the newer style.
      
      Fix missing values in ClassHierarchy initialization.
    removed:
      libcore/asobj/flash/display/DisplayObjectContainer_as.cpp
      libcore/asobj/flash/display/DisplayObjectContainer_as.h
      libcore/asobj/flash/display/DisplayObject_as.cpp
      libcore/asobj/flash/display/DisplayObject_as.h
      libcore/asobj/flash/display/InteractiveObject_as.cpp
      libcore/asobj/flash/display/InteractiveObject_as.h
      libcore/asobj/flash/display/Sprite_as.cpp
      libcore/asobj/flash/display/Sprite_as.h
      libcore/asobj/flash/display/Stage_as.cpp
      libcore/asobj/flash/display/Stage_as.h
    modified:
      libcore/asobj/ClassHierarchy.cpp
      libcore/asobj/Makefile.am
      libcore/asobj/flash/display_pkg.cpp
    ------------------------------------------------------------
    revno: 9703.1.10
    committer: Benjamin Wolsey <address@hidden>
    branch nick: avm2-work
    timestamp: Thu 2009-05-14 13:07:52 +0200
    message:
      Include gnashconfig.h where needed.
    modified:
      libcore/asClass.h
      libcore/asMethod.cpp
      libcore/asMethod.h
    ------------------------------------------------------------
    revno: 9703.1.11
    committer: Benjamin Wolsey <address@hidden>
    branch nick: avm2-work
    timestamp: Thu 2009-05-14 13:23:13 +0200
    message:
      Do includes and forward declarations properly to avoid breaking the build
      on the slightest change.
    modified:
      libcore/asClass.h
      libcore/asobj/ClassHierarchy.h
      libcore/parser/abc_block.h
      libcore/vm/asName.h
    ------------------------------------------------------------
    revno: 9703.1.12
    committer: Benjamin Wolsey <address@hidden>
    branch nick: avm2-work
    timestamp: Thu 2009-05-14 13:41:42 +0200
    message:
      Correct includes in SymbolClassTag.h
    modified:
      libcore/swf/SymbolClassTag.h
=== modified file 'configure.ac'
--- a/configure.ac      2009-04-24 04:32:22 +0000
+++ b/configure.ac      2009-05-14 16:26:38 +0000
@@ -205,6 +205,17 @@
 SOLDIR=${soldir}
 AC_SUBST(SOLDIR)
 
+AC_ARG_ENABLE(avm2,
+  AC_HELP_STRING([--enable-avm2], [Enable support for AS3]),
+  [case "${enableval}" in
+    yes) avm2=yes ;;
+    no)  avm2=no ;;
+    *)   AC_MSG_ERROR([bad value ${enableval} for enable-avm2 option]) ;;
+  esac], avm2=no
+)
+AM_CONDITIONAL(ENABLE_AVM2, [test x"$avm2" = xyes])
+AC_DEFINE(ENABLE_AVM2, [test x"$avm2" = xyes], [Enable AVM2 code])
+
 dnl lckey=0xdd3adabd
 AC_ARG_WITH(lckey,
  AC_HELP_STRING([--with-lckey],

=== modified file 'libcore/Makefile.am'
--- a/libcore/Makefile.am       2009-04-30 22:33:31 +0000
+++ b/libcore/Makefile.am       2009-05-14 16:26:38 +0000
@@ -47,6 +47,7 @@
        $(FONTCONFIG_CFLAGS) \
        $(NULL)
 
+
 libgnashcore_la_SOURCES = \
        BitmapMovie.cpp \
        Property.cpp \
@@ -55,10 +56,8 @@
        SystemClock.cpp \
        as_environment.cpp \
        as_function.cpp \
-       abc_function.cpp \
        as_object.cpp \
        as_value.cpp \
-       asClass.cpp \
        DisplayObject.cpp \
        CharacterProxy.cpp \
        cxform.cpp \
@@ -122,9 +121,18 @@
        styles.cpp \
        Timers.cpp \
        RGBA.cpp        \
+       asClass.cpp \
+       asNamespace.cpp \
        $(FREETYPE_SOURCES) \
        $(NULL)
 
+if ENABLE_AVM2
+libgnashcore_la_SOURCES += \
+       abc_function.cpp \
+       asMethod.cpp
+       $(NULL)
+endif
+
 noinst_HEADERS = \
        Property.h \
        PropertyList.h \
@@ -137,11 +145,9 @@
        RunInfo.h \
        as_environment.h \
        as_function.h \
-       abc_function.h \
        as_object.h \
        as_prop_flags.h \
        as_value.h \
-       asClass.h \
        Bitmap.h \
        BitmapInfo.h \
        BitmapMovie.h \
@@ -214,7 +220,6 @@
        swf/DefineFontNameTag.h \
        swf/RemoveObjectTag.h \
        swf/DisplayListTag.h \
-       swf/DoABCTag.h \
        swf/DoActionTag.h \
        swf/DoInitActionTag.h \
        swf/SetBackgroundColorTag.h \
@@ -226,8 +231,19 @@
        Timers.h \
        RGBA.h  \
        Video.h \
+       asClass.h \
+       asNamespace.h \
        $(NULL)
 
+if ENABLE_AVM2
+noinst_HEADERS += \
+       swf/DoABCTag.h \
+       abc_function.h \
+       asMethod.h \
+       asException.h \
+       asBoundValues.h
+endif
+
 libgnashcore_la_LIBADD = \
        $(top_builddir)/libbase/libgnashbase.la \
        $(top_builddir)/libamf/libgnashamf.la \

=== modified file 'libcore/Property.cpp'
--- a/libcore/Property.cpp      2009-02-25 22:33:03 +0000
+++ b/libcore/Property.cpp      2009-05-14 10:26:47 +0000
@@ -18,7 +18,6 @@
 #include "Property.h"
 #include "VM.h"
 #include "as_function.h"
-#include "Machine.h"
 
 namespace gnash {
 

=== modified file 'libcore/abc_function.cpp'
--- a/libcore/abc_function.cpp  2009-03-25 11:02:48 +0000
+++ b/libcore/abc_function.cpp  2009-05-14 08:00:05 +0000
@@ -36,10 +36,10 @@
 as_value
 abc_function::operator()(const fn_call& fn)
 {
-       LOG_DEBUG_AVM("Calling an abc_function id=%u.",
+       log_abc("Calling an abc_function id=%u.",
             mMethodInfo->methodID());
        as_value val = mMachine->executeFunction(mMethodInfo,fn);
-       LOG_DEBUG_AVM("Done calling abc_function id=%u value=%s",
+       log_abc("Done calling abc_function id=%u value=%s",
             mMethodInfo->methodID(),val.toDebugString());
        return val;
 

=== modified file 'libcore/abc_function.h'
--- a/libcore/abc_function.h    2009-03-25 11:23:39 +0000
+++ b/libcore/abc_function.h    2009-05-14 10:26:47 +0000
@@ -29,10 +29,10 @@
 #include "SafeStack.h"
 #include "as_object.h"
 #include "as_environment.h"
+#include "asMethod.h"
 
 namespace gnash {
 
-class asMethod;
 class Machine;
 
 /// ABC-defined Function 

=== added file 'libcore/asBoundValues.h'
--- a/libcore/asBoundValues.h   1970-01-01 00:00:00 +0000
+++ b/libcore/asBoundValues.h   2009-05-14 10:30:48 +0000
@@ -0,0 +1,61 @@
+// 
+//   Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+// 
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+// 
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+#ifndef GNASH_AS_BOUND_VALUES_H
+#define GNASH_AS_BOUND_VALUES_H
+
+namespace gnash {
+
+class asBoundValue;
+
+class asBoundAccessor
+{
+public:
+       bool setGetter(asMethod *p) { mGetter = p; return true; }
+       bool setSetter(asMethod *p) { _setter = p; return true; }
+       bool setValue(asBoundValue *p) { mValue = p; return true; }
+
+       asBoundValue* getValue() { return mValue; }
+       asMethod *getGetter() { return mGetter; }
+       asMethod *getSetter() { return _setter; }
+
+private:
+       asMethod *mGetter;
+       asMethod *_setter;
+       asBoundValue *mValue;
+};
+
+class asBoundValue 
+{
+public:
+       asBoundValue() : mConst(false), mValue()
+       { mValue.set_undefined(); }
+       void setValue(as_value &v) { mValue = v; }
+       as_value getCurrentValue() { return mValue; }
+
+       void setType(asClass *t) { mType = t; }
+       asClass *getType() { return mType; }
+
+private:
+       bool mConst;
+       asClass *mType;
+       as_value mValue;
+};
+
+} // namespace gnash
+
+#endif

=== modified file 'libcore/asClass.cpp'
--- a/libcore/asClass.cpp       2009-03-25 11:23:39 +0000
+++ b/libcore/asClass.cpp       2009-05-14 10:26:47 +0000
@@ -25,88 +25,25 @@
 #include "VM.h"
 #include "namedStrings.h"
 #include "as_value.h"
+#include "asNamespace.h"
+
+#ifdef ENABLE_AVM2
+#include "asMethod.h"
 #include "abc_function.h"
+#endif
 
 namespace gnash {
 
-asMethod::asMethod()
-    :
-       _minArguments(0),
-       _maxArguments(0),
-    _body(0)
-{
-}
-
-void
-asMethod::print_body()
-{
-               if(!_body){
-                       log_parse("Method has no body.");
-                       return;
-               }
-               boost::uint8_t opcode;
-               std::stringstream ss;
-               ss << "Method Body: ";
-//             ss.setf(std::ios::hex, std::ios::basefield);
-//             ss.setf (std::ios::showbase);
-               boost::uint32_t i;
-               for(i=0;i<_bodyLength;i++){
-                       opcode = _body->read_as3op();
-                       ss << "0x" << std::uppercase << std::hex << (opcode | 
0x0) << " ";
-               }
-               _body->seekTo(0);
-               log_parse("%s",ss.str());
-}
-
-void
-asMethod::setOwner(asClass *pOwner)
-{
-       log_debug("asMethod::setOwner");
-       if(!_prototype){
-               log_debug("ERROR _prototype is null.");
-       }
-       log_debug("Prototype text value: %s",_prototype->get_text_value());
-       _prototype->set_member(NSV::PROP_PROTOTYPE, pOwner->getPrototype());
-}
-
-void
-asMethod::setReturnType(asClass */*type*/)
-{
-       /* No-op */
-}
-
-bool
-asMethod::addValue(string_table::key name, asNamespace *ns, boost::uint32_t 
slotId,
-       asClass *type, as_value& val, bool isconst)
-{
-       if (val.is_object())
-               
val.to_object()->set_member(string_table::key(NSV::INTERNAL_TYPE), 
-                       std::size_t(type->getName()));
-
-       string_table::key nsname = ns ? ns->getURI() : string_table::key(0);
-
-       int flags = as_prop_flags::dontDelete;
-
-       if (isconst)
-               flags |= as_prop_flags::readOnly;
-
-
-       if(slotId == 0){
-               _prototype->init_member(name, val, flags, nsname);
-       }
-       else{
-               _prototype->init_member(name, val, flags, nsname, slotId);
-       }
-       return true;
-}
-
-bool
-asClass::addValue(string_table::key name, asNamespace *ns, boost::uint32_t 
slotId,
-       asClass *type, as_value& val, bool isconst, bool isstatic)
-{
-       if (val.is_object())
+#ifdef ENABLE_AVM2    
+bool
+asClass::addValue(string_table::key name, asNamespace *ns,
+        boost::uint32_t slotId, asClass *type, as_value& val, bool isconst,
+        bool isstatic)
+{
+       if (val.is_object()) {
                val.to_object()->set_member(NSV::INTERNAL_TYPE, 
                        std::size_t(type->getName()));
+    }
 
        string_table::key nsname = ns ? ns->getURI() : string_table::key(0);
 
@@ -299,14 +236,6 @@
        return true;
 }
 
-void
-asNamespace::stubPrototype(string_table::key name)
-{
-       asClass *pClass = VM::get().getClassHierarchy()->newClass();
-       pClass->setName(name);
-       addClass(name, pClass);
-}
-
 #if 0 // TODO
 void
 asClass::buildFromPrototype(as_object *o, string_table::key name,
@@ -387,5 +316,8 @@
                return addBinding(name, asBinding(ns, method, slotId, 
isstatic));
        return addStaticBinding(name, asBinding(ns, method, slotId, isstatic));
 }
-#endif /* 0 */
+#endif 
+
+#endif
+
 } /* namespace gnash */

=== modified file 'libcore/asClass.h'
--- a/libcore/asClass.h 2009-04-16 08:57:58 +0000
+++ b/libcore/asClass.h 2009-05-14 11:23:13 +0000
@@ -18,17 +18,23 @@
 #ifndef GNASH_AS_CLASS_H
 #define GNASH_AS_CLASS_H
 
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
 #include <list>
 #include <map>
 #include <vector>
 #include <iostream>
 #include "string_table.h"
 #include "as_value.h"
-#include "CodeStream.h"
 #include "Property.h"
 #include "as_function.h"
-#include "abc_block.h"
 
+#ifdef ENABLE_AVM2
+# include "CodeStream.h"
+# include "abc_block.h"
+#endif
 
 namespace gnash {
 
@@ -36,9 +42,7 @@
 class asNamespace;
 class asMethod;
 class asClass;
-class asException;
 typedef Property asBinding;
-//class asBinding;
 class asBoundValue;
 class asBoundAccessor;
 class ClassHierarchy;
@@ -47,491 +51,6 @@
 class Machine;
 class abc_function;
 
-namespace abc {
-class Trait;
-}
-
-using namespace abc;
-class asException
-{
-public:
-       void setStart(boost::uint32_t i) { _start = i; }
-       void setEnd(boost::uint32_t i) { mEnd = i; }
-       void setCatch(boost::uint32_t i) { mCatch = i; }
-       void catchAny() { mCatchAny = true; }
-       void setCatchType(asClass* p) { mCatchType = p; }
-       void setNamespace(asNamespace* n) { _namespace = n; }
-       void setName(string_table::key name) { _name = name; }
-
-private:
-       boost::uint32_t _start;
-       boost::uint32_t mEnd;
-       boost::uint32_t mCatch;
-       bool mCatchAny;
-       asClass *mCatchType;
-       asNamespace *_namespace;
-       string_table::key _name;
-};
-#if 0
-/// An abstract binding for ActionScript.
-class asBinding
-{
-public:
-       void dump(string_table::key name);
-
-       void setConst() { mConst = true; }
-       void unsetConst() { mConst = false; }
-       bool isConst() { return mConst; }
-
-       void setStatic() { _static = true; }
-       void unsetStatic() { _static = false; }
-       bool isStatic() { return _static; }
-
-       boost::uint32_t getSlotId() { return _slotId; }
-       void setSlotId(boost::uint32_t s) { _slotId = s; }
-
-       // Chad: Document
-       string_table::key getName() { return _name; }
-       void setLexOnly(bool) { /* TODO */ }
-
-       /// If true, the attribute has a setter, but no getter.
-       bool isWriteOnly();
-
-       /// If true, the attribute can be read, but not written. Might be
-       /// constant or might have a getter but no setter.
-       bool isReadOnly(); 
-
-       bool isGetSet() { return getAccessor() != NULL; }
-
-       // Conversion from Property
-       asBinding(Property *, string_table::key name);
-
-       // As a member method.
-       asBinding(asNamespace *ns, asMethod *pMethod, bool isstatic = false) :
-               _namespace(ns), mType(T_METHOD), _slotId(0), mConst(true),
-               _static(isstatic),      _method(pMethod)
-       {/**/}
-
-       // As an assignable function.
-       asBinding(asNamespace *ns, asMethod *pMethod, boost::uint32_t sid, bool 
isstatic) :
-               _namespace(ns), mType(T_METHOD), _slotId(sid), mConst(false),
-               _static(isstatic),      _method(pMethod)
-       {/**/}
-
-       asBinding(asNamespace *ns, asBoundValue *pValue, boost::uint32_t sid, 
bool isconstant,
-               bool isstatic) : _namespace(ns), mType(T_VALUE), _slotId(sid), 
mConst(isconstant),
-               _static(isstatic), mValue(pValue)
-       {/**/}
-
-       asBinding(asNamespace *ns, asBoundValue *pValue, boost::uint32_t sid, 
bool isstatic) :
-               _namespace(ns), mType(T_VALUE), _slotId(sid), mConst(false), 
_static(isstatic),
-               mValue(pValue)
-       {/**/}
-
-       asBinding(asNamespace *ns, asBoundAccessor *pAccess, bool isstatic) :
-               _namespace(ns), mType(T_ACCESS), _slotId(0), mConst(true), 
_static(isstatic),
-               _access(pAccess)
-       {/**/}
-
-       asBinding(asNamespace *ns, asClass *pClass, boost::uint32_t sid, bool 
isstatic) :
-               _namespace(ns), mType(T_CLASS), _slotId(sid), mConst(true), 
_static(isstatic),
-               mClass(pClass)
-       {/**/}
-
-       asBinding() : _namespace(NULL), mType(T_CLASS), _slotId(0), 
mConst(false), _static(false),
-               mClass(NULL)
-       {/**/}
-
-       asBinding(asMethod *);
-       asBinding(as_function *);
-
-       void reset(asBoundAccessor *pAccess, bool isstatic)
-       {
-               mType = T_ACCESS;
-               _access = pAccess;
-               mConst = true;
-               _static = isstatic;
-       }
-
-       asBoundAccessor* getAccessor()
-       { return mType == T_ACCESS ? _access : NULL; }
-
-       asBoundValue* getValue()
-       { return mType == T_VALUE ? mValue : NULL; }
-
-       asMethod* getMethod()
-       { return mType == T_METHOD ? _method : NULL; }
-
-       asClass* getClass()
-       { return mType == T_CLASS ? mClass : NULL; }
-
-       as_function* getASFunction();
-
-       asNamespace *_namespace;
-
-       typedef enum
-       {
-               T_CLASS,
-               T_METHOD,
-               T_AS_FUNCTION,
-               T_VALUE,
-               T_ACCESS
-       } types;
-       types mType;
-
-       boost::uint32_t _slotId;
-       bool mConst;
-       bool _static;
-       string_table::key _name;
-       as_object* _owner;
-
-       union
-       {
-               asClass *mClass;
-               asMethod *_method;
-               asBoundValue *mValue;
-               asBoundAccessor *_access;
-       };
-};
-#endif // comment out of asBinding
-
-/// Represent an ActionScript namespace
-class asNamespace
-{
-public:
-       void markReachableResources() const { /* TODO */ }
-
-       /// Our parent (for protected)
-       void setParent(asNamespace* p) { _parent = p; }
-
-       asNamespace* getParent() { return _parent; }
-
-       /// Set the uri
-       void setURI(string_table::key name) { mUri = name; }
-
-       /// What is the Uri of the namespace?
-       string_table::key getURI() const { return mUri; }
-
-       string_table::key getAbcURI() const {return _abcURI;}
-       void setAbcURI(string_table::key n){ _abcURI = n; }
-
-       /// What is the XML prefix?
-       string_table::key getPrefix() const { return _prefix; }
-
-       /// Create an empty namespace
-       asNamespace()
-        :
-        _parent(0),
-        mUri(0),
-        _prefix(0),
-        _abcURI(0),
-        mClasses(),
-               mRecursePrevent(false),
-        _private(false),
-        _protected(false)
-       {/**/}
-
-       /// Add a class to the namespace. The namespace stores this, but
-       /// does not take ownership. (So don't delete it.)
-       bool addClass(string_table::key name, asClass *a)
-       {
-               if (getClassInternal(name))
-                       return false;
-               mClasses[static_cast<std::size_t>(name)] = a;
-               return true;
-       }
-
-       void stubPrototype(string_table::key name);
-
-       /// Get the named class. Returns NULL if information is not known
-       /// about the class. (Stubbed classes still return NULL here.)
-       asClass *getClass(string_table::key name) 
-       {
-               if (mRecursePrevent)
-                       return NULL;
-
-               asClass *found = getClassInternal(name);
-               if (found || !getParent())
-                       return found;
-
-               mRecursePrevent = true;
-               found = getParent()->getClass(name);
-               mRecursePrevent = false;
-               return found;
-       }
-
-       void setPrivate() { _private = true; }
-       void unsetPrivate() { _private = false; }
-       bool isPrivate() { return _private; }
-
-       void setProtected() { _protected = true; }
-       void unsetProtected() { _protected = false; }
-       bool isProtected() { return _protected; }
-       
-private:
-       asNamespace *_parent;
-       string_table::key mUri;
-       string_table::key _prefix;
-
-       string_table::key _abcURI;
-
-       typedef std::map<string_table::key, asClass*> container;
-       container mClasses;
-       mutable bool mRecursePrevent;
-
-       bool _private;
-       bool _protected;
-
-       asClass *getClassInternal(string_table::key name) const
-       {
-               container::const_iterator i;
-               if (mClasses.empty())
-                       return NULL;
-
-               i = mClasses.find(name);
-               if (i == mClasses.end())
-                       return NULL;
-               return i->second;
-       }
-};
-
-class asBoundValue;
-
-class asBoundAccessor
-{
-public:
-       bool setGetter(asMethod *p) { mGetter = p; return true; }
-       bool setSetter(asMethod *p) { _setter = p; return true; }
-       bool setValue(asBoundValue *p) { mValue = p; return true; }
-
-       asBoundValue* getValue() { return mValue; }
-       asMethod *getGetter() { return mGetter; }
-       asMethod *getSetter() { return _setter; }
-
-private:
-       asMethod *mGetter;
-       asMethod *_setter;
-       asBoundValue *mValue;
-};
-
-class asBoundValue 
-{
-public:
-       asBoundValue() : mConst(false), mValue()
-       { mValue.set_undefined(); }
-       void setValue(as_value &v) { mValue = v; }
-       as_value getCurrentValue() { return mValue; }
-
-       void setType(asClass *t) { mType = t; }
-       asClass *getType() { return mType; }
-
-private:
-       bool mConst;
-       asClass *mType;
-       as_value mValue;
-};
-
-/// A class to represent, abstractly, an ActionScript method.
-///
-/// Methods are unnamed until they are bound to an object.
-class asMethod
-{
-public:
-       
-    typedef std::list<asClass*> ArgumentList;
-
-       asMethod();
-
-    boost::uint32_t methodID() const {
-        return _methodID;
-    }
-
-    void setMethodID(boost::uint32_t m) {
-        _methodID = m;
-    }
-
-       void initPrototype(Machine* machine);
-
-       boost::uint32_t getMaxRegisters(){ return _maxRegisters;}
-
-       void setMaxRegisters(boost::uint32_t maxRegisters) { 
-        _maxRegisters = maxRegisters;
-    }
-
-       boost::uint32_t getBodyLength(){ return _bodyLength;}
-
-       void setBodyLength(boost::uint32_t length){ _bodyLength = length;}
-
-       abc_function* getPrototype() { return _prototype; }
-
-       asBinding* getBinding(string_table::key name);
-
-       bool isNative() { return _isNative; }
-       bool hasBody() const { return _body != NULL; }
-
-       as_object* construct(as_object* /*base_scope*/) { /* TODO */ return 
NULL; }
-
-       bool hasActivation();
-
-       CodeStream *getBody() { return _body; }
-       void setBody(CodeStream *b) { _body = b; }
-
-       bool addValue(string_table::key name, asNamespace *ns, boost::uint32_t 
slotID,
-               asClass *type, as_value& val, bool isconst);
-
-       bool addSlot(string_table::key name, asNamespace *ns, boost::uint32_t 
slotID,
-               asClass *type);
-
-       bool addMethod(string_table::key name, asNamespace *ns, asMethod 
*method);
-
-       bool addGetter(string_table::key name, asNamespace *ns, asMethod 
*method);
-
-       bool addSetter(string_table::key name, asNamespace *ns, asMethod 
*method);
-
-       bool addMemberClass(string_table::key name, asNamespace *ns,
-               boost::uint32_t slotID, asClass *type);
-       
-       bool addSlotFunction(string_table::key name, asNamespace *ns,
-               boost::uint32_t slotID, asMethod *method);
-
-       /// \brief
-       /// Set the owner of this method.
-       void setOwner(asClass* s);
-
-       /// \brief
-       /// Get the unique identifier for the return type. 0 is 'anything'.
-       /// (This is the value of any dynamic property.)
-       /// Id reference: Type
-       asClass* getReturnType() const;
-
-       /// Set the return type
-       void setReturnType(asClass* t);
-
-       asMethod *getSuper();
-
-       void setSuper(asMethod* s);
-
-       /// \brief
-       /// Is the method final? If so, it may not be overridden.
-       bool isFinal() const { return _flags & FLAGS_FINAL; }
-
-       /// \brief
-       /// Set the method as final.
-       void setFinal() { _flags = _flags | FLAGS_FINAL; }
-
-       /// \brief
-       /// Unset the method as final. Not final anymore.
-       void unsetFinal() { _flags = _flags & ~FLAGS_FINAL; }
-
-       /// \brief
-       /// Is the method private?
-       bool isPrivate() const { return _flags & FLAGS_PRIVATE; }
-
-       /// \brief
-       /// Make the method private.
-       void setPrivate() {
-        _flags = (_flags & ~(FLAGS_PUBLIC | FLAGS_PROTECTED)) | FLAGS_PRIVATE;
-    }
-
-       /// \brief
-       /// Is the method protected?
-       bool isProtected() const {
-        return _flags & FLAGS_PROTECTED;
-    }
-
-       /// \brief
-       /// Make the method protected.
-       void setProtected() {
-        _flags = (_flags & ~(FLAGS_PUBLIC | FLAGS_PRIVATE)) | FLAGS_PROTECTED; 
}
-
-       /// \brief
-       /// Is the method public?
-       bool isPublic() const { return _flags & FLAGS_PUBLIC; }
-
-       /// \brief
-       /// Make the method public.
-       void setPublic() {
-        _flags = (_flags & ~(FLAGS_PRIVATE | FLAGS_PROTECTED)) | FLAGS_PUBLIC;
-    }
-
-       /// \brief
-       /// How many arguments are required? -1 means unknown.
-       int minArgumentCount() const { return _minArguments; }
-
-       /// \brief
-       /// Set the required minimum arguments.
-       void setMinArgumentCount(int i) { _minArguments = i; }
-
-       /// \brief
-       /// How many arguments are allowed? -1 means unknown.
-       int maxArgumentCount() const { return _maxArguments; }
-
-       /// Set the required maximum arguments.
-       void setMaxArgumentCount(int i) { _maxArguments = i; }
-
-       /// \brief
-       /// Push an argument of type t into the method definition
-       void pushArgument(asClass *t) { _arguments.push_back(t); }
-
-       /// \brief
-       /// Push an optional argument's default value.
-       void pushOptional(const as_value& v) { _optionalArguments.push_back(v); 
}
-
-       /// \brief
-       /// Are any of the arguments optional?
-       bool optionalArguments() const {
-        return minArgumentCount() != maxArgumentCount();
-    }
-
-       /// \brief
-       /// Get a reference to a list of argument types.
-       ArgumentList& getArgumentList() { return _arguments; }
-
-       /// \brief
-       /// Get an object capable of executing this function.
-       /// Note: This may be NULL, because we might have information about this
-       /// function but not actually have it yet.
-       as_function* getImplementation() { return _implementation; }
-
-       /// \brief
-       /// Print the opcodes that define a method using log_parse.
-       void print_body();
-
-       void print_static_constructor(){
-
-       }
-
-private:
-
-       enum Flag
-       {
-               FLAGS_FINAL = 0x01,
-               FLAGS_PROTECTED = 0x02,
-               FLAGS_PUBLIC = 0x04,
-               FLAGS_PRIVATE = 0x08
-       };
-
-       /// A list of type identifiers
-       typedef std::map<string_table::key, asBinding> BindingContainer;
-
-       bool addBinding(string_table::key name, asBinding b);
-       
-    boost::uint32_t _methodID;
-
-    abc_function* _prototype;
-       int _minArguments;
-       int _maxArguments;
-       boost::uint32_t _bodyLength;
-       bool _isNative;
-       ArgumentList _arguments;
-       std::list<as_value> _optionalArguments;
-       as_function* _implementation;
-       unsigned char _flags;
-       CodeStream* _body;
-       boost::uint32_t _maxRegisters;
-
-};
-
 /// A class to represent, abstractly, ActionScript prototypes.
 ///
 /// This class is intended to be able to capture the structure of an
@@ -563,9 +82,23 @@
        {}
 
        as_object* getPrototype() { return _prototype; }
+       
+    void setDeclared() { _declared = true; }
+       bool isDeclared() { return _declared; }
+       void setInherited() { _inherited = true; }
+       bool isInherited() { return _inherited; }
+
+       void setSystem() { _system = true; }
+       void unsetSystem() { _system = false; }
+       bool isSystem() { return _system; }
+       
+    /// Set our Name
+       void setName(string_table::key name) { _name = name; }
 
        void dump();
 
+#ifdef ENABLE_AVM2
+
        bool addValue(string_table::key name, asNamespace *ns,
             boost::uint32_t slotID, asClass *type, as_value& val,
             bool isconst, bool isstatic);
@@ -638,9 +171,6 @@
 
        void initPrototype(){ _prototype = new as_object();}
 
-       /// Set our Name
-       void setName(string_table::key name) { _name = name; }
-
        /// What is the type of our parent class?
        asClass* getSuper() const { return _super; }
 
@@ -659,15 +189,6 @@
        void buildFro_prototype(as_object *o, string_table::key name,
                ClassHierarchy *);
 
-       void setDeclared() { _declared = true; }
-       bool isDeclared() { return _declared; }
-       void setInherited() { _inherited = true; }
-       bool isInherited() { return _inherited; }
-
-       void setSystem() { _system = true; }
-       void unsetSystem() { _system = false; }
-       bool isSystem() { return _system; }
-
        asBinding *getBinding(string_table::key name)
        {
                BindingContainer::iterator i;
@@ -680,11 +201,12 @@
 
        asBinding* getGetBinding(as_value& v, asName& n);
        asBinding* getSetBinding(as_value& v, asName& n);
+    std::vector<abc::Trait> _traits;
 
-       std::vector<Trait> _traits;
+#endif
 
 private:
-
+       
        typedef std::map<string_table::key, asBinding> BindingContainer;
 
     as_object *_prototype;
@@ -723,6 +245,6 @@
        bool _system;
 };
 
-} /* namespace gnash */
+} // namespace gnash
 
-#endif /* GNASH_AS_CLASS_H */
+#endif 

=== added file 'libcore/asException.h'
--- a/libcore/asException.h     1970-01-01 00:00:00 +0000
+++ b/libcore/asException.h     2009-05-14 10:30:48 +0000
@@ -0,0 +1,45 @@
+// 
+//   Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+// 
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+// 
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+#ifndef GNASH_AS_EXCEPTION_H
+#define GNASH_AS_EXCEPTION_H
+
+namespace gnash {
+
+class asException
+{
+public:
+       void setStart(boost::uint32_t i) { _start = i; }
+       void setEnd(boost::uint32_t i) { mEnd = i; }
+       void setCatch(boost::uint32_t i) { mCatch = i; }
+       void catchAny() { mCatchAny = true; }
+       void setCatchType(asClass* p) { mCatchType = p; }
+       void setNamespace(asNamespace* n) { _namespace = n; }
+       void setName(string_table::key name) { _name = name; }
+
+private:
+       boost::uint32_t _start;
+       boost::uint32_t mEnd;
+       boost::uint32_t mCatch;
+       bool mCatchAny;
+       asClass *mCatchType;
+       asNamespace *_namespace;
+       string_table::key _name;
+};
+
+} // namespace gnash
+#endif

=== added file 'libcore/asMethod.cpp'
--- a/libcore/asMethod.cpp      1970-01-01 00:00:00 +0000
+++ b/libcore/asMethod.cpp      2009-05-14 11:07:52 +0000
@@ -0,0 +1,94 @@
+// 
+//   Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+// 
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+// 
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
+#include "asMethod.h"
+#include "asClass.h"
+#include "CodeStream.h"
+#include "abc_function.h"
+
+namespace gnash {
+
+asMethod::asMethod()
+    :
+       _minArguments(0),
+       _maxArguments(0),
+    _body(0)
+{
+}
+
+void
+asMethod::print_body()
+{
+               if (!_body) {
+                       log_parse("Method has no body.");
+                       return;
+               }
+               std::stringstream ss("Method Body:");
+               for(boost::uint32_t i = 0; i < _bodyLength ; ++i) {
+                       const boost::uint8_t opcode = _body->read_as3op();
+                       ss << "0x" << std::uppercase << std::hex << (opcode | 
0x0) << " ";
+               }
+               _body->seekTo(0);
+               log_parse("%s", ss.str());
+}
+
+void
+asMethod::setOwner(asClass *pOwner)
+{
+       log_debug("asMethod::setOwner");
+       if(!_prototype){
+               log_debug("ERROR _prototype is null.");
+       }
+       log_debug("Prototype text value: %s",_prototype->get_text_value());
+       _prototype->set_member(NSV::PROP_PROTOTYPE, pOwner->getPrototype());
+}
+
+void
+asMethod::setReturnType(asClass* /*type*/)
+{
+       /* No-op */
+}
+
+bool
+asMethod::addValue(string_table::key name, asNamespace *ns,
+        boost::uint32_t slotId, asClass *type, as_value& val, bool isconst)
+{
+       if (val.is_object()) {
+               val.to_object()->set_member(NSV::INTERNAL_TYPE,
+                size_t(type->getName()));
+    }
+
+       string_table::key nsname = ns ? ns->getURI() : string_table::key(0);
+
+       int flags = as_prop_flags::dontDelete;
+
+       if (isconst) flags |= as_prop_flags::readOnly;
+
+       if (slotId == 0) {
+               _prototype->init_member(name, val, flags, nsname);
+       }
+       else {
+               _prototype->init_member(name, val, flags, nsname, slotId);
+       }
+       return true;
+}
+
+} // namespace gnash

=== added file 'libcore/asMethod.h'
--- a/libcore/asMethod.h        1970-01-01 00:00:00 +0000
+++ b/libcore/asMethod.h        2009-05-14 11:07:52 +0000
@@ -0,0 +1,248 @@
+// 
+//   Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+// 
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+// 
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+#ifndef GNASH_AS_METHOD_H
+#define GNASH_AS_METHOD_H
+
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
+#include "log.h"
+#include "string_table.h"
+#include "Property.h"
+#include "namedStrings.h"
+
+#include <list>
+
+// Forward declarations
+namespace gnash {
+    class CodeStream;
+    class Machine;
+    class as_object;
+    class asClass;
+    class abc_function;
+}
+
+namespace gnash {
+
+typedef Property asBinding;
+
+/// A class to represent, abstractly, an ActionScript method.
+///
+/// Methods are unnamed until they are bound to an object.
+class asMethod
+{
+public:
+       
+    typedef std::list<asClass*> ArgumentList;
+
+       asMethod();
+
+    boost::uint32_t methodID() const {
+        return _methodID;
+    }
+
+    void setMethodID(boost::uint32_t m) {
+        _methodID = m;
+    }
+
+       void initPrototype(Machine* machine);
+
+       boost::uint32_t getMaxRegisters() { return _maxRegisters;}
+
+       void setMaxRegisters(boost::uint32_t maxRegisters) { 
+        _maxRegisters = maxRegisters;
+    }
+
+       boost::uint32_t getBodyLength(){ return _bodyLength;}
+
+       void setBodyLength(boost::uint32_t length){ _bodyLength = length;}
+
+       abc_function* getPrototype() { return _prototype; }
+
+       asBinding* getBinding(string_table::key name);
+
+       bool isNative() { return _isNative; }
+       bool hasBody() const { return _body != NULL; }
+
+       as_object* construct(as_object* /*base_scope*/) { /* TODO */ return 
NULL; }
+
+       bool hasActivation();
+
+       CodeStream *getBody() { return _body; }
+       void setBody(CodeStream *b) { _body = b; }
+
+       bool addValue(string_table::key name, asNamespace *ns, boost::uint32_t 
slotID,
+               asClass *type, as_value& val, bool isconst);
+
+       bool addSlot(string_table::key name, asNamespace *ns, boost::uint32_t 
slotID,
+               asClass *type);
+
+       bool addMethod(string_table::key name, asNamespace *ns, asMethod 
*method);
+
+       bool addGetter(string_table::key name, asNamespace *ns, asMethod 
*method);
+
+       bool addSetter(string_table::key name, asNamespace *ns, asMethod 
*method);
+
+       bool addMemberClass(string_table::key name, asNamespace *ns,
+               boost::uint32_t slotID, asClass *type);
+       
+       bool addSlotFunction(string_table::key name, asNamespace *ns,
+               boost::uint32_t slotID, asMethod *method);
+
+       /// \brief
+       /// Set the owner of this method.
+       void setOwner(asClass* s);
+
+       /// \brief
+       /// Get the unique identifier for the return type. 0 is 'anything'.
+       /// (This is the value of any dynamic property.)
+       /// Id reference: Type
+       asClass* getReturnType() const;
+
+       /// Set the return type
+       void setReturnType(asClass* t);
+
+       asMethod *getSuper();
+
+       void setSuper(asMethod* s);
+
+       /// \brief
+       /// Is the method final? If so, it may not be overridden.
+       bool isFinal() const { return _flags & FLAGS_FINAL; }
+
+       /// \brief
+       /// Set the method as final.
+       void setFinal() { _flags = _flags | FLAGS_FINAL; }
+
+       /// \brief
+       /// Unset the method as final. Not final anymore.
+       void unsetFinal() { _flags = _flags & ~FLAGS_FINAL; }
+
+       /// \brief
+       /// Is the method private?
+       bool isPrivate() const { return _flags & FLAGS_PRIVATE; }
+
+       /// \brief
+       /// Make the method private.
+       void setPrivate() {
+        _flags = (_flags & ~(FLAGS_PUBLIC | FLAGS_PROTECTED)) | FLAGS_PRIVATE;
+    }
+
+       /// \brief
+       /// Is the method protected?
+       bool isProtected() const {
+        return _flags & FLAGS_PROTECTED;
+    }
+
+       /// \brief
+       /// Make the method protected.
+       void setProtected() {
+        _flags = (_flags & ~(FLAGS_PUBLIC | FLAGS_PRIVATE)) | FLAGS_PROTECTED; 
}
+
+       /// \brief
+       /// Is the method public?
+       bool isPublic() const { return _flags & FLAGS_PUBLIC; }
+
+       /// \brief
+       /// Make the method public.
+       void setPublic() {
+        _flags = (_flags & ~(FLAGS_PRIVATE | FLAGS_PROTECTED)) | FLAGS_PUBLIC;
+    }
+
+       /// \brief
+       /// How many arguments are required? -1 means unknown.
+       int minArgumentCount() const { return _minArguments; }
+
+       /// \brief
+       /// Set the required minimum arguments.
+       void setMinArgumentCount(int i) { _minArguments = i; }
+
+       /// \brief
+       /// How many arguments are allowed? -1 means unknown.
+       int maxArgumentCount() const { return _maxArguments; }
+
+       /// Set the required maximum arguments.
+       void setMaxArgumentCount(int i) { _maxArguments = i; }
+
+       /// \brief
+       /// Push an argument of type t into the method definition
+       void pushArgument(asClass *t) { _arguments.push_back(t); }
+
+       /// \brief
+       /// Push an optional argument's default value.
+       void pushOptional(const as_value& v) { _optionalArguments.push_back(v); 
}
+
+       /// \brief
+       /// Are any of the arguments optional?
+       bool optionalArguments() const {
+        return minArgumentCount() != maxArgumentCount();
+    }
+
+       /// \brief
+       /// Get a reference to a list of argument types.
+       ArgumentList& getArgumentList() { return _arguments; }
+
+       /// \brief
+       /// Get an object capable of executing this function.
+       /// Note: This may be NULL, because we might have information about this
+       /// function but not actually have it yet.
+       as_function* getImplementation() { return _implementation; }
+
+       /// \brief
+       /// Print the opcodes that define a method using log_parse.
+       void print_body();
+
+       void print_static_constructor(){
+
+       }
+
+private:
+
+       enum Flag
+       {
+               FLAGS_FINAL = 0x01,
+               FLAGS_PROTECTED = 0x02,
+               FLAGS_PUBLIC = 0x04,
+               FLAGS_PRIVATE = 0x08
+       };
+
+       /// A list of type identifiers
+       typedef std::map<string_table::key, asBinding> BindingContainer;
+
+       bool addBinding(string_table::key name, asBinding b);
+       
+    boost::uint32_t _methodID;
+
+    abc_function* _prototype;
+       int _minArguments;
+       int _maxArguments;
+       boost::uint32_t _bodyLength;
+       bool _isNative;
+       ArgumentList _arguments;
+       std::list<as_value> _optionalArguments;
+       as_function* _implementation;
+       unsigned char _flags;
+       CodeStream* _body;
+       boost::uint32_t _maxRegisters;
+
+};
+
+} // namespace gnash
+
+#endif

=== added file 'libcore/asNamespace.cpp'
--- a/libcore/asNamespace.cpp   1970-01-01 00:00:00 +0000
+++ b/libcore/asNamespace.cpp   2009-05-14 10:30:48 +0000
@@ -0,0 +1,32 @@
+// 
+//   Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+// 
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+// 
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+#include "asNamespace.h"
+#include "VM.h"
+#include "ClassHierarchy.h"
+
+namespace gnash {
+
+void
+asNamespace::stubPrototype(string_table::key name)
+{
+       asClass *pClass = VM::get().getClassHierarchy()->newClass();
+       pClass->setName(name);
+       addClass(name, pClass);
+}
+
+}

=== added file 'libcore/asNamespace.h'
--- a/libcore/asNamespace.h     1970-01-01 00:00:00 +0000
+++ b/libcore/asNamespace.h     2009-05-14 10:30:48 +0000
@@ -0,0 +1,132 @@
+// 
+//   Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+// 
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+// 
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+#ifndef GNASH_AS_NAMESPACE_H
+#define GNASH_AS_NAMESPACE_H
+
+#include "string_table.h"
+
+// Forward declarations
+namespace gnash {
+    class asClass;
+}
+
+namespace gnash {
+
+/// Represent an ActionScript namespace
+class asNamespace
+{
+public:
+       void markReachableResources() const { /* TODO */ }
+
+       /// Our parent (for protected)
+       void setParent(asNamespace* p) { _parent = p; }
+
+       asNamespace* getParent() { return _parent; }
+
+       /// Set the uri
+       void setURI(string_table::key name) { mUri = name; }
+
+       /// What is the Uri of the namespace?
+       string_table::key getURI() const { return mUri; }
+
+       string_table::key getAbcURI() const {return _abcURI;}
+       void setAbcURI(string_table::key n){ _abcURI = n; }
+
+       /// What is the XML prefix?
+       string_table::key getPrefix() const { return _prefix; }
+
+       /// Create an empty namespace
+       asNamespace()
+        :
+        _parent(0),
+        mUri(0),
+        _prefix(0),
+        _abcURI(0),
+        mClasses(),
+               mRecursePrevent(false),
+        _private(false),
+        _protected(false)
+       {/**/}
+
+       /// Add a class to the namespace. The namespace stores this, but
+       /// does not take ownership. (So don't delete it.)
+       bool addClass(string_table::key name, asClass *a)
+       {
+               if (getClassInternal(name))
+                       return false;
+               mClasses[static_cast<std::size_t>(name)] = a;
+               return true;
+       }
+
+       void stubPrototype(string_table::key name);
+
+       /// Get the named class. Returns NULL if information is not known
+       /// about the class. (Stubbed classes still return NULL here.)
+       asClass *getClass(string_table::key name) 
+       {
+               if (mRecursePrevent)
+                       return NULL;
+
+               asClass *found = getClassInternal(name);
+               if (found || !getParent())
+                       return found;
+
+               mRecursePrevent = true;
+               found = getParent()->getClass(name);
+               mRecursePrevent = false;
+               return found;
+       }
+
+       void setPrivate() { _private = true; }
+       void unsetPrivate() { _private = false; }
+       bool isPrivate() { return _private; }
+
+       void setProtected() { _protected = true; }
+       void unsetProtected() { _protected = false; }
+       bool isProtected() { return _protected; }
+       
+private:
+       asNamespace *_parent;
+       string_table::key mUri;
+       string_table::key _prefix;
+
+       string_table::key _abcURI;
+
+       typedef std::map<string_table::key, asClass*> container;
+       container mClasses;
+       mutable bool mRecursePrevent;
+
+       bool _private;
+       bool _protected;
+
+       asClass* getClassInternal(string_table::key name) const
+       {
+               container::const_iterator i;
+               if (mClasses.empty())
+                       return NULL;
+
+               i = mClasses.find(name);
+               if (i == mClasses.end())
+                       return NULL;
+               return i->second;
+       }
+};
+
+} // namespace gnash
+
+#endif

=== modified file 'libcore/asobj/ClassHierarchy.cpp'
--- a/libcore/asobj/ClassHierarchy.cpp  2009-05-02 18:37:52 +0000
+++ b/libcore/asobj/ClassHierarchy.cpp  2009-05-14 16:26:38 +0000
@@ -69,7 +69,8 @@
 
 namespace gnash {
 
-namespace { // anonymous namespace
+// anonymous namespace
+namespace { 
 
 void
 addVisibilityFlag(int& flags, int version)
@@ -243,7 +244,7 @@
 bool
 ClassHierarchy::declareClass(extensionClass& c)
 {
-       if (mExtension == NULL) return false; 
+       if (!mExtension) return false; 
 
        mGlobalNamespace->stubPrototype(c.name);
        mGlobalNamespace->getClass(c.name)->setDeclared();
@@ -289,43 +290,61 @@
 //  { function_name, name key, super name key, lowest version },
        { system_class_init, NSV::CLASS_SYSTEM, 0, NSV::NS_FLASH_SYSTEM, 1 },
        { stage_class_init, NSV::CLASS_STAGE, 0, NSV::NS_FLASH_DISPLAY, 1 },
-       { movieclip_class_init, NSV::CLASS_MOVIE_CLIP, 0, 
NSV::NS_FLASH_DISPLAY, 3 },
+       { movieclip_class_init, NSV::CLASS_MOVIE_CLIP, 0, NSV::NS_FLASH_DISPLAY,
+        3 },
        { textfield_class_init, NSV::CLASS_TEXT_FIELD, 0, NSV::NS_FLASH_TEXT, 3 
},
        { math_class_init, NSV::CLASS_MATH, 0, NS_GLOBAL, 4 },
        { boolean_class_init, NSV::CLASS_BOOLEAN, NSV::CLASS_OBJECT, NS_GLOBAL, 
5 },
        { Button::init, NSV::CLASS_BUTTON, NSV::CLASS_OBJECT, NS_GLOBAL, 5 },
        { color_class_init, NSV::CLASS_COLOR, NSV::CLASS_OBJECT, NS_GLOBAL, 5 },
-       { selection_class_init, NSV::CLASS_SELECTION, NSV::CLASS_OBJECT, 
NS_UNKNOWN, 5 },
-       { Sound_as::init, NSV::CLASS_SOUND, NSV::CLASS_OBJECT, 
NSV::NS_FLASH_MEDIA, 5 },
-       { xmlsocket_class_init, NSV::CLASS_XMLSOCKET, NSV::CLASS_OBJECT, 
NSV::NS_FLASH_NET, 5 },
+       { selection_class_init, NSV::CLASS_SELECTION, NSV::CLASS_OBJECT,
+        NS_UNKNOWN, 5 },
+       { Sound_as::init, NSV::CLASS_SOUND, NSV::CLASS_OBJECT,
+        NSV::NS_FLASH_MEDIA, 5 },
+       { xmlsocket_class_init, NSV::CLASS_X_M_L_SOCKET, NSV::CLASS_OBJECT,
+        NSV::NS_FLASH_NET, 5 },
        { Date_as::init, NSV::CLASS_DATE, NSV::CLASS_OBJECT, NS_GLOBAL, 5 },
        { XML_as::init, NSV::CLASS_XML, NSV::CLASS_OBJECT, NS_GLOBAL, 5 },
-       { XMLNode_as::init, NSV::CLASS_XMLNODE, NSV::CLASS_OBJECT, 
NSV::NS_FLASH_XML, 5 },
-       { Mouse_as::init, NSV::CLASS_MOUSE, NSV::CLASS_OBJECT, 
NSV::NS_FLASH_UI, 5 },
+       { XMLNode_as::init, NSV::CLASS_XMLNODE, NSV::CLASS_OBJECT,
+        NSV::NS_FLASH_XML, 5 },
+       { Mouse_as::init, NSV::CLASS_MOUSE, NSV::CLASS_OBJECT, NSV::NS_FLASH_UI,
+        5 },
        { number_class_init, NSV::CLASS_NUMBER, NSV::CLASS_OBJECT, NS_GLOBAL, 5 
},
-       { TextFormat_as::init, NSV::CLASS_TEXT_FORMAT, NSV::CLASS_OBJECT, 
NS_GLOBAL, 5 },
+       { TextFormat_as::init, NSV::CLASS_TEXT_FORMAT, NSV::CLASS_OBJECT,
+        NS_GLOBAL, 5 },
        { key_class_init, NSV::CLASS_KEY, NSV::CLASS_OBJECT, NS_GLOBAL, 5 },
-       { AsBroadcaster::init, NSV::CLASS_AS_BROADCASTER, NSV::CLASS_OBJECT, 
NS_GLOBAL, 5 },
+       { AsBroadcaster::init, NSV::CLASS_AS_BROADCASTER, NSV::CLASS_OBJECT,
+        NS_GLOBAL, 5 },
        { TextSnapshot_as::init, NSV::CLASS_TEXT_SNAPSHOT, NSV::CLASS_OBJECT,
         NSV::NS_FLASH_TEXT, 5 },
-       { video_class_init, NSV::CLASS_VIDEO, NSV::CLASS_OBJECT, 
NSV::NS_FLASH_MEDIA, 6 },
-       { camera_class_init, NSV::CLASS_CAMERA, NSV::CLASS_OBJECT, 
NSV::NS_FLASH_UI, 6 },
-       { microphone_class_init, NSV::CLASS_MICROPHONE, NSV::CLASS_OBJECT, 
NSV::NS_FLASH_UI, 6 },
-       { sharedobject_class_init, NSV::CLASS_SHARED_OBJECT, NSV::CLASS_OBJECT, 
NSV::NS_FLASH_NET, 5 },
-       { loadvars_class_init, NSV::CLASS_LOAD_VARS, NSV::CLASS_OBJECT, 
NS_GLOBAL, 6 },
-       { LocalConnection_as::init, NSV::CLASS_LOCALCONNECTION, 
NSV::CLASS_OBJECT, NS_GLOBAL, 6 },
-       { customactions_class_init, NSV::CLASS_CUSTOM_ACTIONS, 
NSV::CLASS_OBJECT, NSV::NS_ADOBE_UTILS, 6 },
+       { video_class_init, NSV::CLASS_VIDEO, NSV::CLASS_OBJECT,
+        NSV::NS_FLASH_MEDIA, 6 },
+       { camera_class_init, NSV::CLASS_CAMERA, NSV::CLASS_OBJECT,
+        NSV::NS_FLASH_UI, 6 },
+       { microphone_class_init, NSV::CLASS_MICROPHONE, NSV::CLASS_OBJECT,
+        NSV::NS_FLASH_UI, 6 },
+       { sharedobject_class_init, NSV::CLASS_SHARED_OBJECT, NSV::CLASS_OBJECT,
+        NSV::NS_FLASH_NET, 5 },
+       { loadvars_class_init, NSV::CLASS_LOAD_VARS, NSV::CLASS_OBJECT, 
NS_GLOBAL,
+        6 },
+       { LocalConnection_as::init, NSV::CLASS_LOCAL_CONNECTION, 
NSV::CLASS_OBJECT,
+        NS_GLOBAL, 6 },
+       { customactions_class_init, NSV::CLASS_CUSTOM_ACTIONS, 
NSV::CLASS_OBJECT,
+        NSV::NS_ADOBE_UTILS, 6 },
        { NetConnection_as::init, NSV::CLASS_NET_CONNECTION, NSV::CLASS_OBJECT,
         NSV::NS_FLASH_NET, 6 },
        { NetStream_as::init, NSV::CLASS_NET_STREAM, NSV::CLASS_OBJECT,
         NSV::NS_FLASH_NET, 6 },
-       { contextmenu_class_init, NSV::CLASS_CONTEXTMENU, NSV::CLASS_OBJECT, 
NSV::NS_FLASH_UI, 7 },
-       { moviecliploader_class_init, NSV::CLASS_MOVIE_CLIP_LOADER, 
NSV::CLASS_OBJECT, NS_GLOBAL, 7 },
+       { contextmenu_class_init, NSV::CLASS_CONTEXT_MENU, NSV::CLASS_OBJECT,
+        NSV::NS_FLASH_UI, 7 },
+       { moviecliploader_class_init, NSV::CLASS_MOVIE_CLIP_LOADER,
+        NSV::CLASS_OBJECT, NS_GLOBAL, 7 },
        { Error_class_init, NSV::CLASS_ERROR, NSV::CLASS_OBJECT, NS_GLOBAL, 5 },
        { Accessibility_class_init, NSV::CLASS_ACCESSIBILITY, NSV::CLASS_OBJECT,
         NS_GLOBAL, 5 },
-       { int_class_init, NSV::CLASS_INT, NSV::CLASS_OBJECT, 9 },
-       { textfieldautosize_class_init, NSV::CLASS_TEXTFIELDAUTOSIZE, 
NSV::CLASS_OBJECT, 9 }
+       { int_class_init, NSV::CLASS_INT, NSV::CLASS_OBJECT, NS_GLOBAL, 9 },
+       { TextFieldAutoSize_class_init, NSV::CLASS_TEXTFIELDAUTOSIZE,
+        NSV::CLASS_OBJECT, NS_GLOBAL, 9 }
 
 // These classes are all implicitly constructed; that is, it is not necessary 
for
 // the class name to be used to construct the class, so they must always be 
available.

=== modified file 'libcore/asobj/ClassHierarchy.h'
--- a/libcore/asobj/ClassHierarchy.h    2009-03-04 20:30:04 +0000
+++ b/libcore/asobj/ClassHierarchy.h    2009-05-14 11:23:13 +0000
@@ -19,22 +19,28 @@
 #ifndef GNASH_CLASS_HIERARCHY_H
 #define GNASH_CLASS_HIERARCHY_H
 
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
+#include "as_object.h"
+#include "SafeStack.h"
+#include "asClass.h"
+#include "asNamespace.h"
+
+#ifdef ENABLE_AVM2
+# include "asBoundValues.h"
+# include "asException.h"
+# include "asMethod.h"
+#endif
+
 #include <list>
 #include <vector>
 #include <ostream>
 
-#include "as_object.h"
-#include "asClass.h"
-#include "SafeStack.h"
-
 namespace gnash {
 
 class Extension;
-class asClass;
-class asMethod;
-class asException;
-class asBoundValue;
-class asBoundAccessor;
 class as_object;
 
 /// Register all of the ActionScript classes, with their dependencies.
@@ -129,6 +135,7 @@
        ///
        void massDeclare();
 
+
        /// The global namespace
        ///
        /// Get the global namespace.  This is not the Global object -- it only
@@ -143,7 +150,7 @@
        ///
        /// @return 
        /// The namespace with the given uri or NULL if it doesn't exist.
-       asNamespace *findNamespace(string_table::key uri)
+       asNamespace* findNamespace(string_table::key uri)
        {
                namespacesContainer::iterator i;
                if (mNamespaces.empty())
@@ -175,12 +182,42 @@
        asNamespace* addNamespace(string_table::key uri)
        {
                asNamespace *n = findNamespace(uri);
-               if (n)
-                       return n;
+               if (n) return n;
                // The set should create it automatically here. TODO: Make sure
                mNamespaces[uri].setURI(uri);
                return &mNamespaces[uri];
        }
+       
+    /// Create a new asClass object for use.
+       asClass* newClass() {
+        mClassMemory.grow(1);
+        return &mClassMemory.top(0);
+    }
+
+#ifdef ENABLE_AVM2
+
+       asException* newException() {
+        mExceptionMemory.grow(1);
+        return &mExceptionMemory.top(0);
+    }
+
+       /// Create a new asMethod object for use.
+       asMethod* newMethod() {
+        mMethodMemory.grow(1);
+        return &mMethodMemory.top(0);
+    }
+
+       asBoundValue* newBoundValue() {
+        mBoundValueMemory.grow(1);
+        return &mBoundValueMemory.top(0);
+    }
+
+       asBoundAccessor* newBoundAccessor() {
+        mBoundAccessorMemory.grow(1);
+        return &mBoundAccessorMemory.top(0);
+    }
+
+#endif
 
        /// Set the extension object, since it wasn't set on construction.
        void setExtension(Extension *e) { mExtension = e; }
@@ -191,56 +228,52 @@
        /// Mark objects for garbage collector.
        void markReachableResources() const;
 
-       /// Create a new asClass object for use.
-       asClass *newClass()
-       { mClassMemory.grow(1); return &mClassMemory.top(0); }
-
-       asException *newException()
-       { mExceptionMemory.grow(1); return &mExceptionMemory.top(0); }
-
-       /// Create a new asMethod object for use.
-       asMethod *newMethod()
-       { mMethodMemory.grow(1); return &mMethodMemory.top(0); }
-
-       asBoundValue *newBoundValue()
-       { mBoundValueMemory.grow(1); return &mBoundValueMemory.top(0); }
-
-       asBoundAccessor *newBoundAccessor()
-       { mBoundAccessorMemory.grow(1); return &mBoundAccessorMemory.top(0); }
-
        /// \brief
        /// Construct the declaration object. Later set the global and
        /// extension objects using setGlobal and setExtension
-       ClassHierarchy() :
-               mGlobal(NULL), mGlobalNamespace(NULL), mExtension(NULL),
+       ClassHierarchy()
+        :
+               mGlobal(0),
+        mExtension(0) ,
                mAnonNamespaces(),
-               mClassMemory(), mExceptionMemory(),
+        mGlobalNamespace(anonNamespace(0)),
+               mClassMemory()
+#ifdef ENABLE_AVM2
+        ,
+        mExceptionMemory(),
                mMethodMemory(),
-               mBoundValueMemory(), mBoundAccessorMemory()
-       { mGlobalNamespace = anonNamespace(0); }
+               mBoundValueMemory(),
+        mBoundAccessorMemory()
+#endif
+       {}
 
        /// \brief
        /// Delete our private namespaces.
        ~ClassHierarchy();
 
 private:
-       as_object *mGlobal;
-       asNamespace *mGlobalNamespace;
-       Extension *mExtension;
+       as_object* mGlobal;
+       Extension* mExtension;
 
        typedef std::map<string_table::key, asNamespace> namespacesContainer;
        namespacesContainer mNamespaces;
        SafeStack<asNamespace> mAnonNamespaces;
+       asNamespace* mGlobalNamespace;
        SafeStack<asClass> mClassMemory;
+
+#ifdef ENABLE_AVM2
        SafeStack<asException> mExceptionMemory;
        SafeStack<asMethod> mMethodMemory;
        SafeStack<asBoundValue> mBoundValueMemory;
        SafeStack<asBoundAccessor> mBoundAccessorMemory;
+#endif
 };
 
-std::ostream& operator << (std::ostream& os, const 
ClassHierarchy::nativeClass& c);
-std::ostream& operator << (std::ostream& os, const 
ClassHierarchy::extensionClass& c);
+std::ostream&
+operator<< (std::ostream& os, const ClassHierarchy::nativeClass& c);
+std::ostream&
+operator<< (std::ostream& os, const ClassHierarchy::extensionClass& c);
 
-} /* namespace gnash */
-#endif /* GNASH_CLASS_HIERARCHY_H */
+} 
+#endif 
 

=== removed file 'libcore/asobj/flash/display/DisplayObjectContainer_as.cpp'
--- a/libcore/asobj/flash/display/DisplayObjectContainer_as.cpp 2008-09-12 
12:09:40 +0000
+++ b/libcore/asobj/flash/display/DisplayObjectContainer_as.cpp 1970-01-01 
00:00:00 +0000
@@ -1,101 +0,0 @@
-// EventDispatcher.cpp:  Implementation of ActionScript DisplayObjectContainer 
class, for Gnash.
-// 
-//   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-// 
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "smart_ptr.h"
-#include "fn_call.h"
-#include "as_object.h" // for inheritance
-#include "builtin_function.h" // need builtin_function
-#include "flash/display/InteractiveObject_as.h"
-#include "flash/display/DisplayObjectContainer_as.h"
-
-#include "log.h"
-
-#include <string>
-#include <sstream>
-
-namespace gnash {
-
-static as_value DisplayObjectContainer_addChild(const fn_call& fn);
-
-static void
-attachDisplayObjectContainerInterface(as_object& o)
-{
-        o.init_member("addChild", new 
builtin_function(DisplayObjectContainer_addChild));
-}
-
-
-display_object_container_as_object::display_object_container_as_object()
-       :
-       as_object()
-{
-}
-
-as_value
-display_object_container_as_object::addChild(as_value child){
-
-               return child;
-}
-
-static as_value DisplayObjectContainer_addChild(const fn_call& fn){
-       
-       boost::intrusive_ptr<display_object_container_as_object> ptr = 
ensureType<display_object_container_as_object>(fn.this_ptr);
-
-       return ptr->addChild(fn.arg(0));
-
-}
-
-static as_value
-display_object_container_ctor(const fn_call& fn)
-{
-       boost::intrusive_ptr<as_object> obj = new 
display_object_container_as_object();
-       
-       return as_value(obj.get()); // will keep alive
-}
-
-as_object*
-getDisplayObjectContainerInterface()
-{
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
-               o = new as_object(getInteractiveObjectInterface());
-       }
-       attachDisplayObjectContainerInterface(*o);
-       o.get()->dump_members();
-       return o.get();
-}
-
-// extern
-void display_object_container_class_init(as_object& where)
-{
-    static boost::intrusive_ptr<builtin_function> cl;
-
-       cl=new builtin_function(&display_object_container_ctor, 
getDisplayObjectContainerInterface());
-
-       where.init_member("DisplayObjectContainer", cl.get());
-}
-
-std::auto_ptr<as_object>
-init_display_object_container_instance()
-{
-       return std::auto_ptr<as_object>(new display_object_container_as_object);
-}
-
-
-}

=== removed file 'libcore/asobj/flash/display/DisplayObjectContainer_as.h'
--- a/libcore/asobj/flash/display/DisplayObjectContainer_as.h   2008-09-12 
12:09:40 +0000
+++ b/libcore/asobj/flash/display/DisplayObjectContainer_as.h   1970-01-01 
00:00:00 +0000
@@ -1,58 +0,0 @@
-// 
-//   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-// 
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-// 
-//
-//
-
-// Implementation for ActionScript DisplayObjectContainer object.
-
-#ifndef GNASH_DISPLAYOBJECTCONTAINER_H
-#define GNASH_DISPLAYOBJECTCONTAINER_H
-
-#include <memory> // for auto_ptr
-#include "flash/display/DisplayObject_as.h"
-
-namespace gnash {
-
-class as_object;
-
-class display_object_container_as_object: public as_object
-{
-
-public:
-
-       display_object_container_as_object();
-
-       as_value addChild(as_value child);
-
-private:
-
-};
-
-/// Initialize the DisplayObjectContainer class
-void display_object_container_class_init(as_object& where);
-
-/// Return a DisplayObjectContainer instance
-std::auto_ptr<as_object> init_display_object_container_instance();
-
-as_object* getDisplayObjectContainerInterface();
-
-
-}
-
-#endif // GNASH_DISPLAYOBJECTCONTAINER_H

=== removed file 'libcore/asobj/flash/display/DisplayObject_as.cpp'
--- a/libcore/asobj/flash/display/DisplayObject_as.cpp  2008-09-12 12:09:40 
+0000
+++ b/libcore/asobj/flash/display/DisplayObject_as.cpp  1970-01-01 00:00:00 
+0000
@@ -1,70 +0,0 @@
-// EventDispatcher.cpp:  Implementation of ActionScript DisplayObject class, 
for Gnash.
-// 
-//   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-// 
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "smart_ptr.h"
-#include "fn_call.h"
-#include "as_object.h" // for inheritance
-#include "builtin_function.h" // need builtin_function
-#include "flash/events/EventDispatcher_as.h"
-#include "flash/display/DisplayObject_as.h"
-
-#include "log.h"
-
-#include <string>
-#include <sstream>
-
-namespace gnash {
-
-static as_value
-display_object_ctor(const fn_call& fn)
-{
-       boost::intrusive_ptr<as_object> obj = new display_object_as_object();
-       
-       return as_value(obj.get()); // will keep alive
-}
-
-as_object*
-getDisplayObjectInterface()
-{
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
-               o = new as_object(getEventDispatcherInterface());
-       }
-       return o.get();
-}
-
-// extern
-void display_object_class_init(as_object& where)
-{
-    static boost::intrusive_ptr<builtin_function> cl;
-
-       cl=new builtin_function(&display_object_ctor, 
getDisplayObjectInterface());
-
-       where.init_member("DisplayObject", cl.get());
-}
-
-std::auto_ptr<as_object>
-init_display_object_instance()
-{
-       return std::auto_ptr<as_object>(new display_object_as_object);
-}
-
-
-}

=== removed file 'libcore/asobj/flash/display/DisplayObject_as.h'
--- a/libcore/asobj/flash/display/DisplayObject_as.h    2008-09-12 12:09:40 
+0000
+++ b/libcore/asobj/flash/display/DisplayObject_as.h    1970-01-01 00:00:00 
+0000
@@ -1,57 +0,0 @@
-// 
-//   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-// 
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-// 
-//
-//
-
-// Implementation for ActionScript DisplayObject object.
-
-#ifndef GNASH_DISPLAYOBJECT_H
-#define GNASH_DISPLAYOBJECT_H
-
-#include <memory> // for auto_ptr
-
-namespace gnash {
-
-class as_object;
-
-class display_object_as_object : public as_object
-{
-
-public:
-
-       display_object_as_object()
-               :
-               as_object()
-       {
-       }
-
-};
-
-/// Initialize the DisplayObject class
-void display_object_class_init(as_object& where);
-
-/// Return a DisplayObject instance
-std::auto_ptr<as_object> init_display_object_instance();
-
-as_object* getDisplayObjectInterface();
-
-
-}
-
-#endif // GNASH_DISPLAYOBJECT_H

=== removed file 'libcore/asobj/flash/display/InteractiveObject_as.cpp'
--- a/libcore/asobj/flash/display/InteractiveObject_as.cpp      2008-09-06 
15:57:32 +0000
+++ b/libcore/asobj/flash/display/InteractiveObject_as.cpp      1970-01-01 
00:00:00 +0000
@@ -1,81 +0,0 @@
-// DisplayObject.cpp:  Implementation of ActionScript InteractiveObject class, 
for Gnash.
-// 
-//   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-// 
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "smart_ptr.h"
-#include "fn_call.h"
-#include "as_object.h" // for inheritance
-#include "builtin_function.h" // need builtin_function
-#include "flash/display/DisplayObject_as.h"
-
-#include "log.h"
-
-#include <string>
-#include <sstream>
-
-namespace gnash {
-class interactive_object_as_object : public as_object
-{
-
-public:
-
-       interactive_object_as_object()
-               :
-               as_object()
-       {
-       }
-
-};
-
-static as_value
-interactive_object_ctor(const fn_call& fn)
-{
-       boost::intrusive_ptr<as_object> obj = new 
interactive_object_as_object();
-       
-       return as_value(obj.get()); // will keep alive
-}
-
-as_object*
-getInteractiveObjectInterface()
-{
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
-               o = new as_object(getDisplayObjectInterface());
-       }
-       return o.get();
-}
-
-// extern
-void interactive_object_class_init(as_object& where)
-{
-    static boost::intrusive_ptr<builtin_function> cl;
-
-       cl=new builtin_function(&interactive_object_ctor, 
getInteractiveObjectInterface());
-
-       where.init_member("InteractiveObject", cl.get());
-}
-
-std::auto_ptr<as_object>
-init_interactive_object_instance()
-{
-       return std::auto_ptr<as_object>(new interactive_object_as_object);
-}
-
-
-}

=== removed file 'libcore/asobj/flash/display/InteractiveObject_as.h'
--- a/libcore/asobj/flash/display/InteractiveObject_as.h        2008-09-06 
15:57:32 +0000
+++ b/libcore/asobj/flash/display/InteractiveObject_as.h        1970-01-01 
00:00:00 +0000
@@ -1,44 +0,0 @@
-// 
-//   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-// 
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-// 
-//
-//
-
-// Implementation for ActionScript InteractiveObject object.
-
-#ifndef GNASH_INTERACTIVEOBJECT_H
-#define GNASH_INTERACTIVEOBJECT_H
-
-#include <memory> // for auto_ptr
-
-namespace gnash {
-
-class as_object;
-
-/// Initialize the InteractiveObject class
-void interactive_object_class_init(as_object& where);
-
-/// Return a InteractiveObject instance
-std::auto_ptr<as_object> init_interactive_object_instance();
-
-as_object* getInteractiveObjectInterface();
-
-
-}
-
-#endif // GNASH_INTERACTIVEOBJECT_H

=== removed file 'libcore/asobj/flash/display/Sprite_as.cpp'
--- a/libcore/asobj/flash/display/Sprite_as.cpp 2008-11-10 19:30:45 +0000
+++ b/libcore/asobj/flash/display/Sprite_as.cpp 1970-01-01 00:00:00 +0000
@@ -1,88 +0,0 @@
-// EventDispatcher.cpp:  Implementation of ActionScript Sprite class, for 
Gnash.
-// 
-//   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-// 
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Object.h"
-#include "smart_ptr.h"
-#include "fn_call.h"
-#include "as_object.h" // for inheritance
-#include "builtin_function.h" // need builtin_function
-#include "movie_definition.h" // for Object.registerClass 
(get_exported_resource)
-//#include "character.h" // for Object.registerClass  (get_root_movie)
-#include "MovieClip.h" // for Object.registerClass  (get_movie_definition)
-#include "sprite_definition.h" // for Object.registerClass  
(get_movie_definition)
-#include "VM.h" // for SWF version (attachObjectInterface)
-#include "namedStrings.h" // for NSV::PROP_TO_STRING
-#include "flash/display/DisplayObjectContainer_as.h"
-
-#include "log.h"
-
-#include <string>
-#include <sstream>
-
-namespace gnash {
-class sprite_as_object : public as_object
-{
-
-public:
-
-       sprite_as_object()
-               :
-               as_object()
-       {
-       }
-
-};
-
-static as_value
-sprite_as_ctor(const fn_call& fn)
-{
-       boost::intrusive_ptr<as_object> obj = new sprite_as_object();
-       
-       return as_value(obj.get()); // will keep alive
-}
-
-as_object*
-getSpriteAsInterface()
-{
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
-               o = new as_object(getDisplayObjectContainerInterface());
-       }
-       return o.get();
-}
-
-// extern
-void sprite_as_class_init(as_object& where)
-{
-    static boost::intrusive_ptr<builtin_function> cl;
-
-       cl=new builtin_function(&sprite_as_ctor, getSpriteAsInterface());
-
-       where.init_member("Sprite", cl.get());
-}
-
-std::auto_ptr<as_object>
-init_sprite_as_instance()
-{
-       return std::auto_ptr<as_object>(new sprite_as_object);
-}
-
-
-}

=== removed file 'libcore/asobj/flash/display/Sprite_as.h'
--- a/libcore/asobj/flash/display/Sprite_as.h   2008-09-06 15:57:32 +0000
+++ b/libcore/asobj/flash/display/Sprite_as.h   1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
-// 
-//   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-// 
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-// 
-//
-//
-
-// Implementation for ActionScript Sprite object.
-
-#ifndef GNASH_SPRITEAS_H
-#define GNASH_SPRITEAS_H
-
-#include <memory> // for auto_ptr
-
-namespace gnash {
-
-class as_object;
-
-/// Initialize the Sprite class
-void sprite_as_class_init(as_object& where);
-
-/// Return a Sprite instance
-std::auto_ptr<as_object> init_sprite_as_instance();
-
-as_object* getSpriteAsInterface();
-
-
-}
-
-#endif // GNASH_SPRITEAS_H
\ No newline at end of file

=== removed file 'libcore/asobj/flash/display/Stage_as.cpp'
--- a/libcore/asobj/flash/display/Stage_as.cpp  2008-09-06 15:57:32 +0000
+++ b/libcore/asobj/flash/display/Stage_as.cpp  1970-01-01 00:00:00 +0000
@@ -1,84 +0,0 @@
-// EventDispatcher.cpp:  Implementation of ActionScript Stage class, for Gnash.
-// 
-//   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-// 
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "smart_ptr.h"
-#include "fn_call.h"
-#include "as_object.h" // for inheritance
-#include "builtin_function.h" // need builtin_function
-#include "DisplayObjectContainer.h"
-
-#include "log.h"
-
-#include <string>
-#include <sstream>
-
-namespace gnash {
-class stage_as_object : public as_object
-{
-
-public:
-
-       stage_as_object()
-               :
-               as_object()
-       {
-       }
-
-};
-
-static as_value
-stage_ctor(const fn_call& fn)
-{
-       boost::intrusive_ptr<as_object> obj = new stage_as_object();
-       
-       return as_value(obj.get()); // will keep alive
-}
-
-as_object*
-getStageInterface()
-{
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
-               o = new as_object(getDisplayObjectContainerInterface());
-       }
-       return o.get();
-}
-
-// extern
-void stage_class_init9(as_object& global)
-{
-       log_debug("Loading");
-    static boost::intrusive_ptr<builtin_function> cl;
-
-       cl=new builtin_function(&stage_ctor, getStageInterface());
-       log_debug("Creating function");
-       // Register _global.Stage
-       global.init_member("Stage", cl.get());
-       log_debug("Done attaching.");
-}
-
-std::auto_ptr<as_object>
-init_stage_instance()
-{
-       return std::auto_ptr<as_object>(new stage_as_object);
-}
-
-
-}

=== removed file 'libcore/asobj/flash/display/Stage_as.h'
--- a/libcore/asobj/flash/display/Stage_as.h    2008-09-06 15:57:32 +0000
+++ b/libcore/asobj/flash/display/Stage_as.h    1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
-// 
-//   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-// 
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-// 
-//
-//
-
-// Implementation for ActionScript Stage object.
-
-#ifndef GNASH_STAGE_H
-#define GNASH_STAGE_H
-
-#include <memory> // for auto_ptr
-
-namespace gnash {
-
-class as_object;
-
-/// Initialize the Stage class
-void stage_class_init9(as_object& global);
-
-/// Return a Stage instance
-std::auto_ptr<as_object> init_stage_instance();
-
-as_object* getStageInterface();
-
-
-}
-
-#endif // GNASH_DISPLAYOBJECTCONTAINER_H

=== modified file 'libcore/asobj/flash/display_pkg.cpp'
--- a/libcore/asobj/flash/display_pkg.cpp       2009-03-04 20:30:04 +0000
+++ b/libcore/asobj/flash/display_pkg.cpp       2009-05-14 11:06:24 +0000
@@ -25,10 +25,6 @@
 
 #include "flash/display/BitmapData_as.h"
 #include "Stage_as.h"
-#include "flash/display/DisplayObject_as.h"
-#include "flash/display/InteractiveObject_as.h"
-#include "flash/display/DisplayObjectContainer_as.h"
-#include "flash/display/Sprite_as.h"
 #include "MovieClip.h"
 
 namespace gnash {
@@ -42,10 +38,6 @@
 
        BitmapData_class_init(*pkg);
        stage_class_init(*pkg);
-       display_object_class_init(*pkg);
-       interactive_object_class_init(*pkg);
-       display_object_container_class_init(*pkg);
-       sprite_as_class_init(*pkg);
        movieclip_class_init(*pkg);
 
        return pkg;
@@ -55,7 +47,8 @@
 flash_display_package_init(as_object& where)
 {
        string_table& st = where.getVM().getStringTable();
-       where.init_destructive_property(st.find("display"), 
get_flash_display_package);
+       where.init_destructive_property(st.find("display"),
+                       get_flash_display_package);
 }
 
 

=== modified file 'libcore/impl.cpp'
--- a/libcore/impl.cpp  2009-04-16 10:00:54 +0000
+++ b/libcore/impl.cpp  2009-05-14 16:26:38 +0000
@@ -44,14 +44,12 @@
 #include "DefineTextTag.h"
 #include "PlaceObject2Tag.h"
 #include "RemoveObjectTag.h"
-#include "DoABCTag.h"
 #include "DoActionTag.h"
 #include "DoInitActionTag.h"
 #include "DefineEditTextTag.h"
 #include "SetBackgroundColorTag.h"
 #include "StartSoundTag.h"
 #include "StreamSoundBlockTag.h"
-#include "SymbolClassTag.h"
 #include "DefineButtonSoundTag.h"
 #include "DefineMorphShapeTag.h"
 #include "DefineVideoStreamTag.h"
@@ -63,6 +61,11 @@
 #include "GC.h"
 #endif
 
+#ifdef ENABLE_AVM2
+# include "SymbolClassTag.h"
+# include "DoABCTag.h"
+#endif
+
 #include <string>
 #include <map>
 #include <memory> // for auto_ptr
@@ -211,33 +214,50 @@
     // TODO: Fix this, but probably not critical.
     register_tag_loader(SWF::SETTABINDEX, fixme_loader); //66 
 
-    // TODO: Alexis reference says these are 83, 84. The 67,68 comes from 
Tamarin.
-    // Figure out which one is correct (possibly both are).
-    register_tag_loader(SWF::DEFINESHAPE4_, DefineShapeTag::loader); // 67
+    // TODO: Alexis reference says these are 83, 84. The 67, 68 comes from
+    // Tamarin. Figure out which one is correct (possibly both are).
+    // 67
+    register_tag_loader(SWF::DEFINESHAPE4_, DefineShapeTag::loader);
     // 68
     register_tag_loader(SWF::DEFINEMORPHSHAPE2_, DefineMorphShapeTag::loader);
     // 69
     register_tag_loader(SWF::FILEATTRIBUTES, file_attributes_loader);
-    register_tag_loader(SWF::PLACEOBJECT3, PlaceObject2Tag::loader); // 70
-    register_tag_loader(SWF::IMPORTASSETS2, import_loader); // 71
-
-    register_tag_loader(SWF::DOABC, DoABCTag::doABCLoader); // 72 -- AS3 
codeblock.
-    register_tag_loader(SWF::DEFINEALIGNZONES, 
DefineFontAlignZonesTag::loader); // 73
-
-    register_tag_loader(SWF::CSMTEXTSETTINGS, CSMTextSettingsTag::loader); // 
74
-    register_tag_loader(SWF::DEFINEFONT3, DefineFontTag::loader); // 75
-    register_tag_loader(SWF::SYMBOLCLASS, SymbolClassTag::loader); // 76 
-    register_tag_loader(SWF::METADATA, metadata_loader); // 77
-    register_tag_loader(SWF::DEFINESCALINGGRID, fixme_loader); // 78
-    register_tag_loader(SWF::DOABCDEFINE, DoABCTag::doABCLoader); // 82 -- AS3 
codeblock.
-    register_tag_loader(SWF::DEFINESHAPE4, DefineShapeTag::loader); // 83
+    // 70
+    register_tag_loader(SWF::PLACEOBJECT3, PlaceObject2Tag::loader);
+    // 71
+    register_tag_loader(SWF::IMPORTASSETS2, import_loader);
+    // 73
+    register_tag_loader(SWF::DEFINEALIGNZONES, 
DefineFontAlignZonesTag::loader);
+    // 74
+    register_tag_loader(SWF::CSMTEXTSETTINGS, CSMTextSettingsTag::loader);
+    // 75
+    register_tag_loader(SWF::DEFINEFONT3, DefineFontTag::loader);
+    // 77
+    register_tag_loader(SWF::METADATA, metadata_loader);
+    // 78
+    register_tag_loader(SWF::DEFINESCALINGGRID, fixme_loader);
+    // 83
+    register_tag_loader(SWF::DEFINESHAPE4, DefineShapeTag::loader);
     // 84
     register_tag_loader(SWF::DEFINEMORPHSHAPE2, DefineMorphShapeTag::loader);
-    
register_tag_loader(SWF::DEFINESCENEANDFRAMELABELDATA,define_scene_frame_label_loader);
 //86
     // 88
     register_tag_loader(SWF::DEFINEFONTNAME, DefineFontNameTag::loader);
+    // 777
+    register_tag_loader(SWF::REFLEX, reflex_loader);
+    
+    // The following tags are AVM2 only.
 
-    register_tag_loader(SWF::REFLEX, reflex_loader); // 777
+#ifdef ENABLE_AVM2
+    // 72 -- AS3 codeblock.
+    register_tag_loader(SWF::DOABC, DoABCTag::doABCLoader); 
+    // 76
+    register_tag_loader(SWF::SYMBOLCLASS, SymbolClassTag::loader);
+    // 82
+    register_tag_loader(SWF::DOABCDEFINE, DoABCTag::doABCLoader);
+    // 86
+    register_tag_loader(SWF::DEFINESCENEANDFRAMELABELDATA,
+            define_scene_frame_label_loader);
+#endif
 }
 
 // Create a movie_definition from an image format stream

=== modified file 'libcore/parser/Makefile.am'
--- a/libcore/parser/Makefile.am        2009-04-07 12:34:43 +0000
+++ b/libcore/parser/Makefile.am        2009-05-14 10:26:47 +0000
@@ -39,28 +39,36 @@
        -I$(top_srcdir)/libamf \
        $(GLIB_CFLAGS) \
        $(PTHREAD_CFLAGS) \
-        $(BOOST_CFLAGS) \
+       $(BOOST_CFLAGS) \
        $(FREETYPE2_CFLAGS) \
        $(NULL)
 
 libgnashparser_la_SOURCES = \
-       abc_block.cpp \
        action_buffer.cpp \
        BitmapMovieDefinition.cpp \
        SWFMovieDefinition.cpp \
        sound_definition.cpp \
        sprite_definition.cpp
 
+if ENABLE_AVM2
+libgnashparser_la_SOURCES += \
+       abc_block.cpp
+endif
+
 noinst_HEADERS = \
-       abc_block.h \
        action_buffer.h \
        BitmapMovieDefinition.h \
        movie_definition.h \
        SWFMovieDefinition.h \
-       Namespace.h \
        sound_definition.h \
        sprite_definition.h
 
+if ENABLE_AVM2
+noinst_HEADERS += \
+       Namespace.h \
+       abc_block.h
+endif
+
 libgnashparser_la_LIBADD = \
        $(top_builddir)/libamf/libgnashamf.la \
        $(top_builddir)/libbase/libgnashbase.la

=== modified file 'libcore/parser/abc_block.cpp'
--- a/libcore/parser/abc_block.cpp      2009-04-16 08:57:58 +0000
+++ b/libcore/parser/abc_block.cpp      2009-04-16 10:54:21 +0000
@@ -207,8 +207,10 @@
        boost::uint8_t kind = in->read_u8();
        _kind = static_cast<Kind>(kind & 0x0F);
 
-       log_abc("Trai name=%s Trait kind is 0x%X", 
pBlock->_stringPool[multiname.getABCName()], kind | 0x0);
-       switch (_kind)
+       log_abc("Trait name: %s, Trait kind: 0x%X",
+            pBlock->_stringPool[multiname.getABCName()], kind | 0x0);
+
+    switch (_kind)
        {
        case KIND_SLOT:
        case KIND_CONST:
@@ -362,7 +364,8 @@
        string_table::key global_key = _stringTable->find(name, true);
        log_abc("Global key %u", global_key);
        n->setGlobalName(global_key);
-       log_abc("Multiname: %s ABCName set to %u global name set to %u", name, 
n->getABCName(), n->getGlobalName());
+       log_abc("Multiname: %s ABCName set to %u, global name set to %u",
+            name, n->getABCName(), n->getGlobalName());
 }
 
 void
@@ -1288,14 +1291,38 @@
 asClass*
 abc_block::locateClass(const std::string& className)
 {
-       
-       std::vector<asClass*>::iterator i = _classes.begin();
-       for( ; i!=_classes.end(); ++i) {
-               if (_stringPool[(*i)->getName()] == className) {
-                       return *i;
-               }
-       }       
-       return NULL;
+
+    const std::string::size_type pos = className.rfind(".");
+    
+    if (pos == std::string::npos) {
+        for (std::vector<asClass*>::iterator i = _classes.begin();
+                i != _classes.end(); ++i) {
+            if (_stringPool[(*i)->getName()] == className) {
+                return *i;
+            }
+        }      
+        return 0;
+    }
+    
+    const std::string& nsstr = className.substr(0, pos);
+    const std::string& clstr = className.substr(pos + 1);
+    
+    for (std::vector<asNamespace*>::iterator i = _namespacePool.begin();
+            i != _namespacePool.end(); ++i) {
+        if (_stringPool[(*i)->getAbcURI()] == nsstr) {
+
+            for (std::vector<asClass*>::iterator j = _classes.begin();
+                    j != _classes.end(); ++j) {
+                if (_stringPool[(*j)->getName()] == clstr) {
+                    return (*i)->getClass((*j)->getName());
+                }
+            }  
+        return 0;
+        
+        }
+    }  
+       return 0;
+
 }
 
 void

=== modified file 'libcore/parser/abc_block.h'
--- a/libcore/parser/abc_block.h        2009-04-16 09:37:01 +0000
+++ b/libcore/parser/abc_block.h        2009-05-14 11:23:13 +0000
@@ -21,14 +21,15 @@
 #ifndef GNASH_ABC_BLOCK_H
 #define GNASH_ABC_BLOCK_H
 
+#include "string_table.h"
+#include "asName.h"
+#include "asNamespace.h"
+#include "as_value.h"
+
 #include <vector>
 #include <string>
 #include <boost/scoped_array.hpp>
 
-#include "string_table.h"
-#include "asClass.h"
-#include "asName.h"
-
 namespace gnash {
        class SWFStream; // for read signature
 }
@@ -39,6 +40,7 @@
 class ClassHierarchy;
 class asMethod;
 class asClass;
+class Machine;
 
 namespace abc {
 

=== modified file 'libcore/swf/SymbolClassTag.h'
--- a/libcore/swf/SymbolClassTag.h      2009-02-20 12:24:00 +0000
+++ b/libcore/swf/SymbolClassTag.h      2009-05-14 11:41:42 +0000
@@ -23,6 +23,8 @@
 #include "action_buffer.h" // for composition
 #include "MovieClip.h" // for inlines
 #include "SWFStream.h" // for inlines
+#include "Machine.h"
+#include "VM.h"
 
 // Forward declarations
 namespace gnash {

=== modified file 'libcore/swf/tag_loaders.cpp'
--- a/libcore/swf/tag_loaders.cpp       2009-04-16 10:00:54 +0000
+++ b/libcore/swf/tag_loaders.cpp       2009-05-14 16:26:38 +0000
@@ -44,16 +44,12 @@
 #include "GnashException.h"
 #include "swf/DefineVideoStreamTag.h"
 #include "sound_definition.h"
-#include "abc_block.h"
 #include "SoundInfo.h"
-#include "Machine.h"
-#include "gnash.h" // FileType enum
+#include "gnash.h" 
 #include "MediaHandler.h"
 #include "SimpleBuffer.h"
 #include "sound_handler.h"
 #include "ExportableResource.h"
-
-// TODO: pass the render handler with RunInfo and use that.
 #include "render.h"
 
 #ifdef HAVE_ZLIB_H
@@ -1324,49 +1320,6 @@
 }
 
 void
-abc_loader(SWFStream& in, TagType tag, movie_definition& /*m*/,
-        const RunInfo& /*r*/)
-{
-       assert(tag == SWF::DOABC
-               || tag == SWF::DOABCDEFINE); // 72 or 82
-
-       abc_block a;
-
-       if (tag == SWF::DOABCDEFINE)
-       {
-
-               // Skip the 'flags' until they are actually used.
-               in.ensureBytes(4);
-               static_cast<void> (in.read_u32());
-               std::string name;
-               in.read_string(name);
-               log_debug("Name is %s",name);
-        log_debug("Initializing block...\n");
-        a = abc_block();
-               log_debug("Done Initializing block.\n");
-               log_debug("Begin read...\n");
-               a.read(in);
-               log_debug("Done with read...\n");
-               VM& vm = VM::get();
-               log_debug("getting machine.");
-               Machine *mach = vm.getMachine();
-               as_object* global = vm.getGlobal();
-//             log_debug("Getting entry script.");
-//             asClass* start_script = a.mScripts.back();
-//             log_debug("Getting constructor.");
-//             asMethod* method = start_script->getConstructor();
-//             log_debug("Loding code stream.");
-               mach->initMachine(&a,global);
-               log_debug("Executing machine...");
-               mach->execute();
-       }
-
-       //TODO: Move this to execution time so that as_object can be used. bool 
success = a.read(in);
-
-       log_unimpl(_("%s tag parsed but not yet used"), tag == SWF::DOABC ? 
"DOABC" : "DOABCDEFINE");
-}
-
-void
 define_scene_frame_label_loader(SWFStream& in, TagType tag,
         movie_definition& /*m*/, const RunInfo& /*r*/)
 {

=== modified file 'libcore/swf/tag_loaders.h'
--- a/libcore/swf/tag_loaders.h 2009-04-08 11:48:21 +0000
+++ b/libcore/swf/tag_loaders.h 2009-05-14 10:26:47 +0000
@@ -114,8 +114,6 @@
 void sound_stream_block_loader(SWFStream&, TagType, movie_definition&,
                const RunInfo&);
 
-void abc_loader(SWFStream&, TagType, movie_definition&, const RunInfo&);
-
 void
 define_video_loader(SWFStream& in, TagType tag, movie_definition& m,
                const RunInfo& r);

=== modified file 'libcore/vm/Machine.cpp'
--- a/libcore/vm/Machine.cpp    2009-05-02 18:37:06 +0000
+++ b/libcore/vm/Machine.cpp    2009-05-14 16:26:38 +0000
@@ -29,7 +29,6 @@
 #include "Object.h"
 #include "VM.h"
 
-//#define PRETEND
 namespace gnash {
 /// The type of exceptions thrown by ActionScript.
 class ASException
@@ -81,7 +80,7 @@
 pool_double(boost::uint32_t index, abc_block *pool)
 {
        if (!pool) throw ASException();
-       LOG_DEBUG_AVM("Getting double from pool at index %u",index);
+       log_abc("Getting double from pool at index %u",index);
        return pool->doublePoolAt(index);
 }
 
@@ -113,7 +112,7 @@
        if (!pool) throw ASException();
        asName multiname = pool->multinamePoolAt(index);
 #if 0
-    LOG_DEBUG_AVM("Searching multiname pool for property id=%u abc name=%u "
+    log_abc("Searching multiname pool for property id=%u abc name=%u "
             "global name = %u abc string=%s flags=0x%X name_space=%u",
             index, multiname.getABCName(), multiname.getGlobalName(),
             pool->mStringPool[multiname.getABCName()],multiname.mFlags | 0x0,
@@ -254,7 +253,7 @@
        {
     SWF::abc_action_type opcode = (SWF::abc_action_type)mStream->read_as3op();
        
-       LOG_DEBUG_AVM("** Executing opcode: %s (%d) **", opcode, (int)opcode);
+       log_abc("** Executing opcode: %s (%d) **", opcode, (int)opcode);
 //     continue;
        switch ((opcode /*= mStream->read_as3op()*/)) // Assignment intentional
        {
@@ -460,7 +459,7 @@
        case SWF::ABC_ACTION_JUMP:
        {
                boost::int32_t bytes = mStream->read_S24();
-               LOG_DEBUG_AVM("Jumping %d bytes.",bytes);
+               log_abc("Jumping %d bytes.",bytes);
                mStream->seekBy(bytes);
 
                break;
@@ -477,11 +476,11 @@
        {
                boost::int32_t bytes = mStream->read_S24();
                if (pop_stack().to_bool()) {
-                       LOG_DEBUG_AVM("Jumping %d bytes.",bytes);
+                       log_abc("Jumping %d bytes.",bytes);
                        mStream->seekBy(bytes);
                }
                else{
-                       LOG_DEBUG_AVM("Would have jumpied %d bytes.", bytes);
+                       log_abc("Would have jumpied %d bytes.", bytes);
                }
                break;
        }
@@ -497,8 +496,8 @@
                boost::int32_t bytes = mStream->read_S24();
                bool truth = pop_stack().to_bool();
                if (!truth) {
-                       LOG_DEBUG_AVM("Jumping...");
-                       LOG_DEBUG_AVM("%d bytes.",bytes);
+                       log_abc("Jumping...");
+                       log_abc("%d bytes.",bytes);
                        mStream->seekBy(bytes);
                }
                break;
@@ -517,11 +516,11 @@
                as_value b = pop_stack();
                as_value a = pop_stack();
                if (a.equals(b)) {
-                       LOG_DEBUG_AVM("Jumping %d bytes.",bytes);
+                       log_abc("Jumping %d bytes.",bytes);
                        mStream->seekBy(bytes);
                }
                else{
-                       LOG_DEBUG_AVM("Would have jumped %d bytes", bytes);
+                       log_abc("Would have jumped %d bytes", bytes);
                }
                break;
        }
@@ -539,11 +538,11 @@
                as_value b = pop_stack();
                boost::int32_t bytes = mStream->read_S24();
                if (!a.equals(b)) {
-                       LOG_DEBUG_AVM("Jumping... %d bytes.",bytes);
+                       log_abc("Jumping... %d bytes.",bytes);
                        mStream->seekBy(bytes);
                }
                else{
-                       LOG_DEBUG_AVM("Would have jumped %d bytes",bytes);
+                       log_abc("Would have jumped %d bytes",bytes);
                }
                break;
        }
@@ -562,11 +561,11 @@
                boost::int32_t bytes = mStream->read_S24();
                bool jump = a.newLessThan(b).to_bool();
                if (jump) {
-                       LOG_DEBUG_AVM("Jumping... %d bytes.",bytes);
+                       log_abc("Jumping... %d bytes.",bytes);
                        mStream->seekBy(bytes);
                }
                else{
-                       LOG_DEBUG_AVM("Would have jumped %d bytes",bytes);
+                       log_abc("Would have jumped %d bytes",bytes);
                }
                break;
        }
@@ -602,11 +601,11 @@
                ABSTRACT_COMPARE(truth, mStack.top(0), mStack.top(1), false);
                mStack.drop(2);
                if (truth) {
-                       LOG_DEBUG_AVM("Jumping %d bytes.",bytes);
+                       log_abc("Jumping %d bytes.",bytes);
                        mStream->seekBy(bytes);
                }
                else{
-                       LOG_DEBUG_AVM("Would have jumped %d bytes.",bytes);
+                       log_abc("Would have jumped %d bytes.",bytes);
                }
                break;
        }
@@ -977,15 +976,15 @@
                boost::int32_t iindex = mStream->read_V32();
                as_value &objv = mRegisters[oindex];
                as_value &indexv = mRegisters[iindex];
-               LOG_DEBUG_AVM("Index is %u",indexv.to_number());
+               log_abc("Index is %u",indexv.to_number());
 //             ENSURE_OBJECT(objv);
 //             ENSURE_NUMBER(indexv);
                as_object *obj = objv.to_object().get();
                boost::uint32_t index = indexv.to_number<boost::uint32_t>();
-               LOG_DEBUG_AVM("Object is %s index is 
%u",objv.toDebugString(),index);
+               log_abc("Object is %s index is %u",objv.toDebugString(),index);
                as_object *owner = NULL;
                int next = obj->nextIndex(index, &owner);
-               LOG_DEBUG_AVM("Next index is %d",next);
+               log_abc("Next index is %d",next);
 //             mStack.grow(1);
                if (next)
                {
@@ -1014,7 +1013,7 @@
        case SWF::ABC_ACTION_NEWFUNCTION:
        {
                boost::int32_t method_index = mStream->read_V32();
-               LOG_DEBUG_AVM("Creating new abc_function: method 
index=%u",method_index);
+               log_abc("Creating new abc_function: method 
index=%u",method_index);
                asMethod *m = pool_method(method_index, mPoolObject);
                abc_function* new_function = m->getPrototype();
                // TODO: SafeStack contains all the scope objects
@@ -1175,43 +1174,47 @@
                boost::uint32_t argc = mStream->read_V32();
                std::auto_ptr< std::vector<as_value> > args = get_args(argc);
                //TODO: If multiname is runtime also pop namespace and/or name 
values.
-                if ( a.isRuntime() ) {
-                    log_unimpl("ABC_ACTION_CALL* with runtime multiname");
-                }
+        
+        if (a.isRuntime()) {
+            log_unimpl("ABC_ACTION_CALL* with runtime multiname");
+        }
+
                as_value object_val = pop_stack();
-                
+
                as_object *object = object_val.to_object().get();
                if (!object) {
-                    IF_VERBOSE_ASCODING_ERRORS(
-                       log_aserror(_("Can't call a method of a value that 
doesn't cast to an object (%s)."),
-                                    object_val);
-                        )
-                        }
-               else{
+            IF_VERBOSE_ASCODING_ERRORS(
+                       log_aserror(_("Can't call a method of a value that 
doesn't "
+                    "cast to an object (%s)."),
+                object_val);
+            )
+               }
+               else {
 
-                       as_value property = 
object->getMember(a.getGlobalName(),0);
+                       as_value property = 
object->getMember(a.getGlobalName(), 0);
                
                        if (!property.is_undefined() && !property.is_null()) {
-                               LOG_DEBUG_AVM("Calling method %s on object %s",
+                               log_abc("Calling method %s on object %s",
                         property.toDebugString(),object_val.toDebugString());
                                as_environment env = as_environment(_vm);
                                result = call_method(property,env,object,args);
 
                        }
-                       else{
-                            IF_VERBOSE_ASCODING_ERRORS(
+                       else {
+                IF_VERBOSE_ASCODING_ERRORS(
                                log_aserror(_("Property '%s' of object '%s' is 
'%s', "
-                                              "cannot call as method"),
-                                            
mPoolObject->stringPoolAt(a.getABCName()),
-                                            object_val, property);
-                                )
-                                }
-                        
+                        "cannot call as method"),
+                        mPoolObject->stringPoolAt(a.getABCName()),
+                        object_val, property);
+                )
+                       }
+
                }
-                if (opcode == SWF::ABC_ACTION_CALLPROPERTY) {
-                    push_stack(result);
-                }
-                
+        
+        if (opcode == SWF::ABC_ACTION_CALLPROPERTY) {
+            push_stack(result);
+        }
+
 /*             int shift = completeName(a, argc);
                ENSURE_OBJECT(mStack.top(shift + argc));
                as_object *obj = mStack.top(argc + shift).to_object().get();
@@ -1291,35 +1294,37 @@
        case SWF::ABC_ACTION_CONSTRUCTSUPER:
        {
                boost::uint32_t argc = mStream->read_V32();
-               LOG_DEBUG_AVM("There are %u arguments.",argc);
+               log_abc("There are %u arguments.",argc);
                get_args(argc);
-//             ENSURE_OBJECT(mStack.top(argc));
                //as_object *super = pop_stack().to_object().get()->get_super();
                //TODO: Actually construct the super.
-//             as_object *super = mStack.top(argc).to_object()->get_super();
-//             if (!super)
-//             {
-//                     throw ASException();
-//                     break;
-//             }
-//             as_function *func = super->get_constructor();
+               as_object* super = mStack.top(argc).to_object()->get_super();
+               if (!super) {
+            log_error("No super found in CONSTRUCTSUPER!");
+            throw ASException();
+        }
+               as_function *func = super->get_constructor();
+               if (!func) {
+            log_abc("Super(%s) has no constructor in CONSTRUCTSUPER!");
+        }
                // 'obj' is the 'this' for the call, we ignore the return, 
there are
                // argc arguments, and we drop all of the arguments plus 'obj' 
from
                // the stack.
-//             pushCall(func, obj, mIgnoreReturn, argc, -1);
+               pushCall(func, super, mIgnoreReturn, argc, -1);
 
-        LOG_ONCE( log_unimpl("ABC_ACTION_CONSTRUCTSUPER") );
+        LOG_ONCE(log_unimpl("ABC_ACTION_CONSTRUCTSUPER") );
                break;
        }
-/// 0x4A ABC_ACTION_CONSTRUCTPROP
-/// Stream: V32 'name_offset' | V32 'arg_count'
-/// Stack In:
-///  argN ... arg1 -- the arg_count arguments to pass
-///  [ns [n]] -- Namespace stuff
-///  obj -- the object whose property should be constructed
-/// Stack Out:
-///  value -- the newly constructed prop from obj::(resolve)
-///   'name_offset'(arg1, ..., argN)
+    
+    /// 0x4A ABC_ACTION_CONSTRUCTPROP
+    /// Stream: V32 'name_offset' | V32 'arg_count'
+    /// Stack In:
+    ///  argN ... arg1 -- the arg_count arguments to pass
+    ///  [ns [n]] -- Namespace stuff
+    ///  obj -- the object whose property should be constructed
+    /// Stack Out:
+    ///  value -- the newly constructed prop from obj::(resolve)
+    ///   'name_offset'(arg1, ..., argN)
        case SWF::ABC_ACTION_CONSTRUCTPROP:
        {
                as_environment env = as_environment(_vm);
@@ -1329,7 +1334,7 @@
                as_object* object = pop_stack().to_object().get();
                if (!object) {
                        //TODO: Should this result in an exeception or an 
actionscript error?
-                       LOG_DEBUG_AVM("Can't constructor property on a null 
object.  Property not constructed.");
+                       log_abc("Can't constructor property on a null object.  
Property not constructed.");
                        push_stack(as_value());
                        break;
                }
@@ -1345,9 +1350,9 @@
                // I don't think this is correct, and I think the problem might 
be how AVM2 adds
                // new objects to the Global object.
                else{
-                       LOG_DEBUG_AVM("Object %s is not a 
constructor",constructor_val.toDebugString());
+                       log_abc("Object %s is not a 
constructor",constructor_val.toDebugString());
                        if (constructor_val.is_null() || 
constructor_val.is_undefined()) {
-                               LOG_DEBUG_AVM("Constructor is undefined, will 
not construct property.");
+                               log_abc("Constructor is undefined, will not 
construct property.");
                                push_stack(as_value());
                        }
                        else{
@@ -1399,7 +1404,7 @@
        case SWF::ABC_ACTION_NEWARRAY:
        {
                boost::uint32_t asize = mStream->read_V32();
-               LOG_DEBUG_AVM("Creating array of size %u",asize);
+               log_abc("Creating array of size %u",asize);
                Array_as *arr = new Array_as;
                arr->resize(asize);
                boost::uint32_t i = asize;
@@ -1432,7 +1437,7 @@
        {
                boost::uint32_t cid = mStream->read_V32();
                asClass *c = pool_class(cid, mPoolObject);
-               LOG_DEBUG_AVM("Creating new class id=%u name=%s", c->getName(),
+               log_abc("Creating new class id=%u name=%s", c->getName(),
                 mPoolObject->stringPoolAt(c->getName()));
                
                as_object* base_class = pop_stack().to_object().get();
@@ -1609,7 +1614,7 @@
        case SWF::ABC_ACTION_SETLOCAL:
        {
                boost::uint32_t index = mStream->read_V32();
-               LOG_DEBUG_AVM("Register index: %u",index);
+               log_abc("Register index: %u",index);
                mRegisters[index] = pop_stack();
                break;
        }
@@ -1734,7 +1739,7 @@
 
                object->get_member_slot(sindex + 1, &val);
 
-               LOG_DEBUG_AVM("object has value %s at real_slot=%u 
abc_slot=%u",val.toDebugString(),sindex + 1, sindex);
+               log_abc("object has value %s at real_slot=%u 
abc_slot=%u",val.toDebugString(),sindex + 1, sindex);
                push_stack(val);
                
                break;
@@ -1755,10 +1760,10 @@
                //We use sindex + 1, because currently as_object sets a 
property at a slot index
                //1 higher than the index the abc_block thinks the property is 
at.
                if (!object.to_object().get()->set_member_slot(sindex+1,value)) 
{
-                       LOG_DEBUG_AVM("Failed to set property at real_slot=%u 
abc_slot=%u",sindex+1,sindex);
+                       log_abc("Failed to set property at real_slot=%u 
abc_slot=%u",sindex+1,sindex);
                }
                else{
-                       LOG_DEBUG_AVM("Set property at real_slot=%u 
abc_slot=%u",sindex+1,sindex);
+                       log_abc("Set property at real_slot=%u 
abc_slot=%u",sindex+1,sindex);
                }
                //TODO: Actually set the object's value.
                break;
@@ -2484,7 +2489,7 @@
                break;
        }
        } // end of switch statement
-               LOG_DEBUG_AVM("* DONE *");
+               log_abc("* DONE *");
                IF_VERBOSE_ACTION(print_stack());
        } // end of AS3 conditional
        else // beginning of !AS3 (this code is AS2)
@@ -2551,15 +2556,16 @@
 }
 
 int
-Machine::completeName(asName &name, int offset)
+Machine::completeName(asName& name, int offset)
 {
        int size = 0;
 
        if (name.isRuntime())
        {
                as_value obj = mStack.top(offset);
-               if (obj.is_object() && obj.to_object()->isQName())
+               if (obj.is_object() && obj.to_object()->isQName()) {
                        name.fill(obj.to_object().get());
+        }
                ++size;
 
                if (name.isRtns())
@@ -2670,7 +2676,7 @@
 void
 Machine::restoreState()
 {
-       LOG_DEBUG_AVM("Restoring state.");
+       log_abc("Restoring state.");
        State &s = mStateStack.top(0);
        s.to_debug_string();
 //     mStack.setAllSizes(s.mStackTotalSize, s.mStackDepth);
@@ -2691,7 +2697,7 @@
 void
 Machine::saveState()
 {
-       LOG_DEBUG_AVM("Saving state.");
+       log_abc("Saving state.");
        mStateStack.grow(1);
        State &s = mStateStack.top(0);
        s.mStackDepth = mStack.getDownstop();
@@ -2774,22 +2780,22 @@
 
     log_debug("instantiateClass: class name %s", className);
 
-       asClass* theClass = mPoolObject->locateClass(className);
-    if ( ! theClass )
+       asClass* cl = mPoolObject->locateClass(className);
+    if (!cl)
     {
-        // TODO: check how the pp would handle this
-        IF_VERBOSE_ASCODING_ERRORS(
-        log_aserror("Could not locate class '%s' for instantiation", 
className);
-        );
+        /// This seems like a big error.
+        log_error("Could not locate class '%s' for instantiation", className);
         return;
     }
        
-       clearRegisters(theClass->getConstructor()->getMaxRegisters());
-       mCurrentFunction = theClass->getConstructor()->getPrototype();
+    asMethod* ctor = cl->getConstructor();
+
+       clearRegisters(ctor->getMaxRegisters());
+       mCurrentFunction = ctor->getPrototype();
        mStack.clear();
        mScopeStack.clear();
        mRegisters[0] = as_value(global);
-       executeCodeblock(theClass->getConstructor()->getBody());
+       executeCodeblock(ctor->getBody());
 }
 
 Machine::Machine(VM& vm)
@@ -2830,7 +2836,7 @@
     {
                as_object* scope_object = mScopeStack.top(i).get();
                if (!scope_object) {
-                       LOG_DEBUG_AVM("Scope object is NULL.");
+                       log_abc("Scope object is NULL.");
                        continue;
                }
                val = scope_object->getMember(multiname.getGlobalName(),
@@ -2843,7 +2849,7 @@
                }
        }
 
-       LOG_DEBUG_AVM("Cannot find property in scope stack.  Trying again using 
as_environment.");
+       log_abc("Cannot find property in scope stack.  Trying again using 
as_environment.");
        as_object *target = NULL;
        as_environment env = as_environment(_vm);
        std::string name = mPoolObject->stringPoolAt(multiname.getABCName());
@@ -2902,7 +2908,7 @@
                if (i!=0) ss << " | ";
                ss << mStack.value(i).toDebugString();
        }
-       LOG_DEBUG_AVM("%s", ss.str());
+       log_abc("%s", ss.str());
 }
 
 void
@@ -2914,13 +2920,13 @@
        for (unsigned int i=0;i<mScopeStack.size();++i) {
                ss << as_value(mScopeStack.top(i).get()).toDebugString();
        }
-       LOG_DEBUG_AVM("%s", ss.str());
+       log_abc("%s", ss.str());
 }      
 
 std::auto_ptr<std::vector<as_value> >
 Machine::get_args(unsigned int argc)
 {
-       LOG_DEBUG_AVM("There are %u args",argc);
+       log_abc("There are %u args",argc);
        std::auto_ptr<std::vector<as_value> > args = 
         std::auto_ptr<std::vector<as_value> >(new std::vector<as_value>);
        args->resize(argc);

=== modified file 'libcore/vm/Machine.h'
--- a/libcore/vm/Machine.h      2009-04-08 11:48:21 +0000
+++ b/libcore/vm/Machine.h      2009-05-14 08:00:05 +0000
@@ -28,8 +28,6 @@
 #include "as_environment.h"
 #include "VM.h"
 
-#define LOG_DEBUG_AVM(fmt,...) IF_VERBOSE_ACTION(log_action("AVM2: " fmt, ## 
__VA_ARGS__));
-
 namespace gnash {
 
 class DisplayObject;
@@ -231,7 +229,7 @@
                std::vector<as_value> mRegisters;
                abc_function* mFunction;
        void to_debug_string(){
-               LOG_DEBUG_AVM("StackDepth=%u StackTotalSize=%u 
ScopeStackDepth=%u 
ScopeTotalSize=%u",mStackDepth,mStackTotalSize,mScopeStackDepth,mScopeTotalSize);
+               log_abc("StackDepth=%u StackTotalSize=%u ScopeStackDepth=%u 
ScopeTotalSize=%u",mStackDepth,mStackTotalSize,mScopeStackDepth,mScopeTotalSize);
 
        }
        };
@@ -274,35 +272,35 @@
        void clearRegisters(boost::uint32_t maxRegsiters);
 
        as_value get_register(int index){
-               LOG_DEBUG_AVM("Getting value at a register %d ",index);
+               log_abc("Getting value at a register %d ",index);
                return mRegisters[index];
        }
 
        void push_stack(as_value object){
-               LOG_DEBUG_AVM("Pushing value %s onto 
stack.",object.toDebugString());
+               log_abc("Pushing value %s onto stack.",object.toDebugString());
                mStack.push(object);
        }
 
        as_value pop_stack(){
                as_value value = mStack.pop();
-               LOG_DEBUG_AVM("Poping value %s off the 
stack.",value.toDebugString());
+               log_abc("Poping value %s off the stack.",value.toDebugString());
                return value;
        }
 
        void push_scope_stack(as_value object){
                boost::intrusive_ptr<as_object> scopeObj = object.to_object();
                assert(scopeObj.get());
-               LOG_DEBUG_AVM("Pushing value %s onto scope 
stack.",object.toDebugString());
+               log_abc("Pushing value %s onto scope 
stack.",object.toDebugString());
                mScopeStack.push(scopeObj);
                print_scope_stack();
        }
 
        boost::intrusive_ptr<as_object> pop_scope_stack(){
-               LOG_DEBUG_AVM("Poping value off the scope stack.  There will be 
%u items left.",mScopeStack.size()-1);
+               log_abc("Poping value off the scope stack.  There will be %u 
items left.",mScopeStack.size()-1);
                return mScopeStack.pop();
        }
        boost::intrusive_ptr<as_object> get_scope_stack(boost::uint8_t depth){
-               LOG_DEBUG_AVM("Geting value from scope stack %u from the 
bottom.",depth | 0x0);
+               log_abc("Geting value from scope stack %u from the 
bottom.",depth | 0x0);
                return mScopeStack.value(depth);
        }
 
@@ -337,4 +335,4 @@
 };
 
 } // namespace gnash
-#endif /* GNASH_MACHINE_H */
+#endif 

=== modified file 'libcore/vm/Makefile.am'
--- a/libcore/vm/Makefile.am    2009-03-04 20:30:04 +0000
+++ b/libcore/vm/Makefile.am    2009-05-14 10:26:47 +0000
@@ -40,20 +40,22 @@
 
 libgnashvm_la_SOURCES = \
        ASHandlers.cpp \
-       Machine.cpp \
        ActionExec.cpp \
        VM.cpp          \
        action.cpp \
        CallStack.cpp \
+       $(NULL)
+
+if ENABLE_AVM2
+libgnashvm_la_SOURCES += \
        CodeStream.cpp \
+       Machine.cpp
        $(NULL)
+endif
 
 noinst_HEADERS =               \
        ASHandlers.h            \
-       CodeStream.h            \
        SafeStack.h                     \
-       Machine.h                       \
-       asName.h                        \
        ActionExec.h            \
        ExecutableCode.h        \
        VM.h                    \
@@ -62,6 +64,14 @@
        CallStack.h \
        with_stack_entry.h      \
        $(NULL)
+       
+if ENABLE_AVM2
+noinst_HEADERS += \
+       asName.h                        \
+       CodeStream.h            \
+       Machine.h \
+       $(NULL)
+endif
 
 libgnashvm_la_LIBADD = \
        $(top_builddir)/libbase/libgnashbase.la 

=== modified file 'libcore/vm/VM.cpp'
--- a/libcore/vm/VM.cpp 2009-04-16 10:00:54 +0000
+++ b/libcore/vm/VM.cpp 2009-05-14 16:26:38 +0000
@@ -33,7 +33,10 @@
 #include "namedStrings.h"
 #include "ClassHierarchy.h"
 #include "VirtualClock.h" // for getTime()
-#include "Machine.h"
+
+#ifdef ENABLE_AVM2
+# include "Machine.h"
+#endif
 
 #ifdef HAVE_SYS_UTSNAME_H
 # include <sys/utsname.h> // For system information
@@ -65,10 +68,12 @@
 
        _singleton->mClassHierarchy.reset(new ClassHierarchy);
        _singleton->setGlobal(new Global(*_singleton, 
_singleton->mClassHierarchy.get()));
-/*?Ask someone if this is correct.*/
+
+#ifdef ENABLE_AVM2
        _singleton->mMachine = new Machine(*_singleton);
        assert(_singleton->getGlobal());
-/*ASK*/
+#endif
+
        return *_singleton;
 }
 
@@ -90,7 +95,9 @@
        :
        _rootMovie(root),
        _swfversion(version),
-       mMachine(0),
+#ifdef ENABLE_AVM2
+    mMachine(0),
+#endif
        _clock(clock),
        _stack(),
     _shLib(new SharedObjectLibrary(*this))

=== modified file 'libcore/vm/VM.h'
--- a/libcore/vm/VM.h   2009-03-31 09:45:01 +0000
+++ b/libcore/vm/VM.h   2009-05-14 10:26:47 +0000
@@ -168,8 +168,10 @@
        /// Get a reference to the string table used by the VM.
        string_table& getStringTable() const { return mStringTable; }
 
+#ifdef ENABLE_AVM2
        /// Get a pointer to the machine, if it exists.
        Machine* getMachine() const { return mMachine; }
+#endif
 
        /// Get version of the player, in a compatible representation
        //
@@ -312,8 +314,10 @@
        /// Not mutable since changing this changes behavior of the VM.
        std::auto_ptr<ClassHierarchy> mClassHierarchy;
 
+#ifdef ENABLE_AVM2
        /// A running execution thread.
        Machine *mMachine;
+#endif
 
        VirtualClock& _clock;
 

=== modified file 'libcore/vm/asName.h'
--- a/libcore/vm/asName.h       2009-05-02 18:37:06 +0000
+++ b/libcore/vm/asName.h       2009-05-14 16:26:38 +0000
@@ -22,6 +22,8 @@
 namespace gnash {
 
 class as_object;
+class asNamespace;
+class Property;
 
 class asName
 {

=== modified file 'testsuite/libcore.all/Makefile.am'
--- a/testsuite/libcore.all/Makefile.am 2009-04-08 11:48:21 +0000
+++ b/testsuite/libcore.all/Makefile.am 2009-05-14 10:26:47 +0000
@@ -44,9 +44,13 @@
        AsValueTest \
        ClassSizes \
        SafeStackTest \
-       CodeStreamTest \
        $(NULL)
 
+if ENABLE_AVM2
+check_PROGRAMS += \
+       CodeStreamTest
+endif
+
 CLEANFILES = \
        testrun.sum \
        testrun.log \

=== modified file 'testsuite/misc-haxe.all/Makefile.am'
--- a/testsuite/misc-haxe.all/Makefile.am       2009-03-04 20:30:04 +0000
+++ b/testsuite/misc-haxe.all/Makefile.am       2009-05-14 10:26:47 +0000
@@ -23,6 +23,7 @@
        Hello.hx \
        AddChild.hx \
        $(NULL)
+
 # These ones are the ones for which consistency check fail 
 BOGUS_ASTESTS = \
        $(NULL)
@@ -43,10 +44,15 @@
 
 
 TEST_DRIVERS = ../simple.exp
+
 TEST_CASES = \
+       $(NULL)
+
+if ENABLE_AVM2
+TEST_CASES += \
        sanetests-runner \
-       bogustests-runner \
-       $(NULL)
+       bogustests-runner
+endif
 
 sanetests-runner: $(srcdir)/../generic-testrunner.sh $(SANE_ASTESTS_OUT) 
Makefile
        sh $< -c __END_OF_TEST__ -r 50 $(top_builddir) $(SANE_ASTESTS_OUT) > $@


reply via email to

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