Another idea would be to compile this code on the server side as part of the build process. Then we don't care how fast the browsers are: they only see pure JavaScript. This brings up an interesting point: when doing C optimizations a pretty typical thing to do is to unroll loops and inline functions. Would this help any with JavaScript, given that loading time is fairly expensive compared to a local binary executable? Would be interesting to test this.
JavaScript compilers (in the sense of Java->JavaScript, not V8/TraceMonkey) already do this. Surprisingly inlining can help quite a bit in JS; due to how JS is "specified", there is extremely little room for interpreters to perform optimizations. Inlining code can save browsers from having to do lots of lookups and dereferences to functions in tight loops.
Scheme2JS, ocamljs, haxe, and others all do inlining. The code size gets a little bit larger, but if you have actual performance problems in loops, it can be worth it. Minify-ing and zip usually make JS code sizes trivial anyway.