Bug 819635 - Dont add setprop-add stub when adding setprop-set stub in ion ICs. r=mjrosenb

This commit is contained in:
Kannan Vijayan 2012-12-18 14:29:04 -05:00
parent faef85a350
commit cd2716cd49

View File

@ -1359,12 +1359,14 @@ js::ion::SetPropertyCache(JSContext *cx, size_t cacheIndex, HandleObject obj, Ha
RootedObject holder(cx);
bool inlinable = IsPropertyInlineable(obj, cache);
bool addedSetterStub = false;
if (inlinable) {
RootedShape shape(cx);
if (IsPropertySetInlineable(cx, obj, id, &shape)) {
cache.incrementStubCount();
if (!cache.attachNativeExisting(cx, ion, obj, shape))
return false;
addedSetterStub = true;
} else {
RootedObject holder(cx);
if (!JSObject::lookupProperty(cx, obj, name, &holder, &shape))
@ -1374,6 +1376,7 @@ js::ion::SetPropertyCache(JSContext *cx, size_t cacheIndex, HandleObject obj, Ha
cache.incrementStubCount();
if (!cache.attachSetterCall(cx, ion, obj, holder, shape, returnAddr))
return false;
addedSetterStub = true;
}
}
}
@ -1387,7 +1390,7 @@ js::ion::SetPropertyCache(JSContext *cx, size_t cacheIndex, HandleObject obj, Ha
// The property did not exists before, now we can try again to inline the
// procedure which is adding the property.
if (inlinable && IsPropertyAddInlineable(cx, obj, id, oldSlots, &shape)) {
if (inlinable && !addedSetterStub && IsPropertyAddInlineable(cx, obj, id, oldSlots, &shape)) {
RootedShape newShape(cx, obj->lastProperty());
cache.incrementStubCount();
if (!cache.attachNativeAdding(cx, ion, obj, oldShape, newShape, shape))