Gnash  0.8.11dev
Public Types | Public Member Functions | Friends | List of all members
gnash::abc::AbcBlock Class Reference

The ActionScript bytecode of a single ABC tag in a SWF. More...

#include <AbcBlock.h>

Public Types

enum  NamespaceConstant {
  PRIVATE_NS = 0x05, CONSTANT_NS = 0x08, PACKAGE_NS = 0x16, PACKAGE_INTERNAL_NS = 0x17,
  PROTECTED_NS = 0x18, EXPLICIT_NS = 0x19, STATIC_PROTECTED_NS = 0x1A
}
 
enum  MethodConstant {
  METHOD_ARGS = 0x01, METHOD_ACTIVATION = 0x02, METHOD_MORE = 0x04, METHOD_OPTIONAL_ARGS = 0x08,
  METHOD_IGNORE = 0x10, METHOD_NATIVE = 0x20, METHOD_DEFAULT_NS = 0x40, METHOD_ARG_NAMES = 0x80
}
 
enum  InstanceConstant {
  INSTANCE_SEALED = 0x01, INSTANCE_FINAL = 0x02, INSTANCE_INTERFACE = 0x04, INSTANCE_DYNAMIC = 0x00,
  INSTANCE_PROTECTED_NS = 0x08
}
 
enum  PoolConstant {
  POOL_STRING = 0x01, POOL_INTEGER = 0x03, POOL_UINTEGER = 0x04, POOL_DOUBLE = 0x06,
  POOL_NAMESPACE = 0x08, POOL_FALSE = 0x0A, POOL_TRUE = 0x0B, POOL_NULL = 0x0C
}
 
typedef std::vector< Namespace * > NamespaceSet
 

Public Member Functions

 AbcBlock ()
 
abc::ClasslocateClass (MultiName &m)
 
abc::ClasslocateClass (const std::string &className)
 
bool read (SWFStream &in)
 
void update_global_name (unsigned int multiname_index)
 
const std::vector< abc::Class * > & scripts () const
 Scripts can contain several classes. More...
 
std::uint32_t uIntegerPoolAt (size_t i) const
 
const std::string & stringPoolAt (size_t i) const
 
std::int32_t integerPoolAt (size_t i) const
 
double doublePoolAt (size_t i) const
 
MethodmethodPoolAt (size_t i) const
 
MultiName multinamePoolAt (size_t i) const
 
abc::ClassclassPoolAt (size_t i) const
 
NamespacenamespacePoolAt (size_t i) const
 
void prepare (Machine *mach)
 

Friends

class abc::Trait
 

Detailed Description

The ActionScript bytecode of a single ABC tag in a SWF.

ABC blocks have their own "names" for all resources. In Gnash, these are a string table index. They are different from global names. These are used to locate resources inside the ABC block. ABC blocks have a set of "namespace" resources. Some namespaces are private. We make these into anonymous namespaces. We assume all non-private namespaces are public. Some are "package" namespaces; these seem to coincide with the built-in packages or 0, the global namespace.

We always search for these public namespaces by global URI in our ClassHierarchy. If we use ABC names, "flash.text" will not find the built-in flash.text namespace. Using the global name means that we 'import' the built-in namespace into our own resources. Instances / Scriptes Likewise, classes are always given a global name, not an ABC name. This is because they become globally available, including (we assume) to other ABC blocks, so using an ABC name means they cannot be located externally. Even if ABC block resources should not be available to other blocks (which seems unlikely), using an ABC name for classes risks name conflicts with the built-in classes already in a namespace: ABC names and global names can have the same index even when the names are different. Class lookup This is particularly important for locateClass (called by instantiateScript from SymbolScript tag execution). The SymbolScript tag identifies a class using a global name, which may be qualified with a namespace. If it is not qualified, we look in the global namespace 0. When we call locateClass, we use global names, not ABC names, because classes are identified by global names (see above). However, we still look only in the ABC block's namespaces. The block's first namespace is always the global namespace; other package namespaces are imported according to the block's namespace constants.

