The test PreCompileSerialization in test-api.cc tests that ScriptData can be
serialized and deserialized to the same, but there is no check of the byte
order. However currently V8 only works on a little-endian architectures, so
it is not realy a problem, and as mentioned before the data starts with a
magic number 0xbaddead, which will be read as 0xaddead0b if there was a
byte-order mismatch.

If big-endian support should one day become possible then we should just
establish that the serialization format is the way it is written
with little-endian.

I don't understand what you mean with byte ordering changing in the future.
If the ScriptData format changes then any old data will just be invalid and
should be thrown away and new data generated. ScriptData is cachable but
there is no guarantee that it will be usable from one version of V8 to
another.

Regards,
Søren

On Tue, Jan 11, 2011 at 00:17, bradley.meck <[email protected]> wrote:

> If there is a test already in place for this, could it be made public in
> the v8 c++ api or exposed if the script-data is not used somehow? I could
> save the byte ordering on machine I guess but would be afraid of using that
> as it may change in the future.
>
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
>

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to