The language doesn't really matter, only what it has access to - anything that can be written in one language can also be written in another language - hell most languages have implementation of interpreters for other languages!
Have a look at http://bellard.org/jslinux/ which can run x86 binaries in javascript. The APIs and what can actually be done by the code are the main security issue, for example that x86 emulator doesn't have access to your local disk because the javascript interpreter in most browsers doesn't provide APIs for it.
The advantage of using javascript for it is that most platforms have a web browser so if something is written using HTML5/javascript then in theory it works everywhere by default, you can then check for what additional functionality the browser provides for enabling additional features such as saving files locally etc.
Regarding performance, normally javascript performance is perfectly acceptable on modern browsers/devices, the only slow part is doing DOM updates to update the GUI, but any devices where they expect apps to be written in javascript will provide high performance drawing interfaces (HTML5 canvas for example) for any heavy GUI work, so most of the graphics processing will be handled by hardware with the same performance as a native app.