What are the differences between Firefox's Javascript engine and Chrome's V8?

Spry Mickael picture Spry Mickael · Apr 1, 2012 · Viewed 8k times · Source

I have found in some articles saying that FF's Javascript engine partially adopt Chrome's V8 feature ,or even some sourcecode are from V8! If so,can I say that replacing the Javascript engine in Firefox with Chrome's V8 is just easy as pie? If not,what's the difference?

Answer

Boris Zbarsky picture Boris Zbarsky · Apr 2, 2012

The only V8 source code that Firefox uses is things that were factored out into separate libraries (e.g. some of the numeric conversion code), as far as I know.

The reasons to not adopt V8 wholesale are that it has certain bugs that SpiderMonkey (the JS engine in Firefox) doesn't have, is missing some features that SpiderMonkey has, and Firefox would not be able to introduce new features for JS until the V8 folks got around to it.