David Wendt
fd275bdcf3
Implement constant slots and traits.
...
Class and Function traits now generate const slots, too.
2020-07-13 17:43:33 -04:00
David Wendt
362294181f
Implement constant pool default values (index 0).
...
All constant pools in an ABC file are actually numbered starting from one; there's an implicit 0 entry not stored in the file that the runtime is expected to retrieve when pulling constants from the pool.
The AVM2/ABC spec only mentions this in passing.
2020-07-13 17:43:27 -04:00
David Wendt
e1916519dd
Add debug for trait installs
2020-07-13 17:43:26 -04:00
David Wendt
cfe0e333be
Fix invalid script index when loading an ABC file.
2020-07-13 17:43:26 -04:00
David Wendt
04879fc419
Implement class traits.
...
This allows the AVM to declare classes, which necessitated some refactoring to avoid double-borrows or having to do something "magic" that would dodge virtual properties.
2020-07-13 17:43:25 -04:00
David Wendt
ecfd5abb41
Impl `construct` and `constructprop`.
2020-07-13 17:43:24 -04:00
David Wendt
1ab4091050
Implement slots and related opcodes.
2020-07-13 17:43:24 -04:00
David Wendt
88957b2b3d
Add stub builtins for Object and Function. These are more-or-less identical to the way we did it in AVM1 (e.g. no fancy player globals file)
2020-07-13 17:43:24 -04:00
David Wendt
1945f36dc0
When running the initial script, also install it's traits onto the global scope.
2020-07-13 17:43:23 -04:00
David Wendt
35c36a807b
Always execute the last script when loading an ABC file
2020-07-13 17:43:23 -04:00
David Wendt
560900e708
ABC files are always pre-loaded.
...
Frame actions are handled as syntactic sugar on top of a `MovieClip` subclass and event handlers. ABC scripts do not live on the normal timeline.
2020-07-13 17:43:23 -04:00
David Wendt
12e9fbbffb
Impl virtual property slots
2020-07-13 17:43:22 -04:00
David Wendt
b12c6e0ff1
Implement closure scope stacks.
2020-07-13 17:43:20 -04:00
David Wendt
7d75255a1a
Add global scope which is automatically included on all new activations.
2020-07-13 17:43:20 -04:00
David Wendt
78a1c9a7e3
Implement `pushscope`, `popscope`, and `pushwith`.
2020-07-13 17:43:16 -04:00
David Wendt
5e6fc79f42
Implement `getproperty`, `setproperty`
2020-07-13 17:43:15 -04:00
David Wendt
60c16b0a60
Implement `findproperty`, `findpropstrict`, and `getlex`; which are necessary for interacting with global scope.
2020-07-13 17:43:15 -04:00
David Wendt
376d1a8ca6
Add scope support
2020-07-13 17:43:13 -04:00
David Wendt
3b476cba9e
Implement `pushnamespace` since that's a value type now
2020-07-13 17:43:13 -04:00
David Wendt
6d8dc6e63d
Pull ABC constant pool methods out of Avm2 and into Value.
...
The old methods still exist and do the same thing, but the Value methods
accept arbitrary AbcFile references.
2020-07-13 17:42:51 -04:00
David Wendt
52ac7a6583
Implement call/return for bare functions
2020-07-13 17:42:49 -04:00
David Wendt
115f0393aa
Add `call` method to the object trait. Only functions are callable in AVM2, all others error out.
2020-07-13 17:42:48 -04:00
David Wendt
d1aeae8e02
Add support for local registers in the interpreter.
2020-07-13 17:42:47 -04:00
David Wendt
4d000e1ce0
Implement `pushxyz` opcodes for all value types that we currently support.
2020-07-13 17:42:46 -04:00
David Wendt
5600ac477c
Always execute any AVM2 code that may have been queued as a result of loading ABC files.
2020-07-13 17:42:45 -04:00
David Wendt
7f60fab1e5
Add the bare minimum necessary to get opcodes out of an ABC and into an interpreter loop.
...
Surprisingly enough, the "bare minimum" includes a stack, object model, and values already.
2020-07-13 17:42:45 -04:00
David Wendt
e80c887261
Add a very basic object model to the AVM2 interpreter.
2020-07-13 17:42:44 -04:00
David Wendt
b7f257e7c8
Add a path to get from the movie clip to the Avm2.
2020-07-13 17:42:43 -04:00
David Wendt
a852a6939a
Add an extremely trivial implementation for the AVM2 interpreter state.
2020-07-13 17:42:31 -04:00