wondering why people keep talking about V8 engines, monkeys and rhinos,
|Name||Type||Garbage Collection||Security||Implemented In|
|Rhino||Compiler and interpreter||Java runtime||SecuritySupport interface, domain-based||Java|
|SpiderMonkey||Compiler and interpreter||Mark-and-Sweep, non-conservative (exact) collector||Java principals security model||C|
|V8||Virtual machine||Generational stop-the-world collector||Context-based, with security tokens||C++|
Rhino and SpiderMonkey can run as compilers or interpreters. They parse
intermediate parser -- it generates assembler. This makes it sound more
like a compiler than anything, but it does include a runtime environment
of its own.
SpiderMonkey works by recursively searching all properties of all
objects in the current scope and deallocating any without references. V8
stops execution to reclaim memory, but it only usually processes part of
the heap to reduce the impact of stopping the program. The disadvantage
of V8's approach is that it has to stop the program -- imagine a
However, because it's simple, it's also fast.
SpiderMonkey 1.8.1 has a just-in-time compiler that can convert bytecode
into machine code to improve performance. This was contributed by Adobe
and now co-maintained by Mozilla. The JIT watches for commonly executed
code and attempts to optimise the equivalent native code. The Tracing
page on Mozilla's site has more details.
This is one of the reasons that recent performance graphs show Mozilla's
compiling straight into native code.