diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp index 332f8eae87e1..350984395e07 100644 --- a/js/src/jit/BaselineIC.cpp +++ b/js/src/jit/BaselineIC.cpp @@ -7109,23 +7109,23 @@ ICGetPropNativeCompiler::getStub(ICStubSpace *space) case ICStub::GetProp_Native: { MOZ_ASSERT(obj_ == holder_); RootedShape shape(cx, obj_->lastProperty()); - return ICGetProp_Native::New(space, getStubCode(), firstMonitorStub_, shape, offset_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, shape, offset_); } case ICStub::GetProp_NativePrototype: { MOZ_ASSERT(obj_ != holder_); RootedShape shape(cx, obj_->lastProperty()); RootedShape holderShape(cx, holder_->lastProperty()); - return ICGetProp_NativePrototype::New(space, getStubCode(), firstMonitorStub_, shape, - offset_, holder_, holderShape); + return ICStub::New(space, getStubCode(), firstMonitorStub_, shape, + offset_, holder_, holderShape); } case ICStub::GetProp_UnboxedPrototype: { MOZ_ASSERT(obj_ != holder_); RootedObjectGroup group(cx, obj_->group()); RootedShape holderShape(cx, holder_->lastProperty()); - return ICGetProp_UnboxedPrototype::New(space, getStubCode(), firstMonitorStub_, group, - offset_, holder_, holderShape); + return ICStub::New(space, getStubCode(), firstMonitorStub_, group, + offset_, holder_, holderShape); } default: @@ -7659,12 +7659,12 @@ ICGetPropCallDOMProxyNativeCompiler::getStub(ICStubSpace *space) expandoShape = expandoVal.toObject().lastProperty(); if (kind == ICStub::GetProp_CallDOMProxyNative) { - return ICGetProp_CallDOMProxyNative::New( + return ICStub::New( space, getStubCode(), firstMonitorStub_, shape, proxy_->handler(), expandoShape, holder_, holderShape, getter_, pcOffset_); } - return ICGetProp_CallDOMProxyWithGenerationNative::New( + return ICStub::New( space, getStubCode(), firstMonitorStub_, shape, proxy_->handler(), expandoAndGeneration, generation, expandoShape, holder_, holderShape, getter_, pcOffset_); @@ -7674,7 +7674,7 @@ ICStub * ICGetProp_DOMProxyShadowed::Compiler::getStub(ICStubSpace *space) { RootedShape shape(cx, proxy_->lastProperty()); - return ICGetProp_DOMProxyShadowed::New(space, getStubCode(), firstMonitorStub_, shape, + return New(space, getStubCode(), firstMonitorStub_, shape, proxy_->handler(), name_, pcOffset_); } @@ -7842,7 +7842,7 @@ ICGetProp_ArgumentsCallee::Compiler::generateStubCode(MacroAssembler &masm) ICGetProp_Generic::Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub, ICGetProp_Generic &other) { - return New(space, other.jitCode(), firstMonitorStub); + return New(space, other.jitCode(), firstMonitorStub); } static bool @@ -11059,7 +11059,7 @@ ICTableSwitch::Compiler::getStub(ICStubSpace *space) pc += JUMP_OFFSET_LEN; } - return ICTableSwitch::New(space, code, table, low, length, defaultpc); + return ICStub::New(space, code, table, low, length, defaultpc); } void @@ -11679,8 +11679,10 @@ ICGetElem_NativePrototypeCallNative::Clone(JSContext *cx, ICStubSpace *space, RootedFunction getter(cx, other.getter()); RootedObject holder(cx, other.holder()); RootedShape holderShape(cx, other.holderShape()); - return New(space, other.jitCode(), firstMonitorStub, shape, name, other.accessType(), - other.needsAtomize(), getter, other.pcOffset_, holder, holderShape); + return New(space, other.jitCode(), firstMonitorStub, + shape, name, other.accessType(), + other.needsAtomize(), getter, other.pcOffset_, + holder, holderShape); } /* static */ ICGetElem_NativePrototypeCallScripted * @@ -11693,8 +11695,9 @@ ICGetElem_NativePrototypeCallScripted::Clone(JSContext *cx, ICStubSpace *space, RootedFunction getter(cx, other.getter()); RootedObject holder(cx, other.holder()); RootedShape holderShape(cx, other.holderShape()); - return New(space, other.jitCode(), firstMonitorStub, shape, name, other.accessType(), - other.needsAtomize(), getter, other.pcOffset_, holder, holderShape); + return New(space, other.jitCode(), firstMonitorStub, shape, name, + other.accessType(), other.needsAtomize(), getter, + other.pcOffset_, holder, holderShape); } ICGetElem_Dense::ICGetElem_Dense(JitCode *stubCode, ICStub *firstMonitorStub, HandleShape shape) @@ -11707,7 +11710,7 @@ ICGetElem_Dense::Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorSt ICGetElem_Dense &other) { RootedShape shape(cx, other.shape_); - return New(space, other.jitCode(), firstMonitorStub, shape); + return New(space, other.jitCode(), firstMonitorStub, shape); } ICGetElem_TypedArray::ICGetElem_TypedArray(JitCode *stubCode, HandleShape shape, Scalar::Type type) @@ -11722,7 +11725,7 @@ ICGetElem_TypedArray::ICGetElem_TypedArray(JitCode *stubCode, HandleShape shape, ICGetElem_Arguments::Clone(JSContext *, ICStubSpace *space, ICStub *firstMonitorStub, ICGetElem_Arguments &other) { - return New(space, other.jitCode(), firstMonitorStub, other.which()); + return New(space, other.jitCode(), firstMonitorStub, other.which()); } ICSetElem_Dense::ICSetElem_Dense(JitCode *stubCode, HandleShape shape, HandleObjectGroup group) @@ -11748,7 +11751,7 @@ ICSetElemDenseAddCompiler::getStubSpecific(ICStubSpace *space, const AutoShapeVe if (!group) return nullptr; Rooted stubCode(cx, getStubCode()); - return ICSetElem_DenseAddImpl::New(space, stubCode, group, shapes); + return ICStub::New>(space, stubCode, group, shapes); } ICSetElem_TypedArray::ICSetElem_TypedArray(JitCode *stubCode, HandleShape shape, Scalar::Type type, @@ -11806,7 +11809,7 @@ ICGetProp_Native::Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorS ICGetProp_Native &other) { RootedShape shape(cx, other.shape()); - return New(space, other.jitCode(), firstMonitorStub, shape, other.offset()); + return New(space, other.jitCode(), firstMonitorStub, shape, other.offset()); } ICGetProp_NativePrototype::ICGetProp_NativePrototype(JitCode *stubCode, ICStub *firstMonitorStub, @@ -11825,8 +11828,8 @@ ICGetProp_NativePrototype::Clone(JSContext *cx, ICStubSpace *space, ICStub *firs RootedShape shape(cx, other.shape()); RootedObject holder(cx, other.holder_); RootedShape holderShape(cx, other.holderShape_); - return New(space, other.jitCode(), firstMonitorStub, shape, other.offset(), - holder, holderShape); + return New(space, other.jitCode(), firstMonitorStub, shape, + other.offset(), holder, holderShape); } ICGetProp_UnboxedPrototype::ICGetProp_UnboxedPrototype(JitCode *stubCode, ICStub *firstMonitorStub, @@ -11845,8 +11848,8 @@ ICGetProp_UnboxedPrototype::Clone(JSContext *cx, ICStubSpace *space, ICStub *fir RootedObjectGroup group(cx, other.group()); RootedObject holder(cx, other.holder_); RootedShape holderShape(cx, other.holderShape_); - return New(space, other.jitCode(), firstMonitorStub, group, other.offset(), - holder, holderShape); + return New(space, other.jitCode(), firstMonitorStub, group, + other.offset(), holder, holderShape); } ICGetProp_NativeDoesNotExist::ICGetProp_NativeDoesNotExist( @@ -11929,8 +11932,8 @@ ICGetProp_CallScripted::Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMo RootedObject holder(cx, other.holder_); RootedShape holderShape(cx, other.holderShape_); RootedFunction getter(cx, other.getter_); - return New(space, other.jitCode(), firstMonitorStub, receiverShape, holder, - holderShape, getter, other.pcOffset_); + return New(space, other.jitCode(), firstMonitorStub, receiverShape, + holder, holderShape, getter, other.pcOffset_); } /* static */ ICGetProp_CallNative * @@ -11940,8 +11943,8 @@ ICGetProp_CallNative::Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMoni RootedObject holder(cx, other.holder_); RootedShape holderShape(cx, other.holderShape_); RootedFunction getter(cx, other.getter_); - return New(space, other.jitCode(), firstMonitorStub, holder, holderShape, getter, - other.pcOffset_); + return New(space, other.jitCode(), firstMonitorStub, holder, holderShape, + getter, other.pcOffset_); } /* static */ ICGetProp_CallNativePrototype * @@ -11952,8 +11955,8 @@ ICGetProp_CallNativePrototype::Clone(JSContext *cx, ICStubSpace *space, ICStub * RootedObject holder(cx, other.holder_); RootedShape holderShape(cx, other.holderShape_); RootedFunction getter(cx, other.getter_); - return New(space, other.jitCode(), firstMonitorStub, receiverShape, holder, - holderShape, getter, other.pcOffset_); + return New(space, other.jitCode(), firstMonitorStub, receiverShape, + holder, holderShape, getter, other.pcOffset_); } ICSetProp_Native::ICSetProp_Native(JitCode *stubCode, HandleObjectGroup group, HandleShape shape, @@ -11972,7 +11975,7 @@ ICSetProp_Native::Compiler::getStub(ICStubSpace *space) return nullptr; RootedShape shape(cx, obj_->lastProperty()); - ICSetProp_Native *stub = ICSetProp_Native::New(space, getStubCode(), group, shape, offset_); + ICSetProp_Native *stub = ICStub::New(space, getStubCode(), group, shape, offset_); if (!stub || !stub->initUpdatingChain(cx, space)) return nullptr; return stub; @@ -12045,7 +12048,8 @@ ICSetProp_CallScripted::Clone(JSContext *cx, ICStubSpace *space, ICStub *, RootedObject holder(cx, other.holder_); RootedShape holderShape(cx, other.holderShape_); RootedFunction setter(cx, other.setter_); - return New(space, other.jitCode(), shape, holder, holderShape, setter, other.pcOffset_); + return New(space, other.jitCode(), shape, holder, holderShape, setter, + other.pcOffset_); } /* static */ ICSetProp_CallNative * @@ -12056,7 +12060,8 @@ ICSetProp_CallNative::Clone(JSContext *cx, ICStubSpace *space, ICStub *, RootedObject holder(cx, other.holder_); RootedShape holderShape(cx, other.holderShape_); RootedFunction setter(cx, other.setter_); - return New(space, other.jitCode(), shape, holder, holderShape, setter, other.pcOffset_); + return New(space, other.jitCode(), shape, holder, holderShape, setter, + other.pcOffset_); } ICCall_Scripted::ICCall_Scripted(JitCode *stubCode, ICStub *firstMonitorStub, @@ -12074,15 +12079,15 @@ ICCall_Scripted::Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorSt { RootedFunction callee(cx, other.callee_); RootedObject templateObject(cx, other.templateObject_); - return New(space, other.jitCode(), firstMonitorStub, callee, templateObject, - other.pcOffset_); + return New(space, other.jitCode(), firstMonitorStub, callee, templateObject, + other.pcOffset_); } /* static */ ICCall_AnyScripted * ICCall_AnyScripted::Clone(JSContext *, ICStubSpace *space, ICStub *firstMonitorStub, ICCall_AnyScripted &other) { - return New(space, other.jitCode(), firstMonitorStub, other.pcOffset_); + return New(space, other.jitCode(), firstMonitorStub, other.pcOffset_); } ICCall_Native::ICCall_Native(JitCode *stubCode, ICStub *firstMonitorStub, @@ -12108,8 +12113,8 @@ ICCall_Native::Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub { RootedFunction callee(cx, other.callee_); RootedObject templateObject(cx, other.templateObject_); - return New(space, other.jitCode(), firstMonitorStub, callee, templateObject, - other.pcOffset_); + return New(space, other.jitCode(), firstMonitorStub, callee, templateObject, + other.pcOffset_); } ICCall_ClassHook::ICCall_ClassHook(JitCode *stubCode, ICStub *firstMonitorStub, @@ -12134,8 +12139,9 @@ ICCall_ClassHook::Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorS ICCall_ClassHook &other) { RootedObject templateObject(cx, other.templateObject_); - ICCall_ClassHook *res = New(space, other.jitCode(), firstMonitorStub, - other.clasp(), nullptr, templateObject, other.pcOffset_); + ICCall_ClassHook *res = New(space, other.jitCode(), firstMonitorStub, + other.clasp(), nullptr, templateObject, + other.pcOffset_); if (res) res->native_ = other.native(); return res; @@ -12145,7 +12151,8 @@ ICCall_ClassHook::Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorS ICCall_ScriptedApplyArray::Clone(JSContext *, ICStubSpace *space, ICStub *firstMonitorStub, ICCall_ScriptedApplyArray &other) { - return New(space, other.jitCode(), firstMonitorStub, other.pcOffset_); + return New(space, other.jitCode(), firstMonitorStub, + other.pcOffset_); } /* static */ ICCall_ScriptedApplyArguments * @@ -12153,14 +12160,15 @@ ICCall_ScriptedApplyArguments::Clone(JSContext *, ICStubSpace *space, ICStub *firstMonitorStub, ICCall_ScriptedApplyArguments &other) { - return New(space, other.jitCode(), firstMonitorStub, other.pcOffset_); + return New(space, other.jitCode(), firstMonitorStub, + other.pcOffset_); } /* static */ ICCall_ScriptedFunCall * ICCall_ScriptedFunCall::Clone(JSContext *, ICStubSpace *space, ICStub *firstMonitorStub, ICCall_ScriptedFunCall &other) { - return New(space, other.jitCode(), firstMonitorStub, other.pcOffset_); + return New(space, other.jitCode(), firstMonitorStub, other.pcOffset_); } ICGetPropCallDOMProxyNativeStub::ICGetPropCallDOMProxyNativeStub(Kind kind, JitCode *stubCode, @@ -12207,8 +12215,9 @@ ICGetProp_CallDOMProxyNative::Clone(JSContext *cx, ICStubSpace *space, ICStub *f RootedObject holder(cx, other.holder_); RootedShape holderShape(cx, other.holderShape_); RootedFunction getter(cx, other.getter_); - return New(space, other.jitCode(), firstMonitorStub, shape, other.proxyHandler_, - expandoShape, holder, holderShape, getter, other.pcOffset_); + return New(space, other.jitCode(), firstMonitorStub, shape, + other.proxyHandler_, expandoShape, holder, + holderShape, getter, other.pcOffset_); } /* static */ ICGetProp_CallDOMProxyWithGenerationNative * @@ -12221,9 +12230,11 @@ ICGetProp_CallDOMProxyWithGenerationNative::Clone(JSContext *cx, ICStubSpace *sp RootedObject holder(cx, other.holder_); RootedShape holderShape(cx, other.holderShape_); RootedFunction getter(cx, other.getter_); - return New(space, other.jitCode(), firstMonitorStub, shape, other.proxyHandler_, - other.expandoAndGeneration_, other.generation_, - expandoShape, holder, holderShape, getter, other.pcOffset_); + return New(space, other.jitCode(), firstMonitorStub, + shape, other.proxyHandler_, + other.expandoAndGeneration_, other.generation_, + expandoShape, holder, holderShape, getter, + other.pcOffset_); } ICGetProp_DOMProxyShadowed::ICGetProp_DOMProxyShadowed(JitCode *stubCode, @@ -12245,8 +12256,8 @@ ICGetProp_DOMProxyShadowed::Clone(JSContext *cx, ICStubSpace *space, ICStub *fir { RootedShape shape(cx, other.shape_); RootedPropertyName name(cx, other.name_); - return New(space, other.jitCode(), firstMonitorStub, shape, other.proxyHandler_, - name, other.pcOffset_); + return New(space, other.jitCode(), firstMonitorStub, shape, + other.proxyHandler_, name, other.pcOffset_); } // diff --git a/js/src/jit/BaselineIC.h b/js/src/jit/BaselineIC.h index abcfc93d171d..1d66e44b4f6d 100644 --- a/js/src/jit/BaselineIC.h +++ b/js/src/jit/BaselineIC.h @@ -632,6 +632,13 @@ class ICStub void updateCode(JitCode *stubCode); void trace(JSTracer *trc); + template + static T *New(ICStubSpace *space, JitCode *code, Args&&... args) { + if (!code) + return nullptr; + return space->allocate(code, mozilla::Forward(args)...); + } + protected: // The raw jitcode to call for this stub. uint8_t *stubCode_; @@ -1202,12 +1209,6 @@ class ICWarmUpCounter_Fallback : public ICFallbackStub { } public: - static inline ICWarmUpCounter_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: @@ -1219,7 +1220,7 @@ class ICWarmUpCounter_Fallback : public ICFallbackStub { } ICWarmUpCounter_Fallback *getStub(ICStubSpace *space) { - return ICWarmUpCounter_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -1380,15 +1381,6 @@ class ICTypeMonitor_Fallback : public ICStub } public: - static inline ICTypeMonitor_Fallback *New( - ICStubSpace *space, JitCode *code, ICMonitoredFallbackStub *mainFbStub, - uint32_t argumentIndex) - { - if (!code) - return nullptr; - return space->allocate(code, mainFbStub, argumentIndex); - } - bool hasStub(ICStub::Kind kind) { ICStub *stub = firstMonitorStub_; do { @@ -1475,8 +1467,8 @@ class ICTypeMonitor_Fallback : public ICStub { } ICTypeMonitor_Fallback *getStub(ICStubSpace *space) { - return ICTypeMonitor_Fallback::New(space, getStubCode(), mainFallbackStub_, - argumentIndex_); + return ICStub::New(space, getStubCode(), mainFallbackStub_, + argumentIndex_); } }; }; @@ -1490,14 +1482,6 @@ class ICTypeMonitor_PrimitiveSet : public TypeCheckPrimitiveSetStub {} public: - static inline ICTypeMonitor_PrimitiveSet *New(ICStubSpace *space, JitCode *code, - uint16_t flags) - { - if (!code) - return nullptr; - return space->allocate(code, flags); - } - class Compiler : public TypeCheckPrimitiveSetStub::Compiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -1517,7 +1501,7 @@ class ICTypeMonitor_PrimitiveSet : public TypeCheckPrimitiveSetStub ICTypeMonitor_PrimitiveSet *getStub(ICStubSpace *space) { MOZ_ASSERT(!existingStub_); - return ICTypeMonitor_PrimitiveSet::New(space, getStubCode(), flags_); + return ICStub::New(space, getStubCode(), flags_); } }; }; @@ -1531,14 +1515,6 @@ class ICTypeMonitor_SingleObject : public ICStub ICTypeMonitor_SingleObject(JitCode *stubCode, HandleObject obj); public: - static inline ICTypeMonitor_SingleObject *New( - ICStubSpace *space, JitCode *code, HandleObject obj) - { - if (!code) - return nullptr; - return space->allocate(code, obj); - } - HeapPtrObject &object() { return obj_; } @@ -1559,7 +1535,7 @@ class ICTypeMonitor_SingleObject : public ICStub { } ICTypeMonitor_SingleObject *getStub(ICStubSpace *space) { - return ICTypeMonitor_SingleObject::New(space, getStubCode(), obj_); + return ICStub::New(space, getStubCode(), obj_); } }; }; @@ -1573,14 +1549,6 @@ class ICTypeMonitor_ObjectGroup : public ICStub ICTypeMonitor_ObjectGroup(JitCode *stubCode, HandleObjectGroup group); public: - static inline ICTypeMonitor_ObjectGroup *New( - ICStubSpace *space, JitCode *code, HandleObjectGroup group) - { - if (!code) - return nullptr; - return space->allocate(code, group); - } - HeapPtrObjectGroup &group() { return group_; } @@ -1601,7 +1569,7 @@ class ICTypeMonitor_ObjectGroup : public ICStub { } ICTypeMonitor_ObjectGroup *getStub(ICStubSpace *space) { - return ICTypeMonitor_ObjectGroup::New(space, getStubCode(), group_); + return ICStub::New(space, getStubCode(), group_); } }; }; @@ -1621,12 +1589,6 @@ class ICTypeUpdate_Fallback : public ICStub {} public: - static inline ICTypeUpdate_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: @@ -1638,7 +1600,7 @@ class ICTypeUpdate_Fallback : public ICStub { } ICTypeUpdate_Fallback *getStub(ICStubSpace *space) { - return ICTypeUpdate_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -1652,14 +1614,6 @@ class ICTypeUpdate_PrimitiveSet : public TypeCheckPrimitiveSetStub {} public: - static inline ICTypeUpdate_PrimitiveSet *New(ICStubSpace *space, JitCode *code, - uint16_t flags) - { - if (!code) - return nullptr; - return space->allocate(code, flags); - } - class Compiler : public TypeCheckPrimitiveSetStub::Compiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -1679,7 +1633,7 @@ class ICTypeUpdate_PrimitiveSet : public TypeCheckPrimitiveSetStub ICTypeUpdate_PrimitiveSet *getStub(ICStubSpace *space) { MOZ_ASSERT(!existingStub_); - return ICTypeUpdate_PrimitiveSet::New(space, getStubCode(), flags_); + return ICStub::New(space, getStubCode(), flags_); } }; }; @@ -1694,14 +1648,6 @@ class ICTypeUpdate_SingleObject : public ICStub ICTypeUpdate_SingleObject(JitCode *stubCode, HandleObject obj); public: - static inline ICTypeUpdate_SingleObject *New(ICStubSpace *space, JitCode *code, - HandleObject obj) - { - if (!code) - return nullptr; - return space->allocate(code, obj); - } - HeapPtrObject &object() { return obj_; } @@ -1722,7 +1668,7 @@ class ICTypeUpdate_SingleObject : public ICStub { } ICTypeUpdate_SingleObject *getStub(ICStubSpace *space) { - return ICTypeUpdate_SingleObject::New(space, getStubCode(), obj_); + return ICStub::New(space, getStubCode(), obj_); } }; }; @@ -1737,14 +1683,6 @@ class ICTypeUpdate_ObjectGroup : public ICStub ICTypeUpdate_ObjectGroup(JitCode *stubCode, HandleObjectGroup group); public: - static inline ICTypeUpdate_ObjectGroup *New(ICStubSpace *space, JitCode *code, - HandleObjectGroup group) - { - if (!code) - return nullptr; - return space->allocate(code, group); - } - HeapPtrObjectGroup &group() { return group_; } @@ -1765,7 +1703,7 @@ class ICTypeUpdate_ObjectGroup : public ICStub { } ICTypeUpdate_ObjectGroup *getStub(ICStubSpace *space) { - return ICTypeUpdate_ObjectGroup::New(space, getStubCode(), group_); + return ICStub::New(space, getStubCode(), group_); } }; }; @@ -1781,12 +1719,6 @@ class ICThis_Fallback : public ICFallbackStub : ICFallbackStub(ICStub::This_Fallback, stubCode) {} public: - static inline ICThis_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: @@ -1797,7 +1729,7 @@ class ICThis_Fallback : public ICFallbackStub : ICStubCompiler(cx, ICStub::This_Fallback) {} ICStub *getStub(ICStubSpace *space) { - return ICThis_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -1813,13 +1745,6 @@ class ICNewArray_Fallback : public ICFallbackStub {} public: - static inline ICNewArray_Fallback *New(ICStubSpace *space, JitCode *code, - ArrayObject *templateObject) { - if (!code) - return nullptr; - return space->allocate(code, templateObject); - } - class Compiler : public ICStubCompiler { RootedArrayObject templateObject; bool generateStubCode(MacroAssembler &masm); @@ -1831,7 +1756,7 @@ class ICNewArray_Fallback : public ICFallbackStub {} ICStub *getStub(ICStubSpace *space) { - return ICNewArray_Fallback::New(space, getStubCode(), templateObject); + return ICStub::New(space, getStubCode(), templateObject); } }; @@ -1851,13 +1776,6 @@ class ICNewObject_Fallback : public ICFallbackStub {} public: - static inline ICNewObject_Fallback *New(ICStubSpace *space, JitCode *code, - PlainObject *templateObject) { - if (!code) - return nullptr; - return space->allocate(code, templateObject); - } - class Compiler : public ICStubCompiler { RootedPlainObject templateObject; bool generateStubCode(MacroAssembler &masm); @@ -1869,7 +1787,7 @@ class ICNewObject_Fallback : public ICFallbackStub {} ICStub *getStub(ICStubSpace *space) { - return ICNewObject_Fallback::New(space, getStubCode(), templateObject); + return ICStub::New(space, getStubCode(), templateObject); } }; @@ -1892,12 +1810,6 @@ class ICCompare_Fallback : public ICFallbackStub public: static const uint32_t MAX_OPTIMIZED_STUBS = 8; - static inline ICCompare_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - static const size_t UNOPTIMIZABLE_ACCESS_BIT = 0; void noteUnoptimizableAccess() { extra_ |= (1u << UNOPTIMIZABLE_ACCESS_BIT); @@ -1916,7 +1828,7 @@ class ICCompare_Fallback : public ICFallbackStub : ICStubCompiler(cx, ICStub::Compare_Fallback) {} ICStub *getStub(ICStubSpace *space) { - return ICCompare_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -1929,12 +1841,6 @@ class ICCompare_Int32 : public ICStub : ICStub(ICStub::Compare_Int32, stubCode) {} public: - static inline ICCompare_Int32 *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - // Compiler for this stub kind. class Compiler : public ICMultiStubCompiler { protected: @@ -1945,7 +1851,7 @@ class ICCompare_Int32 : public ICStub : ICMultiStubCompiler(cx, ICStub::Compare_Int32, op) {} ICStub *getStub(ICStubSpace *space) { - return ICCompare_Int32::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -1959,12 +1865,6 @@ class ICCompare_Double : public ICStub {} public: - static inline ICCompare_Double *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICMultiStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -1975,7 +1875,7 @@ class ICCompare_Double : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICCompare_Double::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -1991,12 +1891,6 @@ class ICCompare_NumberWithUndefined : public ICStub } public: - static inline ICCompare_NumberWithUndefined *New(ICStubSpace *space, JitCode *code, bool lhsIsUndefined) { - if (!code) - return nullptr; - return space->allocate(code, lhsIsUndefined); - } - bool lhsIsUndefined() { return extra_; } @@ -2020,7 +1914,7 @@ class ICCompare_NumberWithUndefined : public ICStub } ICStub *getStub(ICStubSpace *space) { - return ICCompare_NumberWithUndefined::New(space, getStubCode(), lhsIsUndefined); + return ICStub::New(space, getStubCode(), lhsIsUndefined); } }; }; @@ -2034,12 +1928,6 @@ class ICCompare_String : public ICStub {} public: - static inline ICCompare_String *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICMultiStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -2050,7 +1938,7 @@ class ICCompare_String : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICCompare_String::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2064,12 +1952,6 @@ class ICCompare_Boolean : public ICStub {} public: - static inline ICCompare_Boolean *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICMultiStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -2080,7 +1962,7 @@ class ICCompare_Boolean : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICCompare_Boolean::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2094,12 +1976,6 @@ class ICCompare_Object : public ICStub {} public: - static inline ICCompare_Object *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICMultiStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -2110,7 +1986,7 @@ class ICCompare_Object : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICCompare_Object::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2124,12 +2000,6 @@ class ICCompare_ObjectWithUndefined : public ICStub {} public: - static inline ICCompare_ObjectWithUndefined *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICMultiStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -2152,7 +2022,7 @@ class ICCompare_ObjectWithUndefined : public ICStub } ICStub *getStub(ICStubSpace *space) { - return ICCompare_ObjectWithUndefined::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2168,14 +2038,6 @@ class ICCompare_Int32WithBoolean : public ICStub } public: - static inline ICCompare_Int32WithBoolean *New(ICStubSpace *space, JitCode *code, - bool lhsIsInt32) - { - if (!code) - return nullptr; - return space->allocate(code, lhsIsInt32); - } - bool lhsIsInt32() const { return extra_; } @@ -2200,7 +2062,7 @@ class ICCompare_Int32WithBoolean : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICCompare_Int32WithBoolean::New(space, getStubCode(), lhsIsInt32_); + return ICStub::New(space, getStubCode(), lhsIsInt32_); } }; }; @@ -2218,12 +2080,6 @@ class ICToBool_Fallback : public ICFallbackStub public: static const uint32_t MAX_OPTIMIZED_STUBS = 8; - static inline ICToBool_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: @@ -2234,7 +2090,7 @@ class ICToBool_Fallback : public ICFallbackStub : ICStubCompiler(cx, ICStub::ToBool_Fallback) {} ICStub *getStub(ICStubSpace *space) { - return ICToBool_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2247,12 +2103,6 @@ class ICToBool_Int32 : public ICStub : ICStub(ICStub::ToBool_Int32, stubCode) {} public: - static inline ICToBool_Int32 *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: @@ -2263,7 +2113,7 @@ class ICToBool_Int32 : public ICStub : ICStubCompiler(cx, ICStub::ToBool_Int32) {} ICStub *getStub(ICStubSpace *space) { - return ICToBool_Int32::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2276,12 +2126,6 @@ class ICToBool_String : public ICStub : ICStub(ICStub::ToBool_String, stubCode) {} public: - static inline ICToBool_String *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: @@ -2292,7 +2136,7 @@ class ICToBool_String : public ICStub : ICStubCompiler(cx, ICStub::ToBool_String) {} ICStub *getStub(ICStubSpace *space) { - return ICToBool_String::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2305,12 +2149,6 @@ class ICToBool_NullUndefined : public ICStub : ICStub(ICStub::ToBool_NullUndefined, stubCode) {} public: - static inline ICToBool_NullUndefined *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: @@ -2321,7 +2159,7 @@ class ICToBool_NullUndefined : public ICStub : ICStubCompiler(cx, ICStub::ToBool_NullUndefined) {} ICStub *getStub(ICStubSpace *space) { - return ICToBool_NullUndefined::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2334,12 +2172,6 @@ class ICToBool_Double : public ICStub : ICStub(ICStub::ToBool_Double, stubCode) {} public: - static inline ICToBool_Double *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: @@ -2350,7 +2182,7 @@ class ICToBool_Double : public ICStub : ICStubCompiler(cx, ICStub::ToBool_Double) {} ICStub *getStub(ICStubSpace *space) { - return ICToBool_Double::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2363,12 +2195,6 @@ class ICToBool_Object : public ICStub : ICStub(ICStub::ToBool_Object, stubCode) {} public: - static inline ICToBool_Object *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: @@ -2379,7 +2205,7 @@ class ICToBool_Object : public ICStub : ICStubCompiler(cx, ICStub::ToBool_Object) {} ICStub *getStub(ICStubSpace *space) { - return ICToBool_Object::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2395,12 +2221,6 @@ class ICToNumber_Fallback : public ICFallbackStub : ICFallbackStub(ICStub::ToNumber_Fallback, stubCode) {} public: - static inline ICToNumber_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: @@ -2411,7 +2231,7 @@ class ICToNumber_Fallback : public ICFallbackStub : ICStubCompiler(cx, ICStub::ToNumber_Fallback) {} ICStub *getStub(ICStubSpace *space) { - return ICToNumber_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2437,12 +2257,6 @@ class ICBinaryArith_Fallback : public ICFallbackStub public: static const uint32_t MAX_OPTIMIZED_STUBS = 8; - static inline ICBinaryArith_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - bool sawDoubleResult() const { return extra_ & SAW_DOUBLE_RESULT_BIT; } @@ -2466,7 +2280,7 @@ class ICBinaryArith_Fallback : public ICFallbackStub : ICStubCompiler(cx, ICStub::BinaryArith_Fallback) {} ICStub *getStub(ICStubSpace *space) { - return ICBinaryArith_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2482,11 +2296,6 @@ class ICBinaryArith_Int32 : public ICStub } public: - static inline ICBinaryArith_Int32 *New(ICStubSpace *space, JitCode *code, bool allowDouble) { - if (!code) - return nullptr; - return space->allocate(code, allowDouble); - } bool allowDouble() const { return extra_; } @@ -2511,7 +2320,7 @@ class ICBinaryArith_Int32 : public ICStub op_(op), allowDouble_(allowDouble) {} ICStub *getStub(ICStubSpace *space) { - return ICBinaryArith_Int32::New(space, getStubCode(), allowDouble_); + return ICStub::New(space, getStubCode(), allowDouble_); } }; }; @@ -2525,12 +2334,6 @@ class ICBinaryArith_StringConcat : public ICStub {} public: - static inline ICBinaryArith_StringConcat *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -2541,7 +2344,7 @@ class ICBinaryArith_StringConcat : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICBinaryArith_StringConcat::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2557,13 +2360,6 @@ class ICBinaryArith_StringObjectConcat : public ICStub } public: - static inline ICBinaryArith_StringObjectConcat *New(ICStubSpace *space, JitCode *code, - bool lhsIsString) { - if (!code) - return nullptr; - return space->allocate(code, lhsIsString); - } - bool lhsIsString() const { return extra_; } @@ -2584,7 +2380,7 @@ class ICBinaryArith_StringObjectConcat : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICBinaryArith_StringObjectConcat::New(space, getStubCode(), lhsIsString_); + return ICStub::New(space, getStubCode(), lhsIsString_); } }; }; @@ -2598,12 +2394,6 @@ class ICBinaryArith_Double : public ICStub {} public: - static inline ICBinaryArith_Double *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICMultiStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -2614,7 +2404,7 @@ class ICBinaryArith_Double : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICBinaryArith_Double::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2635,13 +2425,6 @@ class ICBinaryArith_BooleanWithInt32 : public ICStub } public: - static inline ICBinaryArith_BooleanWithInt32 *New(ICStubSpace *space, JitCode *code, - bool lhsIsBool, bool rhsIsBool) { - if (!code) - return nullptr; - return space->allocate(code, lhsIsBool, rhsIsBool); - } - bool lhsIsBoolean() const { return extra_ & 1; } @@ -2674,8 +2457,8 @@ class ICBinaryArith_BooleanWithInt32 : public ICStub } ICStub *getStub(ICStubSpace *space) { - return ICBinaryArith_BooleanWithInt32::New(space, getStubCode(), - lhsIsBool_, rhsIsBool_); + return ICStub::New(space, getStubCode(), + lhsIsBool_, rhsIsBool_); } }; }; @@ -2691,13 +2474,6 @@ class ICBinaryArith_DoubleWithInt32 : public ICStub } public: - static inline ICBinaryArith_DoubleWithInt32 *New(ICStubSpace *space, JitCode *code, - bool lhsIsDouble) { - if (!code) - return nullptr; - return space->allocate(code, lhsIsDouble); - } - bool lhsIsDouble() const { return extra_; } @@ -2719,7 +2495,7 @@ class ICBinaryArith_DoubleWithInt32 : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICBinaryArith_DoubleWithInt32::New(space, getStubCode(), lhsIsDouble_); + return ICStub::New(space, getStubCode(), lhsIsDouble_); } }; }; @@ -2741,12 +2517,6 @@ class ICUnaryArith_Fallback : public ICFallbackStub public: static const uint32_t MAX_OPTIMIZED_STUBS = 8; - static inline ICUnaryArith_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - bool sawDoubleResult() { return extra_; } @@ -2765,7 +2535,7 @@ class ICUnaryArith_Fallback : public ICFallbackStub {} ICStub *getStub(ICStubSpace *space) { - return ICUnaryArith_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2779,12 +2549,6 @@ class ICUnaryArith_Int32 : public ICStub {} public: - static inline ICUnaryArith_Int32 *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICMultiStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -2795,7 +2559,7 @@ class ICUnaryArith_Int32 : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICUnaryArith_Int32::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2809,12 +2573,6 @@ class ICUnaryArith_Double : public ICStub {} public: - static inline ICUnaryArith_Double *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICMultiStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -2825,7 +2583,7 @@ class ICUnaryArith_Double : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICUnaryArith_Double::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -2847,12 +2605,6 @@ class ICGetElem_Fallback : public ICMonitoredFallbackStub public: static const uint32_t MAX_OPTIMIZED_STUBS = 16; - static inline ICGetElem_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - void noteNonNativeAccess() { extra_ |= EXTRA_NON_NATIVE; } @@ -2878,7 +2630,7 @@ class ICGetElem_Fallback : public ICMonitoredFallbackStub { } ICStub *getStub(ICStubSpace *space) { - ICGetElem_Fallback *stub = ICGetElem_Fallback::New(space, getStubCode()); + ICGetElem_Fallback *stub = ICStub::New(space, getStubCode()); if (!stub) return nullptr; if (!stub->initMonitoringChain(cx, space)) @@ -2990,18 +2742,6 @@ class ICGetElem_NativeSlot : public ICGetElemNativeSlotStub : ICGetElemNativeSlotStub(ICStub::GetElem_NativeSlot, stubCode, firstMonitorStub, shape, name, acctype, needsAtomize, offset) {} - - public: - static inline ICGetElem_NativeSlot *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, - HandleShape shape, HandlePropertyName name, - AccessType acctype, bool needsAtomize, uint32_t offset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, shape, name, - acctype, needsAtomize, offset); - } }; class ICGetElem_NativePrototypeSlot : public ICGetElemNativeSlotStub @@ -3016,20 +2756,6 @@ class ICGetElem_NativePrototypeSlot : public ICGetElemNativeSlotStub HandleObject holder, HandleShape holderShape); public: - static inline ICGetElem_NativePrototypeSlot *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, - HandleShape shape, HandlePropertyName name, - AccessType acctype, bool needsAtomize, - uint32_t offset, HandleObject holder, - HandleShape holderShape) - { - if (!code) - return nullptr; - return space->allocate( - code, firstMonitorStub, shape, name, acctype, needsAtomize, offset, holder, - holderShape); - } - HeapPtrObject &holder() { return holder_; } @@ -3090,19 +2816,6 @@ class ICGetElem_NativePrototypeCallNative : public ICGetElemNativePrototypeCallS {} public: - static inline ICGetElem_NativePrototypeCallNative *New( - ICStubSpace *space, JitCode *code, ICStub *firstMonitorStub, - HandleShape shape, HandlePropertyName name, AccessType acctype, - bool needsAtomize, HandleFunction getter, uint32_t pcOffset, - HandleObject holder, HandleShape holderShape) - { - if (!code) - return nullptr; - return space->allocate( - code, firstMonitorStub, shape, name, acctype, needsAtomize, getter, - pcOffset, holder, holderShape); - } - static ICGetElem_NativePrototypeCallNative *Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub, ICGetElem_NativePrototypeCallNative &other); @@ -3124,19 +2837,6 @@ class ICGetElem_NativePrototypeCallScripted : public ICGetElemNativePrototypeCal {} public: - static inline ICGetElem_NativePrototypeCallScripted *New( - ICStubSpace *space, JitCode *code, ICStub *firstMonitorStub, - HandleShape shape, HandlePropertyName name, AccessType acctype, - bool needsAtomize, HandleFunction getter, uint32_t pcOffset, - HandleObject holder, HandleShape holderShape) - { - if (!code) - return nullptr; - return space->allocate( - code, firstMonitorStub, shape, name, acctype, needsAtomize, getter, - pcOffset, holder, holderShape); - } - static ICGetElem_NativePrototypeCallScripted * Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub, @@ -3213,7 +2913,7 @@ class ICGetElemNativeCompiler : public ICStubCompiler RootedShape shape(cx, obj_->lastProperty()); if (kind == ICStub::GetElem_NativeSlot) { MOZ_ASSERT(obj_ == holder_); - return ICGetElem_NativeSlot::New( + return ICStub::New( space, getStubCode(), firstMonitorStub_, shape, name_, acctype_, needsAtomize_, offset_); } @@ -3221,20 +2921,20 @@ class ICGetElemNativeCompiler : public ICStubCompiler MOZ_ASSERT(obj_ != holder_); RootedShape holderShape(cx, holder_->lastProperty()); if (kind == ICStub::GetElem_NativePrototypeSlot) { - return ICGetElem_NativePrototypeSlot::New( + return ICStub::New( space, getStubCode(), firstMonitorStub_, shape, name_, acctype_, needsAtomize_, offset_, holder_, holderShape); } if (kind == ICStub::GetElem_NativePrototypeCallNative) { - return ICGetElem_NativePrototypeCallNative::New( + return ICStub::New( space, getStubCode(), firstMonitorStub_, shape, name_, acctype_, needsAtomize_, getter_, pcOffset_, holder_, holderShape); } MOZ_ASSERT(kind == ICStub::GetElem_NativePrototypeCallScripted); if (kind == ICStub::GetElem_NativePrototypeCallScripted) { - return ICGetElem_NativePrototypeCallScripted::New( + return ICStub::New( space, getStubCode(), firstMonitorStub_, shape, name_, acctype_, needsAtomize_, getter_, pcOffset_, holder_, holderShape); } @@ -3251,12 +2951,6 @@ class ICGetElem_String : public ICStub : ICStub(ICStub::GetElem_String, stubCode) {} public: - static inline ICGetElem_String *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: @@ -3267,7 +2961,7 @@ class ICGetElem_String : public ICStub : ICStubCompiler(cx, ICStub::GetElem_String) {} ICStub *getStub(ICStubSpace *space) { - return ICGetElem_String::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -3281,14 +2975,6 @@ class ICGetElem_Dense : public ICMonitoredStub ICGetElem_Dense(JitCode *stubCode, ICStub *firstMonitorStub, HandleShape shape); public: - static inline ICGetElem_Dense *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, HandleShape shape) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, shape); - } - static ICGetElem_Dense *Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub, ICGetElem_Dense &other); @@ -3325,7 +3011,7 @@ class ICGetElem_Dense : public ICMonitoredStub {} ICStub *getStub(ICStubSpace *space) { - return ICGetElem_Dense::New(space, getStubCode(), firstMonitorStub_, shape_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, shape_); } }; }; @@ -3360,14 +3046,6 @@ class ICGetElem_TypedArray : public ICStub ICGetElem_TypedArray(JitCode *stubCode, HandleShape shape, Scalar::Type type); public: - static inline ICGetElem_TypedArray *New(ICStubSpace *space, JitCode *code, - HandleShape shape, Scalar::Type type) - { - if (!code) - return nullptr; - return space->allocate(code, shape, type); - } - static size_t offsetOfShape() { return offsetof(ICGetElem_TypedArray, shape_); } @@ -3399,7 +3077,7 @@ class ICGetElem_TypedArray : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICGetElem_TypedArray::New(space, getStubCode(), shape_, type_); + return ICStub::New(space, getStubCode(), shape_, type_); } }; }; @@ -3418,14 +3096,6 @@ class ICGetElem_Arguments : public ICMonitoredStub } public: - static inline ICGetElem_Arguments *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, Which which) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, which); - } - static ICGetElem_Arguments *Clone(JSContext *, ICStubSpace *space, ICStub *firstMonitorStub, ICGetElem_Arguments &other); @@ -3460,7 +3130,7 @@ class ICGetElem_Arguments : public ICMonitoredStub {} ICStub *getStub(ICStubSpace *space) { - return ICGetElem_Arguments::New(space, getStubCode(), firstMonitorStub_, which_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, which_); } }; }; @@ -3480,12 +3150,6 @@ class ICSetElem_Fallback : public ICFallbackStub public: static const uint32_t MAX_OPTIMIZED_STUBS = 8; - static inline ICSetElem_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - void noteArrayWriteHole() { extra_ = 1; } @@ -3504,7 +3168,7 @@ class ICSetElem_Fallback : public ICFallbackStub { } ICStub *getStub(ICStubSpace *space) { - return ICSetElem_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -3519,13 +3183,6 @@ class ICSetElem_Dense : public ICUpdatedStub ICSetElem_Dense(JitCode *stubCode, HandleShape shape, HandleObjectGroup group); public: - static inline ICSetElem_Dense *New(ICStubSpace *space, JitCode *code, HandleShape shape, - HandleObjectGroup group) { - if (!code) - return nullptr; - return space->allocate(code, shape, group); - } - static size_t offsetOfShape() { return offsetof(ICSetElem_Dense, shape_); } @@ -3558,7 +3215,7 @@ class ICSetElem_Dense : public ICUpdatedStub {} ICUpdatedStub *getStub(ICStubSpace *space) { - ICSetElem_Dense *stub = ICSetElem_Dense::New(space, getStubCode(), shape_, group_); + ICSetElem_Dense *stub = ICStub::New(space, getStubCode(), shape_, group_); if (!stub || !stub->initUpdatingChain(cx, space)) return nullptr; return stub; @@ -3623,15 +3280,6 @@ class ICSetElem_DenseAddImpl : public ICSetElem_DenseAdd } public: - static inline ICSetElem_DenseAddImpl *New(ICStubSpace *space, JitCode *code, - ObjectGroup *group, - const AutoShapeVector *shapes) - { - if (!code) - return nullptr; - return space->allocate >(code, group, shapes); - } - void traceShapes(JSTracer *trc) { for (size_t i = 0; i < NumShapes; i++) MarkShape(trc, &shapes_[i], "baseline-setelem-denseadd-stub-shape"); @@ -3681,15 +3329,6 @@ class ICSetElem_TypedArray : public ICStub bool expectOutOfBounds); public: - static inline ICSetElem_TypedArray *New(ICStubSpace *space, JitCode *code, - HandleShape shape, Scalar::Type type, - bool expectOutOfBounds) - { - if (!code) - return nullptr; - return space->allocate(code, shape, type, expectOutOfBounds); - } - Scalar::Type type() const { return (Scalar::Type) (extra_ & 0xff); } @@ -3732,8 +3371,8 @@ class ICSetElem_TypedArray : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICSetElem_TypedArray::New(space, getStubCode(), shape_, type_, - expectOutOfBounds_); + return ICStub::New(space, getStubCode(), shape_, type_, + expectOutOfBounds_); } }; }; @@ -3749,12 +3388,6 @@ class ICIn_Fallback : public ICFallbackStub { } public: - static inline ICIn_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -3765,7 +3398,7 @@ class ICIn_Fallback : public ICFallbackStub { } ICStub *getStub(ICStubSpace *space) { - return ICIn_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -3783,13 +3416,6 @@ class ICGetName_Fallback : public ICMonitoredFallbackStub public: static const uint32_t MAX_OPTIMIZED_STUBS = 8; - - static inline ICGetName_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - static const size_t UNOPTIMIZABLE_ACCESS_BIT = 0; void noteUnoptimizableAccess() { @@ -3809,7 +3435,7 @@ class ICGetName_Fallback : public ICMonitoredFallbackStub { } ICStub *getStub(ICStubSpace *space) { - ICGetName_Fallback *stub = ICGetName_Fallback::New(space, getStubCode()); + ICGetName_Fallback *stub = ICStub::New(space, getStubCode()); if (!stub || !stub->initMonitoringChain(cx, space)) return nullptr; return stub; @@ -3829,14 +3455,6 @@ class ICGetName_Global : public ICMonitoredStub ICGetName_Global(JitCode *stubCode, ICStub *firstMonitorStub, HandleShape shape, uint32_t slot); public: - static inline ICGetName_Global *New(ICStubSpace *space, JitCode *code, ICStub *firstMonitorStub, - HandleShape shape, uint32_t slot) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, shape, slot); - } - HeapPtrShape &shape() { return shape_; } @@ -3864,7 +3482,8 @@ class ICGetName_Global : public ICMonitoredStub {} ICStub *getStub(ICStubSpace *space) { - return ICGetName_Global::New(space, getStubCode(), firstMonitorStub_, shape_, slot_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, shape_, + slot_); } }; }; @@ -3891,14 +3510,6 @@ class ICGetName_Scope : public ICMonitoredStub } public: - static inline ICGetName_Scope *New(ICStubSpace *space, JitCode *code, ICStub *firstMonitorStub, - AutoShapeVector *shapes, uint32_t offset) - { - if (!code) - return nullptr; - return space->allocate >(code, firstMonitorStub, shapes, offset); - } - void traceScopes(JSTracer *trc) { for (size_t i = 0; i < NumHops + 1; i++) MarkShape(trc, &shapes_[i], "baseline-scope-stub-shape"); @@ -3938,7 +3549,7 @@ class ICGetName_Scope : public ICMonitoredStub } ICStub *getStub(ICStubSpace *space) { - return ICGetName_Scope::New(space, getStubCode(), firstMonitorStub_, shapes_, offset_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, shapes_, offset_); } }; }; @@ -3954,12 +3565,6 @@ class ICBindName_Fallback : public ICFallbackStub { } public: - static inline ICBindName_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -3970,7 +3575,7 @@ class ICBindName_Fallback : public ICFallbackStub { } ICStub *getStub(ICStubSpace *space) { - return ICBindName_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -3986,12 +3591,6 @@ class ICGetIntrinsic_Fallback : public ICMonitoredFallbackStub { } public: - static inline ICGetIntrinsic_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -4002,7 +3601,8 @@ class ICGetIntrinsic_Fallback : public ICMonitoredFallbackStub { } ICStub *getStub(ICStubSpace *space) { - ICGetIntrinsic_Fallback *stub = ICGetIntrinsic_Fallback::New(space, getStubCode()); + ICGetIntrinsic_Fallback *stub = + ICStub::New(space, getStubCode()); if (!stub || !stub->initMonitoringChain(cx, space)) return nullptr; return stub; @@ -4021,14 +3621,6 @@ class ICGetIntrinsic_Constant : public ICStub ~ICGetIntrinsic_Constant(); public: - static inline ICGetIntrinsic_Constant *New(ICStubSpace *space, JitCode *code, - HandleValue value) - { - if (!code) - return nullptr; - return space->allocate(code, value); - } - HeapValue &value() { return value_; } @@ -4048,7 +3640,7 @@ class ICGetIntrinsic_Constant : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICGetIntrinsic_Constant::New(space, getStubCode(), value_); + return ICStub::New(space, getStubCode(), value_); } }; }; @@ -4063,13 +3655,6 @@ class ICGetProp_Fallback : public ICMonitoredFallbackStub public: static const uint32_t MAX_OPTIMIZED_STUBS = 16; - - static inline ICGetProp_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - static const size_t UNOPTIMIZABLE_ACCESS_BIT = 0; static const size_t ACCESSED_GETTER_BIT = 1; @@ -4099,7 +3684,7 @@ class ICGetProp_Fallback : public ICMonitoredFallbackStub { } ICStub *getStub(ICStubSpace *space) { - ICGetProp_Fallback *stub = ICGetProp_Fallback::New(space, getStubCode()); + ICGetProp_Fallback *stub = ICStub::New(space, getStubCode()); if (!stub || !stub->initMonitoringChain(cx, space)) return nullptr; return stub; @@ -4117,13 +3702,6 @@ class ICGetProp_Generic : public ICMonitoredStub : ICMonitoredStub(ICStub::GetProp_Generic, stubCode, firstMonitorStub) {} public: - static inline ICGetProp_Generic *New(ICStubSpace *space, JitCode *code, ICStub *firstMonitorStub) - { - if(!code) - return nullptr; - return space->allocate(code, firstMonitorStub); - } - static ICGetProp_Generic *Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub, ICGetProp_Generic &other); @@ -4138,7 +3716,7 @@ class ICGetProp_Generic : public ICMonitoredStub {} ICStub *getStub(ICStubSpace *space) { - return ICGetProp_Generic::New(space, getStubCode(), firstMonitorStub_); + return ICStub::New(space, getStubCode(), firstMonitorStub_); } }; }; @@ -4153,12 +3731,6 @@ class ICGetProp_ArrayLength : public ICStub {} public: - static inline ICGetProp_ArrayLength *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICStubCompiler { bool generateStubCode(MacroAssembler &masm); @@ -4168,7 +3740,7 @@ class ICGetProp_ArrayLength : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICGetProp_ArrayLength::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -4189,14 +3761,6 @@ class ICGetProp_Primitive : public ICMonitoredStub HandleShape protoShape, uint32_t offset); public: - static inline ICGetProp_Primitive *New(ICStubSpace *space, JitCode *code, ICStub *firstMonitorStub, - HandleShape protoShape, uint32_t offset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, protoShape, offset); - } - HeapPtrShape &protoShape() { return protoShape_; } @@ -4238,8 +3802,8 @@ class ICGetProp_Primitive : public ICMonitoredStub ICStub *getStub(ICStubSpace *space) { RootedShape protoShape(cx, prototype_->lastProperty()); - return ICGetProp_Primitive::New(space, getStubCode(), firstMonitorStub_, - protoShape, offset_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, + protoShape, offset_); } }; }; @@ -4254,12 +3818,6 @@ class ICGetProp_StringLength : public ICStub {} public: - static inline ICGetProp_StringLength *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICStubCompiler { bool generateStubCode(MacroAssembler &masm); @@ -4269,7 +3827,7 @@ class ICGetProp_StringLength : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICGetProp_StringLength::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -4314,15 +3872,6 @@ class ICGetProp_Native : public ICGetPropNativeStub {} public: - static inline ICGetProp_Native *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, HandleShape shape, - uint32_t offset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, shape, offset); - } - HeapPtrShape &shape() { return shape_; } @@ -4353,17 +3902,6 @@ class ICGetProp_NativePrototype : public ICGetPropNativeStub uint32_t offset, HandleObject holder, HandleShape holderShape); public: - static inline ICGetProp_NativePrototype *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, HandleShape shape, - uint32_t offset, HandleObject holder, - HandleShape holderShape) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, shape, offset, - holder, holderShape); - } - static ICGetProp_NativePrototype *Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub, ICGetProp_NativePrototype &other); @@ -4409,18 +3947,6 @@ class ICGetProp_UnboxedPrototype : public ICGetPropNativeStub uint32_t offset, HandleObject holder, HandleShape holderShape); public: - static inline ICGetProp_UnboxedPrototype *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, - HandleObjectGroup group, - uint32_t offset, HandleObject holder, - HandleShape holderShape) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, group, offset, - holder, holderShape); - } - static ICGetProp_UnboxedPrototype *Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub, ICGetProp_UnboxedPrototype &other); @@ -4506,16 +4032,6 @@ class ICGetProp_NativeDoesNotExist : public ICMonitoredStub size_t protoChainDepth); public: - static inline ICGetProp_NativeDoesNotExist *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, - size_t protoChainDepth) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, - protoChainDepth); - } - size_t protoChainDepth() const { MOZ_ASSERT(extra_ <= MAX_PROTO_CHAIN_DEPTH); return extra_; @@ -4545,16 +4061,6 @@ class ICGetProp_NativeDoesNotExistImpl : public ICGetProp_NativeDoesNotExist const AutoShapeVector *shapes); public: - static inline ICGetProp_NativeDoesNotExistImpl *New( - ICStubSpace *space, JitCode *code, ICStub *firstMonitorStub, - const AutoShapeVector *shapes) - { - if (!code) - return nullptr; - return space->allocate>( - code, firstMonitorStub, shapes); - } - void traceShapes(JSTracer *trc) { for (size_t i = 0; i < NumShapes; i++) MarkShape(trc, &shapes_[i], "baseline-getpropnativedoesnotexist-stub-shape"); @@ -4584,8 +4090,8 @@ class ICGetPropNativeDoesNotExistCompiler : public ICStubCompiler template ICStub *getStubSpecific(ICStubSpace *space, const AutoShapeVector *shapes) { - return ICGetProp_NativeDoesNotExistImpl::New(space, getStubCode(), - firstMonitorStub_, shapes); + return ICStub::New>(space, getStubCode(), + firstMonitorStub_, shapes); } ICStub *getStub(ICStubSpace *space); @@ -4607,15 +4113,6 @@ class ICGetProp_Unboxed : public ICMonitoredStub } public: - static inline ICGetProp_Unboxed *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, HandleObjectGroup group, - uint32_t fieldOffset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, group, fieldOffset); - } - HeapPtrObjectGroup &group() { return group_; } @@ -4651,8 +4148,8 @@ class ICGetProp_Unboxed : public ICMonitoredStub {} ICStub *getStub(ICStubSpace *space) { - return ICGetProp_Unboxed::New(space, getStubCode(), firstMonitorStub_, - group_, fieldOffset_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, + group_, fieldOffset_); } }; }; @@ -4681,15 +4178,6 @@ class ICGetProp_TypedObject : public ICMonitoredStub } public: - static inline ICGetProp_TypedObject *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, HandleShape shape, - uint32_t fieldOffset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, shape, fieldOffset); - } - HeapPtrShape &shape() { return shape_; } @@ -4729,8 +4217,8 @@ class ICGetProp_TypedObject : public ICMonitoredStub {} ICStub *getStub(ICStubSpace *space) { - return ICGetProp_TypedObject::New(space, getStubCode(), firstMonitorStub_, - shape_, fieldOffset_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, + shape_, fieldOffset_); } }; }; @@ -4867,18 +4355,6 @@ class ICGetProp_CallScripted : public ICGetPropCallPrototypeGetter {} public: - static inline ICGetProp_CallScripted *New( - ICStubSpace *space, JitCode *code, ICStub *firstMonitorStub, - HandleShape receiverShape, HandleObject holder, HandleShape holderShape, - HandleFunction getter, uint32_t pcOffset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, - receiverShape, holder, holderShape, getter, - pcOffset); - } - static ICGetProp_CallScripted *Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub, ICGetProp_CallScripted &other); @@ -4897,8 +4373,9 @@ class ICGetProp_CallScripted : public ICGetPropCallPrototypeGetter ICStub *getStub(ICStubSpace *space) { RootedShape receiverShape(cx, receiver_->lastProperty()); RootedShape holderShape(cx, holder_->lastProperty()); - return ICGetProp_CallScripted::New(space, getStubCode(), firstMonitorStub_, receiverShape, - holder_, holderShape, getter_, pcOffset_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, + receiverShape, holder_, holderShape, getter_, + pcOffset_); } }; }; @@ -4917,17 +4394,6 @@ class ICGetProp_CallNative : public ICGetPropCallGetter { } public: - static inline ICGetProp_CallNative *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, HandleObject obj, - HandleShape shape, HandleFunction getter, - uint32_t pcOffset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, obj, shape, - getter, pcOffset); - } - static ICGetProp_CallNative *Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub, ICGetProp_CallNative &other); @@ -4953,8 +4419,8 @@ class ICGetProp_CallNative : public ICGetPropCallGetter ICStub *getStub(ICStubSpace *space) { RootedShape shape(cx, holder_->lastProperty()); - return ICGetProp_CallNative::New(space, getStubCode(), firstMonitorStub_, holder_, - shape, getter_, pcOffset_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, + holder_, shape, getter_, pcOffset_); } }; }; @@ -4973,18 +4439,6 @@ class ICGetProp_CallNativePrototype : public ICGetPropCallPrototypeGetter {} public: - static inline ICGetProp_CallNativePrototype *New( - ICStubSpace *space, JitCode *code, ICStub *firstMonitorStub, - HandleShape receiverShape, HandleObject holder, HandleShape holderShape, - HandleFunction getter, uint32_t pcOffset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, - receiverShape, holder, holderShape, - getter, pcOffset); - } - static ICGetProp_CallNativePrototype *Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub, ICGetProp_CallNativePrototype &other); @@ -5012,8 +4466,9 @@ class ICGetProp_CallNativePrototype : public ICGetPropCallPrototypeGetter ICStub *getStub(ICStubSpace *space) { RootedShape receiverShape(cx, receiver_->lastProperty()); RootedShape holderShape(cx, holder_->lastProperty()); - return ICGetProp_CallNativePrototype::New(space, getStubCode(), firstMonitorStub_, receiverShape, - holder_, holderShape, getter_, pcOffset_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, + receiverShape, holder_, holderShape, + getter_, pcOffset_); } }; }; @@ -5068,19 +4523,6 @@ class ICGetProp_CallDOMProxyNative : public ICGetPropCallDOMProxyNativeStub {} public: - static inline ICGetProp_CallDOMProxyNative *New( - ICStubSpace *space, JitCode *code, ICStub *firstMonitorStub, - HandleShape shape, const BaseProxyHandler *proxyHandler, - HandleShape expandoShape, HandleObject holder, HandleShape holderShape, - HandleFunction getter, uint32_t pcOffset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, shape, - proxyHandler, expandoShape, holder, - holderShape, getter, pcOffset); - } - static ICGetProp_CallDOMProxyNative *Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub, ICGetProp_CallDOMProxyNative &other); @@ -5107,21 +4549,6 @@ class ICGetProp_CallDOMProxyWithGenerationNative : public ICGetPropCallDOMProxyN { } - static inline ICGetProp_CallDOMProxyWithGenerationNative *New( - ICStubSpace *space, JitCode *code, ICStub *firstMonitorStub, - HandleShape shape, const BaseProxyHandler *proxyHandler, - ExpandoAndGeneration *expandoAndGeneration, uint32_t generation, - HandleShape expandoShape, HandleObject holder, HandleShape holderShape, - HandleFunction getter, uint32_t pcOffset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, - shape, proxyHandler, expandoAndGeneration, - generation, expandoShape, holder, holderShape, - getter, pcOffset); - } - static ICGetProp_CallDOMProxyWithGenerationNative * Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub, ICGetProp_CallDOMProxyWithGenerationNative &other); @@ -5179,17 +4606,6 @@ class ICGetProp_DOMProxyShadowed : public ICMonitoredStub uint32_t pcOffset); public: - static inline ICGetProp_DOMProxyShadowed *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, HandleShape shape, - const BaseProxyHandler *proxyHandler, - HandlePropertyName name, uint32_t pcOffset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, shape, - proxyHandler, name, pcOffset); - } - static ICGetProp_DOMProxyShadowed *Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub, ICGetProp_DOMProxyShadowed &other); @@ -5248,13 +4664,6 @@ class ICGetProp_ArgumentsLength : public ICStub { } public: - static inline ICGetProp_ArgumentsLength *New(ICStubSpace *space, JitCode *code) - { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICStubCompiler { protected: Which which_; @@ -5272,7 +4681,7 @@ class ICGetProp_ArgumentsLength : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICGetProp_ArgumentsLength::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -5285,14 +4694,6 @@ class ICGetProp_ArgumentsCallee : public ICMonitoredStub ICGetProp_ArgumentsCallee(JitCode *stubCode, ICStub *firstMonitorStub); public: - static inline ICGetProp_ArgumentsCallee *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub); - } - class Compiler : public ICStubCompiler { protected: ICStub *firstMonitorStub_; @@ -5305,7 +4706,7 @@ class ICGetProp_ArgumentsCallee : public ICMonitoredStub {} ICStub *getStub(ICStubSpace *space) { - return ICGetProp_ArgumentsCallee::New(space, getStubCode(), firstMonitorStub_); + return ICStub::New(space, getStubCode(), firstMonitorStub_); } }; }; @@ -5327,12 +4728,6 @@ class ICSetProp_Fallback : public ICFallbackStub public: static const uint32_t MAX_OPTIMIZED_STUBS = 8; - static inline ICSetProp_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - static const size_t UNOPTIMIZABLE_ACCESS_BIT = 0; void noteUnoptimizableAccess() { extra_ |= (1u << UNOPTIMIZABLE_ACCESS_BIT); @@ -5353,7 +4748,7 @@ class ICSetProp_Fallback : public ICFallbackStub { } ICStub *getStub(ICStubSpace *space) { - return ICSetProp_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -5371,13 +4766,6 @@ class ICSetProp_Native : public ICUpdatedStub ICSetProp_Native(JitCode *stubCode, HandleObjectGroup group, HandleShape shape, uint32_t offset); public: - static inline ICSetProp_Native *New(ICStubSpace *space, JitCode *code, HandleObjectGroup group, - HandleShape shape, uint32_t offset) - { - if (!code) - return nullptr; - return space->allocate(code, group, shape, offset); - } HeapPtrObjectGroup &group() { return group_; } @@ -5488,17 +4876,6 @@ class ICSetProp_NativeAddImpl : public ICSetProp_NativeAdd HandleShape newShape, HandleObjectGroup newGroup, uint32_t offset); public: - static inline ICSetProp_NativeAddImpl *New( - ICStubSpace *space, JitCode *code, HandleObjectGroup group, - const AutoShapeVector *shapes, HandleShape newShape, - HandleObjectGroup newGroup, uint32_t offset) - { - if (!code) - return nullptr; - return space->allocate >( - code, group, shapes, newShape, newGroup, offset); - } - void traceShapes(JSTracer *trc) { for (size_t i = 0; i < NumShapes; i++) MarkShape(trc, &shapes_[i], "baseline-setpropnativeadd-stub-shape"); @@ -5546,7 +4923,7 @@ class ICSetPropNativeAddCompiler : public ICStubCompiler RootedShape newShape(cx, obj_->lastProperty()); - return ICSetProp_NativeAddImpl::New( + return ICStub::New>( space, getStubCode(), oldGroup_, shapes, newShape, newGroup, offset_); } @@ -5569,14 +4946,6 @@ class ICSetProp_Unboxed : public ICUpdatedStub } public: - static inline ICSetProp_Unboxed *New(ICStubSpace *space, JitCode *code, - HandleObjectGroup group, uint32_t fieldOffset) - { - if (!code) - return nullptr; - return space->allocate(code, group, fieldOffset); - } - HeapPtrObjectGroup &group() { return group_; } @@ -5611,8 +4980,8 @@ class ICSetProp_Unboxed : public ICUpdatedStub {} ICUpdatedStub *getStub(ICStubSpace *space) { - ICUpdatedStub *stub = ICSetProp_Unboxed::New(space, getStubCode(), - group_, fieldOffset_); + ICUpdatedStub *stub = ICStub::New(space, getStubCode(), + group_, fieldOffset_); if (!stub || !stub->initUpdatingChain(cx, space)) return nullptr; return stub; @@ -5645,16 +5014,6 @@ class ICSetProp_TypedObject : public ICUpdatedStub } public: - static inline ICSetProp_TypedObject *New(ICStubSpace *space, JitCode *code, - HandleShape shape, HandleObjectGroup group, - uint32_t fieldOffset, bool isObjectReference) - { - if (!code) - return nullptr; - return space->allocate(code, shape, group, - fieldOffset, isObjectReference); - } - HeapPtrShape &shape() { return shape_; } @@ -5706,8 +5065,9 @@ class ICSetProp_TypedObject : public ICUpdatedStub bool isObjectReference = fieldDescr_->is() && fieldDescr_->as().type() == ReferenceTypeDescr::TYPE_OBJECT; - ICUpdatedStub *stub = ICSetProp_TypedObject::New(space, getStubCode(), shape_, group_, - fieldOffset_, isObjectReference); + ICUpdatedStub *stub = ICStub::New(space, getStubCode(), shape_, + group_, fieldOffset_, + isObjectReference); if (!stub || !stub->initUpdatingChain(cx, space)) return nullptr; return stub; @@ -5806,17 +5166,6 @@ class ICSetProp_CallScripted : public ICSetPropCallSetter {} public: - static inline ICSetProp_CallScripted *New(ICStubSpace *space, JitCode *code, - HandleShape shape, HandleObject holder, - HandleShape holderShape, HandleFunction setter, - uint32_t pcOffset) - { - if (!code) - return nullptr; - return space->allocate(code, shape, holder, holderShape, setter, - pcOffset); - } - static ICSetProp_CallScripted *Clone(JSContext *cx, ICStubSpace *space, ICStub *, ICSetProp_CallScripted &other); @@ -5834,8 +5183,8 @@ class ICSetProp_CallScripted : public ICSetPropCallSetter ICStub *getStub(ICStubSpace *space) { RootedShape shape(cx, obj_->lastProperty()); RootedShape holderShape(cx, holder_->lastProperty()); - return ICSetProp_CallScripted::New(space, getStubCode(), shape, holder_, holderShape, - setter_, pcOffset_); + return ICStub::New(space, getStubCode(), shape, holder_, + holderShape, setter_, pcOffset_); } }; }; @@ -5853,17 +5202,6 @@ class ICSetProp_CallNative : public ICSetPropCallSetter {} public: - static inline ICSetProp_CallNative *New(ICStubSpace *space, JitCode *code, - HandleShape shape, HandleObject holder, - HandleShape holderShape, HandleFunction setter, - uint32_t pcOffset) - { - if (!code) - return nullptr; - return space->allocate(code, shape, holder, holderShape, setter, - pcOffset); - } - static ICSetProp_CallNative *Clone(JSContext *cx, ICStubSpace *space, ICStub *, ICSetProp_CallNative &other); @@ -5881,8 +5219,8 @@ class ICSetProp_CallNative : public ICSetPropCallSetter ICStub *getStub(ICStubSpace *space) { RootedShape shape(cx, obj_->lastProperty()); RootedShape holderShape(cx, holder_->lastProperty()); - return ICSetProp_CallNative::New(space, getStubCode(), shape, holder_, holderShape, - setter_, pcOffset_); + return ICStub::New(space, getStubCode(), shape, holder_, + holderShape, setter_, pcOffset_); } }; }; @@ -5940,14 +5278,6 @@ class ICCall_Fallback : public ICMonitoredFallbackStub } public: - - static inline ICCall_Fallback *New(ICStubSpace *space, JitCode *code, bool isConstructing) - { - if (!code) - return nullptr; - return space->allocate(code, isConstructing); - } - bool isConstructing() const { return extra_ & CONSTRUCTING_FLAG; } @@ -5995,7 +5325,7 @@ class ICCall_Fallback : public ICMonitoredFallbackStub { } ICStub *getStub(ICStubSpace *space) { - ICCall_Fallback *stub = ICCall_Fallback::New(space, getStubCode(), isConstructing_); + ICCall_Fallback *stub = ICStub::New(space, getStubCode(), isConstructing_); if (!stub || !stub->initMonitoringChain(cx, space)) return nullptr; return stub; @@ -6022,17 +5352,6 @@ class ICCall_Scripted : public ICMonitoredStub uint32_t pcOffset); public: - static inline ICCall_Scripted *New( - ICStubSpace *space, JitCode *code, ICStub *firstMonitorStub, - HandleFunction callee, HandleObject templateObject, - uint32_t pcOffset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, - callee, templateObject, pcOffset); - } - static ICCall_Scripted *Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub, ICCall_Scripted &other); @@ -6064,14 +5383,6 @@ class ICCall_AnyScripted : public ICMonitoredStub { } public: - static inline ICCall_AnyScripted *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, uint32_t pcOffset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, pcOffset); - } - static ICCall_AnyScripted *Clone(JSContext *, ICStubSpace *space, ICStub *firstMonitorStub, ICCall_AnyScripted &other); @@ -6122,11 +5433,11 @@ class ICCallScriptedCompiler : public ICCallStubCompiler { ICStub *getStub(ICStubSpace *space) { if (callee_) { - return ICCall_Scripted::New(space, getStubCode(), firstMonitorStub_, - callee_, templateObject_, - pcOffset_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, + callee_, templateObject_, + pcOffset_); } - return ICCall_AnyScripted::New(space, getStubCode(), firstMonitorStub_, pcOffset_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, pcOffset_); } }; @@ -6148,16 +5459,6 @@ class ICCall_Native : public ICMonitoredStub uint32_t pcOffset); public: - static inline ICCall_Native *New(ICStubSpace *space, JitCode *code, ICStub *firstMonitorStub, - HandleFunction callee, HandleObject templateObject, - uint32_t pcOffset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, - callee, templateObject, pcOffset); - } - static ICCall_Native *Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub, ICCall_Native &other); @@ -6211,8 +5512,8 @@ class ICCall_Native : public ICMonitoredStub { } ICStub *getStub(ICStubSpace *space) { - return ICCall_Native::New(space, getStubCode(), firstMonitorStub_, - callee_, templateObject_, pcOffset_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, + callee_, templateObject_, pcOffset_); } }; }; @@ -6232,18 +5533,6 @@ class ICCall_ClassHook : public ICMonitoredStub uint32_t pcOffset); public: - static inline ICCall_ClassHook *New(ICStubSpace *space, - JitCode *code, ICStub *firstMonitorStub, - const Class *clasp, Native native, - HandleObject templateObject, - uint32_t pcOffset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, - clasp, native, templateObject, pcOffset); - } - static ICCall_ClassHook *Clone(JSContext *cx, ICStubSpace *space, ICStub *firstMonitorStub, ICCall_ClassHook &other); @@ -6297,8 +5586,8 @@ class ICCall_ClassHook : public ICMonitoredStub { } ICStub *getStub(ICStubSpace *space) { - return ICCall_ClassHook::New(space, getStubCode(), firstMonitorStub_, - clasp_, native_, templateObject_, pcOffset_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, + clasp_, native_, templateObject_, pcOffset_); } }; }; @@ -6321,14 +5610,6 @@ class ICCall_ScriptedApplyArray : public ICMonitoredStub {} public: - static inline ICCall_ScriptedApplyArray *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, uint32_t pcOffset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, pcOffset); - } - static ICCall_ScriptedApplyArray *Clone(JSContext *, ICStubSpace *space, ICStub *firstMonitorStub, ICCall_ScriptedApplyArray &other); @@ -6356,8 +5637,8 @@ class ICCall_ScriptedApplyArray : public ICMonitoredStub { } ICStub *getStub(ICStubSpace *space) { - return ICCall_ScriptedApplyArray::New(space, getStubCode(), firstMonitorStub_, - pcOffset_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, + pcOffset_); } }; }; @@ -6375,14 +5656,6 @@ class ICCall_ScriptedApplyArguments : public ICMonitoredStub {} public: - static inline ICCall_ScriptedApplyArguments *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, uint32_t pcOffset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, pcOffset); - } - static ICCall_ScriptedApplyArguments *Clone(JSContext *, ICStubSpace *space, ICStub *firstMonitorStub, ICCall_ScriptedApplyArguments &other); @@ -6410,8 +5683,8 @@ class ICCall_ScriptedApplyArguments : public ICMonitoredStub { } ICStub *getStub(ICStubSpace *space) { - return ICCall_ScriptedApplyArguments::New(space, getStubCode(), firstMonitorStub_, - pcOffset_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, + pcOffset_); } }; }; @@ -6430,14 +5703,6 @@ class ICCall_ScriptedFunCall : public ICMonitoredStub {} public: - static inline ICCall_ScriptedFunCall *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, uint32_t pcOffset) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, pcOffset); - } - static ICCall_ScriptedFunCall *Clone(JSContext *, ICStubSpace *space, ICStub *firstMonitorStub, ICCall_ScriptedFunCall &other); @@ -6464,8 +5729,8 @@ class ICCall_ScriptedFunCall : public ICMonitoredStub { } ICStub *getStub(ICStubSpace *space) { - return ICCall_ScriptedFunCall::New(space, getStubCode(), firstMonitorStub_, - pcOffset_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, + pcOffset_); } }; }; @@ -6488,16 +5753,6 @@ class ICCall_StringSplit : public ICMonitoredStub { } public: - static inline ICCall_StringSplit *New(ICStubSpace *space, JitCode *code, - ICStub *firstMonitorStub, uint32_t pcOffset, HandleString thisString, - HandleString argString, HandleArrayObject templateObject) - { - if (!code) - return nullptr; - return space->allocate(code, firstMonitorStub, pcOffset, thisString, - argString, templateObject); - } - static size_t offsetOfExpectedThis() { return offsetof(ICCall_StringSplit, expectedThis_); } @@ -6548,9 +5803,9 @@ class ICCall_StringSplit : public ICMonitoredStub { } ICStub *getStub(ICStubSpace *space) { - return ICCall_StringSplit::New(space, getStubCode(), firstMonitorStub_, - pcOffset_, expectedThis_, expectedArg_, - templateObject_); + return ICStub::New(space, getStubCode(), firstMonitorStub_, + pcOffset_, expectedThis_, expectedArg_, + templateObject_); } }; }; @@ -6565,12 +5820,6 @@ class ICCall_IsSuspendedStarGenerator : public ICStub {} public: - static inline ICCall_IsSuspendedStarGenerator *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -6580,7 +5829,7 @@ class ICCall_IsSuspendedStarGenerator : public ICStub : ICStubCompiler(cx, ICStub::Call_IsSuspendedStarGenerator) {} ICStub *getStub(ICStubSpace *space) { - return ICCall_IsSuspendedStarGenerator::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -6604,13 +5853,6 @@ class ICTableSwitch : public ICStub {} public: - static inline ICTableSwitch *New(ICStubSpace *space, JitCode *code, void **table, - int32_t min, int32_t length, void *defaultTarget) { - if (!code) - return nullptr; - return space->allocate(code, table, min, length, defaultTarget); - } - void fixupJumpTable(JSScript *script, BaselineScript *baseline); class Compiler : public ICStubCompiler { @@ -6637,12 +5879,6 @@ class ICIteratorNew_Fallback : public ICFallbackStub { } public: - static inline ICIteratorNew_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -6653,7 +5889,7 @@ class ICIteratorNew_Fallback : public ICFallbackStub { } ICStub *getStub(ICStubSpace *space) { - return ICIteratorNew_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -6668,12 +5904,6 @@ class ICIteratorMore_Fallback : public ICFallbackStub { } public: - static inline ICIteratorMore_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - void setHasNonStringResult() { extra_ = 1; } @@ -6692,7 +5922,7 @@ class ICIteratorMore_Fallback : public ICFallbackStub { } ICStub *getStub(ICStubSpace *space) { - return ICIteratorMore_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -6707,12 +5937,6 @@ class ICIteratorMore_Native : public ICStub { } public: - static inline ICIteratorMore_Native *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -6723,7 +5947,7 @@ class ICIteratorMore_Native : public ICStub { } ICStub *getStub(ICStubSpace *space) { - return ICIteratorMore_Native::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -6738,12 +5962,6 @@ class ICIteratorClose_Fallback : public ICFallbackStub { } public: - static inline ICIteratorClose_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -6754,7 +5972,7 @@ class ICIteratorClose_Fallback : public ICFallbackStub { } ICStub *getStub(ICStubSpace *space) { - return ICIteratorClose_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -6774,12 +5992,6 @@ class ICInstanceOf_Fallback : public ICFallbackStub public: static const uint32_t MAX_OPTIMIZED_STUBS = 4; - static inline ICInstanceOf_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - void noteUnoptimizableAccess() { extra_ |= UNOPTIMIZABLE_ACCESS_BIT; } @@ -6797,7 +6009,7 @@ class ICInstanceOf_Fallback : public ICFallbackStub { } ICStub *getStub(ICStubSpace *space) { - return ICInstanceOf_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -6813,14 +6025,6 @@ class ICInstanceOf_Function : public ICStub ICInstanceOf_Function(JitCode *stubCode, Shape *shape, JSObject *prototypeObj, uint32_t slot); public: - static inline ICInstanceOf_Function *New(ICStubSpace *space, JitCode *code, Shape *shape, - JSObject *prototypeObj, uint32_t slot) - { - if (!code) - return nullptr; - return space->allocate(code, shape, prototypeObj, slot); - } - HeapPtrShape &shape() { return shape_; } @@ -6857,7 +6061,7 @@ class ICInstanceOf_Function : public ICStub {} ICStub *getStub(ICStubSpace *space) { - return ICInstanceOf_Function::New(space, getStubCode(), shape_, prototypeObj_, slot_); + return ICStub::New(space, getStubCode(), shape_, prototypeObj_, slot_); } }; }; @@ -6874,12 +6078,6 @@ class ICTypeOf_Fallback : public ICFallbackStub { } public: - static inline ICTypeOf_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -6890,7 +6088,7 @@ class ICTypeOf_Fallback : public ICFallbackStub { } ICStub *getStub(ICStubSpace *space) { - return ICTypeOf_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -6907,12 +6105,6 @@ class ICTypeOf_Typed : public ICFallbackStub } public: - static inline ICTypeOf_Typed *New(ICStubSpace *space, JitCode *code, JSType type) { - if (!code) - return nullptr; - return space->allocate(code, type); - } - JSType type() const { return JSType(extra_); } @@ -6935,7 +6127,7 @@ class ICTypeOf_Typed : public ICFallbackStub { } ICStub *getStub(ICStubSpace *space) { - return ICTypeOf_Typed::New(space, getStubCode(), type_); + return ICStub::New(space, getStubCode(), type_); } }; }; @@ -6953,13 +6145,6 @@ class ICRest_Fallback : public ICFallbackStub public: static const uint32_t MAX_OPTIMIZED_STUBS = 8; - static inline ICRest_Fallback *New(ICStubSpace *space, JitCode *code, - ArrayObject *templateObject) { - if (!code) - return nullptr; - return space->allocate(code, templateObject); - } - HeapPtrArrayObject &templateObject() { return templateObject_; } @@ -6976,7 +6161,7 @@ class ICRest_Fallback : public ICFallbackStub { } ICStub *getStub(ICStubSpace *space) { - return ICRest_Fallback::New(space, getStubCode(), templateObject); + return ICStub::New(space, getStubCode(), templateObject); } }; }; @@ -6993,12 +6178,6 @@ class ICRetSub_Fallback : public ICFallbackStub public: static const uint32_t MAX_OPTIMIZED_STUBS = 8; - static inline ICRetSub_Fallback *New(ICStubSpace *space, JitCode *code) { - if (!code) - return nullptr; - return space->allocate(code); - } - class Compiler : public ICStubCompiler { protected: bool generateStubCode(MacroAssembler &masm); @@ -7009,7 +6188,7 @@ class ICRetSub_Fallback : public ICFallbackStub { } ICStub *getStub(ICStubSpace *space) { - return ICRetSub_Fallback::New(space, getStubCode()); + return ICStub::New(space, getStubCode()); } }; }; @@ -7031,13 +6210,6 @@ class ICRetSub_Resume : public ICStub { } public: - static ICRetSub_Resume *New(ICStubSpace *space, JitCode *code, uint32_t pcOffset, - uint8_t *addr) { - if (!code) - return nullptr; - return space->allocate(code, pcOffset, addr); - } - static size_t offsetOfPCOffset() { return offsetof(ICRetSub_Resume, pcOffset_); } @@ -7059,7 +6231,7 @@ class ICRetSub_Resume : public ICStub { } ICStub *getStub(ICStubSpace *space) { - return ICRetSub_Resume::New(space, getStubCode(), pcOffset_, addr_); + return ICStub::New(space, getStubCode(), pcOffset_, addr_); } }; };