Turn PGO off for various functions (bug 791214, r=jandem).

This commit is contained in:
David Anderson 2012-12-07 14:01:40 -08:00
parent af314435e2
commit 51923f08a7
3 changed files with 36 additions and 0 deletions

View File

@ -417,6 +417,10 @@ js_math_min(JSContext *cx, unsigned argc, Value *vp)
return JS_TRUE; return JS_TRUE;
} }
// Disable PGO for Math.pow() and related functions (see bug 791214).
#if defined(_MSC_VER)
# pragma optimize("g", off)
#endif
double double
js::powi(double x, int y) js::powi(double x, int y)
{ {
@ -444,7 +448,14 @@ js::powi(double x, int y)
m *= m; m *= m;
} }
} }
#if defined(_MSC_VER)
# pragma optimize("", on)
#endif
// Disable PGO for Math.pow() and related functions (see bug 791214).
#if defined(_MSC_VER)
# pragma optimize("g", off)
#endif
double double
js::ecmaPow(double x, double y) js::ecmaPow(double x, double y)
{ {
@ -456,7 +467,14 @@ js::ecmaPow(double x, double y)
return js_NaN; return js_NaN;
return pow(x, y); return pow(x, y);
} }
#if defined(_MSC_VER)
# pragma optimize("", on)
#endif
// Disable PGO for Math.pow() and related functions (see bug 791214).
#if defined(_MSC_VER)
# pragma optimize("g", off)
#endif
JSBool JSBool
js_math_pow(JSContext *cx, unsigned argc, Value *vp) js_math_pow(JSContext *cx, unsigned argc, Value *vp)
{ {
@ -501,6 +519,9 @@ js_math_pow(JSContext *cx, unsigned argc, Value *vp)
vp->setNumber(z); vp->setNumber(z);
return JS_TRUE; return JS_TRUE;
} }
#if defined(_MSC_VER)
# pragma optimize("", on)
#endif
static const int64_t RNG_MULTIPLIER = 0x5DEECE66DLL; static const int64_t RNG_MULTIPLIER = 0x5DEECE66DLL;
static const int64_t RNG_ADDEND = 0xBLL; static const int64_t RNG_ADDEND = 0xBLL;

View File

@ -1329,6 +1329,9 @@ js::NumberValueToStringBuffer(JSContext *cx, const Value &v, StringBuffer &sb)
return sb.appendInflated(cstr, cstrlen); return sb.appendInflated(cstr, cstrlen);
} }
#if defined(_MSC_VER)
# pragma optimize("g", off)
#endif
JS_PUBLIC_API(bool) JS_PUBLIC_API(bool)
js::ToNumberSlow(JSContext *cx, Value v, double *out) js::ToNumberSlow(JSContext *cx, Value v, double *out)
{ {
@ -1387,6 +1390,9 @@ js::ToNumberSlow(JSContext *cx, Value v, double *out)
*out = js_NaN; *out = js_NaN;
return true; return true;
} }
#if defined(_MSC_VER)
# pragma optimize("", on)
#endif
/* /*
* Convert a value to an int64_t, according to the WebIDL rules for long long * Convert a value to an int64_t, according to the WebIDL rules for long long

View File

@ -379,6 +379,11 @@ ic::Equality(VMFrame &f, ic::EqualityICInfo *ic)
return ic->stub(f); return ic->stub(f);
} }
// Disable PGO as a precaution (see bug 791214).
#if defined(_MSC_VER)
# pragma optimize("g", off)
#endif
static void * JS_FASTCALL static void * JS_FASTCALL
SlowCallFromIC(VMFrame &f, ic::CallICInfo *ic) SlowCallFromIC(VMFrame &f, ic::CallICInfo *ic)
{ {
@ -1423,6 +1428,10 @@ ic::SplatApplyArgs(VMFrame &f)
return true; return true;
} }
#if defined(_MSC_VER)
# pragma optimize("", on)
#endif
void void
ic::GenerateArgumentCheckStub(VMFrame &f) ic::GenerateArgumentCheckStub(VMFrame &f)
{ {