Member Typedef Documentation

§ NamespaceSet

Member Enumeration Documentation

§ InstanceConstant

Enumerator
INSTANCE_SEALED 
INSTANCE_FINAL 
INSTANCE_INTERFACE 
INSTANCE_DYNAMIC 
INSTANCE_PROTECTED_NS 

§ MethodConstant

Enumerator
METHOD_ARGS 
METHOD_ACTIVATION 
METHOD_MORE 
METHOD_OPTIONAL_ARGS 
METHOD_IGNORE 
METHOD_NATIVE 
METHOD_DEFAULT_NS 
METHOD_ARG_NAMES 

§ NamespaceConstant

Enumerator
PRIVATE_NS 
CONSTANT_NS 
PACKAGE_NS 
PACKAGE_INTERNAL_NS 
PROTECTED_NS 
EXPLICIT_NS 
STATIC_PROTECTED_NS 

§ PoolConstant

Enumerator
POOL_STRING 
POOL_INTEGER 
POOL_UINTEGER 
POOL_DOUBLE 
POOL_NAMESPACE 
POOL_FALSE 
POOL_TRUE 
POOL_NULL 

Constructor & Destructor Documentation

§ AbcBlock()

gnash::abc::AbcBlock::AbcBlock ( )

Member Function Documentation

§ classPoolAt()

abc::Class* gnash::abc::AbcBlock::classPoolAt ( size_t  i) const
inline

References gnash::key::i.

§ doublePoolAt()

double gnash::abc::AbcBlock::doublePoolAt ( size_t  i) const
inline

References gnash::key::i.

§ integerPoolAt()

std::int32_t gnash::abc::AbcBlock::integerPoolAt ( size_t  i) const
inline

References gnash::key::i.

§ locateClass() [1/2]

abc::Class * gnash::abc::AbcBlock::locateClass ( MultiName m)

