зеркало из https://github.com/mozilla/gecko-dev.git
Bug 799818 part 1 - Ensure return type before optimizing getelem for strings. r=jandem
This commit is contained in:
Родитель
1847a73fea
Коммит
55ea96ff64
|
@ -5054,6 +5054,9 @@ IonBuilder::jsop_getelem_string()
|
|||
MStringLength *length = MStringLength::New(str);
|
||||
current->add(length);
|
||||
|
||||
// This will cause an invalidation of this script once the 'undefined' type
|
||||
// is monitored by the interpreter.
|
||||
JS_ASSERT(oracle->propertyRead(script_, pc)->getKnownTypeTag() == JSVAL_TYPE_STRING);
|
||||
id = addBoundsCheck(id, length);
|
||||
|
||||
MCharCodeAt *charCode = MCharCodeAt::New(str, id);
|
||||
|
|
|
@ -357,8 +357,11 @@ TypeInferenceOracle::elementReadIsString(JSScript *script, jsbytecode *pc)
|
|||
if (id->getKnownTypeTag() != JSVAL_TYPE_INT32)
|
||||
return false;
|
||||
|
||||
types::TypeSet *pushed = script->analysis()->pushedTypes(pc, 0);
|
||||
if (!pushed->hasType(types::Type::StringType()))
|
||||
// This function is used for jsop_getelem_string which should return
|
||||
// undefined if this is out-side the string bounds. Currently we just
|
||||
// fallback to a CallGetElement.
|
||||
StackTypeSet *pushed = script->analysis()->pushedTypes(pc, 0);
|
||||
if (pushed->getKnownTypeTag() != JSVAL_TYPE_STRING)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
Загрузка…
Ссылка в новой задаче