Demote modulo operations to integer if both args are int (456934, r=brendan).
This commit is contained in:
@@ -86,15 +86,13 @@ 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;
|
||||
if (a < 0 || b <= 0)
|
||||
return -1;
|
||||
int r = a % b;
|
||||
return r;
|
||||
}
|
||||
|
||||
/* The following boxing/unboxing primitives we can't emit inline because
|
||||
|
||||
Reference in New Issue
Block a user