Bug 718541 - Work around an MSVC compiler bug with inlining JSObject::nativeLookup. r=Waldo

--HG--
extra : rebase_source : 15e0e90a4c525b40253d38ed5c6c9b6b7d299891
This commit is contained in:
Siddharth Agarwal 2012-01-26 21:47:10 +05:30
parent 537142c830
commit 5101b91ac2
2 changed files with 14 additions and 8 deletions

View File

@ -4074,6 +4074,20 @@ JSObject::setSlotSpan(JSContext *cx, uint32_t span)
return true;
}
#if defined(_MSC_VER) && _MSC_VER >= 1500
/* Work around a compiler bug in MSVC9 and above, where inlining this function
causes stack pointer offsets to go awry and spp to refer to something higher
up the stack. */
MOZ_NEVER_INLINE
#endif
const js::Shape *
JSObject::nativeLookup(JSContext *cx, jsid id)
{
JS_ASSERT(isNative());
js::Shape **spp;
return js::Shape::search(cx, lastProperty(), id, &spp);
}
bool
JSObject::growSlots(JSContext *cx, uint32_t oldCount, uint32_t newCount)
{

View File

@ -1154,14 +1154,6 @@ JSObject::isNative() const
return lastProperty()->isNative();
}
inline const js::Shape *
JSObject::nativeLookup(JSContext *cx, jsid id)
{
JS_ASSERT(isNative());
js::Shape **spp;
return js::Shape::search(cx, lastProperty(), id, &spp);
}
inline bool
JSObject::nativeContains(JSContext *cx, jsid id)
{