#416: M1366903 M1371283 M1368576

This commit is contained in:
Cameron Kaiser 2017-07-14 05:22:37 -07:00
parent 6958789e8f
commit baaf2ee89c
3 changed files with 34 additions and 6 deletions

View File

@ -1293,6 +1293,11 @@ IonBuilder::addOsrValueTypeBarrier(uint32_t slot, MInstruction** def_,
osrBlock->insertBefore(osrBlock->lastIns(), barrier);
osrBlock->rewriteSlot(slot, barrier);
def = barrier;
// If the TypeSet is more precise than |type|, adjust |type| for the
// code below.
if (type == MIRType_Value)
type = barrier->type();
} else if (type == MIRType_Null ||
type == MIRType_Undefined ||
type == MIRType_MagicOptimizedArguments)

View File

@ -1176,12 +1176,33 @@ ExpressionDecompiler::decompilePC(jsbytecode* pc)
write("(...)");
case JSOP_NEWARRAY:
return write("[]");
case JSOP_REGEXP:
case JSOP_OBJECT:
case JSOP_REGEXP: {
RootedObject obj(cx, script->getRegExp(GET_UINT32_INDEX(pc)));
JSString* str = obj->as<RegExpObject>().toString(cx);
if (!str)
return false;
return write(str);
}
case JSOP_NEWARRAY_COPYONWRITE: {
JSObject* obj = (op == JSOP_REGEXP)
? script->getRegExp(GET_UINT32_INDEX(pc))
: script->getObject(GET_UINT32_INDEX(pc));
RootedObject obj(cx, script->getObject(GET_UINT32_INDEX(pc)));
Handle<ArrayObject*> aobj = obj.as<ArrayObject>();
if (!write("["))
return false;
for (size_t i = 0; i < aobj->getDenseInitializedLength(); i++) {
if (i > 0 && !write(", "))
return false;
RootedValue v(cx, aobj->getDenseElement(i));
MOZ_RELEASE_ASSERT(v.isPrimitive() && !v.isMagic());
JSString* str = ValueToSource(cx, v);
if (!str || !write(str))
return false;
}
return write("]");
}
case JSOP_OBJECT: {
JSObject* obj = script->getObject(GET_UINT32_INDEX(pc));
RootedValue objv(cx, ObjectValue(*obj));
JSString* str = ValueToSource(cx, objv);
if (!str)

View File

@ -1438,7 +1438,6 @@ js::FinishCompilation(JSContext* cx, HandleScript script, CompilerConstraintList
// after any future changes to the stack type sets.
if (entry.script->hasFreezeConstraints())
continue;
entry.script->setHasFreezeConstraints();
size_t count = TypeScript::NumTypeSets(entry.script);
@ -1447,6 +1446,9 @@ js::FinishCompilation(JSContext* cx, HandleScript script, CompilerConstraintList
if (!array[i].addConstraint(cx, cx->typeLifoAlloc().new_<TypeConstraintFreezeStack>(entry.script), false))
succeeded = false;
}
if (succeeded)
entry.script->setHasFreezeConstraints();
}
if (!succeeded || types.compilerOutputs->back().pendingInvalidation()) {