You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • After the first 4 values, they get put on the stack and you have to copy them off. But first you have to save the value of any registers above r3 that you might overwrite!

    It's all getting quite complicated by that point.

    Accessing the JsVars from assembler is going to be really difficult too I'm afraid - I wouldn't advise it. For now it's probably best just to call with:

    for(var i in a) adder(a[i]);
    

    Annoyingly map and forEach don't work on Typed Arrays. I'm quite tempted to add support though :/

    EDIT: It's been pointed out to me that you can re-purpose the existing map function:

    [].forEach.call(a, adder);
    

    This won't work in 1v60, but I've just fixed map/forEach so that they will work on the latest build (or when 1v61 comes out). Note that map will create an old-style array from the result, so you'll run out of memory pretty quickly. forEach is fine though.

About

Avatar for Gordon @Gordon started