22 #ifndef GNASH_ABC_BLOCK_H 23 #define GNASH_ABC_BLOCK_H 42 class ClasstHierarchy;
123 return finalize(block, _classTarget, _static);
125 return finalize_mbody(block, _methodTarget);
134 std::uint32_t _slotID;
135 std::uint32_t _typeIndex;
136 std::uint32_t _classInfoIndex;
158 inline void checkBounds(
size_t i,
const T& container)
160 if (i >= container.size()) {
161 throw std::range_error(
"Attempt to access pool out of range");
217 PACKAGE_INTERNAL_NS = 0x17,
220 STATIC_PROTECTED_NS = 0x1A
226 METHOD_ACTIVATION = 0x02,
228 METHOD_OPTIONAL_ARGS = 0x08,
229 METHOD_IGNORE = 0x10,
230 METHOD_NATIVE = 0x20,
231 METHOD_DEFAULT_NS = 0x40,
232 METHOD_ARG_NAMES = 0x80
237 INSTANCE_SEALED = 0x01,
238 INSTANCE_FINAL = 0x02,
239 INSTANCE_INTERFACE = 0x04,
240 INSTANCE_DYNAMIC = 0x00,
241 INSTANCE_PROTECTED_NS = 0x08
248 POOL_UINTEGER = 0x04,
250 POOL_NAMESPACE = 0x08,
262 abc::Class* locateClass(
const std::string& className);
266 void update_global_name(
unsigned int multiname_index);
271 const std::vector<abc::Class*>&
scripts()
const {
276 checkBounds(i, _uIntegerPool);
277 return _uIntegerPool[
i];
281 checkBounds(i, _stringPool);
282 return _stringPool[
i];
286 checkBounds(i, _integerPool);
287 return _integerPool[
i];
291 checkBounds(i, _doublePool);
292 return _doublePool[
i];
301 checkBounds(i, _multinamePool);
302 return _multinamePool[
i];
306 checkBounds(i, _classes);
311 checkBounds(i, _namespacePool);
312 return _namespacePool[
i];
324 bool read_integer_constants();
325 bool read_unsigned_integer_constants();
326 bool read_double_constants();
327 bool read_string_constants();
328 bool read_namespaces();
329 bool read_namespace_sets();
330 bool read_multinames();
331 bool read_method_infos();
332 bool skip_metadata();
333 bool read_instances();
336 bool read_method_bodies();
338 void check_multiname_name(std::uint32_t
name);
340 void check_multiname_namespace(std::uint32_t ns);
342 void check_multiname_namespaceset(std::uint32_t nsset);
348 std::vector<std::int32_t> _integerPool;
349 std::vector<std::uint32_t> _uIntegerPool;
350 std::vector<double> _doublePool;
351 std::vector<std::string> _stringPool;
352 std::vector<Namespace*> _namespacePool;
353 std::vector<NamespaceSet> _namespaceSetPool;
355 std::vector<MultiName> _multinamePool;
356 std::vector<Class*> _classes;
357 std::vector<Class*> _scripts;
365 std::uint32_t mVersion;
Trait()
Definition: AbcBlock.h:86
std::ostream & operator<<(std::ostream &o, const Trait::Kind k)
Output stream operator for abc::Trait::Kind.
Definition: AbcBlock.cpp:289
InstanceConstant
Definition: AbcBlock.h:235
size_t URI
This type should always be used for the index of AbcBlocks' names.
Definition: MultiName.h:42
std::int32_t integerPoolAt(size_t i) const
Definition: AbcBlock.h:285
NamespaceConstant
Definition: AbcBlock.h:212
abc::Class * classPoolAt(size_t i) const
Definition: AbcBlock.h:305
The ActionScript bytecode of a single ABC tag in a SWF.
Definition: AbcBlock.h:208
Class describing a static property.
Definition: AbcBlock.h:71
void set_target(Method *m)
Definition: AbcBlock.h:115
Kind
Definition: AbcBlock.h:75
PoolConstant
Definition: AbcBlock.h:244
std::map< NPIdentifier, NPInvokeFunctionPtr > _methods
Definition: gshell.cpp:402
ActionScript value type.
Definition: as_value.h:94
void set_target(abc::Class *cl, bool do_static)
Definition: AbcBlock.h:110
Method * methodPoolAt(size_t i) const
Definition: AbcBlock.h:295
std::uint32_t uIntegerPoolAt(size_t i) const
Definition: AbcBlock.h:275
std::vector< Namespace * > NamespaceSet
Definition: AbcBlock.h:256
Definition: GnashKey.h:157
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
type
Definition: GnashKey.h:329
Represent an ActionScript Namespace.
Definition: Namespace.h:48
Definition: GnashKey.h:149
double doublePoolAt(size_t i) const
Definition: AbcBlock.h:290
Definition: GnashKey.h:161
const std::string & stringPoolAt(size_t i) const
Definition: AbcBlock.h:280
Register all of the ActionScript classes, with their dependencies.
Definition: ClassHierarchy.h:40
A general use string table.
Definition: string_table.h:41
Definition: GnashKey.h:160
Namespace * namespacePoolAt(size_t i) const
Definition: AbcBlock.h:310
A class to represent AS3 Classes.
Definition: Class.h:75
MultiName multinamePoolAt(size_t i) const
Definition: AbcBlock.h:300
The virtual machine for executing ABC (ActionScript Bytecode).
Definition: Machine.h:73
Definition: GnashKey.h:132
Definition: GnashKey.h:155
bool finalize(AbcBlock *block)
Definition: AbcBlock.h:120
An MultiName represents a single ABC multiname.
Definition: MultiName.h:51
Definition: GnashKey.h:159
const std::vector< abc::Class * > & scripts() const
Scripts can contain several classes.
Definition: AbcBlock.h:271
std::size_t key
Definition: string_table.h:83
std::string name
Definition: LocalConnection_as.cpp:149
SWF stream wrapper class.
Definition: SWFStream.h:58
MethodConstant
Definition: AbcBlock.h:223