mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-08 04:27:37 +00:00
Bug 868890 - Correctly generate barrier when accessing undefined properties of objects whose prototype also has the property, r=dvander.
This commit is contained in:
parent
0c06887eb0
commit
978dd1a882
@ -2420,13 +2420,16 @@ ion::PropertyReadNeedsTypeBarrier(JSContext *cx, types::TypeObject *object, Prop
|
||||
if (!TypeSetIncludes(observed, MIRType_Value, property))
|
||||
return true;
|
||||
|
||||
// Type information for global objects does not reflect the initial
|
||||
// 'undefined' value of variables declared with 'var'. Until the variable
|
||||
// is assigned a value other than undefined, a barrier is required.
|
||||
if (property->empty() && name && object->singleton && object->singleton->isNative()) {
|
||||
// Type information for singleton objects is not required to reflect the
|
||||
// initial 'undefined' value for native properties, in particular global
|
||||
// variables declared with 'var'. Until the property is assigned a value
|
||||
// other than undefined, a barrier is required.
|
||||
if (name && object->singleton && object->singleton->isNative()) {
|
||||
Shape *shape = object->singleton->nativeLookup(cx, name);
|
||||
if (shape && shape->hasDefaultGetter()) {
|
||||
JS_ASSERT(object->singleton->nativeGetSlot(shape->slot()).isUndefined());
|
||||
if (shape &&
|
||||
shape->hasDefaultGetter() &&
|
||||
object->singleton->nativeGetSlot(shape->slot()).isUndefined())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user