Tamarin::AVM2 Overview Errata

From MozillaWiki
Jump to: navigation, search

Possible errata for the AVM2 Overview.

  • On page 15, "Registers 1 through method_info.param_count holds parameter values coerced to the declared types of the parameters. If fewer than method_body_info.local_count values are supplied to the call then the remaining values are either the values provided by default value declarations (optional arguments) or the value undefined."

That may be technically correct, but "If fewer than method_info.param_count values are supplied" reads better with "The rest of registers are initialized to the value undefined" added after NEED_REST and NEED_ARGUMENTS clauses.

  • On page 20 (section 4.3), the definition of the various '*_count' fields in the constants pool is not clear enough. The cpool_info structure appears to be a C-like syntax where the expression "s32 integer[int_count]" means array with int_count items. Using "s32 integer[int_count-1]" instead would better describe the actual file layout in question. [1]
  • On page 25, "The number of optional parameters is given by option_count, which must not be zero nor greater than the parameter_count field of the enclosing method_info structure" should read param_count.
  • On page 26, metadata_info is incorrect. It should be:
metadata_info {
    u30 name
    u30 item_count
    u30 keys[item_count]
    u30 values[item_count]
}
  • On page 34 (section 4.12), exc_type and var_name are actually indices into the multiname array instead of string.
  • On page 66, instruction name is greaterequals but format, forms, and description are those of greaterthan'.

Suggestions.

  • Multiname as both a kind of thing and a specific thing of that kind is confusing. Now that NameL(A?) are ditched, we could try and clear up some confusion there.
  • ASC doesn't do well with early binding. Namespaces in Multinames, to a user new to AVM2, may look like early binding, but are actually "trial and error" for late binding.