Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports for native formats #182

Open
zwetan opened this issue Mar 22, 2020 · 5 comments
Open

Supports for native formats #182

zwetan opened this issue Mar 22, 2020 · 5 comments
Labels
AVMGlue The Flash Platform API runtime

Comments

@zwetan
Copy link
Member

zwetan commented Mar 22, 2020

Native formats are

  • ABC: ActionScript ByteCode
  • SWF: SWF file
    • uncompressed
    • compressed ZIP
    • compressed LZMA
  • SWC: pre-compiled libraries
    • Zip file
    • catalog.xml and library.swf
@zwetan zwetan added the runtime label Mar 22, 2020
@zwetan
Copy link
Member Author

zwetan commented Mar 22, 2020

many goals

  • be able to valid the different formats
    is it a valid ABC file? is it a valid SWF file? etc.
  • when we load external files dynamically
    the AVM2 only supports SWF9+ files with AS3 bytecode
    we do not support AVM1 AS1/AS2 bytecode in SWF8 or less
  • supports libraries using .swc
    • avoid forcing dev to republish an .abc library
    • be able to extract the library.swf in-memory and load the bytecode
  • supports patching on the fly
    • be able to patch kDoAbcLazyInitializeFlag for ABC
      for now, if we load a SWF that is not made as library
      it replaces the current execution context
    • be able to load a SWF but then
      • list all the different ABC contained
      • only load some of them (eg. partial load)
        for ex: loading the SWF does not force to load all ABC in memory
      • extract the files etc.

@zwetan zwetan added the AVMGlue The Flash Platform API label Mar 22, 2020
@zwetan
Copy link
Member Author

zwetan commented Mar 22, 2020

be able to support AVMGlue API ApplicationDomain.getQualifiedDefinitionNames()

  • list all API loaded in-memory
  • be able to add anything loaded dynamically
    for ex: if we load an external SWF, then its definitions are added to the list of getQualifiedDefinitionNames()

@zwetan
Copy link
Member Author

zwetan commented Mar 22, 2020

reuse and repurpose abcdis sources

API would be like:

avmplus.abc
avmplus.abc.types
avmplus.swf
avmplus.swc
avmplus.zip

notes:
because of classname collisions between AS3 and C++ context
all classes under avmplus.xyz package are prepended by the package name in upper case eg. XYZClassName

for ex: avmplus.abc::BasicBlock becomes avmplus.abc::ABCBasicBlock etc.

@zwetan
Copy link
Member Author

zwetan commented Mar 22, 2020

general guideline:

  • we don't try to cover everything
    eg. if we only need to read a SWF we don't add API to modify/write SWF
    unless special case wher we try to patch something on the fly like kDoAbcLazyInitializeFlag
  • it is not a full blown compiler
    this will be done in another project as an external library
  • it is only for "native formats" that make sense to define in avmplus
    other formats can either be defined in shell if needed to be embedded
    or as external libraries etc.

@zwetan
Copy link
Member Author

zwetan commented Mar 22, 2020

like the other #89 AVMGlue API, we document those classes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AVMGlue The Flash Platform API runtime
Projects
None yet
Development

No branches or pull requests

1 participant