Demote modulo operation with a constant non-zero right hand side (451788).

This commit is contained in:
Andreas Gal
2008-09-15 15:59:25 -07:00
parent 70c392f6d4
commit 81a9e63bad
3 changed files with 19 additions and 0 deletions

View File

@@ -86,6 +86,17 @@ js_dmod(jsdouble a, jsdouble b)
return r;
}
/*
* Note: Caller is responsible for ensuring that b is not 0, or really bad things are going to
* happen.
*/
jsint FASTCALL
js_imod(jsint a, jsint b)
{
return a % b;
}
/* The following boxing/unboxing primitives we can't emit inline because
they either interact with the GC and depend on Spidermonkey's 32-bit
integer representation. */