[INFER] Move inference methods out of JSContext, bug 657412.

This commit is contained in:
Brian Hackett
2011-06-02 10:40:27 -07:00
parent e7c78c3859
commit 0effc78aae
38 changed files with 956 additions and 854 deletions

View File

@@ -1455,7 +1455,7 @@ date_getYear(JSContext *cx, uintN argc, Value *vp)
} else {
*vp = yearVal;
if (!vp->isInt32())
cx->markTypeCallerOverflow();
MarkTypeCallerOverflow(cx);
}
return true;
@@ -1473,7 +1473,7 @@ date_getFullYear(JSContext *cx, uintN argc, Value *vp)
*vp = obj->getSlot(JSObject::JSSLOT_DATE_LOCAL_YEAR);
if (!vp->isInt32())
cx->markTypeCallerOverflow();
MarkTypeCallerOverflow(cx);
return JS_TRUE;
}
@@ -1487,7 +1487,7 @@ date_getUTCFullYear(JSContext *cx, uintN argc, Value *vp)
if (JSDOUBLE_IS_FINITE(result))
result = YearFromTime(result);
else
cx->markTypeCallerOverflow();
MarkTypeCallerOverflow(cx);
vp->setNumber(result);
return true;
@@ -1505,7 +1505,7 @@ date_getMonth(JSContext *cx, uintN argc, Value *vp)
*vp = obj->getSlot(JSObject::JSSLOT_DATE_LOCAL_MONTH);
if (!vp->isInt32())
cx->markTypeCallerOverflow();
MarkTypeCallerOverflow(cx);
return true;
}
@@ -1519,7 +1519,7 @@ date_getUTCMonth(JSContext *cx, uintN argc, Value *vp)
if (JSDOUBLE_IS_FINITE(result))
result = MonthFromTime(result);
else
cx->markTypeCallerOverflow();
MarkTypeCallerOverflow(cx);
vp->setNumber(result);
return true;
@@ -1537,7 +1537,7 @@ date_getDate(JSContext *cx, uintN argc, Value *vp)
*vp = obj->getSlot(JSObject::JSSLOT_DATE_LOCAL_DATE);
if (!vp->isInt32())
cx->markTypeCallerOverflow();
MarkTypeCallerOverflow(cx);
return true;
}
@@ -1551,7 +1551,7 @@ date_getUTCDate(JSContext *cx, uintN argc, Value *vp)
if (JSDOUBLE_IS_FINITE(result))
result = DateFromTime(result);
else
cx->markTypeCallerOverflow();
MarkTypeCallerOverflow(cx);
vp->setNumber(result);
return true;
@@ -1569,7 +1569,7 @@ date_getDay(JSContext *cx, uintN argc, Value *vp)
*vp = obj->getSlot(JSObject::JSSLOT_DATE_LOCAL_DAY);
if (!vp->isInt32())
cx->markTypeCallerOverflow();
MarkTypeCallerOverflow(cx);
return true;
}
@@ -1583,7 +1583,7 @@ date_getUTCDay(JSContext *cx, uintN argc, Value *vp)
if (JSDOUBLE_IS_FINITE(result))
result = WeekDay(result);
else
cx->markTypeCallerOverflow();
MarkTypeCallerOverflow(cx);
vp->setNumber(result);
return true;
@@ -1601,7 +1601,7 @@ date_getHours(JSContext *cx, uintN argc, Value *vp)
*vp = obj->getSlot(JSObject::JSSLOT_DATE_LOCAL_HOURS);
if (!vp->isInt32())
cx->markTypeCallerOverflow();
MarkTypeCallerOverflow(cx);
return true;
}
@@ -1615,7 +1615,7 @@ date_getUTCHours(JSContext *cx, uintN argc, Value *vp)
if (JSDOUBLE_IS_FINITE(result))
result = HourFromTime(result);
else
cx->markTypeCallerOverflow();
MarkTypeCallerOverflow(cx);
vp->setNumber(result);
return JS_TRUE;
@@ -1633,7 +1633,7 @@ date_getMinutes(JSContext *cx, uintN argc, Value *vp)
*vp = obj->getSlot(JSObject::JSSLOT_DATE_LOCAL_MINUTES);
if (!vp->isInt32())
cx->markTypeCallerOverflow();
MarkTypeCallerOverflow(cx);
return true;
}
@@ -1647,7 +1647,7 @@ date_getUTCMinutes(JSContext *cx, uintN argc, Value *vp)
if (JSDOUBLE_IS_FINITE(result))
result = MinFromTime(result);
else
cx->markTypeCallerOverflow();
MarkTypeCallerOverflow(cx);
vp->setNumber(result);
return true;
@@ -1667,7 +1667,7 @@ date_getUTCSeconds(JSContext *cx, uintN argc, Value *vp)
*vp = obj->getSlot(JSObject::JSSLOT_DATE_LOCAL_SECONDS);
if (!vp->isInt32())
cx->markTypeCallerOverflow();
MarkTypeCallerOverflow(cx);
return true;
}
@@ -1683,7 +1683,7 @@ date_getUTCMilliseconds(JSContext *cx, uintN argc, Value *vp)
if (JSDOUBLE_IS_FINITE(result))
result = msFromTime(result);
else
cx->markTypeCallerOverflow();
MarkTypeCallerOverflow(cx);
vp->setNumber(result);
return true;
@@ -1711,7 +1711,7 @@ date_getTimezoneOffset(JSContext *cx, uintN argc, Value *vp)
*/
jsdouble result = (utctime - localtime) / msPerMinute;
if (!JSDOUBLE_IS_FINITE(result))
cx->markTypeCallerOverflow();
MarkTypeCallerOverflow(cx);
vp->setNumber(result);
return true;