Bug 1464134 part 6 - Replace AbstractFramePtr::compartment with AbstractFramePtr::realm. r=anba

This commit is contained in:
Jan de Mooij 2018-05-30 20:14:18 +02:00
parent 2eebe87aa6
commit 7ff3b9af6c
5 changed files with 7 additions and 7 deletions

View File

@ -421,7 +421,7 @@ js::DirectEval(JSContext* cx, HandleValue v, MutableHandleValue vp)
JSOp(*iter.pc()) == JSOP_STRICTEVAL ||
JSOp(*iter.pc()) == JSOP_SPREADEVAL ||
JSOp(*iter.pc()) == JSOP_STRICTSPREADEVAL);
MOZ_ASSERT(caller.compartment() == caller.script()->compartment());
MOZ_ASSERT(caller.realm() == caller.script()->realm());
RootedObject envChain(cx, caller.environmentChain());
return EvalKernel(cx, v, DIRECT_EVAL, caller, envChain, iter.pc(), vp);

View File

@ -2829,7 +2829,7 @@ DebugEnvironments::onPopVar(JSContext* cx, const EnvironmentIter& ei)
void
DebugEnvironments::onPopWith(AbstractFramePtr frame)
{
Realm* realm = JS::GetRealmForCompartment(frame.compartment());
Realm* realm = frame.realm();
if (DebugEnvironments* envs = realm->debugEnvs())
envs->liveEnvs.remove(&frame.environmentChain()->as<WithEnvironmentObject>());
}

View File

@ -1481,7 +1481,7 @@ SavedStacks::insertFrames(JSContext* cx, MutableHandleSavedFrame frame,
RootedAtom displayAtom(cx, iter.maybeFunctionDisplayAtom());
auto principals = JS::GetRealmForCompartment(iter.compartment())->principals();
auto principals = iter.realm()->principals();
MOZ_ASSERT_IF(framePtr && !iter.isWasm(), iter.pc());
if (!stackChain->emplaceBack(location.source(),

View File

@ -493,10 +493,10 @@ AbstractFramePtr::pushVarEnvironment(JSContext* cx, HandleScope scope)
return js::PushVarEnvironmentObject(cx, scope, *this);
}
inline JSCompartment*
AbstractFramePtr::compartment() const
inline JS::Realm*
AbstractFramePtr::realm() const
{
return environmentChain()->compartment();
return environmentChain()->realm();
}
inline unsigned

View File

@ -215,7 +215,7 @@ class AbstractFramePtr
template <typename SpecificEnvironment>
inline void popOffEnvironmentChain();
inline JSCompartment* compartment() const;
inline JS::Realm* realm() const;
inline bool hasInitialEnvironment() const;
inline bool isGlobalFrame() const;