зеркало из https://github.com/mozilla/gecko-dev.git
Bug 848449 - GC: Remove AutoAssertNoGC and AssertCanGC - Remove use of AssertCanGC r=terrence
--HG-- extra : rebase_source : 571a1c515d382c94d7a4c4398a08ea48d5507294
This commit is contained in:
Родитель
08b1e4676b
Коммит
3f97c69827
|
@ -4344,7 +4344,6 @@ EmitFor(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, ptrdiff_t top)
|
|||
static JS_NEVER_INLINE bool
|
||||
EmitFunc(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
||||
{
|
||||
AssertCanGC();
|
||||
RootedFunction fun(cx, pn->pn_funbox->function());
|
||||
JS_ASSERT(fun->isInterpreted());
|
||||
if (fun->hasScript()) {
|
||||
|
|
|
@ -4361,7 +4361,6 @@ CodeGenerator::generate()
|
|||
bool
|
||||
CodeGenerator::link()
|
||||
{
|
||||
AssertCanGC();
|
||||
JSContext *cx = GetIonContext()->cx;
|
||||
|
||||
Linker linker(masm);
|
||||
|
@ -4624,7 +4623,6 @@ const VMFunction CallsiteCloneIC::UpdateInfo =
|
|||
bool
|
||||
CodeGenerator::visitCallsiteCloneIC(OutOfLineUpdateCache *ool, CallsiteCloneIC *ic)
|
||||
{
|
||||
AssertCanGC();
|
||||
LInstruction *lir = ool->lir();
|
||||
saveLive(lir);
|
||||
|
||||
|
@ -4656,7 +4654,6 @@ const VMFunction NameIC::UpdateInfo = FunctionInfo<NameICFn>(NameIC::update);
|
|||
bool
|
||||
CodeGenerator::visitNameIC(OutOfLineUpdateCache *ool, NameIC *ic)
|
||||
{
|
||||
AssertCanGC();
|
||||
LInstruction *lir = ool->lir();
|
||||
saveLive(lir);
|
||||
|
||||
|
@ -4704,7 +4701,6 @@ const VMFunction GetPropertyIC::UpdateInfo =
|
|||
bool
|
||||
CodeGenerator::visitGetPropertyIC(OutOfLineUpdateCache *ool, GetPropertyIC *ic)
|
||||
{
|
||||
AssertCanGC();
|
||||
LInstruction *lir = ool->lir();
|
||||
saveLive(lir);
|
||||
|
||||
|
@ -4750,7 +4746,6 @@ const VMFunction GetElementIC::UpdateInfo =
|
|||
bool
|
||||
CodeGenerator::visitGetElementIC(OutOfLineUpdateCache *ool, GetElementIC *ic)
|
||||
{
|
||||
AssertCanGC();
|
||||
LInstruction *lir = ool->lir();
|
||||
saveLive(lir);
|
||||
|
||||
|
@ -4783,7 +4778,6 @@ const VMFunction BindNameIC::UpdateInfo =
|
|||
bool
|
||||
CodeGenerator::visitBindNameIC(OutOfLineUpdateCache *ool, BindNameIC *ic)
|
||||
{
|
||||
AssertCanGC();
|
||||
LInstruction *lir = ool->lir();
|
||||
saveLive(lir);
|
||||
|
||||
|
@ -4877,7 +4871,6 @@ const VMFunction SetPropertyIC::UpdateInfo =
|
|||
bool
|
||||
CodeGenerator::visitSetPropertyIC(OutOfLineUpdateCache *ool, SetPropertyIC *ic)
|
||||
{
|
||||
AssertCanGC();
|
||||
LInstruction *lir = ool->lir();
|
||||
saveLive(lir);
|
||||
|
||||
|
@ -5612,7 +5605,6 @@ static const VMFunction SPSExitInfo = FunctionInfo<SPSFn>(SPSExit);
|
|||
bool
|
||||
CodeGenerator::visitFunctionBoundary(LFunctionBoundary *lir)
|
||||
{
|
||||
AssertCanGC();
|
||||
Register temp = ToRegister(lir->temp()->output());
|
||||
|
||||
switch (lir->type()) {
|
||||
|
|
|
@ -328,8 +328,6 @@ IonActivation::~IonActivation()
|
|||
IonCode *
|
||||
IonCode::New(JSContext *cx, uint8_t *code, uint32_t bufferSize, JSC::ExecutablePool *pool)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
IonCode *codeObj = gc::NewGCThing<IonCode, CanGC>(cx, gc::FINALIZE_IONCODE, sizeof(IonCode), gc::DefaultHeap);
|
||||
if (!codeObj) {
|
||||
pool->release();
|
||||
|
@ -1089,7 +1087,6 @@ void
|
|||
AttachFinishedCompilations(JSContext *cx)
|
||||
{
|
||||
#ifdef JS_THREADSAFE
|
||||
AssertCanGC();
|
||||
IonCompartment *ion = cx->compartment->ionCompartment();
|
||||
if (!ion || !cx->runtime->workerThreadState)
|
||||
return;
|
||||
|
@ -1676,7 +1673,6 @@ ion::CanEnterUsingFastInvoke(JSContext *cx, HandleScript script, uint32_t numAct
|
|||
return Method_Error;
|
||||
|
||||
// This can GC, so afterward, script->ion is not guaranteed to be valid.
|
||||
AssertCanGC();
|
||||
if (!cx->compartment->ionCompartment()->enterJIT())
|
||||
return Method_Error;
|
||||
|
||||
|
@ -1689,7 +1685,6 @@ ion::CanEnterUsingFastInvoke(JSContext *cx, HandleScript script, uint32_t numAct
|
|||
static IonExecStatus
|
||||
EnterIon(JSContext *cx, StackFrame *fp, void *jitcode)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_CHECK_RECURSION(cx, return IonExec_Aborted);
|
||||
JS_ASSERT(ion::IsEnabled(cx));
|
||||
JS_ASSERT(CheckFrame(fp));
|
||||
|
@ -1774,7 +1769,6 @@ EnterIon(JSContext *cx, StackFrame *fp, void *jitcode)
|
|||
IonExecStatus
|
||||
ion::Cannon(JSContext *cx, StackFrame *fp)
|
||||
{
|
||||
AssertCanGC();
|
||||
RootedScript script(cx, fp->script());
|
||||
IonScript *ion = script->ion;
|
||||
IonCode *code = ion->method();
|
||||
|
@ -1806,7 +1800,6 @@ ion::Cannon(JSContext *cx, StackFrame *fp)
|
|||
IonExecStatus
|
||||
ion::SideCannon(JSContext *cx, StackFrame *fp, jsbytecode *pc)
|
||||
{
|
||||
AssertCanGC();
|
||||
RootedScript script(cx, fp->script());
|
||||
IonScript *ion = script->ion;
|
||||
IonCode *code = ion->method();
|
||||
|
|
|
@ -187,8 +187,6 @@ IonBuilder::getPolyCallTargets(types::StackTypeSet *calleeTypes,
|
|||
bool
|
||||
IonBuilder::canInlineTarget(JSFunction *target)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
if (!target->isInterpreted()) {
|
||||
IonSpew(IonSpew_Inlining, "Cannot inline due to non-interpreted");
|
||||
return false;
|
||||
|
@ -760,8 +758,6 @@ IonBuilder::snoopControlFlow(JSOp op)
|
|||
bool
|
||||
IonBuilder::inspectOpcode(JSOp op)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
// Don't compile fat opcodes, run the decomposed version instead.
|
||||
if (js_CodeSpec[op].format & JOF_DECOMPOSE)
|
||||
return true;
|
||||
|
@ -2907,7 +2903,6 @@ class AutoAccumulateExits
|
|||
bool
|
||||
IonBuilder::inlineScriptedCall(HandleFunction target, CallInfo &callInfo)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ASSERT(target->isInterpreted());
|
||||
JS_ASSERT(callInfo.hasCallType());
|
||||
JS_ASSERT(types::IsInlinableCall(pc));
|
||||
|
@ -3131,8 +3126,6 @@ IonBuilder::patchInlinedReturns(CallInfo &callInfo, MIRGraphExits &exits, MBasic
|
|||
bool
|
||||
IonBuilder::makeInliningDecision(AutoObjectVector &targets)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
// For "small" functions, we should be more aggressive about inlining.
|
||||
// This is based on the following intuition:
|
||||
// 1. The call overhead for a small function will likely be a much
|
||||
|
@ -4087,8 +4080,6 @@ IonBuilder::jsop_funapplyarguments(uint32_t argc)
|
|||
bool
|
||||
IonBuilder::jsop_call(uint32_t argc, bool constructing)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
// Acquire known call target if existent.
|
||||
AutoObjectVector originals(cx);
|
||||
types::StackTypeSet *calleeTypes = oracle->getCallTarget(script(), argc, pc);
|
||||
|
@ -6670,7 +6661,6 @@ bool
|
|||
IonBuilder::getPropTryMonomorphic(bool *emitted, HandleId id, types::StackTypeSet *barrier,
|
||||
TypeOracle::Unary unary, TypeOracle::UnaryTypes unaryTypes)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ASSERT(*emitted == false);
|
||||
bool accessGetter = oracle->propertyReadAccessGetter(script(), pc);
|
||||
|
||||
|
|
|
@ -96,7 +96,6 @@ IonCache::CacheName(IonCache::Kind kind)
|
|||
IonCache::LinkStatus
|
||||
IonCache::linkCode(JSContext *cx, MacroAssembler &masm, IonScript *ion, IonCode **code)
|
||||
{
|
||||
AssertCanGC();
|
||||
Linker linker(masm);
|
||||
*code = linker.newCode(cx);
|
||||
if (!code)
|
||||
|
@ -1924,7 +1923,6 @@ BindNameIC::update(JSContext *cx, size_t cacheIndex, HandleObject scopeChain)
|
|||
bool
|
||||
NameIC::attach(JSContext *cx, IonScript *ion, HandleObject scopeChain, HandleObject holder, HandleShape shape)
|
||||
{
|
||||
AssertCanGC();
|
||||
MacroAssembler masm(cx);
|
||||
Label failures;
|
||||
|
||||
|
|
|
@ -247,7 +247,6 @@ IonFrameIterator::machineState() const
|
|||
static void
|
||||
CloseLiveIterator(JSContext *cx, const InlineFrameIterator &frame, uint32_t localSlot)
|
||||
{
|
||||
AssertCanGC();
|
||||
SnapshotIterator si = frame.snapshotIterator();
|
||||
|
||||
// Skip stack slots until we reach the iterator object.
|
||||
|
@ -269,7 +268,6 @@ CloseLiveIterator(JSContext *cx, const InlineFrameIterator &frame, uint32_t loca
|
|||
static void
|
||||
CloseLiveIterators(JSContext *cx, const InlineFrameIterator &frame)
|
||||
{
|
||||
AssertCanGC();
|
||||
RootedScript script(cx, frame.script());
|
||||
jsbytecode *pc = frame.pc();
|
||||
|
||||
|
@ -300,7 +298,6 @@ CloseLiveIterators(JSContext *cx, const InlineFrameIterator &frame)
|
|||
void
|
||||
ion::HandleException(ResumeFromException *rfe)
|
||||
{
|
||||
AssertCanGC();
|
||||
JSContext *cx = GetIonContext()->cx;
|
||||
|
||||
IonSpew(IonSpew_Invalidate, "handling exception");
|
||||
|
|
|
@ -30,7 +30,6 @@ class Linker
|
|||
}
|
||||
|
||||
IonCode *newCode(JSContext *cx, IonCompartment *comp) {
|
||||
AssertCanGC();
|
||||
gc::AutoSuppressGC suppressGC(cx);
|
||||
if (masm.oom())
|
||||
return fail(cx);
|
||||
|
|
|
@ -606,7 +606,6 @@ TypeInferenceOracle::callArgsBarrier(HandleScript caller, jsbytecode *pc)
|
|||
bool
|
||||
TypeInferenceOracle::canEnterInlinedFunction(RawScript caller, jsbytecode *pc, RawFunction target)
|
||||
{
|
||||
AssertCanGC();
|
||||
RootedScript targetScript(cx, target->nonLazyScript());
|
||||
|
||||
// Make sure empty script has type information, to allow inlining in more cases.
|
||||
|
|
|
@ -53,8 +53,6 @@ ShouldMonitorReturnType(JSFunction *fun)
|
|||
bool
|
||||
InvokeFunction(JSContext *cx, HandleFunction fun0, uint32_t argc, Value *argv, Value *rval)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
RootedFunction fun(cx, fun0);
|
||||
if (fun->isInterpreted()) {
|
||||
if (fun->isInterpretedLazy() && !fun->getOrCreateScript(cx))
|
||||
|
|
|
@ -369,7 +369,6 @@ CodeGeneratorShared::markOsiPoint(LOsiPoint *ins, uint32_t *callPointOffset)
|
|||
bool
|
||||
CodeGeneratorShared::callVM(const VMFunction &fun, LInstruction *ins, const Register *dynStack)
|
||||
{
|
||||
AssertCanGC();
|
||||
#ifdef DEBUG
|
||||
if (ins->mirRaw()) {
|
||||
JS_ASSERT(ins->mirRaw()->isInstruction());
|
||||
|
|
|
@ -569,7 +569,6 @@ template <class ArgSeq, class StoreOutputTo>
|
|||
bool
|
||||
CodeGeneratorShared::visitOutOfLineCallVM(OutOfLineCallVM<ArgSeq, StoreOutputTo> *ool)
|
||||
{
|
||||
AssertCanGC();
|
||||
LInstruction *lir = ool->lir();
|
||||
|
||||
saveLive(lir);
|
||||
|
|
|
@ -386,7 +386,6 @@ IonRuntime::generateBailoutHandler(JSContext *cx)
|
|||
IonCode *
|
||||
IonRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
{
|
||||
AssertCanGC();
|
||||
typedef MoveResolver::MoveOperand MoveOperand;
|
||||
|
||||
JS_ASSERT(!StackKeptAligned);
|
||||
|
|
|
@ -27,7 +27,6 @@ using mozilla::DebugOnly;
|
|||
void
|
||||
analyze::PrintBytecode(JSContext *cx, HandleScript script, jsbytecode *pc)
|
||||
{
|
||||
AssertCanGC();
|
||||
printf("#%u:", script->id());
|
||||
Sprinter sprinter(cx);
|
||||
if (!sprinter.init())
|
||||
|
|
|
@ -1690,7 +1690,6 @@ namespace JS {
|
|||
JS_ALWAYS_INLINE bool
|
||||
ToNumber(JSContext *cx, const Value &v, double *out)
|
||||
{
|
||||
AssertCanGC();
|
||||
AssertArgumentsAreSane(cx, v);
|
||||
{
|
||||
js::SkipRoot root(cx, &v);
|
||||
|
@ -1781,7 +1780,6 @@ namespace JS {
|
|||
JS_ALWAYS_INLINE bool
|
||||
ToUint16(JSContext *cx, const js::Value &v, uint16_t *out)
|
||||
{
|
||||
AssertCanGC();
|
||||
AssertArgumentsAreSane(cx, v);
|
||||
{
|
||||
js::SkipRoot skip(cx, &v);
|
||||
|
@ -1798,7 +1796,6 @@ ToUint16(JSContext *cx, const js::Value &v, uint16_t *out)
|
|||
JS_ALWAYS_INLINE bool
|
||||
ToInt32(JSContext *cx, const js::Value &v, int32_t *out)
|
||||
{
|
||||
AssertCanGC();
|
||||
AssertArgumentsAreSane(cx, v);
|
||||
{
|
||||
js::SkipRoot root(cx, &v);
|
||||
|
@ -1815,7 +1812,6 @@ ToInt32(JSContext *cx, const js::Value &v, int32_t *out)
|
|||
JS_ALWAYS_INLINE bool
|
||||
ToUint32(JSContext *cx, const js::Value &v, uint32_t *out)
|
||||
{
|
||||
AssertCanGC();
|
||||
AssertArgumentsAreSane(cx, v);
|
||||
{
|
||||
js::SkipRoot root(cx, &v);
|
||||
|
@ -1832,7 +1828,6 @@ ToUint32(JSContext *cx, const js::Value &v, uint32_t *out)
|
|||
JS_ALWAYS_INLINE bool
|
||||
ToInt64(JSContext *cx, const js::Value &v, int64_t *out)
|
||||
{
|
||||
AssertCanGC();
|
||||
AssertArgumentsAreSane(cx, v);
|
||||
{
|
||||
js::SkipRoot skip(cx, &v);
|
||||
|
@ -1850,7 +1845,6 @@ ToInt64(JSContext *cx, const js::Value &v, int64_t *out)
|
|||
JS_ALWAYS_INLINE bool
|
||||
ToUint64(JSContext *cx, const js::Value &v, uint64_t *out)
|
||||
{
|
||||
AssertCanGC();
|
||||
AssertArgumentsAreSane(cx, v);
|
||||
{
|
||||
js::SkipRoot skip(cx, &v);
|
||||
|
|
|
@ -328,8 +328,6 @@ template <AllowGC allowGC>
|
|||
RawAtom
|
||||
js::AtomizeString(JSContext *cx, JSString *str, js::InternBehavior ib /* = js::DoNotInternAtom */)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
if (str->isAtom()) {
|
||||
JSAtom &atom = str->asAtom();
|
||||
/* N.B. static atoms are effectively always interned. */
|
||||
|
@ -371,7 +369,6 @@ js::AtomizeString<NoGC>(JSContext *cx, JSString *str, js::InternBehavior ib);
|
|||
RawAtom
|
||||
js::Atomize(JSContext *cx, const char *bytes, size_t length, InternBehavior ib)
|
||||
{
|
||||
AssertCanGC();
|
||||
CHECK_REQUEST(cx);
|
||||
|
||||
if (!JSString::validateLength(cx, length))
|
||||
|
@ -468,7 +465,6 @@ template<XDRMode mode>
|
|||
bool
|
||||
js::XDRAtom(XDRState<mode> *xdr, MutableHandleAtom atomp)
|
||||
{
|
||||
AssertCanGC();
|
||||
if (mode == XDR_ENCODE) {
|
||||
uint32_t nchars = atomp->length();
|
||||
if (!xdr->codeUint32(&nchars))
|
||||
|
|
|
@ -451,8 +451,6 @@ static void
|
|||
ReportError(JSContext *cx, const char *message, JSErrorReport *reportp,
|
||||
JSErrorCallback callback, void *userRef)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
/*
|
||||
* Check the error report, and set a JavaScript-catchable exception
|
||||
* if the error is defined to have an associated exception. If an
|
||||
|
|
|
@ -1014,7 +1014,6 @@ JS_UnwrapObjectAndInnerize(JSObject *obj)
|
|||
JS_FRIEND_API(JSBool)
|
||||
js_CallContextDebugHandler(JSContext *cx)
|
||||
{
|
||||
AssertCanGC();
|
||||
ScriptFrameIter iter(cx);
|
||||
JS_ASSERT(!iter.done());
|
||||
|
||||
|
@ -1113,8 +1112,6 @@ static char *
|
|||
FormatFrame(JSContext *cx, const ScriptFrameIter &iter, char *buf, int num,
|
||||
JSBool showArgs, JSBool showLocals, JSBool showThisProps)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
RootedScript script(cx, iter.script());
|
||||
jsbytecode* pc = iter.pc();
|
||||
|
||||
|
|
|
@ -456,8 +456,6 @@ js::XDRInterpretedFunction(XDRState<XDR_DECODE> *, HandleObject, HandleScript, M
|
|||
JSObject *
|
||||
js::CloneInterpretedFunction(JSContext *cx, HandleObject enclosingScope, HandleFunction srcFun)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
/* NB: Keep this in sync with XDRInterpretedFunction. */
|
||||
|
||||
RootedFunction clone(cx, NewFunction(cx, NullPtr(), NULL, 0,
|
||||
|
@ -617,7 +615,6 @@ FindBody(JSContext *cx, HandleFunction fun, StableCharPtr chars, size_t length,
|
|||
JSString *
|
||||
js::FunctionToString(JSContext *cx, HandleFunction fun, bool bodyOnly, bool lambdaParen)
|
||||
{
|
||||
AssertCanGC();
|
||||
StringBuffer out(cx);
|
||||
RootedScript script(cx);
|
||||
|
||||
|
@ -1474,7 +1471,6 @@ js::NewFunction(JSContext *cx, HandleObject funobjArg, Native native, unsigned n
|
|||
JSFunction *
|
||||
js::CloneFunctionObject(JSContext *cx, HandleFunction fun, HandleObject parent, gc::AllocKind allocKind)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ASSERT(parent);
|
||||
JS_ASSERT(!fun->isBoundFunction());
|
||||
|
||||
|
|
|
@ -4509,14 +4509,12 @@ Collect(JSRuntime *rt, bool incremental, int64_t budget,
|
|||
void
|
||||
js::GC(JSRuntime *rt, JSGCInvocationKind gckind, gcreason::Reason reason)
|
||||
{
|
||||
AssertCanGC();
|
||||
Collect(rt, false, SliceBudget::Unlimited, gckind, reason);
|
||||
}
|
||||
|
||||
void
|
||||
js::GCSlice(JSRuntime *rt, JSGCInvocationKind gckind, gcreason::Reason reason, int64_t millis)
|
||||
{
|
||||
AssertCanGC();
|
||||
int64_t sliceBudget;
|
||||
if (millis)
|
||||
sliceBudget = SliceBudget::TimeBudget(millis);
|
||||
|
@ -4531,7 +4529,6 @@ js::GCSlice(JSRuntime *rt, JSGCInvocationKind gckind, gcreason::Reason reason, i
|
|||
void
|
||||
js::GCFinalSlice(JSRuntime *rt, JSGCInvocationKind gckind, gcreason::Reason reason)
|
||||
{
|
||||
AssertCanGC();
|
||||
Collect(rt, true, SliceBudget::Unlimited, gckind, reason);
|
||||
}
|
||||
|
||||
|
@ -4548,7 +4545,6 @@ ZonesSelected(JSRuntime *rt)
|
|||
void
|
||||
js::GCDebugSlice(JSRuntime *rt, bool limit, int64_t objCount)
|
||||
{
|
||||
AssertCanGC();
|
||||
int64_t budget = limit ? SliceBudget::WorkBudget(objCount) : SliceBudget::Unlimited;
|
||||
if (!ZonesSelected(rt)) {
|
||||
if (IsIncrementalGCInProgress(rt))
|
||||
|
|
|
@ -476,9 +476,6 @@ template <typename T, AllowGC allowGC>
|
|||
inline T *
|
||||
NewGCThing(JSContext *cx, AllocKind kind, size_t thingSize, InitialHeap heap)
|
||||
{
|
||||
if (allowGC)
|
||||
AssertCanGC();
|
||||
|
||||
JS_ASSERT(thingSize == js::gc::Arena::thingSize(kind));
|
||||
JS_ASSERT_IF(cx->compartment == cx->runtime->atomsCompartment,
|
||||
kind == FINALIZE_STRING ||
|
||||
|
|
|
@ -6154,8 +6154,6 @@ JSCompartment::getNewType(JSContext *cx, Class *clasp, TaggedProto proto_, JSFun
|
|||
Rooted<TaggedProto> proto(cx, proto_);
|
||||
RootedFunction fun(cx, fun_);
|
||||
|
||||
AssertCanGC();
|
||||
|
||||
if (proto.isObject() && !proto.toObject()->setDelegate(cx))
|
||||
return NULL;
|
||||
|
||||
|
|
|
@ -604,7 +604,6 @@ TrackPropertyTypes(JSContext *cx, RawObject obj, RawId id)
|
|||
inline void
|
||||
AddTypePropertyId(JSContext *cx, JSObject *obj, jsid id, Type type)
|
||||
{
|
||||
AssertCanGC();
|
||||
if (cx->typeInferenceEnabled())
|
||||
id = IdToTypeId(id);
|
||||
if (TrackPropertyTypes(cx, obj, id))
|
||||
|
@ -614,7 +613,6 @@ AddTypePropertyId(JSContext *cx, JSObject *obj, jsid id, Type type)
|
|||
inline void
|
||||
AddTypePropertyId(JSContext *cx, JSObject *obj, jsid id, const Value &value)
|
||||
{
|
||||
AssertCanGC();
|
||||
if (cx->typeInferenceEnabled())
|
||||
id = IdToTypeId(id);
|
||||
if (TrackPropertyTypes(cx, obj, id))
|
||||
|
@ -624,7 +622,6 @@ AddTypePropertyId(JSContext *cx, JSObject *obj, jsid id, const Value &value)
|
|||
inline void
|
||||
AddTypeProperty(JSContext *cx, TypeObject *obj, const char *name, Type type)
|
||||
{
|
||||
AssertCanGC();
|
||||
if (cx->typeInferenceEnabled() && !obj->unknownProperties())
|
||||
obj->addPropertyType(cx, name, type);
|
||||
}
|
||||
|
@ -632,7 +629,6 @@ AddTypeProperty(JSContext *cx, TypeObject *obj, const char *name, Type type)
|
|||
inline void
|
||||
AddTypeProperty(JSContext *cx, TypeObject *obj, const char *name, const Value &value)
|
||||
{
|
||||
AssertCanGC();
|
||||
if (cx->typeInferenceEnabled() && !obj->unknownProperties())
|
||||
obj->addPropertyType(cx, name, value);
|
||||
}
|
||||
|
@ -1577,7 +1573,6 @@ inline HeapTypeSet *
|
|||
TypeObject::getProperty(JSContext *cx, RawId id, bool own)
|
||||
{
|
||||
JS_ASSERT(cx->compartment->activeAnalysis);
|
||||
AssertCanGC();
|
||||
|
||||
JS_ASSERT(JSID_IS_VOID(id) || JSID_IS_EMPTY(id) || JSID_IS_STRING(id));
|
||||
JS_ASSERT_IF(!JSID_IS_EMPTY(id), id == IdToTypeId(id));
|
||||
|
|
|
@ -153,7 +153,6 @@ GuardFunApplyArgumentsOptimization(JSContext *cx, AbstractFramePtr frame, Handle
|
|||
static inline bool
|
||||
GuardFunApplyArgumentsOptimization(JSContext *cx)
|
||||
{
|
||||
AssertCanGC();
|
||||
FrameRegs ®s = cx->regs();
|
||||
CallArgs args = CallArgsFromSp(GET_ARGC(regs.pc), regs.sp);
|
||||
return GuardFunApplyArgumentsOptimization(cx, cx->fp(), args.calleev(), args.array(),
|
||||
|
@ -864,7 +863,6 @@ static JS_ALWAYS_INLINE bool
|
|||
GetElementOperation(JSContext *cx, JSOp op, MutableHandleValue lref, HandleValue rref,
|
||||
MutableHandleValue res)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ASSERT(op == JSOP_GETELEM || op == JSOP_CALLELEM);
|
||||
|
||||
uint32_t index;
|
||||
|
|
|
@ -1503,8 +1503,6 @@ static JSBool
|
|||
SendToGenerator(JSContext *cx, JSGeneratorOp op, HandleObject obj,
|
||||
JSGenerator *gen, const Value &arg)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
if (gen->state == JSGEN_RUNNING || gen->state == JSGEN_CLOSING) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_NESTING_GENERATOR);
|
||||
return false;
|
||||
|
|
|
@ -1329,7 +1329,6 @@ js::NumberValueToStringBuffer(JSContext *cx, const Value &v, StringBuffer &sb)
|
|||
JS_PUBLIC_API(bool)
|
||||
js::ToNumberSlow(JSContext *cx, Value v, double *out)
|
||||
{
|
||||
AssertCanGC();
|
||||
#ifdef DEBUG
|
||||
/*
|
||||
* MSVC bizarrely miscompiles this, complaining about the first brace below
|
||||
|
|
|
@ -126,7 +126,6 @@ GetPrefixInteger(JSContext *cx, const jschar *start, const jschar *end, int base
|
|||
JS_ALWAYS_INLINE bool
|
||||
ToNumber(JSContext *cx, Value *vp)
|
||||
{
|
||||
AssertCanGC();
|
||||
#ifdef DEBUG
|
||||
{
|
||||
SkipRoot skip(cx, vp);
|
||||
|
@ -209,7 +208,6 @@ IsDefinitelyIndex(const Value &v, uint32_t *indexp)
|
|||
static inline bool
|
||||
ToInteger(JSContext *cx, const js::Value &v, double *dp)
|
||||
{
|
||||
AssertCanGC();
|
||||
#ifdef DEBUG
|
||||
{
|
||||
SkipRoot skip(cx, &v);
|
||||
|
|
|
@ -1181,7 +1181,6 @@ static inline JSObject *
|
|||
NewObject(JSContext *cx, Class *clasp, types::TypeObject *type_, JSObject *parent,
|
||||
gc::AllocKind kind, NewObjectKind newKind)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ASSERT(clasp != &ArrayClass);
|
||||
JS_ASSERT_IF(clasp == &FunctionClass,
|
||||
kind == JSFunction::FinalizeKind || kind == JSFunction::ExtendedFinalizeKind);
|
||||
|
@ -1766,7 +1765,6 @@ JSObject::ReserveForTradeGuts(JSContext *cx, JSObject *aArg, JSObject *bArg,
|
|||
{
|
||||
RootedObject a(cx, aArg);
|
||||
RootedObject b(cx, bArg);
|
||||
AssertCanGC();
|
||||
JS_ASSERT(a->compartment() == b->compartment());
|
||||
AutoCompartment ac(cx, a);
|
||||
|
||||
|
@ -2978,7 +2976,6 @@ js_FindClassObject(JSContext *cx, JSProtoKey protoKey, MutableHandleValue vp, Cl
|
|||
/* static */ bool
|
||||
JSObject::allocSlot(JSContext *cx, HandleObject obj, uint32_t *slotp)
|
||||
{
|
||||
AssertCanGC();
|
||||
uint32_t slot = obj->slotSpan();
|
||||
JS_ASSERT(slot >= JSSLOT_FREE(obj->getClass()));
|
||||
|
||||
|
@ -3455,9 +3452,6 @@ LookupPropertyWithFlagsInline(JSContext *cx,
|
|||
typename MaybeRooted<JSObject*, allowGC>::MutableHandleType objp,
|
||||
typename MaybeRooted<Shape*, allowGC>::MutableHandleType propp)
|
||||
{
|
||||
if (allowGC)
|
||||
AssertCanGC();
|
||||
|
||||
/* Search scopes starting with obj and following the prototype link. */
|
||||
typename MaybeRooted<JSObject*, allowGC>::RootType current(cx, obj);
|
||||
|
||||
|
|
|
@ -328,7 +328,6 @@ JS_FRIEND_API(JSBool)
|
|||
js_DisassembleAtPC(JSContext *cx, JSScript *scriptArg, JSBool lines,
|
||||
jsbytecode *pc, bool showAll, Sprinter *sp)
|
||||
{
|
||||
AssertCanGC();
|
||||
RootedScript script(cx, scriptArg);
|
||||
|
||||
jsbytecode *next, *end;
|
||||
|
@ -447,7 +446,6 @@ QuoteString(Sprinter *sp, JSString *str, uint32_t quote);
|
|||
static bool
|
||||
ToDisassemblySource(JSContext *cx, jsval v, JSAutoByteString *bytes)
|
||||
{
|
||||
AssertCanGC();
|
||||
if (JSVAL_IS_STRING(v)) {
|
||||
Sprinter sprinter(cx);
|
||||
if (!sprinter.init())
|
||||
|
@ -528,7 +526,6 @@ unsigned
|
|||
js_Disassemble1(JSContext *cx, HandleScript script, jsbytecode *pc,
|
||||
unsigned loc, JSBool lines, Sprinter *sp)
|
||||
{
|
||||
AssertCanGC();
|
||||
JSOp op = (JSOp)*pc;
|
||||
if (op >= JSOP_LIMIT) {
|
||||
char numBuf1[12], numBuf2[12];
|
||||
|
@ -1533,7 +1530,6 @@ FindStartPC(JSContext *cx, ScriptFrameIter &iter, int spindex, int skipStackHits
|
|||
static bool
|
||||
DecompileExpressionFromStack(JSContext *cx, int spindex, int skipStackHits, HandleValue v, char **res)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ASSERT(spindex < 0 ||
|
||||
spindex == JSDVG_IGNORE_STACK ||
|
||||
spindex == JSDVG_SEARCH_STACK);
|
||||
|
@ -1585,7 +1581,6 @@ char *
|
|||
js::DecompileValueGenerator(JSContext *cx, int spindex, HandleValue v,
|
||||
HandleString fallbackArg, int skipStackHits)
|
||||
{
|
||||
AssertCanGC();
|
||||
RootedString fallback(cx, fallbackArg);
|
||||
{
|
||||
char *result;
|
||||
|
@ -1680,7 +1675,6 @@ DecompileArgumentFromStack(JSContext *cx, int formalIndex, char **res)
|
|||
char *
|
||||
js::DecompileArgument(JSContext *cx, int formalIndex, HandleValue v)
|
||||
{
|
||||
AssertCanGC();
|
||||
{
|
||||
char *result;
|
||||
if (!DecompileArgumentFromStack(cx, formalIndex, &result))
|
||||
|
|
|
@ -130,8 +130,6 @@ Shape::removeChild(RawShape child)
|
|||
RawShape
|
||||
PropertyTree::getChild(JSContext *cx, Shape *parent_, uint32_t nfixed, const StackShape &child)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
{
|
||||
RawShape shape = NULL;
|
||||
|
||||
|
|
|
@ -2014,7 +2014,6 @@ JSScript::enclosingScriptsCompiledSuccessfully() const
|
|||
void
|
||||
js::CallNewScriptHook(JSContext *cx, HandleScript script, HandleFunction fun)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ASSERT(!script->isActiveEval);
|
||||
if (JSNewScriptHook hook = cx->runtime->debugHooks.newScriptHook) {
|
||||
AutoKeepAtoms keep(cx->runtime);
|
||||
|
@ -2293,8 +2292,6 @@ Rebase(RawScript dst, RawScript src, T *srcp)
|
|||
RawScript
|
||||
js::CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun, HandleScript src)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
/* NB: Keep this in sync with XDRScript. */
|
||||
|
||||
uint32_t nconsts = src->hasConsts() ? src->consts()->length : 0;
|
||||
|
@ -2831,7 +2828,6 @@ js::SetFrameArgumentsObject(JSContext *cx, AbstractFramePtr frame,
|
|||
/* static */ bool
|
||||
JSScript::argumentsOptimizationFailed(JSContext *cx, HandleScript script)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ASSERT(script->function());
|
||||
JS_ASSERT(script->analyzedArgsUsage());
|
||||
JS_ASSERT(script->argumentsHasVarBinding());
|
||||
|
|
|
@ -1154,7 +1154,6 @@ RopeMatch(JSContext *cx, JSString *textstr, const jschar *pat, uint32_t patlen,
|
|||
static JSBool
|
||||
str_contains(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
AssertCanGC();
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
|
||||
// Steps 1, 2, and 3
|
||||
|
@ -1206,7 +1205,6 @@ str_contains(JSContext *cx, unsigned argc, Value *vp)
|
|||
static JSBool
|
||||
str_indexOf(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
AssertCanGC();
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
|
||||
// Steps 1, 2, and 3
|
||||
|
@ -1335,7 +1333,6 @@ str_lastIndexOf(JSContext *cx, unsigned argc, Value *vp)
|
|||
static JSBool
|
||||
str_startsWith(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
AssertCanGC();
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
|
||||
// Steps 1, 2, and 3
|
||||
|
@ -1390,7 +1387,6 @@ str_startsWith(JSContext *cx, unsigned argc, Value *vp)
|
|||
static JSBool
|
||||
str_endsWith(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
AssertCanGC();
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
|
||||
// Steps 1, 2, and 3
|
||||
|
@ -2904,7 +2900,6 @@ class SplitRegExpMatcher
|
|||
bool operator()(JSContext *cx, Handle<JSLinearString*> str, size_t index,
|
||||
SplitMatchResult *result) const
|
||||
{
|
||||
AssertCanGC();
|
||||
const jschar *chars = str->chars();
|
||||
size_t length = str->length();
|
||||
|
||||
|
@ -3875,7 +3870,6 @@ js_strchr_limit(const jschar *s, jschar c, const jschar *limit)
|
|||
jschar *
|
||||
js::InflateString(JSContext *cx, const char *bytes, size_t *lengthp)
|
||||
{
|
||||
AssertCanGC();
|
||||
size_t nchars;
|
||||
jschar *chars;
|
||||
size_t nbytes = *lengthp;
|
||||
|
@ -3902,7 +3896,6 @@ js::InflateString(JSContext *cx, const char *bytes, size_t *lengthp)
|
|||
jschar *
|
||||
js::InflateUTF8String(JSContext *cx, const char *bytes, size_t *lengthp)
|
||||
{
|
||||
AssertCanGC();
|
||||
size_t nchars;
|
||||
jschar *chars;
|
||||
size_t nbytes = *lengthp;
|
||||
|
|
|
@ -6508,8 +6508,6 @@ mjit::Compiler::jsop_bindgname()
|
|||
bool
|
||||
mjit::Compiler::jsop_getgname(uint32_t index)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
/* Optimize undefined, NaN and Infinity. */
|
||||
PropertyName *name = script_->getName(index);
|
||||
if (name == cx->names().undefined) {
|
||||
|
@ -7995,8 +7993,6 @@ mjit::Compiler::BarrierState
|
|||
mjit::Compiler::pushAddressMaybeBarrier(Address address, JSValueType type, bool reuseBase,
|
||||
bool testUndefined)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
if (!hasTypeBarriers(PC) && !testUndefined) {
|
||||
frame.push(address, type, reuseBase);
|
||||
return BarrierState();
|
||||
|
|
|
@ -212,7 +212,6 @@ stubs::HitStackQuota(VMFrame &f)
|
|||
void * JS_FASTCALL
|
||||
stubs::FixupArity(VMFrame &f, uint32_t nactual)
|
||||
{
|
||||
AssertCanGC();
|
||||
JSContext *cx = f.cx;
|
||||
StackFrame *oldfp = f.fp();
|
||||
|
||||
|
@ -309,7 +308,6 @@ static inline bool
|
|||
UncachedInlineCall(VMFrame &f, InitialFrameFlags initial,
|
||||
void **pret, bool *unjittable, uint32_t argc)
|
||||
{
|
||||
AssertCanGC();
|
||||
JSContext *cx = f.cx;
|
||||
CallArgs args = CallArgsFromSp(argc, f.regs.sp);
|
||||
RootedFunction newfun(cx, args.callee().toFunction());
|
||||
|
@ -696,7 +694,6 @@ stubs::CreateThis(VMFrame &f, JSObject *proto)
|
|||
void JS_FASTCALL
|
||||
stubs::ScriptDebugPrologue(VMFrame &f)
|
||||
{
|
||||
AssertCanGC();
|
||||
Probes::enterScript(f.cx, f.script(), f.script()->function(), f.fp());
|
||||
JSTrapStatus status = js::ScriptDebugPrologue(f.cx, f.fp());
|
||||
switch (status) {
|
||||
|
@ -735,7 +732,6 @@ stubs::ScriptProbeOnlyEpilogue(VMFrame &f)
|
|||
void JS_FASTCALL
|
||||
stubs::CrossChunkShim(VMFrame &f, void *edge_)
|
||||
{
|
||||
AssertCanGC();
|
||||
DebugOnly<CrossChunkEdge*> edge = (CrossChunkEdge *) edge_;
|
||||
|
||||
mjit::ExpandInlineFrames(f.cx->compartment);
|
||||
|
|
|
@ -59,8 +59,6 @@ PatchGetFallback(VMFrame &f, ic::GetGlobalNameIC *ic)
|
|||
void JS_FASTCALL
|
||||
ic::GetGlobalName(VMFrame &f, ic::GetGlobalNameIC *ic)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
RootedObject obj(f.cx, &f.fp()->global());
|
||||
PropertyName *name = f.script()->getName(GET_UINT32_INDEX(f.pc()));
|
||||
|
||||
|
@ -104,7 +102,6 @@ ic::GetGlobalName(VMFrame &f, ic::GetGlobalNameIC *ic)
|
|||
static void JS_FASTCALL
|
||||
DisabledSetGlobal(VMFrame &f, ic::SetGlobalNameIC *ic)
|
||||
{
|
||||
AssertCanGC();
|
||||
RootedPropertyName name(f.cx, f.script()->getName(GET_UINT32_INDEX(f.pc())));
|
||||
stubs::SetName(f, name);
|
||||
}
|
||||
|
@ -157,8 +154,6 @@ UpdateSetGlobalName(VMFrame &f, ic::SetGlobalNameIC *ic, JSObject *obj, RawShape
|
|||
void JS_FASTCALL
|
||||
ic::SetGlobalName(VMFrame &f, ic::SetGlobalNameIC *ic)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
RootedObject obj(f.cx, &f.fp()->global());
|
||||
RootedPropertyName name(f.cx, f.script()->getName(GET_UINT32_INDEX(f.pc())));
|
||||
|
||||
|
|
|
@ -894,8 +894,6 @@ class GetPropCompiler : public PICStubCompiler
|
|||
|
||||
LookupStatus generateStringPropertyStub()
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
if (!f.fp()->script()->compileAndGo)
|
||||
return disable("String.prototype without compile-and-go global");
|
||||
|
||||
|
@ -1250,7 +1248,6 @@ class GetPropCompiler : public PICStubCompiler
|
|||
|
||||
LookupStatus generateStub(HandleObject holder, HandleShape shape)
|
||||
{
|
||||
AssertCanGC();
|
||||
Vector<Jump, 8> shapeMismatches(cx);
|
||||
|
||||
MJITInstrumentation sps(&f.cx->runtime->spsProfiler);
|
||||
|
|
|
@ -77,7 +77,6 @@ stubs::BindGlobalName(VMFrame &f)
|
|||
void JS_FASTCALL
|
||||
stubs::SetName(VMFrame &f, PropertyName *name)
|
||||
{
|
||||
AssertCanGC();
|
||||
JSContext *cx = f.cx;
|
||||
RootedObject scope(cx, &f.regs.sp[-2].toObject());
|
||||
HandleValue value = HandleValue::fromMarkedLocation(&f.regs.sp[-1]);
|
||||
|
@ -729,7 +728,6 @@ stubs::Mod(VMFrame &f)
|
|||
void JS_FASTCALL
|
||||
stubs::DebuggerStatement(VMFrame &f, jsbytecode *pc)
|
||||
{
|
||||
AssertCanGC();
|
||||
JSDebuggerHandler handler = f.cx->runtime->debugHooks.debuggerHandler;
|
||||
if (handler || !f.cx->compartment->getDebuggees().empty()) {
|
||||
JSTrapStatus st = JSTRAP_CONTINUE;
|
||||
|
@ -775,7 +773,6 @@ stubs::Interrupt(VMFrame &f, jsbytecode *pc)
|
|||
void JS_FASTCALL
|
||||
stubs::TriggerIonCompile(VMFrame &f)
|
||||
{
|
||||
AssertCanGC();
|
||||
RootedScript script(f.cx, f.script());
|
||||
|
||||
if (ion::js_IonOptions.parallelCompilation && !f.cx->runtime->profilingScripts) {
|
||||
|
|
|
@ -2026,7 +2026,6 @@ DumpHeap(JSContext *cx, unsigned argc, jsval *vp)
|
|||
void *thingToIgnore;
|
||||
FILE *dumpFile;
|
||||
bool ok;
|
||||
AssertCanGC();
|
||||
|
||||
const char *fileName = NULL;
|
||||
JSAutoByteString fileNameBytes;
|
||||
|
|
|
@ -119,8 +119,6 @@ template <typename CopyArgs>
|
|||
ArgumentsObject::create(JSContext *cx, HandleScript script, HandleFunction callee, unsigned numActuals,
|
||||
CopyArgs ©)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
RootedObject proto(cx, callee->global().getOrCreateObjectPrototype(cx));
|
||||
if (!proto)
|
||||
return NULL;
|
||||
|
|
|
@ -3589,7 +3589,6 @@ Class DebuggerArguments_class = {
|
|||
static JSBool
|
||||
DebuggerArguments_getArg(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
AssertCanGC();
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
int32_t i = args.callee().toFunction()->getExtendedSlot(0).toInt32();
|
||||
|
||||
|
@ -4045,7 +4044,6 @@ Class DebuggerObject_class = {
|
|||
static JSObject *
|
||||
DebuggerObject_checkThis(JSContext *cx, const CallArgs &args, const char *fnname)
|
||||
{
|
||||
AssertCanGC();
|
||||
if (!args.thisv().isObject()) {
|
||||
ReportObjectRequired(cx);
|
||||
return NULL;
|
||||
|
@ -4090,7 +4088,6 @@ DebuggerObject_checkThis(JSContext *cx, const CallArgs &args, const char *fnname
|
|||
static JSBool
|
||||
DebuggerObject_construct(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_NO_CONSTRUCTOR, "Debugger.Object");
|
||||
return false;
|
||||
}
|
||||
|
@ -4098,7 +4095,6 @@ DebuggerObject_construct(JSContext *cx, unsigned argc, Value *vp)
|
|||
static JSBool
|
||||
DebuggerObject_getProto(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
AssertCanGC();
|
||||
THIS_DEBUGOBJECT_OWNER_REFERENT(cx, argc, vp, "get proto", args, dbg, refobj);
|
||||
RootedObject proto(cx);
|
||||
{
|
||||
|
@ -4116,7 +4112,6 @@ DebuggerObject_getProto(JSContext *cx, unsigned argc, Value *vp)
|
|||
static JSBool
|
||||
DebuggerObject_getClass(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
AssertCanGC();
|
||||
THIS_DEBUGOBJECT_REFERENT(cx, argc, vp, "get class", args, refobj);
|
||||
const char *s = refobj->getClass()->name;
|
||||
JSAtom *str = Atomize(cx, s, strlen(s));
|
||||
|
@ -4137,7 +4132,6 @@ DebuggerObject_getCallable(JSContext *cx, unsigned argc, Value *vp)
|
|||
static JSBool
|
||||
DebuggerObject_getName(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
AssertCanGC();
|
||||
THIS_DEBUGOBJECT_OWNER_REFERENT(cx, argc, vp, "get name", args, dbg, obj);
|
||||
if (!obj->isFunction()) {
|
||||
args.rval().setUndefined();
|
||||
|
@ -4160,7 +4154,6 @@ DebuggerObject_getName(JSContext *cx, unsigned argc, Value *vp)
|
|||
static JSBool
|
||||
DebuggerObject_getDisplayName(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
AssertCanGC();
|
||||
THIS_DEBUGOBJECT_OWNER_REFERENT(cx, argc, vp, "get display name", args, dbg, obj);
|
||||
if (!obj->isFunction()) {
|
||||
args.rval().setUndefined();
|
||||
|
@ -4183,7 +4176,6 @@ DebuggerObject_getDisplayName(JSContext *cx, unsigned argc, Value *vp)
|
|||
static JSBool
|
||||
DebuggerObject_getParameterNames(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
AssertCanGC();
|
||||
THIS_DEBUGOBJECT_REFERENT(cx, argc, vp, "get parameterNames", args, obj);
|
||||
if (!obj->isFunction()) {
|
||||
args.rval().setUndefined();
|
||||
|
@ -4225,7 +4217,6 @@ DebuggerObject_getParameterNames(JSContext *cx, unsigned argc, Value *vp)
|
|||
static JSBool
|
||||
DebuggerObject_getScript(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
AssertCanGC();
|
||||
THIS_DEBUGOBJECT_OWNER_REFERENT(cx, argc, vp, "get script", args, dbg, obj);
|
||||
|
||||
if (!obj->isFunction()) {
|
||||
|
@ -4251,7 +4242,6 @@ DebuggerObject_getScript(JSContext *cx, unsigned argc, Value *vp)
|
|||
static JSBool
|
||||
DebuggerObject_getEnvironment(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
AssertCanGC();
|
||||
THIS_DEBUGOBJECT_OWNER_REFERENT(cx, argc, vp, "get environment", args, dbg, obj);
|
||||
|
||||
/* Don't bother switching compartments just to check obj's type and get its env. */
|
||||
|
@ -4287,7 +4277,6 @@ DebuggerObject_getGlobal(JSContext *cx, unsigned argc, Value *vp)
|
|||
static JSBool
|
||||
DebuggerObject_getOwnPropertyDescriptor(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
AssertCanGC();
|
||||
THIS_DEBUGOBJECT_OWNER_REFERENT(cx, argc, vp, "getOwnPropertyDescriptor", args, dbg, obj);
|
||||
|
||||
RootedId id(cx);
|
||||
|
@ -4334,7 +4323,6 @@ DebuggerObject_getOwnPropertyDescriptor(JSContext *cx, unsigned argc, Value *vp)
|
|||
static JSBool
|
||||
DebuggerObject_getOwnPropertyNames(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
AssertCanGC();
|
||||
THIS_DEBUGOBJECT_OWNER_REFERENT(cx, argc, vp, "getOwnPropertyNames", args, dbg, obj);
|
||||
|
||||
AutoIdVector keys(cx);
|
||||
|
|
|
@ -202,8 +202,6 @@ CallObject::create(JSContext *cx, HandleScript script, HandleObject enclosing, H
|
|||
CallObject *
|
||||
CallObject::createForFunction(JSContext *cx, HandleObject enclosing, HandleFunction callee)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
RootedObject scopeChain(cx, enclosing);
|
||||
JS_ASSERT(scopeChain);
|
||||
|
||||
|
@ -224,7 +222,6 @@ CallObject::createForFunction(JSContext *cx, HandleObject enclosing, HandleFunct
|
|||
CallObject *
|
||||
CallObject::createForFunction(JSContext *cx, AbstractFramePtr frame)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ASSERT(frame.isNonEvalFunctionFrame());
|
||||
assertSameCompartment(cx, frame);
|
||||
|
||||
|
@ -245,7 +242,6 @@ CallObject::createForFunction(JSContext *cx, AbstractFramePtr frame)
|
|||
CallObject *
|
||||
CallObject::createForStrictEval(JSContext *cx, AbstractFramePtr frame)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ASSERT(frame.isStrictEvalFrame());
|
||||
JS_ASSERT_IF(frame.isStackFrame(), cx->fp() == frame.asStackFrame());
|
||||
JS_ASSERT_IF(frame.isStackFrame(), cx->regs().pc == frame.script()->code);
|
||||
|
@ -1290,7 +1286,6 @@ class DebugScopeProxy : public BaseProxyHandler
|
|||
static bool checkForMissingArguments(JSContext *cx, jsid id, ScopeObject &scope,
|
||||
ArgumentsObject **maybeArgsObj)
|
||||
{
|
||||
AssertCanGC();
|
||||
*maybeArgsObj = NULL;
|
||||
|
||||
if (!isArguments(cx, id) || !isFunctionScope(scope))
|
||||
|
|
|
@ -263,7 +263,6 @@ Shape::matchesParamsAfterId(RawBaseShape base, uint32_t aslot,
|
|||
inline bool
|
||||
Shape::getUserId(JSContext *cx, MutableHandleId idp) const
|
||||
{
|
||||
AssertCanGC();
|
||||
const Shape *self = this;
|
||||
#ifdef DEBUG
|
||||
{
|
||||
|
|
|
@ -277,7 +277,6 @@ ShapeTable::grow(JSContext *cx)
|
|||
RawShape
|
||||
Shape::getChildBinding(JSContext *cx, const StackShape &child)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ASSERT(!inDictionary());
|
||||
|
||||
/* Try to allocate all slots inline. */
|
||||
|
@ -480,7 +479,6 @@ JSObject::addPropertyInternal(JSContext *cx, HandleObject obj, HandleId id,
|
|||
unsigned flags, int shortid, Shape **spp,
|
||||
bool allowDictionary)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ASSERT_IF(!allowDictionary, !obj->inDictionaryMode());
|
||||
|
||||
AutoRooterGetterSetter gsRoot(cx, attrs, &getter, &setter);
|
||||
|
@ -929,7 +927,6 @@ JSObject::rollbackProperties(JSContext *cx, uint32_t slotSpan)
|
|||
Shape *
|
||||
JSObject::replaceWithNewEquivalentShape(JSContext *cx, Shape *oldShape, Shape *newShape)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ASSERT(cx->compartment == oldShape->compartment());
|
||||
JS_ASSERT_IF(oldShape != lastProperty(),
|
||||
inDictionaryMode() &&
|
||||
|
@ -1276,7 +1273,6 @@ EmptyShape::getInitialShape(JSContext *cx, Class *clasp, TaggedProto proto, JSOb
|
|||
void
|
||||
NewObjectCache::invalidateEntriesForShape(JSContext *cx, HandleShape shape, HandleObject proto)
|
||||
{
|
||||
AssertCanGC();
|
||||
Class *clasp = shape->getObjectClass();
|
||||
|
||||
gc::AllocKind kind = gc::GetGCObjectKind(shape->numFixedSlots());
|
||||
|
|
|
@ -375,9 +375,6 @@ STATIC_POSTCONDITION(!return || ubound(from) >= nvals)
|
|||
JS_ALWAYS_INLINE bool
|
||||
StackSpace::ensureSpace(JSContext *cx, MaybeReportError report, Value *from, ptrdiff_t nvals) const
|
||||
{
|
||||
if (report)
|
||||
AssertCanGC();
|
||||
|
||||
assertInvariants();
|
||||
JS_ASSERT(from >= firstUnused());
|
||||
#ifdef XP_WIN
|
||||
|
@ -391,7 +388,6 @@ StackSpace::ensureSpace(JSContext *cx, MaybeReportError report, Value *from, ptr
|
|||
inline Value *
|
||||
StackSpace::getStackLimit(JSContext *cx, MaybeReportError report)
|
||||
{
|
||||
AssertCanGC();
|
||||
FrameRegs ®s = cx->regs();
|
||||
unsigned nvals = regs.fp()->script()->nslots + STACK_JIT_EXTRA;
|
||||
return ensureSpace(cx, report, regs.sp, nvals)
|
||||
|
@ -405,9 +401,6 @@ JS_ALWAYS_INLINE StackFrame *
|
|||
ContextStack::getCallFrame(JSContext *cx, MaybeReportError report, const CallArgs &args,
|
||||
JSFunction *fun, HandleScript script, StackFrame::Flags *flags) const
|
||||
{
|
||||
if (report)
|
||||
AssertCanGC();
|
||||
|
||||
JS_ASSERT(fun->nonLazyScript() == script);
|
||||
unsigned nformal = fun->nargs;
|
||||
|
||||
|
@ -449,9 +442,6 @@ ContextStack::pushInlineFrame(JSContext *cx, FrameRegs ®s, const CallArgs &ar
|
|||
HandleFunction callee, HandleScript script,
|
||||
InitialFrameFlags initial, MaybeReportError report)
|
||||
{
|
||||
if (report)
|
||||
AssertCanGC();
|
||||
|
||||
JS_ASSERT(onTop());
|
||||
JS_ASSERT(regs.sp == args.end());
|
||||
/* Cannot assert callee == args.callee() since this is called from LeaveTree. */
|
||||
|
@ -478,7 +468,6 @@ ContextStack::pushInlineFrame(JSContext *cx, FrameRegs ®s, const CallArgs &ar
|
|||
HandleFunction callee, HandleScript script,
|
||||
InitialFrameFlags initial, Value **stackLimit)
|
||||
{
|
||||
AssertCanGC();
|
||||
if (!pushInlineFrame(cx, regs, args, callee, script, initial))
|
||||
return false;
|
||||
*stackLimit = space().conservativeEnd_;
|
||||
|
@ -490,7 +479,6 @@ ContextStack::getFixupFrame(JSContext *cx, MaybeReportError report,
|
|||
const CallArgs &args, JSFunction *fun, HandleScript script,
|
||||
void *ncode, InitialFrameFlags initial, Value **stackLimit)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ASSERT(onTop());
|
||||
JS_ASSERT(fun->nonLazyScript() == args.callee().toFunction()->nonLazyScript());
|
||||
JS_ASSERT(fun->nonLazyScript() == script);
|
||||
|
|
|
@ -721,9 +721,6 @@ StackSpace::markActiveCompartments()
|
|||
JS_FRIEND_API(bool)
|
||||
StackSpace::ensureSpaceSlow(JSContext *cx, MaybeReportError report, Value *from, ptrdiff_t nvals) const
|
||||
{
|
||||
if (report)
|
||||
AssertCanGC();
|
||||
|
||||
assertInvariants();
|
||||
|
||||
JSCompartment *dest = cx->compartment;
|
||||
|
@ -891,9 +888,6 @@ Value *
|
|||
ContextStack::ensureOnTop(JSContext *cx, MaybeReportError report, unsigned nvars,
|
||||
MaybeExtend extend, bool *pushedSeg)
|
||||
{
|
||||
if (report)
|
||||
AssertCanGC();
|
||||
|
||||
Value *firstUnused = space().firstUnused();
|
||||
FrameRegs *regs = cx->maybeRegs();
|
||||
|
||||
|
@ -972,9 +966,6 @@ bool
|
|||
ContextStack::pushInvokeArgs(JSContext *cx, unsigned argc, InvokeArgsGuard *iag,
|
||||
MaybeReportError report)
|
||||
{
|
||||
if (report)
|
||||
AssertCanGC();
|
||||
|
||||
JS_ASSERT(argc <= StackSpace::ARGS_LENGTH_MAX);
|
||||
|
||||
unsigned nvars = 2 + argc;
|
||||
|
@ -1013,9 +1004,6 @@ ContextStack::pushInvokeFrame(JSContext *cx, MaybeReportError report,
|
|||
const CallArgs &args, JSFunction *funArg,
|
||||
InitialFrameFlags initial, FrameGuard *fg)
|
||||
{
|
||||
if (report)
|
||||
AssertCanGC();
|
||||
|
||||
JS_ASSERT(onTop());
|
||||
JS_ASSERT(space().firstUnused() == args.end());
|
||||
|
||||
|
@ -1052,8 +1040,6 @@ ContextStack::pushExecuteFrame(JSContext *cx, HandleScript script, const Value &
|
|||
HandleObject scopeChain, ExecuteType type,
|
||||
AbstractFramePtr evalInFrame, ExecuteFrameGuard *efg)
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
/*
|
||||
* Even though global code and indirect eval do not execute in the context
|
||||
* of the current frame, prev-link these to the current frame so that the
|
||||
|
@ -1166,7 +1152,6 @@ ContextStack::popFrame(const FrameGuard &fg)
|
|||
bool
|
||||
ContextStack::pushGeneratorFrame(JSContext *cx, JSGenerator *gen, GeneratorFrameGuard *gfg)
|
||||
{
|
||||
AssertCanGC();
|
||||
HeapValue *genvp = gen->stackSnapshot;
|
||||
JS_ASSERT(genvp == HeapValueify(gen->fp->generatorArgsSnapshotBegin()));
|
||||
unsigned vplen = HeapValueify(gen->fp->generatorArgsSnapshotEnd()) - genvp;
|
||||
|
@ -1236,8 +1221,6 @@ ContextStack::popGeneratorFrame(const GeneratorFrameGuard &gfg)
|
|||
bool
|
||||
ContextStack::saveFrameChain()
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
bool pushedSeg;
|
||||
if (!ensureOnTop(cx_, REPORT_ERROR, 0, CANT_EXTEND, &pushedSeg))
|
||||
return false;
|
||||
|
|
|
@ -416,7 +416,6 @@ js::StaticStrings::getInt(int32_t i)
|
|||
inline JSLinearString *
|
||||
js::StaticStrings::getUnitStringForElement(JSContext *cx, JSString *str, size_t index)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ASSERT(index < str->length());
|
||||
const jschar *chars = str->getChars(cx);
|
||||
if (!chars)
|
||||
|
|
|
@ -69,7 +69,6 @@ StringBuffer::finishString()
|
|||
RawAtom
|
||||
StringBuffer::finishAtom()
|
||||
{
|
||||
AssertCanGC();
|
||||
JSContext *cx = context();
|
||||
|
||||
size_t length = cb.length();
|
||||
|
|
|
@ -15,7 +15,6 @@ namespace js {
|
|||
inline bool
|
||||
StringObject::init(JSContext *cx, HandleString str)
|
||||
{
|
||||
AssertCanGC();
|
||||
JS_ASSERT(gc::GetGCKindSlots(getAllocKind()) == 2);
|
||||
|
||||
Rooted<StringObject *> self(cx, this);
|
||||
|
|
Загрузка…
Ссылка в новой задаче