Bug 845841 - Don't inline object element read if the value may be a string. r=bhackett

This commit is contained in:
Jan de Mooij 2013-02-28 09:40:17 +01:00
parent 15c976f003
commit 6c55b391b3

View File

@ -298,6 +298,9 @@ TypeInferenceOracle::elementReadIsDenseNative(RawScript script, jsbytecode *pc)
if (idType != JSVAL_TYPE_INT32 && idType != JSVAL_TYPE_DOUBLE)
return false;
if (obj->hasType(types::Type::StringType()))
return false;
Class *clasp = obj->getKnownClass();
return clasp && clasp->isNative();
}
@ -313,6 +316,9 @@ TypeInferenceOracle::elementReadIsTypedArray(RawScript script, jsbytecode *pc, i
if (idType != JSVAL_TYPE_INT32 && idType != JSVAL_TYPE_DOUBLE)
return false;
if (obj->hasType(types::Type::StringType()))
return false;
*arrayType = obj->getTypedArrayType();
if (*arrayType == TypedArray::TYPE_MAX)
return false;