References _, gnash::abc::Class::addInstanceTrait(), gnash::abc::Namespace::addScript(), gnash::abc::Class::addStaticTrait(), gnash::asException::catchAny(), gnash::abc::Namespace::dump(), gnash::string_table::find(), gnash::abc::MultiName::getABCName(), gnash::abc::Method::getBody(), gnash::abc::MultiName::getGlobalName(), gnash::abc::MultiName::getNamespace(), gnash::abc::Class::getProtectedNs(), gnash::abc::Namespace::getScript(), gnash::abc::Class::getSuper(), gnash::abc::Namespace::getURI(), gnash::abc::Class::hasProtectedNs(), gnash::key::i, INSTANCE_DYNAMIC, INSTANCE_FINAL, INSTANCE_INTERFACE, INSTANCE_PROTECTED_NS, INSTANCE_SEALED, gnash::abc::Class::isFinal(), gnash::abc::Class::isInterface(), gnash::abc::MultiName::isQName(), gnash::key::j, gnash::abc::MultiName::KIND_Multiname, gnash::abc::MultiName::KIND_MultinameA, gnash::abc::MultiName::KIND_MultinameL, gnash::abc::MultiName::KIND_MultinameLA, gnash::abc::MultiName::KIND_Qname, gnash::abc::MultiName::KIND_QnameA, gnash::abc::MultiName::KIND_RTQname, gnash::abc::MultiName::KIND_RTQnameA, gnash::abc::MultiName::KIND_RTQnameL, gnash::abc::MultiName::KIND_RTQnameLA, length, gnash::log_abc(), gnash::log_debug(), gnash::log_error(), gnash::abc::Method::maxArgumentCount(), METHOD_ACTIVATION, METHOD_ARG_NAMES, METHOD_OPTIONAL_ARGS, gnash::key::n, gnash::abc::MultiName::namespaceSet(), PACKAGE_NS, POOL_DOUBLE, POOL_FALSE, POOL_INTEGER, POOL_NAMESPACE, POOL_NULL, POOL_STRING, POOL_TRUE, POOL_UINTEGER, PRIVATE_NS, PROTECTED_NS, gnash::abc::Method::pushArgument(), gnash::abc::Class::pushInterface(), gnash::abc::Method::pushOptional(), gnash::abc::Trait::read(), gnash::SWFStream::read_d64(), gnash::SWFStream::read_string_with_length(), gnash::SWFStream::read_u16(), gnash::SWFStream::read_u8(), gnash::SWFStream::read_V32(), gnash::as_value::set_bool(), gnash::as_value::set_double(), gnash::as_value::set_null(), gnash::as_value::set_string(), gnash::abc::Trait::set_target(), gnash::abc::Method::setBody(), gnash::abc::Method::setBodyLength(), gnash::asException::setCatch(), gnash::asException::setCatchType(), gnash::abc::Class::setConstructor(), gnash::abc::Class::setDeclared(), gnash::abc::Class::setDynamic(), gnash::asException::setEnd(), gnash::abc::Class::setFinal(), gnash::abc::Class::setInherited(), gnash::abc::Class::setInterface(), gnash::abc::Method::setMaxArgumentCount(), gnash::abc::Method::setMaxRegisters(), gnash::abc::Method::setMaxScope(), gnash::abc::Method::setMaxStack(), gnash::abc::Method::setMethodID(), gnash::abc::Method::setMinArgumentCount(), gnash::asException::setName(), gnash::abc::Class::setName(), gnash::asException::setNamespace(), gnash::abc::Method::setNeedsActivation(), gnash::abc::Class::setProtectedNs(), gnash::abc::Method::setReturnType(), gnash::abc::Method::setScopeDepth(), gnash::abc::Class::setSealed(), gnash::asException::setStart(), gnash::abc::Class::setStaticConstructor(), gnash::abc::Class::setSuper(), gnash::SWFStream::skip_V32(), gnash::key::t, test::v, and gnash::string_table::value().

Referenced by gnash::abc::Trait::finalize(), gnash::abc::Trait::finalize_mbody(), gnash::abc::Machine::instantiateClass(), and locateClass().

§ locateClass() [2/2]

abc::Class * gnash::abc::AbcBlock::locateClass ( const std::string &  className)

§ methodPoolAt()

Method* gnash::abc::AbcBlock::methodPoolAt ( size_t  i) const
inline

References _methods, and gnash::key::i.

§ multinamePoolAt()

MultiName gnash::abc::AbcBlock::multinamePoolAt ( size_t  i) const
inline

References gnash::key::i.

§ namespacePoolAt()

Namespace* gnash::abc::AbcBlock::namespacePoolAt ( size_t  i) const
inline

References gnash::key::i.

§ prepare()

void gnash::abc::AbcBlock::prepare ( Machine mach)

§ read()

bool gnash::abc::AbcBlock::read ( SWFStream in)

§ scripts()

const std::vector<abc::Class*>& gnash::abc::AbcBlock::scripts ( ) const
inline

Scripts can contain several classes.

TODO: why on earth are Scripts implemented using Classes?

Referenced by gnash::abc::Machine::initMachine().

§ stringPoolAt()

const std::string& gnash::abc::AbcBlock::stringPoolAt ( size_t  i) const
inline

References gnash::key::i.

Referenced by gnash::abc::Machine::execute().

§ uIntegerPoolAt()

std::uint32_t gnash::abc::AbcBlock::uIntegerPoolAt ( size_t  i) const
inline

References gnash::key::i.

§ update_global_name()

void gnash::abc::AbcBlock::update_global_name ( unsigned int  multiname_index)

Friends And Related Function Documentation

§ abc::Trait

friend class abc::Trait
friend

The documentation for this class was generated from the following files: