Common Lisp Package: AVM2-COMPILER

README:

FUNCTION

Private

COMPILE-LAMBDA-CONTEXT-CLEANUP

compile any code that should be after the body of the current lambda, (local functions, continuation table, etc)

PARSE-LAMBDA-LIST (LAMBDA-LIST &KEY (NORMALIZE T) (NORMALIZE-OPTIONAL NORMALIZE) (NORMALIZE-KEYWORD NORMALIZE) (NORMALIZE-AUXILARY NORMALIZE))

modified from alexandria::parse-ordinary-lambda-list, adding support for &AREST etc Parses an ordinary lambda-list, returning as multiple values: 1. Required parameters. 2. Optional parameter specifications, normalized into form (NAME INIT SUPPLIEDP) where SUPPLIEDP is NIL if not present. 3. Name of the rest parameter, or NIL. 4. Keyword parameter specifications, normalized into form ((KEYWORD-NAME NAME) INIT SUPPLIEDP) where SUPPLIEDP is NIL if not present. 5. Boolean indicating &ALLOW-OTHER-KEYS presence. 6. &AUX parameter specifications, normalized into form (NAME INIT). -- 7. &AREST parameter or nil Signals a PROGRAM-ERROR is the lambda-list is malformed.

Undocumented

3BIL-SPECIAL-OPERATOR-P (X)

ADD-CIRCULARITY-FIXUP (VALUE CODE)

ADD-CLASS-REF (NAME)

ADD-FUNCTION-REF (NAME)

ADD-SETF-EXPANSION (SYMBOL VALUE &OPTIONAL (S *SYMBOL-TABLE*))

ADD-SWF-ACCESSOR (SYMBOL SLOT-NAME &OPTIONAL (S *SYMBOL-TABLE*))

ADD-SWF-CLASS (NAME SWF-NAME &KEY NS EXTENDS IMPLEMENTS PROPERTIES CONSTRUCTOR FUNCTIONS CLASS-PROPERTIES CLASS-FUNCTIONS FLAGS)

ADD-SWF-CLASS-PROPERTY (SYMBOL SWF-NAME &OPTIONAL (S *SYMBOL-TABLE*))

ADD-SWF-CMACRO-FUNCTION (SYMBOL VALUE &OPTIONAL (S *SYMBOL-TABLE*))

ADD-SWF-MACRO-FUNCTION (SYMBOL VALUE &OPTIONAL (S *SYMBOL-TABLE*))

ADD-SWF-PROPERTY (SYMBOL SWF-NAME &OPTIONAL (S *SYMBOL-TABLE*))

ALPHA-CONVERT-NAME (SYM &OPTIONAL (PREFIX ))

ALPHATIZE-VAR-NAMES (NAMES)

ASSEMBLE-IR1 (WHOLE &OPTIONAL (WALKER-402 'ASSEMBLE-IR1))

C2 (FORM &OPTIONAL (TOP-LEVEL-NAME TOP-LEVEL))

C3 (NAME FORM)

C4 (NAME FORM)

CC (FORM)

CIRCULAR-P (VALUE)

COALESCE-LITERAL (VALUE CODE)

COERCE-TYPE

COMPILE-LITERAL (VALUE)

DSB-LL-VARS (LAMBDA-LIST)

EXPAND-LAMBDA (BLOCK-NAME LAMBDA-NAME FLAGS LAMBDA-LIST DECLARATIONS-AND-FORMS RECUR)

EXTRACT-DECLARATIONS (FORMS &KEY ALLOW-DOCSTRINGS)

FIND-LITERAL (VALUE)

FIND-SETF-EXPANSION (SYMBOL &OPTIONAL (S *SYMBOL-TABLE*))

FIND-SWF-ACCESSOR (SYMBOL &OPTIONAL (S *SYMBOL-TABLE*))

FIND-SWF-CLASS (SYMBOL &OPTIONAL (S *SYMBOL-TABLE*))

FIND-SWF-CMACRO-FUNCTION (SYMBOL &OPTIONAL (S *SYMBOL-TABLE*))

FIND-SWF-CONSTANT (SYMBOL &OPTIONAL (S *SYMBOL-TABLE*))

FIND-SWF-FUNCTION (SYMBOL &OPTIONAL (S *SYMBOL-TABLE*))

FIND-SWF-MACRO-FUNCTION (SYMBOL &OPTIONAL (S *SYMBOL-TABLE*))

FIND-SWF-METHOD (SYMBOL &OPTIONAL (S *SYMBOL-TABLE*))

FIND-SWF-PROPERTY (SYMBOL &OPTIONAL (S *SYMBOL-TABLE*))

FIND-SWF-SETF-FUNCTION (SYMBOL &OPTIONAL (S *SYMBOL-TABLE*))

FIND-SWF-STATIC-METHOD (SYMBOL &OPTIONAL (S *SYMBOL-TABLE*))

FINISH-ASSEMBLED-IR1 (FORM-807 &OPTIONAL (WALKER-808 'FINISH-ASSEMBLED-IR1))

GET-BLOCK (TAG &OPTIONAL (ENV *LEXENV*))

GET-LAMBDA-LOCAL-INDEX (NAME)

GET-TAG (TAG &OPTIONAL (ENV *LEXENV*))

IR0-MINIMAL-COMPILATION-ETC (WHOLE &OPTIONAL (WALKER-492 'IR0-MINIMAL-COMPILATION-ETC))

IR1-ADD-EXIT-POINTS (WHOLE &OPTIONAL (WALKER-83 'IR1-ADD-EXIT-POINTS))

IR1-CLOSURE-SCOPES (FORM)

IR1-COLLECT-VAR/TAG-INFO (WHOLE &OPTIONAL (WALKER-907 'IR1-COLLECT-VAR/TAG-INFO))

IR1-CONVERT-AND-EXTRACT-NESTED-ACTIVATION-SCOPES (WHOLE &OPTIONAL (WALKER-175 'IR1-CONVERT-AND-EXTRACT-NESTED-ACTIVATION-SCOPES))

IR1-EXTRACT-LAMBDAS (WHOLE &OPTIONAL (WALKER-822 'IR1-EXTRACT-LAMBDAS))

IR1-FIND-FREE-VARS (WHOLE &OPTIONAL (WALKER-362 'IR1-FIND-FREE-VARS))

IR1-FIND-NLX-TAGS (WHOLE &OPTIONAL (WALKER-569 'IR1-FIND-NLX-TAGS))

IR1-OPTIMIZE1 (WHOLE &OPTIONAL (WALKER-1047 'IR1-OPTIMIZE1))

IR1-OPTIMIZE2 (WHOLE &OPTIONAL (WALKER-1161 'IR1-OPTIMIZE2))

IR2-MARK-SPILLED-ARGS (WHOLE &OPTIONAL (WALKER-57 'IR2-MARK-SPILLED-ARGS))

LAMBDA-LIST-VARS (LLIST)

LEXENV-GET-FUNCTION-BINDING (FORM &OPTIONAL (*LEXENV* *LEXENV*))

LEXENV-GET-VARIABLE-BINDING (FORM &OPTIONAL (*LEXENV* *LEXENV*))

LITERAL-ADD (VALUE CODE)

LITERAL-REF* (VALUE)

MAKE-EXPANDED-ENVIRONMENT (&KEY VARIABLES FUNCTIONS TAGS BLOCKS)

MAKE-LAMBDA-CONTEXT (&KEY ARGS BLOCKS TAGS (PARENT *CURRENT-LAMBDA*) NAME)

MARK-ACTIVATIONS (WHOLE &OPTIONAL (WALKER-0 'MARK-ACTIVATIONS))

NULL-CL-WALKER (FORM-67 &OPTIONAL (WALKER-68 'NULL-CL-WALKER))

NULL-IR1-WALKER (WHOLE &OPTIONAL (WALKER-0 'NULL-IR1-WALKER))

PASSES (FORM PASSES)

SIMPLE-DEFAULT-P (Z)

SIMPLE-QUOTE-P (VALUE)

UPGRADED-TYPE (TYPE)

MACRO

Public

Undocumented

C3* (NAME &BODY FORMS)

Private

DECLARE-SWF-CLASS (CLASS-NAME (&OPTIONAL SUPER) &BODY _ &KEY ((SWF-NAME CLASS-SWF-NAME) NIL) CONSTANTS PROPERTIES METHODS)

declare an external class to be accessed through ffi

DEFINE-STRUCTURED-WALKER (NAME INHERIT &KEY SPECIALS LABELS FORMS FORM-VAR)

define a code walker named NAME, optionally falling back to a walker named by INHERIT on unrecognized forms. :FORMS param is list of ((symbol . args) . body) forms. when SYMBOL matches car of current form, args is a list of symbols naming properties in cdr of current form, which will be bound to accessors with symbol-macrolet, and body is evaluated with the scope of the binding of args (note keys in plist must be non-keyword symbols for this to work, since we can't use symbol-macrolet on keywords.) intent is that once usage stabilizes, structs/classes can be defined, and accessors GETF accessors can be replaces with struct/class accessors to improve performance without code changes in the walkers :FORM-VAR specifies a var to bind to the entire form while evaluating FORMS :SPECIALS is a list of symbols to declare special within the body of the walker for temp variables, etc :LABELS is a list of labels bindings the following functions are available to bodies of ATOMS and FORMS: (SUPER FORM) to pass evaluation to INHERIT for FORM (RECUR FORM) to evaluate a sub-form (RECUR-ALL FORM &key TEST) to evaluate elements of a list, optionally only evaluating elements for which TEST is true, keeping others as-is (S-LET bindings &body body) is a shortcut for binding a variable and declaring it special ;;FIXME: might be better to just defvar the specials in a progn outside the generated function? (or declaim it special)

DEFINE-WALKER (NAME INHERIT &KEY ATOMS FORMS FORM-VAR)

define a code walker named NAME, optionally falling back to a walker named by INHERIT on unrecognized forms/atoms. :ATOMS param is a TYPECASE style list of forms for processing atoms, ATOM is bound to the current atom while evaluating body of forms :FORMS param is list of ((symbol . args) . body) forms. when SYMBOL matches car of current form, args is used to destructure cdr, and body is evaluated with the scope of the binding of args :FORM-VAR specifies a var to bind to the entire form while evaluating FORMS the following functions are available to bodies of ATOMS and FORMS: (SUPER FORM) to pass evaluation to INHERIT for FORM (RECUR FORM) to evaluate a sub-form (RECUR-ALL FORM &key TEST) to evaluate elements of a list, optionally only evaluating elements for which TEST is true, keeping others as-is

SWF-FFI-DEFCONSTANT (LISP-NAME MEMBER TYPE)

declare a top level constant, for example NaN

SWF-FFI-DEFUN-FIND-PROP-STRICT (LISP-NAME MEMBER (&REST ARGS) RETURN)

declare a function in a namespace?, for example flash.sampler:getMemberNames()

Undocumented

%DEFMACRO (NAME (&REST ARGS) &BODY BODY)

DEFINE-SWF-ADD-FOO (NAME HASH-ACCESSOR)

DEFINE-SWF-FIND-FOO (NAME HASH-ACCESSORS)

WITH-BLOCK-TAG (TAG &BODY BODY)

WITH-LAMBDA-CONTEXT ((&KEY ARGS BLOCKS TAGS NAME (PARENT *CURRENT-LAMBDA*)) &BODY BODY)

WITH-LOCAL-FUNCTIONS (BINDINGS &BODY BODY)

WITH-LOCAL-MACROS (BINDINGS &BODY BODY)

WITH-LOCAL-VARS (LOCALS &BODY BODY)

WITH-SYMBOL-MACROS (SYMBOL-MACROS &BODY BODY)

WITH-TAGS (TAGS &BODY BODY)

SLOT-ACCESSOR

Private

Undocumented

%FLETS (OBJECT)

SETF%FLETS (NEW-VALUE OBJECT)

ACCESSORS (OBJECT)

SETFACCESSORS (NEW-VALUE OBJECT)

BLOCKS (OBJECT)

SETFBLOCKS (NEW-VALUE OBJECT)

CIRCULARITY-FIXUPS (OBJECT)

SETFCIRCULARITY-FIXUPS (NEW-VALUE OBJECT)

CLASS-FUNCTIONS (OBJECT)

SETFCLASS-FUNCTIONS (NEW-VALUE OBJECT)

CLASS-METHODS (OBJECT)

SETFCLASS-METHODS (NEW-VALUE OBJECT)

CLASS-NAMES (OBJECT)

SETFCLASS-NAMES (NEW-VALUE OBJECT)

CLASS-PROPERTIES (OBJECT)

SETFCLASS-PROPERTIES (NEW-VALUE OBJECT)

CLASS-STATIC-METHODS (OBJECT)

SETFCLASS-STATIC-METHODS (NEW-VALUE OBJECT)

CLASSES (OBJECT)

SETFCLASSES (NEW-VALUE OBJECT)

CMACRO-FUNCTIONS (OBJECT)

SETFCMACRO-FUNCTIONS (NEW-VALUE OBJECT)

CONSTANTS (OBJECT)

SETFCONSTANTS (NEW-VALUE OBJECT)

CONSTRUCTOR (OBJECT)

SETFCONSTRUCTOR (NEW-VALUE OBJECT)

CONTINUATION-VAR (OBJECT)

SETFCONTINUATION-VAR (NEW-VALUE OBJECT)

CONTINUATIONS (OBJECT)

SETFCONTINUATIONS (NEW-VALUE OBJECT)

EQL-LITERALS-HASH (OBJECT)

SETFEQL-LITERALS-HASH (NEW-VALUE OBJECT)

EXTENDS (OBJECT)

SETFEXTENDS (NEW-VALUE OBJECT)

FLAGS (OBJECT)

SETFFLAGS (NEW-VALUE OBJECT)

FUNCTION-NAMES (OBJECT)

SETFFUNCTION-NAMES (NEW-VALUE OBJECT)

FUNCTIONS (OBJECT)

SETFFUNCTIONS (NEW-VALUE OBJECT)

IMPLEMENTS (OBJECT)

SETFIMPLEMENTS (NEW-VALUE OBJECT)

INHERITED-SYMBOL-TABLES (OBJECT)

SETFINHERITED-SYMBOL-TABLES (NEW-VALUE OBJECT)

LITERALS-GLOBAL-NAME (OBJECT)

SETFLITERALS-GLOBAL-NAME (NEW-VALUE OBJECT)

LITERALS-HASH (OBJECT)

SETFLITERALS-HASH (NEW-VALUE OBJECT)

LITERALS-INDEX (OBJECT)

SETFLITERALS-INDEX (NEW-VALUE OBJECT)

LOAD-TOP-LEVEL (OBJECT)

SETFLOAD-TOP-LEVEL (NEW-VALUE OBJECT)

LOCAL-RETURN-VAR (OBJECT)

SETFLOCAL-RETURN-VAR (NEW-VALUE OBJECT)

LOCALS (OBJECT)

SETFLOCALS (NEW-VALUE OBJECT)

MACRO-FUNCTIONS (OBJECT)

SETFMACRO-FUNCTIONS (NEW-VALUE OBJECT)

NAME (OBJECT)

SETFNAME (NEW-VALUE OBJECT)

NS (OBJECT)

SETFNS (NEW-VALUE OBJECT)

PARENT (OBJECT)

SETFPARENT (NEW-VALUE OBJECT)

PROPERTIES (OBJECT)

SETFPROPERTIES (NEW-VALUE OBJECT)

SCRIPT-SLOTS (OBJECT)

SETFSCRIPT-SLOTS (NEW-VALUE OBJECT)

SETF-EXPANSIONS (OBJECT)

SETFSETF-EXPANSIONS (NEW-VALUE OBJECT)

SETF-FUNCTIONS (OBJECT)

SETFSETF-FUNCTIONS (NEW-VALUE OBJECT)

SWF-NAME (OBJECT)

SETFSWF-NAME (NEW-VALUE OBJECT)

TAGS (OBJECT)

SETFTAGS (NEW-VALUE OBJECT)

VARIABLES (OBJECT)

SETFVARIABLES (NEW-VALUE OBJECT)

VARIABLE

Private

*ALPHA-NAME-PREFIX*

garbage chars prepended to alphatized variable names to avoid conflicts with real variable/member/method/etc names from actionscript code

Undocumented

*ACTIVATION-LOCAL-NAME*

*CL-SYMBOL-TABLE*

*COMPILER-CONTEXT*

*CURRENT-CLOSURE-INDEX*

*CURRENT-CLOSURE-SCOPE-INDEX*

*CURRENT-CLOSURE-VARS*

*CURRENT-LAMBDA*

*CURRENT-LOCAL-INDEX*

*FUNCTION-CIRCULARITY-FIXUPS*

*FUNCTION-LITERALS*

*IR1-BLOCK-DEST-TYPE*

*IR1-CURRENT-FUN*

*IR1-DEST-TYPE*

*IR1-DUMP-ASM*

*IR1-FREE-VARS*

*IR1-FUN-INFO*

*IR1-IN-TAGBODY*

*IR1-IN-UWP*

*IR1-LAMBDAS*

*IR1-LOCAL-TAGS*

*IR1-LOCAL-VARS*

*IR1-LX-TAGS*

*IR1-NEED-ANOTHER-PASS*

*IR1-NLX-TAGS*

*IR1-PASSES*

*IR1-TAG-INFO*

*IR1-VAR-INFO*

*IR1-VERBOSE*

*IR2-CALL-STACK*

*LEXENV*

*LITERALS-LOCAL*

*LITERALS-SEEN*

*LIVE-LOCALS*

*NEW-COMPILER*

*PLAYER-SYMBOL-TABLE*

*SCOPE-LIVE-LOCALS*

*SYMBOL-TABLE*

*TOP-LEVEL-FUNCTION*

CLASS

Private

Undocumented

COMPILER-CONTEXT

LAMBDA-CONTEXT

LEXICAL-ENVIRONMENT

SYMBOL-CLASS-DATA

SYMBOL-TABLE