Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

When using Google Chrome mobile (or any other android web browser) is the Javascript VM running on top of the Java VM? Or is the JS code compiled to Java bytecode?

I ask this because JS seems to run obnoxiously slower on Android using Google Chrome vs a PC. Granted a PC is much faster, but I have a Galaxy S3 which should be on par with a 2yr old netbook right?

share|improve this question
1  
Not sure why this was closed. I'd think a question about the performance would be on-topic. Certainly it's not obviously off-topic. –  Al E. Jan 18 '13 at 14:37
    
I agree, and I don't think this question is unanswerable, per the close reason. The main questions (Is the Javascript VM running on top of the Java VM? Or is the JS code compiled to Java bytecode?) do have a specific answer that can be answered with sufficient research. –  Lie Ryan Jan 18 '13 at 14:53
add comment

1 Answer 1

up vote 3 down vote accepted

The Javascript engine in Android's Browser/WebView can be either JavaScriptCore (lower end phones) or V8 (higher end phones). Chrome also uses V8. Both engines are written in C++.

Javascript is never compiled to Java bytecode, instead it is interpreted and/or JIT compiled into ARM bytecode.

My guess on why V8 on PC is much faster than V8 on Android is probably because JIT compilation to x86 is more mature than JIT compilation to ARM.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.