mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 13:56:29 +00:00
Bug 949475 - Remove JOF_TYPESET from initializer ops. r=bhackett
This commit is contained in:
parent
4b2523106b
commit
da3a4828db
@ -972,8 +972,7 @@ IonBuilder::initScopeChain(MDefinition *callee)
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
scope = MConstant::New(alloc(), ObjectValue(script()->global()));
|
||||
current->add(scope);
|
||||
scope = constant(ObjectValue(script()->global()));
|
||||
}
|
||||
|
||||
current->setScopeChain(scope);
|
||||
@ -3597,9 +3596,7 @@ IonBuilder::processThrow()
|
||||
bool
|
||||
IonBuilder::pushConstant(const Value &v)
|
||||
{
|
||||
MConstant *ins = MConstant::New(alloc(), v);
|
||||
current->add(ins);
|
||||
current->push(ins);
|
||||
current->push(constant(v));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -4197,8 +4194,7 @@ IonBuilder::inlineCallsite(ObjectVector &targets, ObjectVector &originals,
|
||||
// constant.
|
||||
if (!lambda) {
|
||||
// Replace the function with an MConstant.
|
||||
MConstant *constFun = MConstant::New(alloc(), ObjectValue(*target));
|
||||
current->add(constFun);
|
||||
MConstant *constFun = constant(ObjectValue(*target));
|
||||
callInfo.setFun(constFun);
|
||||
}
|
||||
|
||||
@ -4440,7 +4436,7 @@ IonBuilder::inlineCalls(CallInfo &callInfo, ObjectVector &targets,
|
||||
return false;
|
||||
|
||||
// Create a function MConstant to use in the entry ResumePoint.
|
||||
MConstant *funcDef = MConstant::New(alloc(), ObjectValue(*target));
|
||||
MConstant *funcDef = MConstant::New(alloc(), ObjectValue(*target), constraints());
|
||||
funcDef->setFoldedUnchecked();
|
||||
dispatchBlock->add(funcDef);
|
||||
|
||||
@ -4726,7 +4722,7 @@ IonBuilder::createThisScriptedSingleton(JSFunction *target, MDefinition *callee)
|
||||
// Generate an inline path to create a new |this| object with
|
||||
// the given singleton prototype.
|
||||
MCreateThisWithTemplate *createThis =
|
||||
MCreateThisWithTemplate::New(alloc(), templateObject,
|
||||
MCreateThisWithTemplate::New(alloc(), constraints(), templateObject,
|
||||
templateObject->type()->initialHeap(constraints()));
|
||||
current->add(createThis);
|
||||
|
||||
@ -5066,10 +5062,8 @@ IonBuilder::makeCallsiteClone(JSFunction *target, MDefinition *fun)
|
||||
// function, which means that target already is the clone. Make sure to ensure
|
||||
// that the old definition remains in resume points.
|
||||
if (target) {
|
||||
MConstant *constant = MConstant::New(alloc(), ObjectValue(*target));
|
||||
current->add(constant);
|
||||
fun->setFoldedUnchecked();
|
||||
return constant;
|
||||
return constant(ObjectValue(*target));
|
||||
}
|
||||
|
||||
// Add a callsite clone IC if we have multiple targets. Note that we
|
||||
@ -5419,18 +5413,16 @@ IonBuilder::jsop_newarray(uint32_t count)
|
||||
return abort("New array has unknown properties");
|
||||
}
|
||||
|
||||
types::TemporaryTypeSet::DoubleConversion conversion =
|
||||
bytecodeTypes(pc)->convertDoubleElements(constraints());
|
||||
if (conversion == types::TemporaryTypeSet::AlwaysConvertToDoubles)
|
||||
templateObject->setShouldConvertDoubleElements();
|
||||
|
||||
MNewArray *ins = MNewArray::New(alloc(), count, templateObject,
|
||||
MNewArray *ins = MNewArray::New(alloc(), constraints(), count, templateObject,
|
||||
templateObject->type()->initialHeap(constraints()),
|
||||
MNewArray::NewArray_Allocating);
|
||||
|
||||
current->add(ins);
|
||||
current->push(ins);
|
||||
|
||||
types::TemporaryTypeSet::DoubleConversion conversion =
|
||||
ins->resultTypeSet()->convertDoubleElements(constraints());
|
||||
if (conversion == types::TemporaryTypeSet::AlwaysConvertToDoubles)
|
||||
templateObject->setShouldConvertDoubleElements();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -5445,7 +5437,7 @@ IonBuilder::jsop_newobject()
|
||||
return abort("No template object for NEWOBJECT");
|
||||
|
||||
JS_ASSERT(templateObject->is<JSObject>());
|
||||
MNewObject *ins = MNewObject::New(alloc(), templateObject,
|
||||
MNewObject *ins = MNewObject::New(alloc(), constraints(), templateObject,
|
||||
templateObject->hasSingletonType()
|
||||
? gc::TenuredHeap
|
||||
: templateObject->type()->initialHeap(constraints()),
|
||||
@ -6323,8 +6315,7 @@ IonBuilder::getStaticName(JSObject *staticObject, PropertyName *name, bool *psuc
|
||||
return pushConstant(NullValue());
|
||||
}
|
||||
|
||||
MInstruction *obj = MConstant::New(alloc(), ObjectValue(*staticObject));
|
||||
current->add(obj);
|
||||
MInstruction *obj = constant(ObjectValue(*staticObject));
|
||||
|
||||
MIRType rvalType = MIRTypeFromValueType(types->getKnownTypeTag());
|
||||
if (barrier)
|
||||
@ -6422,8 +6413,7 @@ IonBuilder::jsop_getname(PropertyName *name)
|
||||
{
|
||||
MDefinition *object;
|
||||
if (js_CodeSpec[*pc].format & JOF_GNAME) {
|
||||
MInstruction *global = MConstant::New(alloc(), ObjectValue(script()->global()));
|
||||
current->add(global);
|
||||
MInstruction *global = constant(ObjectValue(script()->global()));
|
||||
object = global;
|
||||
} else {
|
||||
current->push(current->scopeChain());
|
||||
@ -6471,10 +6461,7 @@ IonBuilder::jsop_intrinsic(PropertyName *name)
|
||||
JS_ALWAYS_TRUE(script()->global().maybeGetIntrinsicValue(name, &vp));
|
||||
JS_ASSERT(types->hasType(types::GetValueType(vp)));
|
||||
|
||||
MConstant *ins = MConstant::New(alloc(), vp);
|
||||
current->add(ins);
|
||||
current->push(ins);
|
||||
|
||||
pushConstant(vp);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -7766,7 +7753,8 @@ IonBuilder::jsop_rest()
|
||||
|
||||
// Pass in the number of actual arguments, the number of formals (not
|
||||
// including the rest parameter slot itself), and the template object.
|
||||
MRest *rest = MRest::New(alloc(), numActuals, info().nargs() - 1, templateObject);
|
||||
MRest *rest = MRest::New(alloc(), constraints(), numActuals, info().nargs() - 1,
|
||||
templateObject);
|
||||
current->add(rest);
|
||||
current->push(rest);
|
||||
return true;
|
||||
@ -7777,7 +7765,7 @@ IonBuilder::jsop_rest()
|
||||
unsigned numFormals = info().nargs() - 1;
|
||||
unsigned numRest = numActuals > numFormals ? numActuals - numFormals : 0;
|
||||
|
||||
MNewArray *array = MNewArray::New(alloc(), numRest, templateObject,
|
||||
MNewArray *array = MNewArray::New(alloc(), constraints(), numRest, templateObject,
|
||||
templateObject->type()->initialHeap(constraints()),
|
||||
MNewArray::NewArray_Allocating);
|
||||
current->add(array);
|
||||
@ -7969,9 +7957,7 @@ IonBuilder::testCommonGetterSetter(types::TemporaryTypeSet *types, PropertyName
|
||||
// the prototype chain is guarded by TI freezes. Note that a shape guard is
|
||||
// good enough here, even in the proxy case, because we have ensured there
|
||||
// are no lookup hooks for this property.
|
||||
MInstruction *wrapper = MConstant::New(alloc(), ObjectValue(*foundProto));
|
||||
current->add(wrapper);
|
||||
|
||||
MInstruction *wrapper = constant(ObjectValue(*foundProto));
|
||||
return addShapeGuard(wrapper, lastProperty, Bailout_ShapeGuard);
|
||||
}
|
||||
|
||||
@ -8253,10 +8239,7 @@ IonBuilder::getPropTryConstant(bool *emitted, PropertyName *name,
|
||||
else
|
||||
obj->setFoldedUnchecked();
|
||||
|
||||
MConstant *known = MConstant::New(alloc(), ObjectValue(*singleton));
|
||||
|
||||
current->add(known);
|
||||
current->push(known);
|
||||
pushConstant(ObjectValue(*singleton));
|
||||
|
||||
*emitted = true;
|
||||
return true;
|
||||
@ -9059,7 +9042,7 @@ IonBuilder::jsop_regexp(RegExpObject *reobj)
|
||||
|
||||
JSObject *prototype = reobj->getProto();
|
||||
|
||||
MRegExp *regexp = MRegExp::New(alloc(), reobj, prototype, mustClone);
|
||||
MRegExp *regexp = MRegExp::New(alloc(), constraints(), reobj, prototype, mustClone);
|
||||
current->add(regexp);
|
||||
current->push(regexp);
|
||||
|
||||
@ -9084,10 +9067,7 @@ IonBuilder::jsop_regexp(RegExpObject *reobj)
|
||||
bool
|
||||
IonBuilder::jsop_object(JSObject *obj)
|
||||
{
|
||||
MConstant *ins = MConstant::New(alloc(), ObjectValue(*obj));
|
||||
current->add(ins);
|
||||
current->push(ins);
|
||||
|
||||
pushConstant(ObjectValue(*obj));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -9100,7 +9080,7 @@ IonBuilder::jsop_lambda(JSFunction *fun)
|
||||
if (fun->isNative() && IsAsmJSModuleNative(fun->native()))
|
||||
return abort("asm.js module function");
|
||||
|
||||
MLambda *ins = MLambda::New(alloc(), current->scopeChain(), fun);
|
||||
MLambda *ins = MLambda::New(alloc(), constraints(), current->scopeChain(), fun);
|
||||
current->add(ins);
|
||||
current->push(ins);
|
||||
|
||||
@ -9475,9 +9455,7 @@ IonBuilder::jsop_setaliasedvar(ScopeCoordinate sc)
|
||||
if (call) {
|
||||
// Push the object on the stack to match the bound object expected in
|
||||
// the global and property set cases.
|
||||
MInstruction *constant = MConstant::New(alloc(), ObjectValue(*call));
|
||||
current->add(constant);
|
||||
current->push(constant);
|
||||
pushConstant(ObjectValue(*call));
|
||||
current->push(value);
|
||||
return setStaticName(call, name);
|
||||
}
|
||||
@ -9901,7 +9879,7 @@ IonBuilder::storeScalarTypedObjectValue(MDefinition *typedObj,
|
||||
MConstant *
|
||||
IonBuilder::constant(const Value &v)
|
||||
{
|
||||
MConstant *c = MConstant::New(alloc(), v);
|
||||
MConstant *c = MConstant::New(alloc(), v, constraints());
|
||||
current->add(c);
|
||||
return c;
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ IonBuilder::inlineArray(CallInfo &callInfo)
|
||||
if (conversion == types::TemporaryTypeSet::AlwaysConvertToDoubles)
|
||||
templateObject->setShouldConvertDoubleElements();
|
||||
|
||||
MNewArray *ins = MNewArray::New(alloc(), initLength, templateObject,
|
||||
MNewArray *ins = MNewArray::New(alloc(), constraints(), initLength, templateObject,
|
||||
templateObject->type()->initialHeap(constraints()),
|
||||
allocating);
|
||||
current->add(ins);
|
||||
@ -495,8 +495,8 @@ IonBuilder::inlineArrayConcat(CallInfo &callInfo)
|
||||
|
||||
callInfo.unwrapArgs();
|
||||
|
||||
MArrayConcat *ins = MArrayConcat::New(alloc(), callInfo.thisArg(), callInfo.getArg(0), templateObj,
|
||||
templateObj->type()->initialHeap(constraints()));
|
||||
MArrayConcat *ins = MArrayConcat::New(alloc(), constraints(), callInfo.thisArg(), callInfo.getArg(0),
|
||||
templateObj, templateObj->type()->initialHeap(constraints()));
|
||||
current->add(ins);
|
||||
current->push(ins);
|
||||
|
||||
@ -969,7 +969,8 @@ IonBuilder::inlineStringSplit(CallInfo &callInfo)
|
||||
|
||||
callInfo.unwrapArgs();
|
||||
|
||||
MStringSplit *ins = MStringSplit::New(alloc(), callInfo.thisArg(), callInfo.getArg(0), templateObject);
|
||||
MStringSplit *ins = MStringSplit::New(alloc(), constraints(), callInfo.thisArg(),
|
||||
callInfo.getArg(0), templateObject);
|
||||
current->add(ins);
|
||||
current->push(ins);
|
||||
|
||||
|
@ -413,34 +413,41 @@ MDefinition::emptyResultTypeSet() const
|
||||
}
|
||||
|
||||
MConstant *
|
||||
MConstant::New(TempAllocator &alloc, const Value &v)
|
||||
MConstant::New(TempAllocator &alloc, const Value &v, types::CompilerConstraintList *constraints)
|
||||
{
|
||||
return new(alloc) MConstant(v);
|
||||
return new(alloc) MConstant(v, constraints);
|
||||
}
|
||||
|
||||
MConstant *
|
||||
MConstant::NewAsmJS(TempAllocator &alloc, const Value &v, MIRType type)
|
||||
{
|
||||
MConstant *constant = new(alloc) MConstant(v);
|
||||
MConstant *constant = new(alloc) MConstant(v, nullptr);
|
||||
constant->setResultType(type);
|
||||
return constant;
|
||||
}
|
||||
|
||||
types::TemporaryTypeSet *
|
||||
jit::MakeSingletonTypeSet(JSObject *obj)
|
||||
jit::MakeSingletonTypeSet(types::CompilerConstraintList *constraints, JSObject *obj)
|
||||
{
|
||||
LifoAlloc *alloc = GetIonContext()->temp->lifoAlloc();
|
||||
return alloc->new_<types::TemporaryTypeSet>(types::Type::ObjectType(obj));
|
||||
// Invalidate when this object's TypeObject gets unknown properties. This
|
||||
// happens for instance when we mutate an object's __proto__, in this case
|
||||
// we want to invalidate and mark this TypeSet as containing AnyObject
|
||||
// (because mutating __proto__ will change an object's TypeObject).
|
||||
JS_ASSERT(constraints);
|
||||
types::TypeObjectKey *objType = types::TypeObjectKey::get(obj);
|
||||
objType->hasFlags(constraints, types::OBJECT_FLAG_UNKNOWN_PROPERTIES);
|
||||
|
||||
return GetIonContext()->temp->lifoAlloc()->new_<types::TemporaryTypeSet>(types::Type::ObjectType(obj));
|
||||
}
|
||||
|
||||
MConstant::MConstant(const js::Value &vp)
|
||||
MConstant::MConstant(const js::Value &vp, types::CompilerConstraintList *constraints)
|
||||
: value_(vp)
|
||||
{
|
||||
setResultType(MIRTypeFromValue(vp));
|
||||
if (vp.isObject()) {
|
||||
// Create a singleton type set for the object. This isn't necessary for
|
||||
// other types as the result type encodes all needed information.
|
||||
setResultTypeSet(MakeSingletonTypeSet(&vp.toObject()));
|
||||
setResultTypeSet(MakeSingletonTypeSet(constraints, &vp.toObject()));
|
||||
}
|
||||
|
||||
setMovable();
|
||||
|
@ -951,11 +951,12 @@ class MConstant : public MNullaryInstruction
|
||||
Value value_;
|
||||
|
||||
protected:
|
||||
MConstant(const Value &v);
|
||||
MConstant(const Value &v, types::CompilerConstraintList *constraints);
|
||||
|
||||
public:
|
||||
INSTRUCTION_HEADER(Constant)
|
||||
static MConstant *New(TempAllocator &alloc, const Value &v);
|
||||
static MConstant *New(TempAllocator &alloc, const Value &v,
|
||||
types::CompilerConstraintList *constraints = nullptr);
|
||||
static MConstant *NewAsmJS(TempAllocator &alloc, const Value &v, MIRType type);
|
||||
|
||||
const js::Value &value() const {
|
||||
@ -1365,7 +1366,7 @@ class MThrow
|
||||
|
||||
// Fabricate a type set containing only the type of the specified object.
|
||||
types::TemporaryTypeSet *
|
||||
MakeSingletonTypeSet(JSObject *obj);
|
||||
MakeSingletonTypeSet(types::CompilerConstraintList *constraints, JSObject *obj);
|
||||
|
||||
void
|
||||
MergeTypes(MIRType *ptype, types::TemporaryTypeSet **ptypeSet,
|
||||
@ -1388,24 +1389,26 @@ class MNewArray : public MNullaryInstruction
|
||||
// Allocate space at initialization or not
|
||||
AllocatingBehaviour allocating_;
|
||||
|
||||
MNewArray(uint32_t count, JSObject *templateObject, gc::InitialHeap initialHeap,
|
||||
AllocatingBehaviour allocating)
|
||||
MNewArray(types::CompilerConstraintList *constraints, uint32_t count, JSObject *templateObject,
|
||||
gc::InitialHeap initialHeap, AllocatingBehaviour allocating)
|
||||
: count_(count),
|
||||
templateObject_(templateObject),
|
||||
initialHeap_(initialHeap),
|
||||
allocating_(allocating)
|
||||
{
|
||||
setResultType(MIRType_Object);
|
||||
setResultTypeSet(MakeSingletonTypeSet(templateObject));
|
||||
if (!templateObject->hasSingletonType())
|
||||
setResultTypeSet(MakeSingletonTypeSet(constraints, templateObject));
|
||||
}
|
||||
|
||||
public:
|
||||
INSTRUCTION_HEADER(NewArray)
|
||||
|
||||
static MNewArray *New(TempAllocator &alloc, uint32_t count, JSObject *templateObject,
|
||||
static MNewArray *New(TempAllocator &alloc, types::CompilerConstraintList *constraints,
|
||||
uint32_t count, JSObject *templateObject,
|
||||
gc::InitialHeap initialHeap, AllocatingBehaviour allocating)
|
||||
{
|
||||
return new(alloc) MNewArray(count, templateObject, initialHeap, allocating);
|
||||
return new(alloc) MNewArray(constraints, count, templateObject, initialHeap, allocating);
|
||||
}
|
||||
|
||||
uint32_t count() const {
|
||||
@ -1445,24 +1448,27 @@ class MNewObject : public MNullaryInstruction
|
||||
gc::InitialHeap initialHeap_;
|
||||
bool templateObjectIsClassPrototype_;
|
||||
|
||||
MNewObject(JSObject *templateObject, gc::InitialHeap initialHeap,
|
||||
bool templateObjectIsClassPrototype)
|
||||
MNewObject(types::CompilerConstraintList *constraints, JSObject *templateObject,
|
||||
gc::InitialHeap initialHeap, bool templateObjectIsClassPrototype)
|
||||
: templateObject_(templateObject),
|
||||
initialHeap_(initialHeap),
|
||||
templateObjectIsClassPrototype_(templateObjectIsClassPrototype)
|
||||
{
|
||||
JS_ASSERT_IF(templateObjectIsClassPrototype, !shouldUseVM());
|
||||
setResultType(MIRType_Object);
|
||||
setResultTypeSet(MakeSingletonTypeSet(templateObject));
|
||||
if (!templateObject->hasSingletonType())
|
||||
setResultTypeSet(MakeSingletonTypeSet(constraints, templateObject));
|
||||
}
|
||||
|
||||
public:
|
||||
INSTRUCTION_HEADER(NewObject)
|
||||
|
||||
static MNewObject *New(TempAllocator &alloc, JSObject *templateObject, gc::InitialHeap initialHeap,
|
||||
static MNewObject *New(TempAllocator &alloc, types::CompilerConstraintList *constraints,
|
||||
JSObject *templateObject, gc::InitialHeap initialHeap,
|
||||
bool templateObjectIsClassPrototype)
|
||||
{
|
||||
return new(alloc) MNewObject(templateObject, initialHeap, templateObjectIsClassPrototype);
|
||||
return new(alloc) MNewObject(constraints, templateObject, initialHeap,
|
||||
templateObjectIsClassPrototype);
|
||||
}
|
||||
|
||||
// Returns true if the code generator should call through to the
|
||||
@ -2524,20 +2530,21 @@ class MCreateThisWithTemplate
|
||||
CompilerRootObject templateObject_;
|
||||
gc::InitialHeap initialHeap_;
|
||||
|
||||
MCreateThisWithTemplate(JSObject *templateObject, gc::InitialHeap initialHeap)
|
||||
MCreateThisWithTemplate(types::CompilerConstraintList *constraints, JSObject *templateObject,
|
||||
gc::InitialHeap initialHeap)
|
||||
: templateObject_(templateObject),
|
||||
initialHeap_(initialHeap)
|
||||
{
|
||||
setResultType(MIRType_Object);
|
||||
setResultTypeSet(MakeSingletonTypeSet(templateObject));
|
||||
setResultTypeSet(MakeSingletonTypeSet(constraints, templateObject));
|
||||
}
|
||||
|
||||
public:
|
||||
INSTRUCTION_HEADER(CreateThisWithTemplate);
|
||||
static MCreateThisWithTemplate *New(TempAllocator &alloc, JSObject *templateObject,
|
||||
gc::InitialHeap initialHeap)
|
||||
static MCreateThisWithTemplate *New(TempAllocator &alloc, types::CompilerConstraintList *constraints,
|
||||
JSObject *templateObject, gc::InitialHeap initialHeap)
|
||||
{
|
||||
return new(alloc) MCreateThisWithTemplate(templateObject, initialHeap);
|
||||
return new(alloc) MCreateThisWithTemplate(constraints, templateObject, initialHeap);
|
||||
}
|
||||
|
||||
JSObject *templateObject() const {
|
||||
@ -4355,21 +4362,23 @@ class MStringSplit
|
||||
{
|
||||
types::TypeObject *typeObject_;
|
||||
|
||||
MStringSplit(MDefinition *string, MDefinition *sep, JSObject *templateObject)
|
||||
MStringSplit(types::CompilerConstraintList *constraints, MDefinition *string, MDefinition *sep,
|
||||
JSObject *templateObject)
|
||||
: MBinaryInstruction(string, sep),
|
||||
typeObject_(templateObject->type())
|
||||
{
|
||||
setResultType(MIRType_Object);
|
||||
setResultTypeSet(MakeSingletonTypeSet(templateObject));
|
||||
setResultTypeSet(MakeSingletonTypeSet(constraints, templateObject));
|
||||
}
|
||||
|
||||
public:
|
||||
INSTRUCTION_HEADER(StringSplit)
|
||||
|
||||
static MStringSplit *New(TempAllocator &alloc, MDefinition *string, MDefinition *sep,
|
||||
static MStringSplit *New(TempAllocator &alloc, types::CompilerConstraintList *constraints,
|
||||
MDefinition *string, MDefinition *sep,
|
||||
JSObject *templateObject)
|
||||
{
|
||||
return new(alloc) MStringSplit(string, sep, templateObject);
|
||||
return new(alloc) MStringSplit(constraints, string, sep, templateObject);
|
||||
}
|
||||
types::TypeObject *typeObject() const {
|
||||
return typeObject_;
|
||||
@ -4845,7 +4854,7 @@ class MRegExp : public MNullaryInstruction
|
||||
CompilerRootObject prototype_;
|
||||
bool mustClone_;
|
||||
|
||||
MRegExp(RegExpObject *source, JSObject *prototype, bool mustClone)
|
||||
MRegExp(types::CompilerConstraintList *constraints, RegExpObject *source, JSObject *prototype, bool mustClone)
|
||||
: source_(source),
|
||||
prototype_(prototype),
|
||||
mustClone_(mustClone)
|
||||
@ -4853,16 +4862,17 @@ class MRegExp : public MNullaryInstruction
|
||||
setResultType(MIRType_Object);
|
||||
|
||||
JS_ASSERT(source->getProto() == prototype);
|
||||
setResultTypeSet(MakeSingletonTypeSet(source));
|
||||
setResultTypeSet(MakeSingletonTypeSet(constraints, source));
|
||||
}
|
||||
|
||||
public:
|
||||
INSTRUCTION_HEADER(RegExp)
|
||||
|
||||
static MRegExp *New(TempAllocator &alloc, RegExpObject *source, JSObject *prototype,
|
||||
static MRegExp *New(TempAllocator &alloc, types::CompilerConstraintList *constraints,
|
||||
RegExpObject *source, JSObject *prototype,
|
||||
bool mustClone)
|
||||
{
|
||||
return new(alloc) MRegExp(source, prototype, mustClone);
|
||||
return new(alloc) MRegExp(constraints, source, prototype, mustClone);
|
||||
}
|
||||
|
||||
bool mustClone() const {
|
||||
@ -4951,19 +4961,21 @@ class MLambda
|
||||
{
|
||||
LambdaFunctionInfo info_;
|
||||
|
||||
MLambda(MDefinition *scopeChain, JSFunction *fun)
|
||||
MLambda(types::CompilerConstraintList *constraints, MDefinition *scopeChain, JSFunction *fun)
|
||||
: MUnaryInstruction(scopeChain), info_(fun)
|
||||
{
|
||||
setResultType(MIRType_Object);
|
||||
if (!fun->hasSingletonType() && !types::UseNewTypeForClone(fun))
|
||||
setResultTypeSet(MakeSingletonTypeSet(fun));
|
||||
setResultTypeSet(MakeSingletonTypeSet(constraints, fun));
|
||||
}
|
||||
|
||||
public:
|
||||
INSTRUCTION_HEADER(Lambda)
|
||||
|
||||
static MLambda *New(TempAllocator &alloc, MDefinition *scopeChain, JSFunction *fun) {
|
||||
return new(alloc) MLambda(scopeChain, fun);
|
||||
static MLambda *New(TempAllocator &alloc, types::CompilerConstraintList *constraints,
|
||||
MDefinition *scopeChain, JSFunction *fun)
|
||||
{
|
||||
return new(alloc) MLambda(constraints, scopeChain, fun);
|
||||
}
|
||||
MDefinition *scopeChain() const {
|
||||
return getOperand(0);
|
||||
@ -5939,22 +5951,24 @@ class MArrayConcat
|
||||
CompilerRootObject templateObj_;
|
||||
gc::InitialHeap initialHeap_;
|
||||
|
||||
MArrayConcat(MDefinition *lhs, MDefinition *rhs, JSObject *templateObj, gc::InitialHeap initialHeap)
|
||||
MArrayConcat(types::CompilerConstraintList *constraints, MDefinition *lhs, MDefinition *rhs,
|
||||
JSObject *templateObj, gc::InitialHeap initialHeap)
|
||||
: MBinaryInstruction(lhs, rhs),
|
||||
templateObj_(templateObj),
|
||||
initialHeap_(initialHeap)
|
||||
{
|
||||
setResultType(MIRType_Object);
|
||||
setResultTypeSet(MakeSingletonTypeSet(templateObj));
|
||||
setResultTypeSet(MakeSingletonTypeSet(constraints, templateObj));
|
||||
}
|
||||
|
||||
public:
|
||||
INSTRUCTION_HEADER(ArrayConcat)
|
||||
|
||||
static MArrayConcat *New(TempAllocator &alloc, MDefinition *lhs, MDefinition *rhs,
|
||||
static MArrayConcat *New(TempAllocator &alloc, types::CompilerConstraintList *constraints,
|
||||
MDefinition *lhs, MDefinition *rhs,
|
||||
JSObject *templateObj, gc::InitialHeap initialHeap)
|
||||
{
|
||||
return new(alloc) MArrayConcat(lhs, rhs, templateObj, initialHeap);
|
||||
return new(alloc) MArrayConcat(constraints, lhs, rhs, templateObj, initialHeap);
|
||||
}
|
||||
|
||||
JSObject *templateObj() const {
|
||||
@ -8486,21 +8500,23 @@ class MRest
|
||||
public MRestCommon,
|
||||
public IntPolicy<0>
|
||||
{
|
||||
MRest(MDefinition *numActuals, unsigned numFormals, JSObject *templateObject)
|
||||
MRest(types::CompilerConstraintList *constraints, MDefinition *numActuals, unsigned numFormals,
|
||||
JSObject *templateObject)
|
||||
: MUnaryInstruction(numActuals),
|
||||
MRestCommon(numFormals, templateObject)
|
||||
{
|
||||
setResultType(MIRType_Object);
|
||||
setResultTypeSet(MakeSingletonTypeSet(templateObject));
|
||||
setResultTypeSet(MakeSingletonTypeSet(constraints, templateObject));
|
||||
}
|
||||
|
||||
public:
|
||||
INSTRUCTION_HEADER(Rest);
|
||||
|
||||
static MRest *New(TempAllocator &alloc, MDefinition *numActuals, unsigned numFormals,
|
||||
static MRest *New(TempAllocator &alloc, types::CompilerConstraintList *constraints,
|
||||
MDefinition *numActuals, unsigned numFormals,
|
||||
JSObject *templateObject)
|
||||
{
|
||||
return new(alloc) MRest(numActuals, numFormals, templateObject);
|
||||
return new(alloc) MRest(constraints, numActuals, numFormals, templateObject);
|
||||
}
|
||||
|
||||
MDefinition *numActuals() const {
|
||||
|
@ -287,9 +287,7 @@ NewInitArray(JSContext *cx, uint32_t count, types::TypeObject *typeArg)
|
||||
if (!obj)
|
||||
return nullptr;
|
||||
|
||||
if (!type)
|
||||
types::TypeScript::Monitor(cx, ObjectValue(*obj));
|
||||
else
|
||||
if (type)
|
||||
obj->setType(type);
|
||||
|
||||
return obj;
|
||||
@ -306,9 +304,7 @@ NewInitObject(JSContext *cx, HandleObject templateObject)
|
||||
if (!obj)
|
||||
return nullptr;
|
||||
|
||||
if (templateObject->hasSingletonType())
|
||||
types::TypeScript::Monitor(cx, ObjectValue(*obj));
|
||||
else
|
||||
if (!templateObject->hasSingletonType())
|
||||
obj->setType(templateObject->type());
|
||||
|
||||
return obj;
|
||||
|
@ -424,19 +424,18 @@ enum {
|
||||
*/
|
||||
OBJECT_FLAG_PRE_TENURE = 0x00400000,
|
||||
|
||||
/* Flags which indicate dynamic properties of represented objects. */
|
||||
OBJECT_FLAG_DYNAMIC_MASK = 0x007f0000,
|
||||
|
||||
/*
|
||||
* Whether all properties of this object are considered unknown.
|
||||
* If set, all flags in DYNAMIC_MASK will also be set.
|
||||
* If set, all other flags in DYNAMIC_MASK will also be set.
|
||||
*/
|
||||
OBJECT_FLAG_UNKNOWN_PROPERTIES = 0x00800000,
|
||||
|
||||
/* Flags which indicate dynamic properties of represented objects. */
|
||||
OBJECT_FLAG_DYNAMIC_MASK = 0x00ff0000,
|
||||
|
||||
/* Mask for objects created with unknown properties. */
|
||||
OBJECT_FLAG_UNKNOWN_MASK =
|
||||
OBJECT_FLAG_DYNAMIC_MASK
|
||||
| OBJECT_FLAG_UNKNOWN_PROPERTIES
|
||||
| OBJECT_FLAG_SETS_MARKED_UNKNOWN
|
||||
};
|
||||
typedef uint32_t TypeObjectFlags;
|
||||
|
@ -194,9 +194,9 @@ OPDEF(JSOP_UINT16, 88, "uint16", NULL, 3, 0, 1, JOF_UINT16)
|
||||
* shape, which can be set at the start and slots then filled in directly.
|
||||
* NEWINIT has an extra byte so it can be exchanged with NEWOBJECT during emit.
|
||||
*/
|
||||
OPDEF(JSOP_NEWINIT, 89, "newinit", NULL, 5, 0, 1, JOF_UINT8|JOF_TYPESET)
|
||||
OPDEF(JSOP_NEWARRAY, 90, "newarray", NULL, 4, 0, 1, JOF_UINT24|JOF_TYPESET)
|
||||
OPDEF(JSOP_NEWOBJECT, 91, "newobject", NULL, 5, 0, 1, JOF_OBJECT|JOF_TYPESET)
|
||||
OPDEF(JSOP_NEWINIT, 89, "newinit", NULL, 5, 0, 1, JOF_UINT8)
|
||||
OPDEF(JSOP_NEWARRAY, 90, "newarray", NULL, 4, 0, 1, JOF_UINT24)
|
||||
OPDEF(JSOP_NEWOBJECT, 91, "newobject", NULL, 5, 0, 1, JOF_OBJECT)
|
||||
OPDEF(JSOP_ENDINIT, 92, "endinit", NULL, 1, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_INITPROP, 93, "initprop", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_SET|JOF_DETECTING)
|
||||
|
||||
|
@ -3092,7 +3092,6 @@ CASE(JSOP_NEWINIT)
|
||||
goto error;
|
||||
|
||||
PUSH_OBJECT(*obj);
|
||||
TypeScript::Monitor(cx, script, REGS.pc, REGS.sp[-1]);
|
||||
}
|
||||
END_CASE(JSOP_NEWINIT)
|
||||
|
||||
@ -3106,7 +3105,6 @@ CASE(JSOP_NEWARRAY)
|
||||
goto error;
|
||||
|
||||
PUSH_OBJECT(*obj);
|
||||
TypeScript::Monitor(cx, script, REGS.pc, REGS.sp[-1]);
|
||||
}
|
||||
END_CASE(JSOP_NEWARRAY)
|
||||
|
||||
@ -3122,7 +3120,6 @@ CASE(JSOP_NEWOBJECT)
|
||||
goto error;
|
||||
|
||||
PUSH_OBJECT(*obj);
|
||||
TypeScript::Monitor(cx, script, REGS.pc, REGS.sp[-1]);
|
||||
}
|
||||
END_CASE(JSOP_NEWOBJECT)
|
||||
|
||||
|
@ -22,7 +22,7 @@ namespace js {
|
||||
* and saved versions. If deserialization fails, the data should be
|
||||
* invalidated if possible.
|
||||
*/
|
||||
static const uint32_t XDR_BYTECODE_VERSION = uint32_t(0xb973c0de - 156);
|
||||
static const uint32_t XDR_BYTECODE_VERSION = uint32_t(0xb973c0de - 157);
|
||||
|
||||
class XDRBuffer {
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user