I've found the definition of the several '*_count' fields in
'constant_pool' surprising/confusing. Therefore I wanted to check some
compilers to see how others interpret the specification.
Testing the java compiler from flex sdk on the 'hello world' example
described at
http://developer.mozilla.org/en/docs/Tamarin_Build_Documentation#Compiling_and_running_applications
I found out that the when there are no ints or uints the corresponding
fields are
set to 0s. However there are 4 utf-8 strings and the string_count is set to 5.
The esc from the tamarin repository is more consistent. It sets the
counts to 1 when there are no items in the array.
Might I suggest amending the document to clear the definition a bit?
The description seems to be clear but the C-like structure suggests a
different interpretation.
cpool_info
{
u30 int_count
s32 integer[int_count]
u30 uint_count
u32 uinteger[uint_count]
u30 double_count
d64 double[double_count]
u30 string_count
string_info string[string_count]
u30 namespace_count
namespace_info namespace[namespace_count]
u30 ns_set_count
ns_set_info ns_set[ns_set_count]
u30 multiname_count
multiname_info multiname[multiname_count]
}
I believe that using "s32 integer[int_count-1]" would better represent
the fact that there is one less field in the array than the count
suggests. I believe the structure attempts to represent the *file*
structure in C-like syntax and not the actual in-memory structure that
is supposed to be built from the file. Is it not so?
Zbynek Winkler
http://wiki.mozilla.org/index.php?title=Tamarin::AVM2_Overview_Errata&ac
tion=edit
Ed
Hello!
Zbynek Winkler
--
http://robotika.cz/
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-js-engine