| IMPORTANT: The content of this page is outdated. Reason: V8 has been replaced by V4. Also, qtjsbackend no longer exists.|
If you have checked or updated this page and found the content to be suitable, please remove this notice.
To allow creation of snapshots for architectures other than the host (say an arm snapshot on i386), V8 has CPU simulators.
The procedure for snapshot creation is this:
- Create mksnapshot. This is essentially compiling the V8 code with the appropriate CPU emulator (i386/arm/mips) and using mksnapshot.cpp for the main(). The mksnapshot binary when run creates a snapshot.cc file. Note mksnapshot has to run on the host, which essentially means we are compiling using the host tool chain.
- Copy over the snapshot.cc generated above into src/ and let V8 use that as the snapshot.
- Compile V8 again but now with the target toolchain.
- The CPU simulator can simulate any configuration and needs to know what the target machine is like. So, it needs to know if it has VFP3, floating point eabi to name two. When cross-compiling, we can figure this automatically.
Current state in qtjsbackend
- Snapshots are disabled when cross compiling
- When not cross compiling, user can still pass -arch to configure! (i.e no -xplatform set). This -arch is the hint to qtjsbackend as to which simulator to use to create the snapshot. configure currently allows snapshots only for i386 host and arm (-arch arm) target. I beleive the only purpose of this feature is to be able to help in code generation debugging (http://code.google.com/p/v8/wiki/ARMDebuggingWithTheSimulator).
- When not-cross compiling and no -arch passed, all builds have snapshot support as long as you are not inside arm scratchbox env.
- The simulator is always setup to use hardfloat and VFP3. Because of the logic in the pri files, we end up passing these arguments to v8 even when cross compiling i.e even when no simulator is in use and snapshotting is disabled. This is the core issue that needs to be fixed, since currently, during cross compiling qtjsbackend ends up assuming a ARMv7 target