Skip to content

Commit

Permalink
fix for #2313 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Jan 23, 2023
1 parent a03879c commit b36a670
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README_JIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ jit()==42
function jit() {"jit";a.c();}
jit(); // prints 'hello {b:42,...}'
a=Uint8Array([42])
function jit(){"jit";var i=0;return a[i];}
jit()==42
function jit(a,b) {'jit';return a+"Hello world"+b;}
jit(1,2)=="1Hello world2"
Expand Down Expand Up @@ -228,7 +232,7 @@ t=getTime();function jit() {"jit";
digitalWrite(LED,0);
print("Stop");
}
};print("JIT compile time", getTime()-t)
};print("JIT compile time", getTime()-t,"s")
```

Run JIT on ARM and then disassemble:
Expand Down
2 changes: 1 addition & 1 deletion src/jsjit.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ bool jsjFactorMember() {
JSP_ASSERT_MATCH('[');
jsjAssignmentExpression();
if (jit.phase == JSJP_EMIT) {
jsjPopAsVar(0);
jsjPopNoName(0);
jsjcCall(jsvAsArrayIndexAndUnLock);
}
JSP_MATCH_WITH_RETURN(']', false); // if we fail we're stopping compilation anyway
Expand Down

0 comments on commit b36a670

Please sign in to comment.