mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Merge mozilla-central and inbound
This commit is contained in:
commit
4b7c34d87b
@ -372,8 +372,8 @@ private:
|
||||
bool SubjectIsPrivileged();
|
||||
|
||||
static JSBool
|
||||
CheckObjectAccess(JSContext *cx, JSHandleObject obj,
|
||||
JSHandleId id, JSAccessMode mode,
|
||||
CheckObjectAccess(JSContext *cx, JS::Handle<JSObject*> obj,
|
||||
JS::Handle<jsid> id, JSAccessMode mode,
|
||||
JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
// Decides, based on CSP, whether or not eval() and stuff can be executed.
|
||||
|
@ -484,8 +484,8 @@ nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx)
|
||||
|
||||
|
||||
JSBool
|
||||
nsScriptSecurityManager::CheckObjectAccess(JSContext *cx, JSHandleObject obj,
|
||||
JSHandleId id, JSAccessMode mode,
|
||||
nsScriptSecurityManager::CheckObjectAccess(JSContext *cx, JS::Handle<JSObject*> obj,
|
||||
JS::Handle<jsid> id, JSAccessMode mode,
|
||||
JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
// Get the security manager
|
||||
|
@ -114,8 +114,8 @@ typedef CallbackObjectHolder<NodeFilter, nsIDOMNodeFilter> NodeFilterHolder;
|
||||
} // namespace mozilla
|
||||
|
||||
#define NS_IDOCUMENT_IID \
|
||||
{ 0x308f8444, 0x7679, 0x445a, \
|
||||
{ 0xa6, 0xcc, 0xb9, 0x5c, 0x61, 0xff, 0xe2, 0x66 } }
|
||||
{ 0x62cca591, 0xa030, 0x4117, \
|
||||
{ 0x9b, 0x80, 0xdc, 0xd3, 0x66, 0xbb, 0xb5, 0x9 } }
|
||||
|
||||
// Flag for AddStyleSheet().
|
||||
#define NS_STYLESHEET_FROM_CATALOG (1 << 0)
|
||||
@ -770,13 +770,6 @@ public:
|
||||
return mStyleAttrStyleSheet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get/set the object from which a document can get a script context
|
||||
* and scope. This is the context within which all scripts (during
|
||||
* document creation and during event handling) will run. Note that
|
||||
* this is the *inner* window object.
|
||||
*/
|
||||
virtual nsIScriptGlobalObject* GetScriptGlobalObject() const = 0;
|
||||
virtual void SetScriptGlobalObject(nsIScriptGlobalObject* aGlobalObject) = 0;
|
||||
|
||||
/**
|
||||
@ -1475,8 +1468,7 @@ public:
|
||||
{
|
||||
NS_PRECONDITION(!GetShell() &&
|
||||
!nsCOMPtr<nsISupports>(GetContainer()) &&
|
||||
!GetWindow() &&
|
||||
!GetScriptGlobalObject(),
|
||||
!GetWindow(),
|
||||
"Shouldn't set mDisplayDocument on documents that already "
|
||||
"have a presentation or a docshell or a window");
|
||||
NS_PRECONDITION(aDisplayDocument != this, "Should be different document");
|
||||
|
@ -308,7 +308,7 @@ nsContentSink::ProcessHeaderData(nsIAtom* aHeader, const nsAString& aValue,
|
||||
NS_ENSURE_TRUE(codebaseURI, rv);
|
||||
|
||||
nsCOMPtr<nsIPrompt> prompt;
|
||||
nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(mDocument->GetScriptGlobalObject());
|
||||
nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(mDocument->GetWindow());
|
||||
if (window) {
|
||||
window->GetPrompter(getter_AddRefs(prompt));
|
||||
}
|
||||
|
@ -6100,10 +6100,10 @@ nsContentUtils::IsPatternMatching(nsAString& aValue, nsAString& aPattern,
|
||||
nsIDocument* aDocument)
|
||||
{
|
||||
NS_ASSERTION(aDocument, "aDocument should be a valid pointer (not null)");
|
||||
NS_ENSURE_TRUE(aDocument->GetScriptGlobalObject(), true);
|
||||
nsCOMPtr<nsIScriptGlobalObject> sgo = do_QueryInterface(aDocument->GetWindow());
|
||||
NS_ENSURE_TRUE(sgo, true);
|
||||
|
||||
AutoPushJSContext cx(aDocument->GetScriptGlobalObject()->
|
||||
GetContext()->GetNativeContext());
|
||||
AutoPushJSContext cx(sgo->GetContext()->GetNativeContext());
|
||||
NS_ENSURE_TRUE(cx, true);
|
||||
|
||||
// The pattern has to match the entire value.
|
||||
|
@ -4078,28 +4078,6 @@ nsDocument::FirstAdditionalAuthorSheet()
|
||||
return mAdditionalSheets[eAuthorSheet].SafeObjectAt(0);
|
||||
}
|
||||
|
||||
nsIScriptGlobalObject*
|
||||
nsDocument::GetScriptGlobalObject() const
|
||||
{
|
||||
// If we're going away, we've already released the reference to our
|
||||
// ScriptGlobalObject. We can, however, try to obtain it for the
|
||||
// caller through our docshell.
|
||||
|
||||
// We actually need to start returning the docshell's script global
|
||||
// object as soon as nsDocumentViewer::Close has called
|
||||
// RemovedFromDocShell on us.
|
||||
if (mRemovedFromDocShell) {
|
||||
nsCOMPtr<nsIInterfaceRequestor> requestor =
|
||||
do_QueryReferent(mDocumentContainer);
|
||||
if (requestor) {
|
||||
nsCOMPtr<nsIScriptGlobalObject> globalObject = do_GetInterface(requestor);
|
||||
return globalObject;
|
||||
}
|
||||
}
|
||||
|
||||
return mScriptGlobalObject;
|
||||
}
|
||||
|
||||
nsIGlobalObject*
|
||||
nsDocument::GetScopeObject() const
|
||||
{
|
||||
@ -4270,14 +4248,25 @@ nsPIDOMWindow *
|
||||
nsDocument::GetWindowInternal() const
|
||||
{
|
||||
MOZ_ASSERT(!mWindow, "This should not be called when mWindow is not null!");
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> win(do_QueryInterface(GetScriptGlobalObject()));
|
||||
|
||||
if (!win) {
|
||||
return nullptr;
|
||||
// Let's use mScriptGlobalObject. Even if the document is already removed from
|
||||
// the docshell, the outer window might be still obtainable from the it.
|
||||
nsCOMPtr<nsPIDOMWindow> win;
|
||||
if (mRemovedFromDocShell) {
|
||||
nsCOMPtr<nsIInterfaceRequestor> requestor =
|
||||
do_QueryReferent(mDocumentContainer);
|
||||
if (requestor) {
|
||||
// The docshell returns the outer window we are done.
|
||||
win = do_GetInterface(requestor);
|
||||
}
|
||||
} else {
|
||||
win = do_QueryInterface(mScriptGlobalObject);
|
||||
if (win) {
|
||||
// mScriptGlobalObject is always the inner window, let's get the outer.
|
||||
win = win->GetOuterWindow();
|
||||
}
|
||||
}
|
||||
|
||||
return win->GetOuterWindow();
|
||||
return win;
|
||||
}
|
||||
|
||||
nsScriptLoader*
|
||||
@ -7111,7 +7100,7 @@ nsDocument::IsScriptEnabled()
|
||||
nsCOMPtr<nsIScriptSecurityManager> sm(do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID));
|
||||
NS_ENSURE_TRUE(sm, false);
|
||||
|
||||
nsIScriptGlobalObject* globalObject = GetScriptGlobalObject();
|
||||
nsCOMPtr<nsIScriptGlobalObject> globalObject = do_QueryInterface(GetWindow());
|
||||
NS_ENSURE_TRUE(globalObject, false);
|
||||
|
||||
nsIScriptContext *scriptContext = globalObject->GetContext();
|
||||
@ -8123,7 +8112,7 @@ nsDocument::MutationEventDispatched(nsINode* aTarget)
|
||||
}
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> window;
|
||||
window = do_QueryInterface(GetScriptGlobalObject());
|
||||
window = do_QueryInterface(GetWindow());
|
||||
if (window &&
|
||||
!window->HasMutationListeners(NS_EVENT_BITS_MUTATION_SUBTREEMODIFIED)) {
|
||||
mSubtreeModifiedTargets.Clear();
|
||||
@ -11275,7 +11264,7 @@ nsIDocument::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aScope)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(GetScriptGlobalObject());
|
||||
nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(GetInnerWindow());
|
||||
if (!win) {
|
||||
// No window, nothing else to do here
|
||||
return obj;
|
||||
|
@ -640,12 +640,6 @@ public:
|
||||
return mChannel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the object from which a document can get a script context.
|
||||
* This is the context within which all scripts (during document
|
||||
* creation and during event handling) will run.
|
||||
*/
|
||||
virtual nsIScriptGlobalObject* GetScriptGlobalObject() const MOZ_OVERRIDE;
|
||||
virtual void SetScriptGlobalObject(nsIScriptGlobalObject* aGlobalObject) MOZ_OVERRIDE;
|
||||
|
||||
virtual void SetScriptHandlingObject(nsIScriptGlobalObject* aScriptObject) MOZ_OVERRIDE;
|
||||
|
@ -1797,7 +1797,7 @@ nsFrameLoader::GetWindowDimensions(nsRect& aRect)
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIWebNavigation> parentAsWebNav =
|
||||
do_GetInterface(doc->GetScriptGlobalObject());
|
||||
do_GetInterface(doc->GetWindow());
|
||||
|
||||
if (!parentAsWebNav) {
|
||||
return NS_ERROR_FAILURE;
|
||||
@ -1973,7 +1973,7 @@ nsFrameLoader::TryRemoteBrowser()
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIWebNavigation> parentAsWebNav =
|
||||
do_GetInterface(doc->GetScriptGlobalObject());
|
||||
do_GetInterface(doc->GetWindow());
|
||||
|
||||
if (!parentAsWebNav) {
|
||||
return false;
|
||||
|
@ -603,9 +603,9 @@ nsObjectLoadingContent::IsSupportedDocument(const nsCString& aMimeType)
|
||||
nsCOMPtr<nsIWebNavigation> webNav;
|
||||
nsIDocument* currentDoc = thisContent->GetCurrentDoc();
|
||||
if (currentDoc) {
|
||||
webNav = do_GetInterface(currentDoc->GetScriptGlobalObject());
|
||||
webNav = do_GetInterface(currentDoc->GetWindow());
|
||||
}
|
||||
|
||||
|
||||
uint32_t supported;
|
||||
nsresult rv = info->IsTypeSupported(aMimeType, webNav, &supported);
|
||||
|
||||
@ -3187,8 +3187,8 @@ nsObjectLoadingContent::TeardownProtoChain()
|
||||
}
|
||||
|
||||
bool
|
||||
nsObjectLoadingContent::DoNewResolve(JSContext* aCx, JSHandleObject aObject,
|
||||
JSHandleId aId, unsigned aFlags,
|
||||
nsObjectLoadingContent::DoNewResolve(JSContext* aCx, JS::Handle<JSObject*> aObject,
|
||||
JS::Handle<jsid> aId, unsigned aFlags,
|
||||
JS::MutableHandle<JSObject*> aObjp)
|
||||
{
|
||||
// We don't resolve anything; we just try to make sure we're instantiated
|
||||
|
@ -148,7 +148,7 @@ class nsObjectLoadingContent : public nsImageLoadingContent
|
||||
void TeardownProtoChain();
|
||||
|
||||
// Helper for WebIDL newResolve
|
||||
bool DoNewResolve(JSContext* aCx, JSHandleObject aObject, JSHandleId aId,
|
||||
bool DoNewResolve(JSContext* aCx, JS::Handle<JSObject*> aObject, JS::Handle<jsid> aId,
|
||||
unsigned aFlags, JS::MutableHandle<JSObject*> aObjp);
|
||||
|
||||
// WebIDL API
|
||||
|
@ -273,7 +273,7 @@ nsScriptLoader::StartLoad(nsScriptLoadRequest *aRequest, const nsAString &aType,
|
||||
|
||||
nsCOMPtr<nsILoadGroup> loadGroup = mDocument->GetDocumentLoadGroup();
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> window(do_QueryInterface(mDocument->GetScriptGlobalObject()));
|
||||
nsCOMPtr<nsPIDOMWindow> window(do_QueryInterface(mDocument->GetWindow()));
|
||||
if (!window) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
@ -430,7 +430,8 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
||||
// For now though, if JS is disabled we assume every language is
|
||||
// disabled.
|
||||
// XXX is this different from the mDocument->IsScriptEnabled() call?
|
||||
nsIScriptGlobalObject *globalObject = mDocument->GetScriptGlobalObject();
|
||||
nsCOMPtr<nsIScriptGlobalObject> globalObject =
|
||||
do_QueryInterface(mDocument->GetWindow());
|
||||
if (!globalObject) {
|
||||
return false;
|
||||
}
|
||||
|
@ -889,10 +889,11 @@ HTMLCanvasElement::InvalidateCanvasContent(const gfx::Rect* damageRect)
|
||||
* invalidating a canvas will feed into heuristics and cause JIT code to be
|
||||
* kept around longer, for smoother animations.
|
||||
*/
|
||||
nsIScriptGlobalObject *scope = OwnerDoc()->GetScriptGlobalObject();
|
||||
if (scope) {
|
||||
JSObject *obj = scope->GetGlobalJSObject();
|
||||
if (obj) {
|
||||
nsCOMPtr<nsIGlobalObject> global =
|
||||
do_QueryInterface(OwnerDoc()->GetInnerWindow());
|
||||
|
||||
if (global) {
|
||||
if (JSObject *obj = global->GetGlobalJSObject()) {
|
||||
js::NotifyAnimationActivity(obj);
|
||||
}
|
||||
}
|
||||
|
@ -81,8 +81,7 @@ ImageListener::OnStartRequest(nsIRequest* request, nsISupports *ctxt)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> domWindow =
|
||||
do_QueryInterface(imgDoc->GetScriptGlobalObject());
|
||||
nsCOMPtr<nsPIDOMWindow> domWindow = imgDoc->GetWindow();
|
||||
NS_ENSURE_TRUE(domWindow, NS_ERROR_UNEXPECTED);
|
||||
|
||||
// Do a ShouldProcess check to see whether to keep loading the image.
|
||||
|
@ -1321,7 +1321,8 @@ IsScriptEnabled(nsIDocument *aDoc, nsIDocShell *aContainer)
|
||||
{
|
||||
NS_ENSURE_TRUE(aDoc && aContainer, true);
|
||||
|
||||
nsCOMPtr<nsIScriptGlobalObject> globalObject = aDoc->GetScriptGlobalObject();
|
||||
nsCOMPtr<nsIScriptGlobalObject> globalObject =
|
||||
do_QueryInterface(aDoc->GetWindow());
|
||||
|
||||
// Getting context is tricky if the document hasn't had its
|
||||
// GlobalObject set yet
|
||||
|
@ -1172,7 +1172,8 @@ nsBindingManager::GetBindingImplementation(nsIContent* aContent, REFNSIID aIID,
|
||||
|
||||
nsIDocument* doc = aContent->OwnerDoc();
|
||||
|
||||
nsIScriptGlobalObject *global = doc->GetScriptGlobalObject();
|
||||
nsCOMPtr<nsIScriptGlobalObject> global =
|
||||
do_QueryInterface(doc->GetWindow());
|
||||
if (!global)
|
||||
return NS_NOINTERFACE;
|
||||
|
||||
|
@ -1254,7 +1254,7 @@ nsXBLBinding::AllowScripts()
|
||||
return false;
|
||||
}
|
||||
|
||||
nsIScriptGlobalObject* global = doc->GetScriptGlobalObject();
|
||||
nsCOMPtr<nsIScriptGlobalObject> global = do_QueryInterface(doc->GetWindow());
|
||||
if (!global) {
|
||||
return false;
|
||||
}
|
||||
|
@ -118,23 +118,23 @@ nsXBLDocGlobalObject::doCheckAccess(JSContext *cx, JS::Handle<JSObject*> obj,
|
||||
}
|
||||
|
||||
static JSBool
|
||||
nsXBLDocGlobalObject_getProperty(JSContext *cx, JSHandleObject obj,
|
||||
JSHandleId id, JS::MutableHandle<JS::Value> vp)
|
||||
nsXBLDocGlobalObject_getProperty(JSContext *cx, JS::Handle<JSObject*> obj,
|
||||
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
return nsXBLDocGlobalObject::
|
||||
doCheckAccess(cx, obj, id, nsIXPCSecurityManager::ACCESS_GET_PROPERTY);
|
||||
}
|
||||
|
||||
static JSBool
|
||||
nsXBLDocGlobalObject_setProperty(JSContext *cx, JSHandleObject obj,
|
||||
JSHandleId id, JSBool strict, JS::MutableHandle<JS::Value> vp)
|
||||
nsXBLDocGlobalObject_setProperty(JSContext *cx, JS::Handle<JSObject*> obj,
|
||||
JS::Handle<jsid> id, JSBool strict, JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
return nsXBLDocGlobalObject::
|
||||
doCheckAccess(cx, obj, id, nsIXPCSecurityManager::ACCESS_SET_PROPERTY);
|
||||
}
|
||||
|
||||
static JSBool
|
||||
nsXBLDocGlobalObject_checkAccess(JSContext *cx, JSHandleObject obj, JSHandleId id,
|
||||
nsXBLDocGlobalObject_checkAccess(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
JSAccessMode mode, JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
uint32_t translated;
|
||||
@ -163,7 +163,7 @@ nsXBLDocGlobalObject_finalize(JSFreeOp *fop, JSObject *obj)
|
||||
}
|
||||
|
||||
static JSBool
|
||||
nsXBLDocGlobalObject_resolve(JSContext *cx, JS::HandleObject obj, JS::HandleId id)
|
||||
nsXBLDocGlobalObject_resolve(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id)
|
||||
{
|
||||
JSBool did_resolve = JS_FALSE;
|
||||
return JS_ResolveStandardClass(cx, obj, id, &did_resolve);
|
||||
|
@ -195,7 +195,8 @@ InstallXBLField(JSContext* cx,
|
||||
MOZ_ASSERT(field);
|
||||
|
||||
// This mirrors code in nsXBLProtoImpl::InstallImplementation
|
||||
nsIScriptGlobalObject* global = xblNode->OwnerDoc()->GetScriptGlobalObject();
|
||||
nsCOMPtr<nsIScriptGlobalObject> global =
|
||||
do_QueryInterface(xblNode->OwnerDoc()->GetWindow());
|
||||
if (!global) {
|
||||
return true;
|
||||
}
|
||||
|
@ -281,7 +281,8 @@ nsXBLProtoImplAnonymousMethod::Execute(nsIContent* aBoundElement)
|
||||
// nsXBLProtoImpl::InstallImplementation does.
|
||||
nsIDocument* document = aBoundElement->OwnerDoc();
|
||||
|
||||
nsIScriptGlobalObject* global = document->GetScriptGlobalObject();
|
||||
nsCOMPtr<nsIScriptGlobalObject> global =
|
||||
do_QueryInterface(document->GetWindow());
|
||||
if (!global) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -454,7 +454,7 @@ nsXBLPrototypeHandler::DispatchXBLCommand(EventTarget* aTarget, nsIDOMEvent* aEv
|
||||
if (!doc)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
privateWindow = do_QueryInterface(doc->GetScriptGlobalObject());
|
||||
privateWindow = doc->GetWindow();
|
||||
if (!privateWindow)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ already_AddRefed<nsPIWindowRoot>
|
||||
nsXULCommandDispatcher::GetWindowRoot()
|
||||
{
|
||||
if (mDocument) {
|
||||
nsCOMPtr<nsPIDOMWindow> window(do_QueryInterface(mDocument->GetScriptGlobalObject()));
|
||||
nsCOMPtr<nsPIDOMWindow> window(mDocument->GetWindow());
|
||||
if (window) {
|
||||
return window->GetTopWindowRoot();
|
||||
}
|
||||
|
@ -945,9 +945,9 @@ XULContentSinkImpl::OpenScript(const PRUnichar** aAttributes,
|
||||
|
||||
// Don't process scripts that aren't known
|
||||
if (langID != nsIProgrammingLanguage::UNKNOWN) {
|
||||
nsIScriptGlobalObject* globalObject = nullptr; // borrowed reference
|
||||
nsCOMPtr<nsIScriptGlobalObject> globalObject;
|
||||
if (doc)
|
||||
globalObject = doc->GetScriptGlobalObject();
|
||||
globalObject = do_QueryInterface(doc->GetWindow());
|
||||
nsRefPtr<nsXULPrototypeScript> script =
|
||||
new nsXULPrototypeScript(aLineNumber, version);
|
||||
if (! script)
|
||||
|
@ -103,7 +103,7 @@ nsXULPDGlobalObject_finalize(JSFreeOp *fop, JSObject *obj)
|
||||
|
||||
|
||||
JSBool
|
||||
nsXULPDGlobalObject_resolve(JSContext *cx, JS::HandleObject obj, JS::HandleId id)
|
||||
nsXULPDGlobalObject_resolve(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id)
|
||||
{
|
||||
JSBool did_resolve = JS_FALSE;
|
||||
|
||||
|
@ -1371,7 +1371,8 @@ nsXULTemplateBuilder::InitHTMLTemplateRoot()
|
||||
if (! doc)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
nsIScriptGlobalObject *global = doc->GetScriptGlobalObject();
|
||||
nsCOMPtr<nsIScriptGlobalObject> global =
|
||||
do_QueryInterface(doc->GetWindow());
|
||||
if (! global)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
|
@ -2601,8 +2601,8 @@ static JSClass sGlobalScopePolluterClass = {
|
||||
|
||||
// static
|
||||
JSBool
|
||||
nsWindowSH::GlobalScopePolluterGetProperty(JSContext *cx, JSHandleObject obj,
|
||||
JSHandleId id, JS::MutableHandle<JS::Value> vp)
|
||||
nsWindowSH::GlobalScopePolluterGetProperty(JSContext *cx, JS::Handle<JSObject*> obj,
|
||||
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
// Someone is accessing a element by referencing its name/id in the
|
||||
// global scope, do a security check to make sure that's ok.
|
||||
@ -2624,7 +2624,7 @@ nsWindowSH::GlobalScopePolluterGetProperty(JSContext *cx, JSHandleObject obj,
|
||||
|
||||
// Gets a subframe.
|
||||
static JSBool
|
||||
ChildWindowGetter(JSContext *cx, JSHandleObject obj, JSHandleId id,
|
||||
ChildWindowGetter(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
MOZ_ASSERT(JSID_IS_STRING(id));
|
||||
@ -2661,8 +2661,8 @@ GetDocument(JSObject *obj)
|
||||
|
||||
// static
|
||||
JSBool
|
||||
nsWindowSH::GlobalScopePolluterNewResolve(JSContext *cx, JSHandleObject obj,
|
||||
JSHandleId id, unsigned flags,
|
||||
nsWindowSH::GlobalScopePolluterNewResolve(JSContext *cx, JS::Handle<JSObject*> obj,
|
||||
JS::Handle<jsid> id, unsigned flags,
|
||||
JS::MutableHandle<JSObject*> objp)
|
||||
{
|
||||
if (!JSID_IS_STRING(id)) {
|
||||
@ -3108,7 +3108,8 @@ static const IDBConstant sIDBConstants[] = {
|
||||
};
|
||||
|
||||
static JSBool
|
||||
IDBConstantGetter(JSContext *cx, JSHandleObject obj, JSHandleId id, JS::MutableHandle<JS::Value> vp)
|
||||
IDBConstantGetter(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
JSString *idstr = JSID_TO_STRING(id);
|
||||
unsigned index;
|
||||
@ -4244,7 +4245,7 @@ LocationSetterGuts(JSContext *cx, JSObject *obj, jsval *vp)
|
||||
|
||||
template<class Interface>
|
||||
static JSBool
|
||||
LocationSetter(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict,
|
||||
LocationSetter(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict,
|
||||
JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
nsresult rv = LocationSetterGuts<Interface>(cx, obj, vp.address());
|
||||
@ -4257,8 +4258,8 @@ LocationSetter(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict,
|
||||
}
|
||||
|
||||
static JSBool
|
||||
LocationSetterUnwrapper(JSContext *cx, JSHandleObject obj_, JSHandleId id, JSBool strict,
|
||||
JS::MutableHandle<JS::Value> vp)
|
||||
LocationSetterUnwrapper(JSContext *cx, JS::Handle<JSObject*> obj_, JS::Handle<jsid> id,
|
||||
JSBool strict, JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
JS::RootedObject obj(cx, obj_);
|
||||
|
||||
@ -5616,8 +5617,8 @@ nsHTMLDocumentSH::GetDocumentAllNodeList(JSContext *cx,
|
||||
}
|
||||
|
||||
JSBool
|
||||
nsHTMLDocumentSH::DocumentAllGetProperty(JSContext *cx, JSHandleObject obj_,
|
||||
JSHandleId id, JS::MutableHandle<JS::Value> vp)
|
||||
nsHTMLDocumentSH::DocumentAllGetProperty(JSContext *cx, JS::Handle<JSObject*> obj_,
|
||||
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
JS::Rooted<JSObject*> obj(cx, obj_);
|
||||
|
||||
@ -5713,8 +5714,9 @@ nsHTMLDocumentSH::DocumentAllGetProperty(JSContext *cx, JSHandleObject obj_,
|
||||
}
|
||||
|
||||
JSBool
|
||||
nsHTMLDocumentSH::DocumentAllNewResolve(JSContext *cx, JSHandleObject obj, JSHandleId id,
|
||||
unsigned flags, JS::MutableHandle<JSObject*> objp)
|
||||
nsHTMLDocumentSH::DocumentAllNewResolve(JSContext *cx, JS::Handle<JSObject*> obj,
|
||||
JS::Handle<jsid> id, unsigned flags,
|
||||
JS::MutableHandle<JSObject*> objp)
|
||||
{
|
||||
JS::RootedValue v(cx);
|
||||
|
||||
|
@ -343,11 +343,11 @@ public:
|
||||
NS_IMETHOD OuterObject(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
|
||||
JSObject * obj, JSObject * *_retval) MOZ_OVERRIDE;
|
||||
|
||||
static JSBool GlobalScopePolluterNewResolve(JSContext *cx, JSHandleObject obj,
|
||||
JSHandleId id, unsigned flags,
|
||||
static JSBool GlobalScopePolluterNewResolve(JSContext *cx, JS::Handle<JSObject*> obj,
|
||||
JS::Handle<jsid> id, unsigned flags,
|
||||
JS::MutableHandle<JSObject*> objp);
|
||||
static JSBool GlobalScopePolluterGetProperty(JSContext *cx, JSHandleObject obj,
|
||||
JSHandleId id, JS::MutableHandle<JS::Value> vp);
|
||||
static JSBool GlobalScopePolluterGetProperty(JSContext *cx, JS::Handle<JSObject*> obj,
|
||||
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);
|
||||
static JSBool InvalidateGlobalScopePolluter(JSContext *cx,
|
||||
JS::Handle<JSObject*> obj);
|
||||
static nsresult InstallGlobalScopePolluter(JSContext *cx,
|
||||
@ -576,9 +576,9 @@ protected:
|
||||
nsDocument *doc,
|
||||
nsContentList **nodeList);
|
||||
public:
|
||||
static JSBool DocumentAllGetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id,
|
||||
static JSBool DocumentAllGetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
JS::MutableHandle<JS::Value> vp);
|
||||
static JSBool DocumentAllNewResolve(JSContext *cx, JSHandleObject obj, JSHandleId id,
|
||||
static JSBool DocumentAllNewResolve(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
unsigned flags, JS::MutableHandle<JSObject*> objp);
|
||||
static void ReleaseDocument(JSFreeOp *fop, JSObject *obj);
|
||||
static JSBool CallToGetPropMapper(JSContext *cx, unsigned argc, jsval *vp);
|
||||
|
@ -8074,11 +8074,7 @@ nsGlobalWindow::GetPrivateParent()
|
||||
if (!doc)
|
||||
return nullptr; // This is ok, just means a null parent.
|
||||
|
||||
nsIScriptGlobalObject *globalObject = doc->GetScriptGlobalObject();
|
||||
if (!globalObject)
|
||||
return nullptr; // This is ok, just means a null parent.
|
||||
|
||||
parent = do_QueryInterface(globalObject);
|
||||
return doc->GetWindow();
|
||||
}
|
||||
|
||||
if (parent) {
|
||||
|
@ -655,7 +655,7 @@ TryPreserveWrapper(JSObject* obj)
|
||||
// Can only be called with the immediate prototype of the instance object. Can
|
||||
// only be called on the prototype of an object known to be a DOM instance.
|
||||
JSBool
|
||||
InstanceClassHasProtoAtDepth(JSHandleObject protoObject, uint32_t protoID,
|
||||
InstanceClassHasProtoAtDepth(JS::Handle<JSObject*> protoObject, uint32_t protoID,
|
||||
uint32_t depth)
|
||||
{
|
||||
const DOMClass* domClass = static_cast<DOMClass*>(
|
||||
@ -1755,7 +1755,7 @@ InterfaceHasInstance(JSContext* cx, JS::Handle<JSObject*> obj,
|
||||
}
|
||||
|
||||
JSBool
|
||||
InterfaceHasInstance(JSContext* cx, JSHandleObject obj, JS::MutableHandle<JS::Value> vp,
|
||||
InterfaceHasInstance(JSContext* cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JS::Value> vp,
|
||||
JSBool* bp)
|
||||
{
|
||||
if (!vp.isObject()) {
|
||||
|
@ -928,7 +928,7 @@ TryPreserveWrapper(JSObject* obj);
|
||||
// Can only be called with the immediate prototype of the instance object. Can
|
||||
// only be called on the prototype of an object known to be a DOM instance.
|
||||
JSBool
|
||||
InstanceClassHasProtoAtDepth(JSHandleObject protoObject, uint32_t protoID,
|
||||
InstanceClassHasProtoAtDepth(JS::Handle<JSObject*> protoObject, uint32_t protoID,
|
||||
uint32_t depth);
|
||||
|
||||
// Only set allowNativeWrapper to false if you really know you need it, if in
|
||||
@ -1970,7 +1970,7 @@ InterfaceHasInstance(JSContext* cx, JS::Handle<JSObject*> obj,
|
||||
JS::Handle<JSObject*> instance,
|
||||
JSBool* bp);
|
||||
JSBool
|
||||
InterfaceHasInstance(JSContext* cx, JSHandleObject obj, JS::MutableHandle<JS::Value> vp,
|
||||
InterfaceHasInstance(JSContext* cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JS::Value> vp,
|
||||
JSBool* bp);
|
||||
|
||||
// Helper for lenient getters/setters to report to console. If this
|
||||
|
@ -930,8 +930,8 @@ class CGAddPropertyHook(CGAbstractClassHook):
|
||||
A hook for addProperty, used to preserve our wrapper from GC.
|
||||
"""
|
||||
def __init__(self, descriptor):
|
||||
args = [Argument('JSContext*', 'cx'), Argument('JSHandleObject', 'obj'),
|
||||
Argument('JSHandleId', 'id'), Argument('JS::MutableHandle<JS::Value>', 'vp')]
|
||||
args = [Argument('JSContext*', 'cx'), Argument('JS::Handle<JSObject*>', 'obj'),
|
||||
Argument('JS::Handle<jsid>', 'id'), Argument('JS::MutableHandle<JS::Value>', 'vp')]
|
||||
CGAbstractClassHook.__init__(self, descriptor, ADDPROPERTY_HOOK_NAME,
|
||||
'JSBool', args)
|
||||
|
||||
@ -1187,7 +1187,7 @@ class CGNamedConstructors(CGThing):
|
||||
|
||||
class CGClassHasInstanceHook(CGAbstractStaticMethod):
|
||||
def __init__(self, descriptor):
|
||||
args = [Argument('JSContext*', 'cx'), Argument('JSHandleObject', 'obj'),
|
||||
args = [Argument('JSContext*', 'cx'), Argument('JS::Handle<JSObject*>', 'obj'),
|
||||
Argument('JS::MutableHandle<JS::Value>', 'vp'), Argument('JSBool*', 'bp')]
|
||||
CGAbstractStaticMethod.__init__(self, descriptor, HASINSTANCE_HOOK_NAME,
|
||||
'JSBool', args)
|
||||
@ -5206,7 +5206,7 @@ class CGSpecializedMethod(CGAbstractStaticMethod):
|
||||
def __init__(self, descriptor, method):
|
||||
self.method = method
|
||||
name = CppKeywords.checkMethodName(method.identifier.name)
|
||||
args = [Argument('JSContext*', 'cx'), Argument('JSHandleObject', 'obj'),
|
||||
args = [Argument('JSContext*', 'cx'), Argument('JS::Handle<JSObject*>', 'obj'),
|
||||
Argument('%s*' % descriptor.nativeType, 'self'),
|
||||
Argument('const JSJitMethodCallArgs&', 'args')]
|
||||
CGAbstractStaticMethod.__init__(self, descriptor, name, 'bool', args)
|
||||
@ -5252,8 +5252,8 @@ class CGNewResolveHook(CGAbstractBindingMethod):
|
||||
"""
|
||||
def __init__(self, descriptor):
|
||||
self._needNewResolve = descriptor.interface.getExtendedAttribute("NeedNewResolve")
|
||||
args = [Argument('JSContext*', 'cx'), Argument('JSHandleObject', 'obj_'),
|
||||
Argument('JSHandleId', 'id'), Argument('unsigned', 'flags'),
|
||||
args = [Argument('JSContext*', 'cx'), Argument('JS::Handle<JSObject*>', 'obj_'),
|
||||
Argument('JS::Handle<jsid>', 'id'), Argument('unsigned', 'flags'),
|
||||
Argument('JS::MutableHandle<JSObject*>', 'objp')]
|
||||
# Our "self" is actually the callee in this case, not the thisval.
|
||||
CGAbstractBindingMethod.__init__(
|
||||
@ -5343,7 +5343,7 @@ class CGSpecializedGetter(CGAbstractStaticMethod):
|
||||
self.attr = attr
|
||||
name = 'get_' + attr.identifier.name
|
||||
args = [ Argument('JSContext*', 'cx'),
|
||||
Argument('JSHandleObject', 'obj'),
|
||||
Argument('JS::Handle<JSObject*>', 'obj'),
|
||||
Argument('%s*' % descriptor.nativeType, 'self'),
|
||||
Argument('JSJitGetterCallArgs', 'args') ]
|
||||
CGAbstractStaticMethod.__init__(self, descriptor, name, "bool", args)
|
||||
@ -5431,7 +5431,7 @@ class CGSpecializedSetter(CGAbstractStaticMethod):
|
||||
self.attr = attr
|
||||
name = 'set_' + attr.identifier.name
|
||||
args = [ Argument('JSContext*', 'cx'),
|
||||
Argument('JSHandleObject', 'obj'),
|
||||
Argument('JS::Handle<JSObject*>', 'obj'),
|
||||
Argument('%s*' % descriptor.nativeType, 'self'),
|
||||
Argument('JSJitSetterCallArgs', 'args')]
|
||||
CGAbstractStaticMethod.__init__(self, descriptor, name, "bool", args)
|
||||
|
@ -36,7 +36,7 @@ DefineStaticJSVals(JSContext* cx)
|
||||
int HandlerFamily;
|
||||
|
||||
js::DOMProxyShadowsResult
|
||||
DOMProxyShadows(JSContext* cx, JSHandleObject proxy, JSHandleId id)
|
||||
DOMProxyShadows(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id)
|
||||
{
|
||||
JS::Value v = js::GetProxyExtra(proxy, JSPROXYSLOT_EXPANDO);
|
||||
if (v.isObject()) {
|
||||
|
@ -54,7 +54,7 @@ nsresult
|
||||
ConvertCloneReadInfosToArrayInternal(
|
||||
JSContext* aCx,
|
||||
nsTArray<StructuredCloneReadInfo>& aReadInfos,
|
||||
jsval* aResult)
|
||||
JS::MutableHandle<JS::Value> aResult)
|
||||
{
|
||||
JS::Rooted<JSObject*> array(aCx, JS_NewArrayObject(aCx, 0, nullptr));
|
||||
if (!array) {
|
||||
@ -73,7 +73,7 @@ ConvertCloneReadInfosToArrayInternal(
|
||||
StructuredCloneReadInfo& readInfo = aReadInfos[index];
|
||||
|
||||
JS::Rooted<JS::Value> val(aCx);
|
||||
if (!IDBObjectStore::DeserializeValue(aCx, readInfo, val.address())) {
|
||||
if (!IDBObjectStore::DeserializeValue(aCx, readInfo, &val)) {
|
||||
NS_WARNING("Failed to decode!");
|
||||
return NS_ERROR_DOM_DATA_CLONE_ERR;
|
||||
}
|
||||
@ -85,7 +85,7 @@ ConvertCloneReadInfosToArrayInternal(
|
||||
}
|
||||
}
|
||||
|
||||
*aResult = OBJECT_TO_JSVAL(array);
|
||||
aResult.setObject(*array);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -112,18 +112,18 @@ HelperBase::~HelperBase()
|
||||
nsresult
|
||||
HelperBase::WrapNative(JSContext* aCx,
|
||||
nsISupports* aNative,
|
||||
jsval* aResult)
|
||||
JS::MutableHandle<JS::Value> aResult)
|
||||
{
|
||||
NS_ASSERTION(aCx, "Null context!");
|
||||
NS_ASSERTION(aNative, "Null pointer!");
|
||||
NS_ASSERTION(aResult, "Null pointer!");
|
||||
NS_ASSERTION(aResult.address(), "Null pointer!");
|
||||
NS_ASSERTION(mRequest, "Null request!");
|
||||
|
||||
JS::Rooted<JSObject*> global(aCx, mRequest->GetParentObject());
|
||||
NS_ASSERTION(global, "This should never be null!");
|
||||
|
||||
nsresult rv =
|
||||
nsContentUtils::WrapNative(aCx, global, aNative, aResult);
|
||||
nsContentUtils::WrapNative(aCx, global, aNative, aResult.address());
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
|
||||
return NS_OK;
|
||||
@ -533,11 +533,11 @@ AsyncConnectionHelper::OnError()
|
||||
|
||||
nsresult
|
||||
AsyncConnectionHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
|
||||
*aVal = JSVAL_VOID;
|
||||
aVal.setUndefined();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -612,10 +612,10 @@ nsresult
|
||||
AsyncConnectionHelper::ConvertToArrayAndCleanup(
|
||||
JSContext* aCx,
|
||||
nsTArray<StructuredCloneReadInfo>& aReadInfos,
|
||||
jsval* aResult)
|
||||
JS::MutableHandle<JS::Value> aResult)
|
||||
{
|
||||
NS_ASSERTION(aCx, "Null context!");
|
||||
NS_ASSERTION(aResult, "Null pointer!");
|
||||
NS_ASSERTION(aResult.address(), "Null pointer!");
|
||||
|
||||
nsresult rv = ConvertCloneReadInfosToArrayInternal(aCx, aReadInfos, aResult);
|
||||
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
virtual nsresult GetResultCode() = 0;
|
||||
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) = 0;
|
||||
JS::MutableHandle<JS::Value> aVal) = 0;
|
||||
|
||||
IDBRequest* GetRequest() const
|
||||
{
|
||||
@ -61,7 +61,7 @@ protected:
|
||||
*/
|
||||
nsresult WrapNative(JSContext* aCx,
|
||||
nsISupports* aNative,
|
||||
jsval* aResult);
|
||||
JS::MutableHandle<JS::Value> aResult);
|
||||
|
||||
/**
|
||||
* Gives the subclass a chance to release any objects that must be released
|
||||
@ -201,7 +201,7 @@ protected:
|
||||
* accesses the result property of the request.
|
||||
*/
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) MOZ_OVERRIDE;
|
||||
JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Gives the subclass a chance to release any objects that must be released
|
||||
@ -216,7 +216,7 @@ protected:
|
||||
static nsresult ConvertToArrayAndCleanup(
|
||||
JSContext* aCx,
|
||||
nsTArray<StructuredCloneReadInfo>& aReadInfos,
|
||||
jsval* aResult);
|
||||
JS::MutableHandle<JS::Value> aResult);
|
||||
|
||||
/**
|
||||
* This should only be called by AutoSetCurrentTransaction.
|
||||
|
@ -88,7 +88,7 @@ public:
|
||||
MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) MOZ_OVERRIDE;
|
||||
JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ReleaseMainThreadObjects() MOZ_OVERRIDE;
|
||||
|
||||
@ -607,7 +607,7 @@ IDBCursor::GetValue(JSContext* aCx,
|
||||
}
|
||||
|
||||
JS::Rooted<JS::Value> val(aCx);
|
||||
if (!IDBObjectStore::DeserializeValue(aCx, mCloneReadInfo, val.address())) {
|
||||
if (!IDBObjectStore::DeserializeValue(aCx, mCloneReadInfo, &val)) {
|
||||
return NS_ERROR_DOM_DATA_CLONE_ERR;
|
||||
}
|
||||
|
||||
@ -1004,12 +1004,12 @@ ContinueHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
|
||||
nsresult
|
||||
ContinueHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
UpdateCursorState();
|
||||
|
||||
if (mKey.IsUnset()) {
|
||||
*aVal = JSVAL_NULL;
|
||||
aVal.setNull();
|
||||
}
|
||||
else {
|
||||
nsresult rv = WrapNative(aCx, mCursor, aVal);
|
||||
|
@ -118,7 +118,7 @@ public:
|
||||
|
||||
nsresult DoDatabaseWork(mozIStorageConnection* aConnection);
|
||||
nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal);
|
||||
JS::MutableHandle<JS::Value> aVal);
|
||||
void ReleaseMainThreadObjects()
|
||||
{
|
||||
mFileInfo = nullptr;
|
||||
@ -1016,7 +1016,7 @@ CreateFileHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
|
||||
nsresult
|
||||
CreateFileHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
nsRefPtr<IDBFileHandle> fileHandle =
|
||||
IDBFileHandle::Create(mDatabase, mName, mType, mFileInfo.forget());
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) MOZ_OVERRIDE;
|
||||
JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ReleaseMainThreadObjects() MOZ_OVERRIDE;
|
||||
|
||||
@ -126,7 +126,7 @@ public:
|
||||
MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) MOZ_OVERRIDE;
|
||||
JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ReleaseMainThreadObjects() MOZ_OVERRIDE;
|
||||
|
||||
@ -159,7 +159,7 @@ public:
|
||||
MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) MOZ_OVERRIDE;
|
||||
JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult
|
||||
PackArgumentsForParentProcess(IndexRequestParams& aParams) MOZ_OVERRIDE;
|
||||
@ -198,7 +198,7 @@ public:
|
||||
MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) MOZ_OVERRIDE;
|
||||
JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ReleaseMainThreadObjects() MOZ_OVERRIDE;
|
||||
|
||||
@ -238,7 +238,7 @@ public:
|
||||
MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) MOZ_OVERRIDE;
|
||||
JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ReleaseMainThreadObjects() MOZ_OVERRIDE;
|
||||
|
||||
@ -320,7 +320,7 @@ public:
|
||||
MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) MOZ_OVERRIDE;
|
||||
JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ReleaseMainThreadObjects() MOZ_OVERRIDE;
|
||||
|
||||
@ -1177,14 +1177,9 @@ GetKeyHelper::DoDatabaseWork(mozIStorageConnection* /* aConnection */)
|
||||
|
||||
nsresult
|
||||
GetKeyHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
JS::Rooted<JS::Value> value(aCx);
|
||||
nsresult rv = mKey.ToJSVal(aCx, &value);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
*aVal = value;
|
||||
}
|
||||
return rv;
|
||||
return mKey.ToJSVal(aCx, aVal);
|
||||
}
|
||||
|
||||
void
|
||||
@ -1309,7 +1304,7 @@ GetHelper::DoDatabaseWork(mozIStorageConnection* /* aConnection */)
|
||||
|
||||
nsresult
|
||||
GetHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
bool result = IDBObjectStore::DeserializeValue(aCx, mCloneReadInfo, aVal);
|
||||
|
||||
@ -1488,7 +1483,7 @@ GetAllKeysHelper::DoDatabaseWork(mozIStorageConnection* /* aConnection */)
|
||||
|
||||
nsresult
|
||||
GetAllKeysHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
NS_ASSERTION(mKeys.Length() <= mLimit, "Too many results!");
|
||||
|
||||
@ -1525,7 +1520,7 @@ GetAllKeysHelper::GetSuccessResult(JSContext* aCx,
|
||||
}
|
||||
}
|
||||
|
||||
*aVal = OBJECT_TO_JSVAL(array);
|
||||
aVal.setObject(*array);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1665,7 +1660,7 @@ GetAllHelper::DoDatabaseWork(mozIStorageConnection* /* aConnection */)
|
||||
|
||||
nsresult
|
||||
GetAllHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
NS_ASSERTION(mCloneReadInfos.Length() <= mLimit, "Too many results!");
|
||||
|
||||
@ -2005,7 +2000,7 @@ OpenKeyCursorHelper::EnsureCursor()
|
||||
|
||||
nsresult
|
||||
OpenKeyCursorHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
nsresult rv = EnsureCursor();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@ -2015,7 +2010,7 @@ OpenKeyCursorHelper::GetSuccessResult(JSContext* aCx,
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
}
|
||||
else {
|
||||
*aVal = JSVAL_VOID;
|
||||
aVal.setUndefined();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
@ -2554,9 +2549,9 @@ CountHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
|
||||
nsresult
|
||||
CountHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
*aVal = JS_NumberValue(static_cast<double>(mCount));
|
||||
aVal.setNumber(static_cast<double>(mCount));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,7 @@ public:
|
||||
MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) MOZ_OVERRIDE;
|
||||
JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ReleaseMainThreadObjects() MOZ_OVERRIDE;
|
||||
|
||||
@ -215,7 +215,7 @@ public:
|
||||
MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) MOZ_OVERRIDE;
|
||||
JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ReleaseMainThreadObjects() MOZ_OVERRIDE;
|
||||
|
||||
@ -252,7 +252,7 @@ public:
|
||||
MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) MOZ_OVERRIDE;
|
||||
JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult
|
||||
PackArgumentsForParentProcess(ObjectStoreRequestParams& aParams) MOZ_OVERRIDE;
|
||||
@ -309,7 +309,7 @@ public:
|
||||
MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) MOZ_OVERRIDE;
|
||||
JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ReleaseMainThreadObjects() MOZ_OVERRIDE;
|
||||
|
||||
@ -415,7 +415,7 @@ public:
|
||||
MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) MOZ_OVERRIDE;
|
||||
JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ReleaseMainThreadObjects() MOZ_OVERRIDE;
|
||||
|
||||
@ -454,7 +454,7 @@ public:
|
||||
MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) MOZ_OVERRIDE;
|
||||
JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ReleaseMainThreadObjects() MOZ_OVERRIDE;
|
||||
|
||||
@ -1219,7 +1219,7 @@ IDBObjectStore::ClearStructuredCloneBuffer(JSAutoStructuredCloneBuffer& aBuffer)
|
||||
bool
|
||||
IDBObjectStore::DeserializeValue(JSContext* aCx,
|
||||
StructuredCloneReadInfo& aCloneReadInfo,
|
||||
jsval* aValue)
|
||||
JS::MutableHandle<JS::Value> aValue)
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(),
|
||||
"Should only be deserializing on the main thread!");
|
||||
@ -1228,7 +1228,7 @@ IDBObjectStore::DeserializeValue(JSContext* aCx,
|
||||
JSAutoStructuredCloneBuffer& buffer = aCloneReadInfo.mCloneBuffer;
|
||||
|
||||
if (!buffer.data()) {
|
||||
*aValue = JSVAL_VOID;
|
||||
aValue.setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1240,7 +1240,7 @@ IDBObjectStore::DeserializeValue(JSContext* aCx,
|
||||
nullptr
|
||||
};
|
||||
|
||||
return buffer.read(aCx, aValue, &callbacks, &aCloneReadInfo);
|
||||
return buffer.read(aCx, aValue.address(), &callbacks, &aCloneReadInfo);
|
||||
}
|
||||
|
||||
// static
|
||||
@ -3128,18 +3128,13 @@ AddHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
|
||||
nsresult
|
||||
AddHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
NS_ASSERTION(!mKey.IsUnset(), "Badness!");
|
||||
|
||||
mCloneWriteInfo.mCloneBuffer.clear();
|
||||
|
||||
JS::Rooted<JS::Value> value(aCx);
|
||||
nsresult rv = mKey.ToJSVal(aCx, &value);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
*aVal = value;
|
||||
}
|
||||
return rv;
|
||||
return mKey.ToJSVal(aCx, aVal);
|
||||
}
|
||||
|
||||
void
|
||||
@ -3296,7 +3291,7 @@ GetHelper::DoDatabaseWork(mozIStorageConnection* /* aConnection */)
|
||||
|
||||
nsresult
|
||||
GetHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
bool result = IDBObjectStore::DeserializeValue(aCx, mCloneReadInfo, aVal);
|
||||
|
||||
@ -3447,9 +3442,9 @@ DeleteHelper::DoDatabaseWork(mozIStorageConnection* /*aConnection */)
|
||||
|
||||
nsresult
|
||||
DeleteHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
*aVal = JSVAL_VOID;
|
||||
aVal.setUndefined();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -3737,7 +3732,7 @@ OpenCursorHelper::EnsureCursor()
|
||||
|
||||
nsresult
|
||||
OpenCursorHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
nsresult rv = EnsureCursor();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@ -3747,7 +3742,7 @@ OpenCursorHelper::GetSuccessResult(JSContext* aCx,
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
}
|
||||
else {
|
||||
*aVal = JSVAL_VOID;
|
||||
aVal.setUndefined();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
@ -4208,7 +4203,7 @@ GetAllHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
|
||||
nsresult
|
||||
GetAllHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
NS_ASSERTION(mCloneReadInfos.Length() <= mLimit, "Too many results!");
|
||||
|
||||
@ -4431,9 +4426,9 @@ CountHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
|
||||
nsresult
|
||||
CountHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
*aVal = JS_NumberValue(static_cast<double>(mCount));
|
||||
aVal.setNumber(static_cast<double>(mCount));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ public:
|
||||
static bool
|
||||
DeserializeValue(JSContext* aCx,
|
||||
StructuredCloneReadInfo& aCloneReadInfo,
|
||||
jsval* aValue);
|
||||
JS::MutableHandle<JS::Value> aValue);
|
||||
|
||||
static bool
|
||||
SerializeValue(JSContext* aCx,
|
||||
|
@ -120,7 +120,7 @@ IDBRequest::NotifyHelperCompleted(HelperBase* aHelper)
|
||||
AssertIsRooted();
|
||||
|
||||
JS::Rooted<JS::Value> value(cx);
|
||||
rv = aHelper->GetSuccessResult(cx, value.address());
|
||||
rv = aHelper->GetSuccessResult(cx, &value);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("GetSuccessResult failed!");
|
||||
}
|
||||
|
@ -1444,7 +1444,7 @@ public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) MOZ_OVERRIDE;
|
||||
JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult
|
||||
OnExclusiveAccessAcquired() MOZ_OVERRIDE;
|
||||
@ -1515,7 +1515,7 @@ public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal);
|
||||
JS::MutableHandle<JS::Value> aVal);
|
||||
|
||||
void ReleaseMainThreadObjects()
|
||||
{
|
||||
@ -2323,7 +2323,7 @@ OpenDatabaseHelper::EnsureSuccessResult()
|
||||
|
||||
nsresult
|
||||
OpenDatabaseHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
// Be careful not to load the database twice.
|
||||
if (!mDatabase) {
|
||||
@ -2471,7 +2471,7 @@ SetVersionHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
|
||||
nsresult
|
||||
SetVersionHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
DatabaseInfo* info = mDatabase->Info();
|
||||
info->version = mRequestedVersion;
|
||||
@ -2679,7 +2679,7 @@ DeleteDatabaseHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
}
|
||||
|
||||
nsresult
|
||||
DeleteDatabaseHelper::GetSuccessResult(JSContext* aCx, jsval* aVal)
|
||||
DeleteDatabaseHelper::GetSuccessResult(JSContext* aCx, JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ protected:
|
||||
nsresult StartSetVersion();
|
||||
nsresult StartDelete();
|
||||
virtual nsresult GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal) MOZ_OVERRIDE;
|
||||
JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
void DispatchSuccessEvent();
|
||||
void DispatchErrorEvent();
|
||||
virtual void ReleaseMainThreadObjects() MOZ_OVERRIDE;
|
||||
@ -159,4 +159,4 @@ protected:
|
||||
|
||||
END_INDEXEDDB_NAMESPACE
|
||||
|
||||
#endif // mozilla_dom_indexeddb_opendatabasehelper_h__
|
||||
#endif // mozilla_dom_indexeddb_opendatabasehelper_h__
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
SendResponseToChildProcess(nsresult aResultCode) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult
|
||||
GetSuccessResult(JSContext* aCx, jsval* aVal) MOZ_OVERRIDE;
|
||||
GetSuccessResult(JSContext* aCx, JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult
|
||||
OnSuccess() MOZ_OVERRIDE
|
||||
@ -96,7 +96,7 @@ public:
|
||||
CreateSuccessEvent(mozilla::dom::EventTarget* aOwner) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult
|
||||
GetSuccessResult(JSContext* aCx, jsval* aVal) MOZ_OVERRIDE;
|
||||
GetSuccessResult(JSContext* aCx, JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
};
|
||||
|
||||
class IPCDeleteDatabaseHelper : public AsyncConnectionHelper
|
||||
@ -114,7 +114,7 @@ public:
|
||||
SendResponseToChildProcess(nsresult aResultCode) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult
|
||||
GetSuccessResult(JSContext* aCx, jsval* aVal) MOZ_OVERRIDE;
|
||||
GetSuccessResult(JSContext* aCx, JS::MutableHandle<JS::Value> aVal) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult
|
||||
DoDatabaseWork(mozIStorageConnection* aConnection) MOZ_OVERRIDE;
|
||||
@ -1294,7 +1294,7 @@ IPCOpenDatabaseHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
}
|
||||
|
||||
nsresult
|
||||
IPCOpenDatabaseHelper::GetSuccessResult(JSContext* aCx, jsval* aVal)
|
||||
IPCOpenDatabaseHelper::GetSuccessResult(JSContext* aCx, JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
return WrapNative(aCx, NS_ISUPPORTS_CAST(EventTarget*, mDatabase),
|
||||
aVal);
|
||||
@ -1331,7 +1331,7 @@ IPCSetVersionHelper::CreateSuccessEvent(mozilla::dom::EventTarget* aOwner)
|
||||
}
|
||||
|
||||
nsresult
|
||||
IPCSetVersionHelper::GetSuccessResult(JSContext* aCx, jsval* aVal)
|
||||
IPCSetVersionHelper::GetSuccessResult(JSContext* aCx, JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
mOpenRequest->SetTransaction(mTransaction);
|
||||
|
||||
@ -1355,9 +1355,9 @@ IPCDeleteDatabaseHelper::SendResponseToChildProcess(nsresult aResultCode)
|
||||
}
|
||||
|
||||
nsresult
|
||||
IPCDeleteDatabaseHelper::GetSuccessResult(JSContext* aCx, jsval* aVal)
|
||||
IPCDeleteDatabaseHelper::GetSuccessResult(JSContext* aCx, JS::MutableHandle<JS::Value> aVal)
|
||||
{
|
||||
*aVal = JSVAL_VOID;
|
||||
aVal.setUndefined();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -109,28 +109,28 @@ NPClass nsJSObjWrapper::sJSObjWrapperNPClass =
|
||||
};
|
||||
|
||||
static JSBool
|
||||
NPObjWrapper_AddProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JS::MutableHandle<JS::Value> vp);
|
||||
NPObjWrapper_AddProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
static JSBool
|
||||
NPObjWrapper_DelProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool *succeeded);
|
||||
NPObjWrapper_DelProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool *succeeded);
|
||||
|
||||
static JSBool
|
||||
NPObjWrapper_SetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict,
|
||||
NPObjWrapper_SetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict,
|
||||
JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
static JSBool
|
||||
NPObjWrapper_GetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JS::MutableHandle<JS::Value> vp);
|
||||
NPObjWrapper_GetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
static JSBool
|
||||
NPObjWrapper_newEnumerate(JSContext *cx, JSHandleObject obj, JSIterateOp enum_op,
|
||||
NPObjWrapper_newEnumerate(JSContext *cx, JS::Handle<JSObject*> obj, JSIterateOp enum_op,
|
||||
JS::Value *statep, jsid *idp);
|
||||
|
||||
static JSBool
|
||||
NPObjWrapper_NewResolve(JSContext *cx, JSHandleObject obj, JSHandleId id, unsigned flags,
|
||||
NPObjWrapper_NewResolve(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, unsigned flags,
|
||||
JS::MutableHandle<JSObject*> objp);
|
||||
|
||||
static JSBool
|
||||
NPObjWrapper_Convert(JSContext *cx, JSHandleObject obj, JSType type, JS::MutableHandle<JS::Value> vp);
|
||||
NPObjWrapper_Convert(JSContext *cx, JS::Handle<JSObject*> obj, JSType type, JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
static void
|
||||
NPObjWrapper_Finalize(JSFreeOp *fop, JSObject *obj);
|
||||
@ -171,7 +171,7 @@ typedef struct NPObjectMemberPrivate {
|
||||
} NPObjectMemberPrivate;
|
||||
|
||||
static JSBool
|
||||
NPObjectMember_Convert(JSContext *cx, JSHandleObject obj, JSType type, JS::MutableHandle<JS::Value> vp);
|
||||
NPObjectMember_Convert(JSContext *cx, JS::Handle<JSObject*> obj, JSType type, JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
static void
|
||||
NPObjectMember_Finalize(JSFreeOp *fop, JSObject *obj);
|
||||
@ -1108,7 +1108,7 @@ GetNPObject(JSContext *cx, JSObject *obj)
|
||||
// Does not actually add a property because this is always followed by a
|
||||
// SetProperty call.
|
||||
static JSBool
|
||||
NPObjWrapper_AddProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JS::MutableHandle<JS::Value> vp)
|
||||
NPObjWrapper_AddProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
NPObject *npobj = GetNPObject(cx, obj);
|
||||
|
||||
@ -1149,7 +1149,7 @@ NPObjWrapper_AddProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JS::M
|
||||
}
|
||||
|
||||
static JSBool
|
||||
NPObjWrapper_DelProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool *succeeded)
|
||||
NPObjWrapper_DelProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool *succeeded)
|
||||
{
|
||||
NPObject *npobj = GetNPObject(cx, obj);
|
||||
|
||||
@ -1182,7 +1182,7 @@ NPObjWrapper_DelProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBoo
|
||||
}
|
||||
|
||||
static JSBool
|
||||
NPObjWrapper_SetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict,
|
||||
NPObjWrapper_SetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict,
|
||||
JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
NPObject *npobj = GetNPObject(cx, obj);
|
||||
@ -1242,7 +1242,7 @@ NPObjWrapper_SetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBoo
|
||||
}
|
||||
|
||||
static JSBool
|
||||
NPObjWrapper_GetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JS::MutableHandle<JS::Value> vp)
|
||||
NPObjWrapper_GetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
NPObject *npobj = GetNPObject(cx, obj);
|
||||
|
||||
@ -1472,7 +1472,7 @@ struct NPObjectEnumerateState {
|
||||
};
|
||||
|
||||
static JSBool
|
||||
NPObjWrapper_newEnumerate(JSContext *cx, JSHandleObject obj, JSIterateOp enum_op,
|
||||
NPObjWrapper_newEnumerate(JSContext *cx, JS::Handle<JSObject*> obj, JSIterateOp enum_op,
|
||||
JS::Value *statep, jsid *idp)
|
||||
{
|
||||
NPObject *npobj = GetNPObject(cx, obj);
|
||||
@ -1552,7 +1552,7 @@ NPObjWrapper_newEnumerate(JSContext *cx, JSHandleObject obj, JSIterateOp enum_op
|
||||
}
|
||||
|
||||
static JSBool
|
||||
NPObjWrapper_NewResolve(JSContext *cx, JSHandleObject obj, JSHandleId id, unsigned flags,
|
||||
NPObjWrapper_NewResolve(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, unsigned flags,
|
||||
JS::MutableHandle<JSObject*> objp)
|
||||
{
|
||||
NPObject *npobj = GetNPObject(cx, obj);
|
||||
@ -1606,7 +1606,7 @@ NPObjWrapper_NewResolve(JSContext *cx, JSHandleObject obj, JSHandleId id, unsign
|
||||
}
|
||||
|
||||
static JSBool
|
||||
NPObjWrapper_Convert(JSContext *cx, JSHandleObject obj, JSType hint, JS::MutableHandle<JS::Value> vp)
|
||||
NPObjWrapper_Convert(JSContext *cx, JS::Handle<JSObject*> obj, JSType hint, JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
JS_ASSERT(hint == JSTYPE_NUMBER || hint == JSTYPE_STRING || hint == JSTYPE_VOID);
|
||||
|
||||
@ -2026,7 +2026,7 @@ CreateNPObjectMember(NPP npp, JSContext *cx, JSObject *obj, NPObject* npobj,
|
||||
}
|
||||
|
||||
static JSBool
|
||||
NPObjectMember_Convert(JSContext *cx, JSHandleObject obj, JSType type, JS::MutableHandle<JS::Value> vp)
|
||||
NPObjectMember_Convert(JSContext *cx, JS::Handle<JSObject*> obj, JSType type, JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
NPObjectMemberPrivate *memberPrivate =
|
||||
(NPObjectMemberPrivate *)::JS_GetInstancePrivate(cx, obj,
|
||||
|
@ -644,7 +644,7 @@ GetDocumentFromNPP(NPP npp)
|
||||
static JSContext *
|
||||
GetJSContextFromDoc(nsIDocument *doc)
|
||||
{
|
||||
nsIScriptGlobalObject *sgo = doc->GetScriptGlobalObject();
|
||||
nsCOMPtr<nsIScriptGlobalObject> sgo = do_QueryInterface(doc->GetWindow());
|
||||
NS_ENSURE_TRUE(sgo, nullptr);
|
||||
|
||||
nsIScriptContext *scx = sgo->GetContext();
|
||||
|
@ -1618,7 +1618,8 @@ nsNPAPIPluginInstance::GetJSContext(JSContext* *outContext)
|
||||
nsresult rv = mOwner->GetDocument(getter_AddRefs(document));
|
||||
|
||||
if (NS_SUCCEEDED(rv) && document) {
|
||||
nsIScriptGlobalObject *global = document->GetScriptGlobalObject();
|
||||
nsCOMPtr<nsIScriptGlobalObject> global =
|
||||
do_QueryInterface(document->GetWindow());
|
||||
|
||||
if (global) {
|
||||
nsIScriptContext *context = global->GetContext();
|
||||
|
@ -220,7 +220,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetProperty(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetProperty(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
JS_ASSERT(JSID_IS_INT(aIdval));
|
||||
|
||||
@ -236,7 +237,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetConstant(JSContext* aCx, JSHandleObject aObj, JSHandleId idval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetConstant(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> idval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
JS_ASSERT(JSID_IS_INT(idval));
|
||||
JS_ASSERT(JSID_TO_INT(idval) >= CAPTURING_PHASE &&
|
||||
@ -505,7 +507,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetProperty(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetProperty(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
JS_ASSERT(JSID_IS_INT(aIdval));
|
||||
|
||||
@ -712,7 +715,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetProperty(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetProperty(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
JS_ASSERT(JSID_IS_INT(aIdval));
|
||||
|
||||
@ -891,7 +895,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetProperty(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetProperty(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
JS_ASSERT(JSID_IS_INT(aIdval));
|
||||
|
||||
|
@ -126,7 +126,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetProperty(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetProperty(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
JS_ASSERT(JSID_IS_INT(aIdval));
|
||||
|
||||
@ -146,7 +147,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetConstant(JSContext* aCx, JSHandleObject aObj, JSHandleId idval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetConstant(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> idval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
JS_ASSERT(JSID_IS_INT(idval));
|
||||
aVp.set(INT_TO_JSVAL(JSID_TO_INT(idval)));
|
||||
|
@ -113,7 +113,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetSize(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetSize(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
nsIDOMBlob* blob = GetInstancePrivate(aCx, aObj, "size");
|
||||
if (!blob) {
|
||||
@ -132,7 +133,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetType(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetType(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
nsIDOMBlob* blob = GetInstancePrivate(aCx, aObj, "type");
|
||||
if (!blob) {
|
||||
@ -302,7 +304,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetMozFullPath(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetMozFullPath(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
nsIDOMFile* file = GetInstancePrivate(aCx, aObj, "mozFullPath");
|
||||
if (!file) {
|
||||
@ -328,7 +331,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetName(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetName(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
nsIDOMFile* file = GetInstancePrivate(aCx, aObj, "name");
|
||||
if (!file) {
|
||||
@ -350,7 +354,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetLastModifiedDate(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetLastModifiedDate(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
nsIDOMFile* file = GetInstancePrivate(aCx, aObj, "lastModifiedDate");
|
||||
if (!file) {
|
||||
|
@ -115,7 +115,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetProperty(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetProperty(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
JSClass* classPtr = JS_GetClass(aObj);
|
||||
if (classPtr != &sClass) {
|
||||
|
@ -129,7 +129,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetProperty(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetProperty(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
JSClass* classPtr = JS_GetClass(aObj);
|
||||
if (classPtr != &sClass) {
|
||||
|
@ -117,7 +117,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetProperty(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetProperty(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
JSClass* classPtr = JS_GetClass(aObj);
|
||||
if (classPtr != &sClass) {
|
||||
|
@ -912,8 +912,8 @@ BEGIN_WORKERS_NAMESPACE
|
||||
|
||||
// Entry point for the DOM.
|
||||
JSBool
|
||||
ResolveWorkerClasses(JSContext* aCx, JSHandleObject aObj, JSHandleId aId, unsigned aFlags,
|
||||
JS::MutableHandle<JSObject*> aObjp)
|
||||
ResolveWorkerClasses(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aId,
|
||||
unsigned aFlags, JS::MutableHandle<JSObject*> aObjp)
|
||||
{
|
||||
AssertIsOnMainThread();
|
||||
|
||||
|
@ -175,7 +175,8 @@ private:
|
||||
~Worker();
|
||||
|
||||
static JSBool
|
||||
GetEventListener(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetEventListener(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
JS_ASSERT(JSID_IS_INT(aIdval));
|
||||
JS_ASSERT(JSID_TO_INT(aIdval) >= 0 && JSID_TO_INT(aIdval) < STRING_COUNT);
|
||||
@ -199,8 +200,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
SetEventListener(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JSBool aStrict,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
SetEventListener(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JSBool aStrict, JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
JS_ASSERT(JSID_IS_INT(aIdval));
|
||||
JS_ASSERT(JSID_TO_INT(aIdval) >= 0 && JSID_TO_INT(aIdval) < STRING_COUNT);
|
||||
|
@ -142,7 +142,8 @@ protected:
|
||||
|
||||
private:
|
||||
static JSBool
|
||||
GetEventListener(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetEventListener(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
JS_ASSERT(JSID_IS_INT(aIdval));
|
||||
JS_ASSERT(JSID_TO_INT(aIdval) >= 0 && JSID_TO_INT(aIdval) < STRING_COUNT);
|
||||
@ -168,8 +169,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
SetEventListener(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JSBool aStrict,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
SetEventListener(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JSBool aStrict, JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
JS_ASSERT(JSID_IS_INT(aIdval));
|
||||
JS_ASSERT(JSID_TO_INT(aIdval) >= 0 && JSID_TO_INT(aIdval) < STRING_COUNT);
|
||||
@ -209,7 +210,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetSelf(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetSelf(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
if (!GetInstancePrivate(aCx, aObj, "self")) {
|
||||
return false;
|
||||
@ -220,7 +222,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetLocation(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetLocation(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
WorkerGlobalScope* scope =
|
||||
GetInstancePrivate(aCx, aObj, sProperties[SLOT_location].name);
|
||||
@ -309,7 +312,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetOnErrorListener(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetOnErrorListener(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
const char* name = sEventStrings[STRING_onerror];
|
||||
WorkerGlobalScope* scope = GetInstancePrivate(aCx, aObj, name);
|
||||
@ -340,7 +344,7 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
SetOnErrorListener(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval,
|
||||
SetOnErrorListener(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JSBool aStrict, JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
const char* name = sEventStrings[STRING_onerror];
|
||||
@ -383,7 +387,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
GetNavigator(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetNavigator(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
WorkerGlobalScope* scope =
|
||||
GetInstancePrivate(aCx, aObj, sProperties[SLOT_navigator].name);
|
||||
@ -732,7 +737,8 @@ private:
|
||||
using EventTarget::SetEventListener;
|
||||
|
||||
static JSBool
|
||||
GetEventListener(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JS::MutableHandle<JS::Value> aVp)
|
||||
GetEventListener(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
JS_ASSERT(JSID_IS_INT(aIdval));
|
||||
JS_ASSERT(JSID_TO_INT(aIdval) >= 0 && JSID_TO_INT(aIdval) < STRING_COUNT);
|
||||
@ -758,8 +764,8 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
SetEventListener(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JSBool aStrict,
|
||||
JS::MutableHandle<JS::Value> aVp)
|
||||
SetEventListener(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aIdval,
|
||||
JSBool aStrict, JS::MutableHandle<JS::Value> aVp)
|
||||
{
|
||||
JS_ASSERT(JSID_IS_INT(aIdval));
|
||||
JS_ASSERT(JSID_TO_INT(aIdval) >= 0 && JSID_TO_INT(aIdval) < STRING_COUNT);
|
||||
@ -812,7 +818,7 @@ private:
|
||||
}
|
||||
|
||||
static JSBool
|
||||
Resolve(JSContext* aCx, JS::HandleObject aObj, JS::HandleId aId, unsigned aFlags,
|
||||
Resolve(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aId, unsigned aFlags,
|
||||
JS::MutableHandle<JSObject*> aObjp)
|
||||
{
|
||||
JSBool resolved;
|
||||
|
@ -165,7 +165,7 @@ struct JSSettings
|
||||
|
||||
// All of these are implemented in RuntimeService.cpp
|
||||
JSBool
|
||||
ResolveWorkerClasses(JSContext* aCx, JSHandleObject aObj, JSHandleId aId,
|
||||
ResolveWorkerClasses(JSContext* aCx, JS::Handle<JSObject*> aObj, JS::Handle<jsid> aId,
|
||||
unsigned aFlags, JS::MutableHandle<JSObject*> aObjp);
|
||||
|
||||
void
|
||||
|
@ -387,7 +387,7 @@ jsval_to_nsString(JSContext* cx, jsid from, nsString* to)
|
||||
}
|
||||
|
||||
/*static*/ JSBool
|
||||
ObjectWrapperParent::CPOW_AddProperty(JSContext *cx, JSHandleObject obj, JSHandleId id,
|
||||
ObjectWrapperParent::CPOW_AddProperty(JSContext *cx, HandleObject obj, HandleId id,
|
||||
MutableHandleValue vp)
|
||||
{
|
||||
CPOW_LOG(("Calling CPOW_AddProperty (%s)...",
|
||||
@ -414,7 +414,7 @@ ObjectWrapperParent::CPOW_AddProperty(JSContext *cx, JSHandleObject obj, JSHandl
|
||||
}
|
||||
|
||||
/*static*/ JSBool
|
||||
ObjectWrapperParent::CPOW_GetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id,
|
||||
ObjectWrapperParent::CPOW_GetProperty(JSContext *cx, HandleObject obj, HandleId id,
|
||||
MutableHandleValue vp)
|
||||
{
|
||||
CPOW_LOG(("Calling CPOW_GetProperty (%s)...",
|
||||
@ -441,7 +441,7 @@ ObjectWrapperParent::CPOW_GetProperty(JSContext *cx, JSHandleObject obj, JSHandl
|
||||
}
|
||||
|
||||
/*static*/ JSBool
|
||||
ObjectWrapperParent::CPOW_SetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id,
|
||||
ObjectWrapperParent::CPOW_SetProperty(JSContext *cx, HandleObject obj, HandleId id,
|
||||
JSBool strict, MutableHandleValue vp)
|
||||
{
|
||||
CPOW_LOG(("Calling CPOW_SetProperty (%s)...",
|
||||
@ -470,7 +470,7 @@ ObjectWrapperParent::CPOW_SetProperty(JSContext *cx, JSHandleObject obj, JSHandl
|
||||
}
|
||||
|
||||
/*static*/ JSBool
|
||||
ObjectWrapperParent::CPOW_DelProperty(JSContext *cx, JSHandleObject obj, JSHandleId id,
|
||||
ObjectWrapperParent::CPOW_DelProperty(JSContext *cx, HandleObject obj, HandleId id,
|
||||
JSBool *succeeded)
|
||||
{
|
||||
CPOW_LOG(("Calling CPOW_DelProperty (%s)...",
|
||||
@ -551,7 +551,7 @@ ObjectWrapperParent::NewEnumerateDestroy(JSContext* cx, jsval state)
|
||||
}
|
||||
|
||||
/*static*/ JSBool
|
||||
ObjectWrapperParent::CPOW_NewEnumerate(JSContext *cx, JSHandleObject obj,
|
||||
ObjectWrapperParent::CPOW_NewEnumerate(JSContext *cx, HandleObject obj,
|
||||
JSIterateOp enum_op, jsval *statep,
|
||||
jsid *idp)
|
||||
{
|
||||
@ -577,7 +577,7 @@ ObjectWrapperParent::CPOW_NewEnumerate(JSContext *cx, JSHandleObject obj,
|
||||
}
|
||||
|
||||
/*static*/ JSBool
|
||||
ObjectWrapperParent::CPOW_NewResolve(JSContext *cx, JSHandleObject obj, JSHandleId id,
|
||||
ObjectWrapperParent::CPOW_NewResolve(JSContext *cx, HandleObject obj, HandleId id,
|
||||
unsigned flags, MutableHandleObject objp)
|
||||
{
|
||||
CPOW_LOG(("Calling CPOW_NewResolve (%s)...",
|
||||
@ -613,7 +613,7 @@ ObjectWrapperParent::CPOW_NewResolve(JSContext *cx, JSHandleObject obj, JSHandle
|
||||
}
|
||||
|
||||
/*static*/ JSBool
|
||||
ObjectWrapperParent::CPOW_Convert(JSContext *cx, JSHandleObject obj, JSType type,
|
||||
ObjectWrapperParent::CPOW_Convert(JSContext *cx, HandleObject obj, JSType type,
|
||||
MutableHandleValue vp)
|
||||
{
|
||||
CPOW_LOG(("Calling CPOW_Convert (to %s)...",
|
||||
@ -708,7 +708,7 @@ ObjectWrapperParent::CPOW_Construct(JSContext* cx, unsigned argc, jsval* vp)
|
||||
}
|
||||
|
||||
/*static*/ JSBool
|
||||
ObjectWrapperParent::CPOW_HasInstance(JSContext *cx, JSHandleObject obj, MutableHandleValue v,
|
||||
ObjectWrapperParent::CPOW_HasInstance(JSContext *cx, HandleObject obj, MutableHandleValue v,
|
||||
JSBool *bp)
|
||||
{
|
||||
CPOW_LOG(("Calling CPOW_HasInstance..."));
|
||||
|
@ -59,30 +59,33 @@ private:
|
||||
mutable JSObject* mObj;
|
||||
|
||||
static JSBool
|
||||
CPOW_AddProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JS::MutableHandleValue vp);
|
||||
CPOW_AddProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
|
||||
JS::MutableHandleValue vp);
|
||||
|
||||
static JSBool
|
||||
CPOW_DelProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool *succeeded);
|
||||
CPOW_DelProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JSBool *succeeded);
|
||||
|
||||
static JSBool
|
||||
CPOW_GetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JS::MutableHandleValue vp);
|
||||
|
||||
CPOW_GetProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
|
||||
JS::MutableHandleValue vp);
|
||||
|
||||
static JSBool
|
||||
CPOW_SetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JS::MutableHandleValue vp);
|
||||
CPOW_SetProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JSBool strict,
|
||||
JS::MutableHandleValue vp);
|
||||
|
||||
JSBool NewEnumerateInit(JSContext* cx, jsval* statep, jsid* idp);
|
||||
JSBool NewEnumerateNext(JSContext* cx, jsval* statep, jsid* idp);
|
||||
JSBool NewEnumerateDestroy(JSContext* cx, jsval state);
|
||||
static JSBool
|
||||
CPOW_NewEnumerate(JSContext *cx, JSHandleObject obj, JSIterateOp enum_op,
|
||||
CPOW_NewEnumerate(JSContext *cx, JS::HandleObject obj, JSIterateOp enum_op,
|
||||
jsval *statep, jsid *idp);
|
||||
|
||||
static JSBool
|
||||
CPOW_NewResolve(JSContext *cx, JSHandleObject obj, JSHandleId id, unsigned flags,
|
||||
CPOW_NewResolve(JSContext *cx, JS::HandleObject obj, JS::HandleId id, unsigned flags,
|
||||
JS::MutableHandleObject objp);
|
||||
|
||||
static JSBool
|
||||
CPOW_Convert(JSContext *cx, JSHandleObject obj, JSType type, JS::MutableHandleValue vp);
|
||||
CPOW_Convert(JSContext *cx, JS::HandleObject obj, JSType type, JS::MutableHandleValue vp);
|
||||
|
||||
static void
|
||||
CPOW_Finalize(js::FreeOp* fop, JSObject* obj);
|
||||
@ -94,7 +97,7 @@ private:
|
||||
CPOW_Construct(JSContext *cx, unsigned argc, jsval *vp);
|
||||
|
||||
static JSBool
|
||||
CPOW_HasInstance(JSContext *cx, JSHandleObject obj, JS::MutableHandleValue vp, JSBool *bp);
|
||||
CPOW_HasInstance(JSContext *cx, JS::HandleObject obj, JS::MutableHandleValue vp, JSBool *bp);
|
||||
|
||||
static bool jsval_to_JSVariant(JSContext* cx, jsval from, JSVariant* to);
|
||||
static bool jsval_from_JSVariant(JSContext* cx, const JSVariant& from,
|
||||
@ -102,7 +105,8 @@ private:
|
||||
static bool boolean_from_JSVariant(JSContext* cx, const JSVariant& from,
|
||||
JSBool* to);
|
||||
static bool
|
||||
JSObject_to_PObjectWrapperParent(JSContext* cx, JSObject* from, PObjectWrapperParent** to);
|
||||
JSObject_to_PObjectWrapperParent(JSContext* cx, JSObject* from,
|
||||
PObjectWrapperParent** to);
|
||||
static bool
|
||||
JSObject_from_PObjectWrapperParent(JSContext* cx,
|
||||
const PObjectWrapperParent* from,
|
||||
|
@ -135,7 +135,7 @@ struct RuntimeSizes
|
||||
size_t dtoa;
|
||||
size_t temporary;
|
||||
size_t regexpData;
|
||||
size_t stack;
|
||||
size_t interpreterStack;
|
||||
size_t gcMarker;
|
||||
size_t mathCache;
|
||||
size_t scriptData;
|
||||
|
@ -170,9 +170,21 @@ struct JS_PUBLIC_API(NullPtr)
|
||||
};
|
||||
|
||||
/*
|
||||
* Encapsulated pointer class for use on the heap.
|
||||
* An encapsulated pointer class for heap based GC thing pointers.
|
||||
*
|
||||
* Implements post barriers for heap-based GC thing pointers outside the engine.
|
||||
* This implements post-barriers for GC thing pointers stored on the heap. It is
|
||||
* designed to be used for all heap-based GC thing pointers outside the JS
|
||||
* engine.
|
||||
*
|
||||
* The template parameter T must be a JS GC thing pointer, masked pointer or
|
||||
* possible pointer, such as a JS::Value or jsid.
|
||||
*
|
||||
* The class must be used to declare data members of heap classes only.
|
||||
* Stack-based GC thing pointers should used Rooted<T>.
|
||||
*
|
||||
* Write barriers are implemented by overloading the assingment operator.
|
||||
* Assiging to a Heap<T> triggers the appropriate calls into the GC to notify it
|
||||
* of the change.
|
||||
*/
|
||||
template <typename T>
|
||||
class Heap : public js::HeapBase<T>
|
||||
|
@ -405,7 +405,7 @@ static inline bool
|
||||
WarnOnTooManyArgs(JSContext *cx, const CallArgs &args)
|
||||
{
|
||||
if (args.length() > 1) {
|
||||
Rooted<JSScript*> script(cx, cx->stack.currentScript());
|
||||
Rooted<JSScript*> script(cx, cx->currentScript());
|
||||
if (script && !script->warnedAboutTwoArgumentEval) {
|
||||
static const char TWO_ARGUMENT_WARNING[] =
|
||||
"Support for eval(code, scopeObject) has been removed. "
|
||||
|
@ -443,8 +443,8 @@ IntlInitialize(JSContext *cx, HandleObject obj, Handle<PropertyName*> initialize
|
||||
JS_ASSERT(initializerValue.isObject());
|
||||
JS_ASSERT(initializerValue.toObject().is<JSFunction>());
|
||||
|
||||
InvokeArgsGuard args;
|
||||
if (!cx->stack.pushInvokeArgs(cx, 3, &args))
|
||||
InvokeArgs args(cx);
|
||||
if (!args.init(3))
|
||||
return false;
|
||||
|
||||
args.setCallee(initializerValue);
|
||||
@ -509,8 +509,8 @@ GetInternals(JSContext *cx, HandleObject obj, MutableHandleObject internals)
|
||||
JS_ASSERT(getInternalsValue.isObject());
|
||||
JS_ASSERT(getInternalsValue.toObject().is<JSFunction>());
|
||||
|
||||
InvokeArgsGuard args;
|
||||
if (!cx->stack.pushInvokeArgs(cx, 1, &args))
|
||||
InvokeArgs args(cx);
|
||||
if (!args.init(1))
|
||||
return false;
|
||||
|
||||
args.setCallee(getInternalsValue);
|
||||
|
@ -530,14 +530,14 @@ obj_getPrototypeOf(JSContext *cx, unsigned argc, Value *vp)
|
||||
* Implement [[Prototype]]-getting -- particularly across compartment
|
||||
* boundaries -- by calling a cached __proto__ getter function.
|
||||
*/
|
||||
InvokeArgsGuard nested;
|
||||
if (!cx->stack.pushInvokeArgs(cx, 0, &nested))
|
||||
InvokeArgs args2(cx);
|
||||
if (!args2.init(0))
|
||||
return false;
|
||||
nested.setCallee(cx->global()->protoGetter());
|
||||
nested.setThis(args[0]);
|
||||
if (!Invoke(cx, nested))
|
||||
args2.setCallee(cx->global()->protoGetter());
|
||||
args2.setThis(args[0]);
|
||||
if (!Invoke(cx, args2))
|
||||
return false;
|
||||
args.rval().set(nested.rval());
|
||||
args.rval().set(args2.rval());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ ParallelArrayObject::constructHelper(JSContext *cx, MutableHandleFunction ctor,
|
||||
|
||||
if (cx->typeInferenceEnabled()) {
|
||||
jsbytecode *pc;
|
||||
RootedScript script(cx, cx->stack.currentScript(&pc));
|
||||
RootedScript script(cx, cx->currentScript(&pc));
|
||||
if (script) {
|
||||
if (ctor->nonLazyScript()->shouldCloneAtCallsite) {
|
||||
ctor.set(CloneFunctionAtCallsite(cx, ctor, script, pc));
|
||||
@ -163,8 +163,8 @@ ParallelArrayObject::constructHelper(JSContext *cx, MutableHandleFunction ctor,
|
||||
}
|
||||
}
|
||||
|
||||
InvokeArgsGuard args;
|
||||
if (!cx->stack.pushInvokeArgs(cx, args0.length(), &args))
|
||||
InvokeArgs args(cx);
|
||||
if (!args.init(args0.length()))
|
||||
return false;
|
||||
|
||||
args.setCallee(ObjectValue(*ctor));
|
||||
|
@ -12,7 +12,7 @@
|
||||
namespace js {
|
||||
|
||||
bool
|
||||
DefineTestingFunctions(JSContext *cx, JSHandleObject obj);
|
||||
DefineTestingFunctions(JSContext *cx, HandleObject obj);
|
||||
|
||||
JSBool
|
||||
testingFunc_inParallelSection(JSContext *cx, unsigned argc, jsval *vp);
|
||||
|
@ -158,23 +158,23 @@ static JSBool ConstructAbstract(JSContext* cx, unsigned argc, jsval* vp);
|
||||
|
||||
namespace CType {
|
||||
static JSBool ConstructData(JSContext* cx, unsigned argc, jsval* vp);
|
||||
static JSBool ConstructBasic(JSContext* cx, JSHandleObject obj, const CallArgs& args);
|
||||
static JSBool ConstructBasic(JSContext* cx, HandleObject obj, const CallArgs& args);
|
||||
|
||||
static void Trace(JSTracer* trc, JSObject* obj);
|
||||
static void Finalize(JSFreeOp *fop, JSObject* obj);
|
||||
static void FinalizeProtoClass(JSFreeOp *fop, JSObject* obj);
|
||||
|
||||
static JSBool PrototypeGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval,
|
||||
static JSBool PrototypeGetter(JSContext* cx, HandleObject obj, HandleId idval,
|
||||
MutableHandleValue vp);
|
||||
static JSBool NameGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval,
|
||||
static JSBool NameGetter(JSContext* cx, HandleObject obj, HandleId idval,
|
||||
MutableHandleValue vp);
|
||||
static JSBool SizeGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval,
|
||||
static JSBool SizeGetter(JSContext* cx, HandleObject obj, HandleId idval,
|
||||
MutableHandleValue vp);
|
||||
static JSBool PtrGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHandleValue vp);
|
||||
static JSBool PtrGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp);
|
||||
static JSBool CreateArray(JSContext* cx, unsigned argc, jsval* vp);
|
||||
static JSBool ToString(JSContext* cx, unsigned argc, jsval* vp);
|
||||
static JSBool ToSource(JSContext* cx, unsigned argc, jsval* vp);
|
||||
static JSBool HasInstance(JSContext* cx, JSHandleObject obj, MutableHandleValue v, JSBool* bp);
|
||||
static JSBool HasInstance(JSContext* cx, HandleObject obj, MutableHandleValue v, JSBool* bp);
|
||||
|
||||
|
||||
/*
|
||||
@ -195,13 +195,13 @@ namespace ABI {
|
||||
|
||||
namespace PointerType {
|
||||
static JSBool Create(JSContext* cx, unsigned argc, jsval* vp);
|
||||
static JSBool ConstructData(JSContext* cx, JSHandleObject obj, const CallArgs& args);
|
||||
static JSBool ConstructData(JSContext* cx, HandleObject obj, const CallArgs& args);
|
||||
|
||||
static JSBool TargetTypeGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval,
|
||||
static JSBool TargetTypeGetter(JSContext* cx, HandleObject obj, HandleId idval,
|
||||
MutableHandleValue vp);
|
||||
static JSBool ContentsGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval,
|
||||
static JSBool ContentsGetter(JSContext* cx, HandleObject obj, HandleId idval,
|
||||
MutableHandleValue vp);
|
||||
static JSBool ContentsSetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, JSBool strict,
|
||||
static JSBool ContentsSetter(JSContext* cx, HandleObject obj, HandleId idval, JSBool strict,
|
||||
MutableHandleValue vp);
|
||||
static JSBool IsNull(JSContext* cx, unsigned argc, jsval* vp);
|
||||
static JSBool Increment(JSContext* cx, unsigned argc, jsval* vp);
|
||||
@ -213,26 +213,26 @@ namespace PointerType {
|
||||
|
||||
namespace ArrayType {
|
||||
static JSBool Create(JSContext* cx, unsigned argc, jsval* vp);
|
||||
static JSBool ConstructData(JSContext* cx, JSHandleObject obj, const CallArgs& args);
|
||||
static JSBool ConstructData(JSContext* cx, HandleObject obj, const CallArgs& args);
|
||||
|
||||
static JSBool ElementTypeGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval,
|
||||
static JSBool ElementTypeGetter(JSContext* cx, HandleObject obj, HandleId idval,
|
||||
MutableHandleValue vp);
|
||||
static JSBool LengthGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval,
|
||||
static JSBool LengthGetter(JSContext* cx, HandleObject obj, HandleId idval,
|
||||
MutableHandleValue vp);
|
||||
static JSBool Getter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHandleValue vp);
|
||||
static JSBool Setter(JSContext* cx, JSHandleObject obj, JSHandleId idval, JSBool strict, MutableHandleValue vp);
|
||||
static JSBool Getter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp);
|
||||
static JSBool Setter(JSContext* cx, HandleObject obj, HandleId idval, JSBool strict, MutableHandleValue vp);
|
||||
static JSBool AddressOfElement(JSContext* cx, unsigned argc, jsval* vp);
|
||||
}
|
||||
|
||||
namespace StructType {
|
||||
static JSBool Create(JSContext* cx, unsigned argc, jsval* vp);
|
||||
static JSBool ConstructData(JSContext* cx, JSHandleObject obj, const CallArgs& args);
|
||||
static JSBool ConstructData(JSContext* cx, HandleObject obj, const CallArgs& args);
|
||||
|
||||
static JSBool FieldsArrayGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval,
|
||||
static JSBool FieldsArrayGetter(JSContext* cx, HandleObject obj, HandleId idval,
|
||||
MutableHandleValue vp);
|
||||
static JSBool FieldGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval,
|
||||
static JSBool FieldGetter(JSContext* cx, HandleObject obj, HandleId idval,
|
||||
MutableHandleValue vp);
|
||||
static JSBool FieldSetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, JSBool strict,
|
||||
static JSBool FieldSetter(JSContext* cx, HandleObject obj, HandleId idval, JSBool strict,
|
||||
MutableHandleValue vp);
|
||||
static JSBool AddressOfField(JSContext* cx, unsigned argc, jsval* vp);
|
||||
static JSBool Define(JSContext* cx, unsigned argc, jsval* vp);
|
||||
@ -240,17 +240,17 @@ namespace StructType {
|
||||
|
||||
namespace FunctionType {
|
||||
static JSBool Create(JSContext* cx, unsigned argc, jsval* vp);
|
||||
static JSBool ConstructData(JSContext* cx, JSHandleObject typeObj,
|
||||
JSHandleObject dataObj, JSHandleObject fnObj, JSHandleObject thisObj, jsval errVal);
|
||||
static JSBool ConstructData(JSContext* cx, HandleObject typeObj,
|
||||
HandleObject dataObj, HandleObject fnObj, HandleObject thisObj, jsval errVal);
|
||||
|
||||
static JSBool Call(JSContext* cx, unsigned argc, jsval* vp);
|
||||
|
||||
static JSBool ArgTypesGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval,
|
||||
static JSBool ArgTypesGetter(JSContext* cx, HandleObject obj, HandleId idval,
|
||||
MutableHandleValue vp);
|
||||
static JSBool ReturnTypeGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval,
|
||||
static JSBool ReturnTypeGetter(JSContext* cx, HandleObject obj, HandleId idval,
|
||||
MutableHandleValue vp);
|
||||
static JSBool ABIGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHandleValue vp);
|
||||
static JSBool IsVariadicGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval,
|
||||
static JSBool ABIGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp);
|
||||
static JSBool IsVariadicGetter(JSContext* cx, HandleObject obj, HandleId idval,
|
||||
MutableHandleValue vp);
|
||||
}
|
||||
|
||||
@ -266,21 +266,21 @@ namespace CClosure {
|
||||
namespace CData {
|
||||
static void Finalize(JSFreeOp *fop, JSObject* obj);
|
||||
|
||||
static JSBool ValueGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval,
|
||||
static JSBool ValueGetter(JSContext* cx, HandleObject obj, HandleId idval,
|
||||
MutableHandleValue vp);
|
||||
static JSBool ValueSetter(JSContext* cx, JSHandleObject obj, JSHandleId idval,
|
||||
static JSBool ValueSetter(JSContext* cx, HandleObject obj, HandleId idval,
|
||||
JSBool strict, MutableHandleValue vp);
|
||||
static JSBool Address(JSContext* cx, unsigned argc, jsval* vp);
|
||||
static JSBool ReadString(JSContext* cx, unsigned argc, jsval* vp);
|
||||
static JSBool ReadStringReplaceMalformed(JSContext* cx, unsigned argc, jsval* vp);
|
||||
static JSBool ToSource(JSContext* cx, unsigned argc, jsval* vp);
|
||||
static JSString *GetSourceString(JSContext *cx, JSHandleObject typeObj,
|
||||
static JSString *GetSourceString(JSContext *cx, HandleObject typeObj,
|
||||
void *data);
|
||||
static JSBool ErrnoGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval,
|
||||
static JSBool ErrnoGetter(JSContext* cx, HandleObject obj, HandleId idval,
|
||||
MutableHandleValue vp);
|
||||
|
||||
#if defined(XP_WIN)
|
||||
static JSBool LastErrorGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval,
|
||||
static JSBool LastErrorGetter(JSContext* cx, HandleObject obj, HandleId idval,
|
||||
MutableHandleValue vp);
|
||||
#endif // defined(XP_WIN)
|
||||
}
|
||||
@ -3543,7 +3543,7 @@ CType::GetFFIType(JSContext* cx, JSObject* obj)
|
||||
}
|
||||
|
||||
JSString*
|
||||
CType::GetName(JSContext* cx, JSHandleObject obj)
|
||||
CType::GetName(JSContext* cx, HandleObject obj)
|
||||
{
|
||||
JS_ASSERT(CType::IsCType(obj));
|
||||
|
||||
@ -3593,7 +3593,7 @@ CType::GetProtoFromType(JSContext* cx, JSObject* obj, CTypeProtoSlot slot)
|
||||
}
|
||||
|
||||
JSBool
|
||||
CType::PrototypeGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHandleValue vp)
|
||||
CType::PrototypeGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp)
|
||||
{
|
||||
if (!(CType::IsCType(obj) || CType::IsCTypeProto(obj))) {
|
||||
JS_ReportError(cx, "not a CType or CTypeProto");
|
||||
@ -3608,7 +3608,7 @@ CType::PrototypeGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, Muta
|
||||
}
|
||||
|
||||
JSBool
|
||||
CType::NameGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHandleValue vp)
|
||||
CType::NameGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp)
|
||||
{
|
||||
if (!CType::IsCType(obj)) {
|
||||
JS_ReportError(cx, "not a CType");
|
||||
@ -3624,7 +3624,7 @@ CType::NameGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHa
|
||||
}
|
||||
|
||||
JSBool
|
||||
CType::SizeGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHandleValue vp)
|
||||
CType::SizeGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp)
|
||||
{
|
||||
if (!CType::IsCType(obj)) {
|
||||
JS_ReportError(cx, "not a CType");
|
||||
@ -3637,7 +3637,7 @@ CType::SizeGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHa
|
||||
}
|
||||
|
||||
JSBool
|
||||
CType::PtrGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHandleValue vp)
|
||||
CType::PtrGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp)
|
||||
{
|
||||
if (!CType::IsCType(obj)) {
|
||||
JS_ReportError(cx, "not a CType");
|
||||
@ -3747,7 +3747,7 @@ CType::ToSource(JSContext* cx, unsigned argc, jsval* vp)
|
||||
}
|
||||
|
||||
JSBool
|
||||
CType::HasInstance(JSContext* cx, JSHandleObject obj, MutableHandleValue v, JSBool* bp)
|
||||
CType::HasInstance(JSContext* cx, HandleObject obj, MutableHandleValue v, JSBool* bp)
|
||||
{
|
||||
JS_ASSERT(CType::IsCType(obj));
|
||||
|
||||
@ -3909,7 +3909,7 @@ PointerType::CreateInternal(JSContext* cx, HandleObject baseType)
|
||||
|
||||
JSBool
|
||||
PointerType::ConstructData(JSContext* cx,
|
||||
JSHandleObject obj,
|
||||
HandleObject obj,
|
||||
const CallArgs& args)
|
||||
{
|
||||
if (!CType::IsCType(obj) || CType::GetTypeCode(obj) != TYPE_pointer) {
|
||||
@ -4001,8 +4001,8 @@ PointerType::GetBaseType(JSObject* obj)
|
||||
|
||||
JSBool
|
||||
PointerType::TargetTypeGetter(JSContext* cx,
|
||||
JSHandleObject obj,
|
||||
JSHandleId idval,
|
||||
HandleObject obj,
|
||||
HandleId idval,
|
||||
MutableHandleValue vp)
|
||||
{
|
||||
if (!CType::IsCType(obj) || CType::GetTypeCode(obj) != TYPE_pointer) {
|
||||
@ -4091,8 +4091,8 @@ PointerType::Decrement(JSContext* cx, unsigned argc, jsval* vp)
|
||||
|
||||
JSBool
|
||||
PointerType::ContentsGetter(JSContext* cx,
|
||||
JSHandleObject obj,
|
||||
JSHandleId idval,
|
||||
HandleObject obj,
|
||||
HandleId idval,
|
||||
MutableHandleValue vp)
|
||||
{
|
||||
if (!CData::IsCData(obj)) {
|
||||
@ -4129,8 +4129,8 @@ PointerType::ContentsGetter(JSContext* cx,
|
||||
|
||||
JSBool
|
||||
PointerType::ContentsSetter(JSContext* cx,
|
||||
JSHandleObject obj,
|
||||
JSHandleId idval,
|
||||
HandleObject obj,
|
||||
HandleId idval,
|
||||
JSBool strict,
|
||||
MutableHandleValue vp)
|
||||
{
|
||||
@ -4254,7 +4254,7 @@ ArrayType::CreateInternal(JSContext* cx,
|
||||
|
||||
JSBool
|
||||
ArrayType::ConstructData(JSContext* cx,
|
||||
JSHandleObject obj_,
|
||||
HandleObject obj_,
|
||||
const CallArgs& args)
|
||||
{
|
||||
RootedObject obj(cx, obj_); // Make a mutable version
|
||||
@ -4449,7 +4449,7 @@ ArrayType::BuildFFIType(JSContext* cx, JSObject* obj)
|
||||
}
|
||||
|
||||
JSBool
|
||||
ArrayType::ElementTypeGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHandleValue vp)
|
||||
ArrayType::ElementTypeGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp)
|
||||
{
|
||||
if (!CType::IsCType(obj) || CType::GetTypeCode(obj) != TYPE_array) {
|
||||
JS_ReportError(cx, "not an ArrayType");
|
||||
@ -4462,7 +4462,7 @@ ArrayType::ElementTypeGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval
|
||||
}
|
||||
|
||||
JSBool
|
||||
ArrayType::LengthGetter(JSContext* cx, JSHandleObject obj_, JSHandleId idval, MutableHandleValue vp)
|
||||
ArrayType::LengthGetter(JSContext* cx, HandleObject obj_, HandleId idval, MutableHandleValue vp)
|
||||
{
|
||||
JSObject *obj = obj_;
|
||||
|
||||
@ -4482,7 +4482,7 @@ ArrayType::LengthGetter(JSContext* cx, JSHandleObject obj_, JSHandleId idval, Mu
|
||||
}
|
||||
|
||||
JSBool
|
||||
ArrayType::Getter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHandleValue vp)
|
||||
ArrayType::Getter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp)
|
||||
{
|
||||
// This should never happen, but we'll check to be safe.
|
||||
if (!CData::IsCData(obj)) {
|
||||
@ -4518,7 +4518,7 @@ ArrayType::Getter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHa
|
||||
}
|
||||
|
||||
JSBool
|
||||
ArrayType::Setter(JSContext* cx, JSHandleObject obj, JSHandleId idval, JSBool strict, MutableHandleValue vp)
|
||||
ArrayType::Setter(JSContext* cx, HandleObject obj, HandleId idval, JSBool strict, MutableHandleValue vp)
|
||||
{
|
||||
// This should never happen, but we'll check to be safe.
|
||||
if (!CData::IsCData(obj)) {
|
||||
@ -5118,7 +5118,7 @@ StructType::BuildFieldsArray(JSContext* cx, JSObject* obj)
|
||||
}
|
||||
|
||||
JSBool
|
||||
StructType::FieldsArrayGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHandleValue vp)
|
||||
StructType::FieldsArrayGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp)
|
||||
{
|
||||
if (!CType::IsCType(obj) || CType::GetTypeCode(obj) != TYPE_struct) {
|
||||
JS_ReportError(cx, "not a StructType");
|
||||
@ -5148,7 +5148,7 @@ StructType::FieldsArrayGetter(JSContext* cx, JSHandleObject obj, JSHandleId idva
|
||||
}
|
||||
|
||||
JSBool
|
||||
StructType::FieldGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHandleValue vp)
|
||||
StructType::FieldGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp)
|
||||
{
|
||||
if (!CData::IsCData(obj)) {
|
||||
JS_ReportError(cx, "not a CData");
|
||||
@ -5171,7 +5171,7 @@ StructType::FieldGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, Mut
|
||||
}
|
||||
|
||||
JSBool
|
||||
StructType::FieldSetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, JSBool strict, MutableHandleValue vp)
|
||||
StructType::FieldSetter(JSContext* cx, HandleObject obj, HandleId idval, JSBool strict, MutableHandleValue vp)
|
||||
{
|
||||
if (!CData::IsCData(obj)) {
|
||||
JS_ReportError(cx, "not a CData");
|
||||
@ -5635,10 +5635,10 @@ FunctionType::CreateInternal(JSContext* cx,
|
||||
// PointerType::ConstructData().
|
||||
JSBool
|
||||
FunctionType::ConstructData(JSContext* cx,
|
||||
JSHandleObject typeObj,
|
||||
JSHandleObject dataObj,
|
||||
JSHandleObject fnObj,
|
||||
JSHandleObject thisObj,
|
||||
HandleObject typeObj,
|
||||
HandleObject dataObj,
|
||||
HandleObject fnObj,
|
||||
HandleObject thisObj,
|
||||
jsval errVal)
|
||||
{
|
||||
JS_ASSERT(CType::GetTypeCode(typeObj) == TYPE_function);
|
||||
@ -5890,7 +5890,7 @@ CheckFunctionType(JSContext* cx, JSObject* obj)
|
||||
}
|
||||
|
||||
JSBool
|
||||
FunctionType::ArgTypesGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHandleValue vp)
|
||||
FunctionType::ArgTypesGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp)
|
||||
{
|
||||
if (!CheckFunctionType(cx, obj))
|
||||
return JS_FALSE;
|
||||
@ -5925,7 +5925,7 @@ FunctionType::ArgTypesGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval
|
||||
}
|
||||
|
||||
JSBool
|
||||
FunctionType::ReturnTypeGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHandleValue vp)
|
||||
FunctionType::ReturnTypeGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp)
|
||||
{
|
||||
if (!CheckFunctionType(cx, obj))
|
||||
return JS_FALSE;
|
||||
@ -5936,7 +5936,7 @@ FunctionType::ReturnTypeGetter(JSContext* cx, JSHandleObject obj, JSHandleId idv
|
||||
}
|
||||
|
||||
JSBool
|
||||
FunctionType::ABIGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHandleValue vp)
|
||||
FunctionType::ABIGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp)
|
||||
{
|
||||
if (!CheckFunctionType(cx, obj))
|
||||
return JS_FALSE;
|
||||
@ -5947,7 +5947,7 @@ FunctionType::ABIGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, Mut
|
||||
}
|
||||
|
||||
JSBool
|
||||
FunctionType::IsVariadicGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHandleValue vp)
|
||||
FunctionType::IsVariadicGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp)
|
||||
{
|
||||
if (!CheckFunctionType(cx, obj))
|
||||
return JS_FALSE;
|
||||
@ -6394,7 +6394,7 @@ CData::IsCDataProto(JSObject* obj)
|
||||
}
|
||||
|
||||
JSBool
|
||||
CData::ValueGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableHandleValue vp)
|
||||
CData::ValueGetter(JSContext* cx, HandleObject obj, HandleId idval, MutableHandleValue vp)
|
||||
{
|
||||
if (!IsCData(obj)) {
|
||||
JS_ReportError(cx, "not a CData");
|
||||
@ -6410,7 +6410,7 @@ CData::ValueGetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, MutableH
|
||||
}
|
||||
|
||||
JSBool
|
||||
CData::ValueSetter(JSContext* cx, JSHandleObject obj, JSHandleId idval, JSBool strict, MutableHandleValue vp)
|
||||
CData::ValueSetter(JSContext* cx, HandleObject obj, HandleId idval, JSBool strict, MutableHandleValue vp)
|
||||
{
|
||||
if (!IsCData(obj)) {
|
||||
JS_ReportError(cx, "not a CData");
|
||||
@ -6639,7 +6639,7 @@ CData::ReadStringReplaceMalformed(JSContext* cx, unsigned argc, jsval* vp)
|
||||
}
|
||||
|
||||
JSString *
|
||||
CData::GetSourceString(JSContext *cx, JSHandleObject typeObj, void *data)
|
||||
CData::GetSourceString(JSContext *cx, HandleObject typeObj, void *data)
|
||||
{
|
||||
// Walk the types, building up the toSource() string.
|
||||
// First, we build up the type expression:
|
||||
@ -6693,7 +6693,7 @@ CData::ToSource(JSContext* cx, unsigned argc, jsval* vp)
|
||||
}
|
||||
|
||||
JSBool
|
||||
CData::ErrnoGetter(JSContext* cx, JSHandleObject obj, JSHandleId, MutableHandleValue vp)
|
||||
CData::ErrnoGetter(JSContext* cx, HandleObject obj, HandleId, MutableHandleValue vp)
|
||||
{
|
||||
if (!IsCTypesGlobal(obj)) {
|
||||
JS_ReportError(cx, "this is not not global object ctypes");
|
||||
@ -6706,7 +6706,7 @@ CData::ErrnoGetter(JSContext* cx, JSHandleObject obj, JSHandleId, MutableHandleV
|
||||
|
||||
#if defined(XP_WIN)
|
||||
JSBool
|
||||
CData::LastErrorGetter(JSContext* cx, JSHandleObject obj, JSHandleId, MutableHandleValue vp)
|
||||
CData::LastErrorGetter(JSContext* cx, HandleObject obj, HandleId, MutableHandleValue vp)
|
||||
{
|
||||
if (!IsCTypesGlobal(obj)) {
|
||||
JS_ReportError(cx, "not global object ctypes");
|
||||
|
@ -311,15 +311,15 @@ bool IsCTypesGlobal(JSObject* obj);
|
||||
|
||||
JSCTypesCallbacks* GetCallbacks(JSObject* obj);
|
||||
|
||||
JSBool InitTypeClasses(JSContext* cx, JSHandleObject parent);
|
||||
JSBool InitTypeClasses(JSContext* cx, HandleObject parent);
|
||||
|
||||
JSBool ConvertToJS(JSContext* cx, JSHandleObject typeObj, JSHandleObject dataObj,
|
||||
JSBool ConvertToJS(JSContext* cx, HandleObject typeObj, HandleObject dataObj,
|
||||
void* data, bool wantPrimitive, bool ownResult, jsval* result);
|
||||
|
||||
JSBool ImplicitConvert(JSContext* cx, JSHandleValue val, JSObject* targetType,
|
||||
JSBool ImplicitConvert(JSContext* cx, HandleValue val, JSObject* targetType,
|
||||
void* buffer, bool isArgument, bool* freePointer);
|
||||
|
||||
JSBool ExplicitConvert(JSContext* cx, JSHandleValue val, JSHandleObject targetType,
|
||||
JSBool ExplicitConvert(JSContext* cx, HandleValue val, HandleObject targetType,
|
||||
void* buffer);
|
||||
|
||||
/*******************************************************************************
|
||||
@ -419,7 +419,7 @@ enum Int64FunctionSlot {
|
||||
*******************************************************************************/
|
||||
|
||||
namespace CType {
|
||||
JSObject* Create(JSContext* cx, JSHandleObject typeProto, JSHandleObject dataProto,
|
||||
JSObject* Create(JSContext* cx, HandleObject typeProto, HandleObject dataProto,
|
||||
TypeCode type, JSString* name, jsval size, jsval align, ffi_type* ffiType);
|
||||
|
||||
JSObject* DefineBuiltin(JSContext* cx, JSObject* parent, const char* propName,
|
||||
@ -435,20 +435,20 @@ namespace CType {
|
||||
bool IsSizeDefined(JSObject* obj);
|
||||
size_t GetAlignment(JSObject* obj);
|
||||
ffi_type* GetFFIType(JSContext* cx, JSObject* obj);
|
||||
JSString* GetName(JSContext* cx, JSHandleObject obj);
|
||||
JSString* GetName(JSContext* cx, HandleObject obj);
|
||||
JSObject* GetProtoFromCtor(JSObject* obj, CTypeProtoSlot slot);
|
||||
JSObject* GetProtoFromType(JSContext* cx, JSObject* obj, CTypeProtoSlot slot);
|
||||
JSCTypesCallbacks* GetCallbacksFromType(JSObject* obj);
|
||||
}
|
||||
|
||||
namespace PointerType {
|
||||
JSObject* CreateInternal(JSContext* cx, JSHandleObject baseType);
|
||||
JSObject* CreateInternal(JSContext* cx, HandleObject baseType);
|
||||
|
||||
JSObject* GetBaseType(JSObject* obj);
|
||||
}
|
||||
|
||||
namespace ArrayType {
|
||||
JSObject* CreateInternal(JSContext* cx, JSHandleObject baseType, size_t length,
|
||||
JSObject* CreateInternal(JSContext* cx, HandleObject baseType, size_t length,
|
||||
bool lengthDefined);
|
||||
|
||||
JSObject* GetBaseType(JSObject* obj);
|
||||
@ -479,12 +479,12 @@ namespace FunctionType {
|
||||
}
|
||||
|
||||
namespace CClosure {
|
||||
JSObject* Create(JSContext* cx, JSHandleObject typeObj, JSHandleObject fnObj,
|
||||
JSHandleObject thisObj, jsval errVal, PRFuncPtr* fnptr);
|
||||
JSObject* Create(JSContext* cx, HandleObject typeObj, HandleObject fnObj,
|
||||
HandleObject thisObj, jsval errVal, PRFuncPtr* fnptr);
|
||||
}
|
||||
|
||||
namespace CData {
|
||||
JSObject* Create(JSContext* cx, JSHandleObject typeObj, JSHandleObject refObj,
|
||||
JSObject* Create(JSContext* cx, HandleObject typeObj, HandleObject refObj,
|
||||
void* data, bool ownResult);
|
||||
|
||||
JSObject* GetCType(JSObject* dataObj);
|
||||
|
@ -513,24 +513,6 @@ MarkValueInternal(JSTracer *trc, Value *v)
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
MarkValueInternalMaybeNullPayload(JSTracer *trc, Value *v)
|
||||
{
|
||||
if (v->isMarkable()) {
|
||||
void *thing = v->toGCThing();
|
||||
if (thing) {
|
||||
JS_SET_TRACING_LOCATION(trc, (void *)v);
|
||||
MarkKind(trc, &thing, v->gcKind());
|
||||
if (v->isString())
|
||||
v->setString((JSString *)thing);
|
||||
else
|
||||
v->setObjectOrNull((JSObject *)thing);
|
||||
return;
|
||||
}
|
||||
}
|
||||
JS_UNSET_TRACING_LOCATION(trc);
|
||||
}
|
||||
|
||||
void
|
||||
gc::MarkValue(JSTracer *trc, EncapsulatedValue *v, const char *name)
|
||||
{
|
||||
@ -581,16 +563,6 @@ gc::MarkValueRootRange(JSTracer *trc, size_t len, Value *vec, const char *name)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gc::MarkValueRootRangeMaybeNullPayload(JSTracer *trc, size_t len, Value *vec, const char *name)
|
||||
{
|
||||
JS_ROOT_MARKING_ASSERT(trc);
|
||||
for (size_t i = 0; i < len; ++i) {
|
||||
JS_SET_TRACING_INDEX(trc, name, i);
|
||||
MarkValueInternalMaybeNullPayload(trc, &vec[i]);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
gc::IsValueMarked(Value *v)
|
||||
{
|
||||
|
@ -181,9 +181,6 @@ MarkValueRootRange(JSTracer *trc, Value *begin, Value *end, const char *name)
|
||||
MarkValueRootRange(trc, end - begin, begin, name);
|
||||
}
|
||||
|
||||
void
|
||||
MarkValueRootRangeMaybeNullPayload(JSTracer *trc, size_t len, Value *vec, const char *name);
|
||||
|
||||
void
|
||||
MarkTypeRoot(JSTracer *trc, types::Type *v, const char *name);
|
||||
|
||||
|
@ -737,7 +737,7 @@ js::gc::MarkRuntime(JSTracer *trc, bool useSavedRoots)
|
||||
c->debugScopes->mark(trc);
|
||||
}
|
||||
|
||||
rt->stackSpace.mark(trc);
|
||||
MarkInterpreterActivations(rt, trc);
|
||||
|
||||
#ifdef JS_ION
|
||||
ion::MarkJitActivations(rt, trc);
|
||||
|
@ -1400,10 +1400,8 @@ class MOZ_STACK_CLASS ModuleCompiler
|
||||
if (!module_->addHeapAccesses(gen.heapAccesses()))
|
||||
return false;
|
||||
#endif
|
||||
for (unsigned i = 0; i < gen.globalAccesses().length(); i++) {
|
||||
if (!globalAccesses_.append(gen.globalAccesses()[i]))
|
||||
return false;
|
||||
}
|
||||
if (!globalAccesses_.append(gen.globalAccesses()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
bool addGlobalAccess(AsmJSGlobalAccess access) {
|
||||
|
@ -411,8 +411,8 @@ HandleDynamicLinkFailure(JSContext *cx, CallArgs args, AsmJSModule &module, Hand
|
||||
|
||||
unsigned argc = args.length();
|
||||
|
||||
InvokeArgsGuard args2;
|
||||
if (!cx->stack.pushInvokeArgs(cx, argc, &args2))
|
||||
InvokeArgs args2(cx);
|
||||
if (!args2.init(argc))
|
||||
return false;
|
||||
|
||||
args2.setCallee(ObjectValue(*fun));
|
||||
|
@ -613,11 +613,7 @@ class AsmJSModule
|
||||
}
|
||||
|
||||
bool addHeapAccesses(const ion::AsmJSHeapAccessVector &accesses) {
|
||||
if (!heapAccesses_.reserve(heapAccesses_.length() + accesses.length()))
|
||||
return false;
|
||||
for (size_t i = 0; i < accesses.length(); i++)
|
||||
heapAccesses_.infallibleAppend(accesses[i]);
|
||||
return true;
|
||||
return heapAccesses_.append(accesses);
|
||||
}
|
||||
unsigned numHeapAccesses() const {
|
||||
return heapAccesses_.length();
|
||||
@ -630,11 +626,7 @@ class AsmJSModule
|
||||
}
|
||||
#if defined(JS_CPU_ARM)
|
||||
bool addBoundsChecks(const ion::AsmJSBoundsCheckVector &checks) {
|
||||
if (!boundsChecks_.reserve(boundsChecks_.length() + checks.length()))
|
||||
return false;
|
||||
for (size_t i = 0; i < checks.length(); i++)
|
||||
boundsChecks_.infallibleAppend(checks[i]);
|
||||
return true;
|
||||
return boundsChecks_.append(checks);
|
||||
}
|
||||
void convertBoundsChecksToActualOffset(ion::MacroAssembler &masm) {
|
||||
for (unsigned i = 0; i < boundsChecks_.length(); i++)
|
||||
|
@ -1204,7 +1204,7 @@ ion::FinishBailoutToBaseline(BaselineBailoutInfo *bailoutInfo)
|
||||
// Check that we can get the current script's PC.
|
||||
#ifdef DEBUG
|
||||
jsbytecode *pc;
|
||||
cx->stack.currentScript(&pc);
|
||||
cx->currentScript(&pc);
|
||||
IonSpew(IonSpew_BaselineBailouts, " Got pc=%p", pc);
|
||||
#endif
|
||||
|
||||
|
@ -786,10 +786,9 @@ ion::BuildDominatorTree(MIRGraph &graph)
|
||||
MBasicBlock *block = worklist.popCopy();
|
||||
block->setDomIndex(index);
|
||||
|
||||
for (size_t i = 0; i < block->numImmediatelyDominatedBlocks(); i++) {
|
||||
if (!worklist.append(block->getImmediatelyDominatedBlock(i)))
|
||||
return false;
|
||||
}
|
||||
if (!worklist.append(block->immediatelyDominatedBlocksBegin(),
|
||||
block->immediatelyDominatedBlocksEnd()))
|
||||
return false;
|
||||
index++;
|
||||
}
|
||||
|
||||
@ -1358,10 +1357,9 @@ ion::EliminateRedundantChecks(MIRGraph &graph)
|
||||
MBasicBlock *block = worklist.popCopy();
|
||||
|
||||
// Add all immediate dominators to the front of the worklist.
|
||||
for (size_t i = 0; i < block->numImmediatelyDominatedBlocks(); i++) {
|
||||
if (!worklist.append(block->getImmediatelyDominatedBlock(i)))
|
||||
return false;
|
||||
}
|
||||
if (!worklist.append(block->immediatelyDominatedBlocksBegin(),
|
||||
block->immediatelyDominatedBlocksEnd()))
|
||||
return false;
|
||||
|
||||
for (MDefinitionIterator iter(block); iter; ) {
|
||||
bool eliminated = false;
|
||||
|
@ -105,8 +105,7 @@ class LinearSum
|
||||
LinearSum(const LinearSum &other)
|
||||
: constant_(other.constant_)
|
||||
{
|
||||
for (size_t i = 0; i < other.terms_.length(); i++)
|
||||
terms_.append(other.terms_[i]);
|
||||
terms_.append(other.terms_);
|
||||
}
|
||||
|
||||
bool multiply(int32_t scale);
|
||||
|
@ -936,7 +936,7 @@ GenerateCallGetter(JSContext *cx, IonScript *ion, MacroAssembler &masm,
|
||||
|
||||
PropertyOp target = shape->getterOp();
|
||||
JS_ASSERT(target);
|
||||
// JSPropertyOp: JSBool fn(JSContext *cx, JSHandleObject obj, JSHandleId id, MutableHandleValue vp)
|
||||
// JSPropertyOp: JSBool fn(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp)
|
||||
|
||||
// Push args on stack first so we can take pointers to make handles.
|
||||
masm.Push(UndefinedValue());
|
||||
@ -1845,8 +1845,8 @@ SetPropertyIC::attachSetterCall(JSContext *cx, IonScript *ion,
|
||||
|
||||
StrictPropertyOp target = shape->setterOp();
|
||||
JS_ASSERT(target);
|
||||
// JSStrictPropertyOp: JSBool fn(JSContext *cx, JSHandleObject obj,
|
||||
// JSHandleId id, JSBool strict, MutableHandleValue vp);
|
||||
// JSStrictPropertyOp: JSBool fn(JSContext *cx, HandleObject obj,
|
||||
// HandleId id, JSBool strict, MutableHandleValue vp);
|
||||
|
||||
// Push args on stack first so we can take pointers to make handles.
|
||||
if (value().constant())
|
||||
|
@ -384,6 +384,14 @@ class MBasicBlock : public TempObject, public InlineListNode<MBasicBlock>
|
||||
return immediatelyDominated_[i];
|
||||
}
|
||||
|
||||
MBasicBlock **immediatelyDominatedBlocksBegin() {
|
||||
return immediatelyDominated_.begin();
|
||||
}
|
||||
|
||||
MBasicBlock **immediatelyDominatedBlocksEnd() {
|
||||
return immediatelyDominated_.end();
|
||||
}
|
||||
|
||||
size_t numDominated() const {
|
||||
return numDominated_;
|
||||
}
|
||||
|
@ -16,15 +16,11 @@ AllocationIntegrityState::record()
|
||||
if (!instructions.empty())
|
||||
return true;
|
||||
|
||||
if (!instructions.reserve(graph.numInstructions()))
|
||||
if (!instructions.appendN(InstructionInfo(), graph.numInstructions()))
|
||||
return false;
|
||||
for (size_t i = 0; i < graph.numInstructions(); i++)
|
||||
instructions.infallibleAppend(InstructionInfo());
|
||||
|
||||
if (!virtualRegisters.reserve(graph.numVirtualRegisters()))
|
||||
if (!virtualRegisters.appendN((LDefinition *)NULL, graph.numVirtualRegisters()))
|
||||
return false;
|
||||
for (size_t i = 0; i < graph.numVirtualRegisters(); i++)
|
||||
virtualRegisters.infallibleAppend((LDefinition *)NULL);
|
||||
|
||||
if (!blocks.reserve(graph.numBlocks()))
|
||||
return false;
|
||||
@ -425,8 +421,7 @@ AllocationIntegrityState::dump()
|
||||
// were discovered.
|
||||
|
||||
Vector<IntegrityItem, 20, SystemAllocPolicy> seenOrdered;
|
||||
for (size_t i = 0; i < seen.count(); i++)
|
||||
seenOrdered.append(IntegrityItem());
|
||||
seenOrdered.appendN(IntegrityItem(), seen.count());
|
||||
|
||||
for (IntegrityItemSet::Enum iter(seen); !iter.empty(); iter.popFront()) {
|
||||
IntegrityItem item = iter.front();
|
||||
|
@ -65,12 +65,9 @@ struct AllocationIntegrityState
|
||||
|
||||
InstructionInfo(const InstructionInfo &o)
|
||||
{
|
||||
for (size_t i = 0; i < o.inputs.length(); i++)
|
||||
inputs.append(o.inputs[i]);
|
||||
for (size_t i = 0; i < o.temps.length(); i++)
|
||||
temps.append(o.temps[i]);
|
||||
for (size_t i = 0; i < o.outputs.length(); i++)
|
||||
outputs.append(o.outputs[i]);
|
||||
inputs.append(o.inputs);
|
||||
temps.append(o.temps);
|
||||
outputs.append(o.outputs);
|
||||
}
|
||||
};
|
||||
Vector<InstructionInfo, 0, SystemAllocPolicy> instructions;
|
||||
@ -79,8 +76,7 @@ struct AllocationIntegrityState
|
||||
Vector<InstructionInfo, 5, SystemAllocPolicy> phis;
|
||||
BlockInfo() {}
|
||||
BlockInfo(const BlockInfo &o) {
|
||||
for (size_t i = 0; i < o.phis.length(); i++)
|
||||
phis.append(o.phis[i]);
|
||||
phis.append(o.phis);
|
||||
}
|
||||
};
|
||||
Vector<BlockInfo, 0, SystemAllocPolicy> blocks;
|
||||
|
@ -46,10 +46,8 @@ StupidAllocator::init()
|
||||
if (!RegisterAllocator::init())
|
||||
return false;
|
||||
|
||||
if (!virtualRegisters.reserve(graph.numVirtualRegisters()))
|
||||
if (!virtualRegisters.appendN((LDefinition *)NULL, graph.numVirtualRegisters()))
|
||||
return false;
|
||||
for (size_t i = 0; i < graph.numVirtualRegisters(); i++)
|
||||
virtualRegisters.infallibleAppend((LDefinition *)NULL);
|
||||
|
||||
for (size_t i = 0; i < graph.numBlocks(); i++) {
|
||||
LBlock *block = graph.getBlock(i);
|
||||
|
@ -366,10 +366,9 @@ ValueNumberer::eliminateRedundancies()
|
||||
IonSpew(IonSpew_GVN, "Looking at block %d", block->id());
|
||||
|
||||
// Add all immediate dominators to the front of the worklist.
|
||||
for (size_t i = 0; i < block->numImmediatelyDominatedBlocks(); i++) {
|
||||
if (!worklist.append(block->getImmediatelyDominatedBlock(i)))
|
||||
return false;
|
||||
}
|
||||
if (!worklist.append(block->immediatelyDominatedBlocksBegin(),
|
||||
block->immediatelyDominatedBlocksEnd()))
|
||||
return false;
|
||||
|
||||
// For each instruction, attempt to look up a dominating definition.
|
||||
for (MDefinitionIterator iter(block); iter; ) {
|
||||
|
@ -344,10 +344,10 @@ class IonOOLPropertyOpExitFrameLayout
|
||||
IonExitFooterFrame footer_;
|
||||
IonExitFrameLayout exit_;
|
||||
|
||||
// Object for JSHandleObject
|
||||
// Object for HandleObject
|
||||
JSObject *obj_;
|
||||
|
||||
// id for JSHandleId
|
||||
// id for HandleId
|
||||
jsid id_;
|
||||
|
||||
// space for MutableHandleValue result
|
||||
@ -392,10 +392,10 @@ class IonOOLProxyGetExitFrameLayout
|
||||
// The proxy object.
|
||||
JSObject *proxy_;
|
||||
|
||||
// Object for JSHandleObject
|
||||
// Object for HandleObject
|
||||
JSObject *receiver_;
|
||||
|
||||
// id for JSHandleId
|
||||
// id for HandleId
|
||||
jsid id_;
|
||||
|
||||
// space for MutableHandleValue result
|
||||
|
@ -308,10 +308,10 @@ class IonOOLPropertyOpExitFrameLayout
|
||||
IonExitFooterFrame footer_;
|
||||
IonExitFrameLayout exit_;
|
||||
|
||||
// Object for JSHandleObject
|
||||
// Object for HandleObject
|
||||
JSObject *obj_;
|
||||
|
||||
// id for JSHandleId
|
||||
// id for HandleId
|
||||
jsid id_;
|
||||
|
||||
// space for MutableHandleValue result
|
||||
@ -356,10 +356,10 @@ class IonOOLProxyGetExitFrameLayout
|
||||
// The proxy object.
|
||||
JSObject *proxy_;
|
||||
|
||||
// Object for JSHandleObject
|
||||
// Object for HandleObject
|
||||
JSObject *receiver_;
|
||||
|
||||
// id for JSHandleId
|
||||
// id for HandleId
|
||||
jsid id_;
|
||||
|
||||
// space for MutableHandleValue result
|
||||
|
@ -50,7 +50,7 @@ static JSClass DocumentAllClass = {
|
||||
};
|
||||
|
||||
JSBool
|
||||
document_resolve(JSContext *cx, JSHandleObject obj, JSHandleId id, unsigned flags,
|
||||
document_resolve(JSContext *cx, JS::HandleObject obj, JS::HandleId id, unsigned flags,
|
||||
JS::MutableHandleObject objp)
|
||||
{
|
||||
// If id is "all", resolve document.all=true.
|
||||
|
@ -69,7 +69,7 @@ struct AutoIncrCounters {
|
||||
};
|
||||
|
||||
bool
|
||||
doResolve(JSHandleObject obj, JSHandleId id, unsigned flags, JS::MutableHandleObject objp)
|
||||
doResolve(JS::HandleObject obj, JS::HandleId id, unsigned flags, JS::MutableHandleObject objp)
|
||||
{
|
||||
CHECK_EQUAL(resolveExitCount, 0);
|
||||
AutoIncrCounters incr(this);
|
||||
@ -127,7 +127,7 @@ doResolve(JSHandleObject obj, JSHandleId id, unsigned flags, JS::MutableHandleOb
|
||||
}
|
||||
|
||||
static JSBool
|
||||
my_resolve(JSContext *cx, JSHandleObject obj, JSHandleId id, unsigned flags,
|
||||
my_resolve(JSContext *cx, JS::HandleObject obj, JS::HandleId id, unsigned flags,
|
||||
JS::MutableHandleObject objp)
|
||||
{
|
||||
return static_cast<cls_testResolveRecursion *>(JS_GetPrivate(obj))->
|
||||
|
@ -963,9 +963,6 @@ JSRuntime::init(uint32_t maxbytes)
|
||||
|
||||
dateTimeInfo.updateTimeZoneAdjustment();
|
||||
|
||||
if (!stackSpace.init())
|
||||
return false;
|
||||
|
||||
if (!scriptDataTable.init())
|
||||
return false;
|
||||
|
||||
@ -3078,38 +3075,38 @@ JS_DefaultValue(JSContext *cx, JSObject *objArg, JSType hint, jsval *vp)
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSBool)
|
||||
JS_PropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, MutableHandleValue vp)
|
||||
JS_PropertyStub(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp)
|
||||
{
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSBool)
|
||||
JS_StrictPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, MutableHandleValue vp)
|
||||
JS_StrictPropertyStub(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHandleValue vp)
|
||||
{
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSBool)
|
||||
JS_DeletePropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool *succeeded)
|
||||
JS_DeletePropertyStub(JSContext *cx, HandleObject obj, HandleId id, JSBool *succeeded)
|
||||
{
|
||||
*succeeded = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSBool)
|
||||
JS_EnumerateStub(JSContext *cx, JSHandleObject obj)
|
||||
JS_EnumerateStub(JSContext *cx, HandleObject obj)
|
||||
{
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSBool)
|
||||
JS_ResolveStub(JSContext *cx, JSHandleObject obj, JSHandleId id)
|
||||
JS_ResolveStub(JSContext *cx, HandleObject obj, HandleId id)
|
||||
{
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSBool)
|
||||
JS_ConvertStub(JSContext *cx, JSHandleObject obj, JSType type, MutableHandleValue vp)
|
||||
JS_ConvertStub(JSContext *cx, HandleObject obj, JSType type, MutableHandleValue vp)
|
||||
{
|
||||
JS_ASSERT(type != JSTYPE_OBJECT && type != JSTYPE_FUNCTION);
|
||||
JS_ASSERT(obj);
|
||||
@ -3801,7 +3798,7 @@ JS_DefineElement(JSContext *cx, JSObject *objArg, uint32_t index, jsval valueArg
|
||||
}
|
||||
|
||||
static JSBool
|
||||
DefineProperty(JSContext *cx, JSHandleObject obj, const char *name, const Value &value_,
|
||||
DefineProperty(JSContext *cx, HandleObject obj, const char *name, const Value &value_,
|
||||
const JSPropertyOpWrapper &getter, const JSStrictPropertyOpWrapper &setter,
|
||||
unsigned attrs, unsigned flags, int tinyid)
|
||||
{
|
||||
@ -3844,7 +3841,7 @@ JS_DefinePropertyWithTinyId(JSContext *cx, JSObject *objArg, const char *name, i
|
||||
}
|
||||
|
||||
static JSBool
|
||||
DefineUCProperty(JSContext *cx, JSHandleObject obj, const jschar *name, size_t namelen,
|
||||
DefineUCProperty(JSContext *cx, HandleObject obj, const jschar *name, size_t namelen,
|
||||
const Value &value_, PropertyOp getter, StrictPropertyOp setter, unsigned attrs,
|
||||
unsigned flags, int tinyid)
|
||||
{
|
||||
@ -5784,8 +5781,8 @@ JS_New(JSContext *cx, JSObject *ctorArg, unsigned argc, jsval *argv)
|
||||
// is not a simple variation of JSOP_CALL. We have to determine what class
|
||||
// of object to create, create it, and clamp the return value to an object,
|
||||
// among other details. InvokeConstructor does the hard work.
|
||||
InvokeArgsGuard args;
|
||||
if (!cx->stack.pushInvokeArgs(cx, argc, &args))
|
||||
InvokeArgs args(cx);
|
||||
if (!args.init(argc))
|
||||
return NULL;
|
||||
|
||||
args.setCallee(ObjectValue(*ctor));
|
||||
|
@ -713,11 +713,6 @@ CallNonGenericMethod(JSContext *cx, IsAcceptableThis Test, NativeImpl Impl, Call
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
typedef JS::Handle<JSObject*> JSHandleObject;
|
||||
typedef JS::Handle<JSString*> JSHandleString;
|
||||
typedef JS::Handle<JS::Value> JSHandleValue;
|
||||
typedef JS::Handle<jsid> JSHandleId;
|
||||
|
||||
/* JSClass operation signatures. */
|
||||
|
||||
/*
|
||||
@ -726,7 +721,7 @@ typedef JS::Handle<jsid> JSHandleId;
|
||||
* *vp out parameter, on success, is the new property value after the action.
|
||||
*/
|
||||
typedef JSBool
|
||||
(* JSPropertyOp)(JSContext *cx, JSHandleObject obj, JSHandleId id, JS::MutableHandle<JS::Value> vp);
|
||||
(* JSPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
/*
|
||||
* Set a property named by id in obj, treating the assignment as strict
|
||||
@ -736,7 +731,7 @@ typedef JSBool
|
||||
* set.
|
||||
*/
|
||||
typedef JSBool
|
||||
(* JSStrictPropertyOp)(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JS::MutableHandle<JS::Value> vp);
|
||||
(* JSStrictPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict, JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
/*
|
||||
* Delete a property named by id in obj.
|
||||
@ -754,7 +749,7 @@ typedef JSBool
|
||||
* set *succeeded to true and return true.
|
||||
*/
|
||||
typedef JSBool
|
||||
(* JSDeletePropertyOp)(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool *succeeded);
|
||||
(* JSDeletePropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool *succeeded);
|
||||
|
||||
/*
|
||||
* This function type is used for callbacks that enumerate the properties of
|
||||
@ -789,7 +784,7 @@ typedef JSBool
|
||||
* indicating failure.
|
||||
*/
|
||||
typedef JSBool
|
||||
(* JSNewEnumerateOp)(JSContext *cx, JSHandleObject obj, JSIterateOp enum_op,
|
||||
(* JSNewEnumerateOp)(JSContext *cx, JS::Handle<JSObject*> obj, JSIterateOp enum_op,
|
||||
JS::MutableHandle<JS::Value> statep, JS::MutableHandleId idp);
|
||||
|
||||
/*
|
||||
@ -797,7 +792,7 @@ typedef JSBool
|
||||
* yet reflected in obj.
|
||||
*/
|
||||
typedef JSBool
|
||||
(* JSEnumerateOp)(JSContext *cx, JSHandleObject obj);
|
||||
(* JSEnumerateOp)(JSContext *cx, JS::Handle<JSObject*> obj);
|
||||
|
||||
/*
|
||||
* Resolve a lazy property named by id in obj by defining it directly in obj.
|
||||
@ -812,7 +807,7 @@ typedef JSBool
|
||||
* NB: JSNewResolveOp provides a cheaper way to resolve lazy properties.
|
||||
*/
|
||||
typedef JSBool
|
||||
(* JSResolveOp)(JSContext *cx, JSHandleObject obj, JSHandleId id);
|
||||
(* JSResolveOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id);
|
||||
|
||||
/*
|
||||
* Like JSResolveOp, but flags provide contextual information as follows:
|
||||
@ -827,7 +822,7 @@ typedef JSBool
|
||||
* if JSCLASS_NEW_RESOLVE is set in JSClass.flags.
|
||||
*/
|
||||
typedef JSBool
|
||||
(* JSNewResolveOp)(JSContext *cx, JSHandleObject obj, JSHandleId id, unsigned flags,
|
||||
(* JSNewResolveOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, unsigned flags,
|
||||
JS::MutableHandleObject objp);
|
||||
|
||||
/*
|
||||
@ -835,7 +830,8 @@ typedef JSBool
|
||||
* *vp on success, and returning false on error or exception.
|
||||
*/
|
||||
typedef JSBool
|
||||
(* JSConvertOp)(JSContext *cx, JSHandleObject obj, JSType type, JS::MutableHandle<JS::Value> vp);
|
||||
(* JSConvertOp)(JSContext *cx, JS::Handle<JSObject*> obj, JSType type,
|
||||
JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
typedef struct JSFreeOp JSFreeOp;
|
||||
|
||||
@ -877,8 +873,8 @@ struct JSStringFinalizer {
|
||||
* is either a string or an int jsval.
|
||||
*/
|
||||
typedef JSBool
|
||||
(* JSCheckAccessOp)(JSContext *cx, JSHandleObject obj, JSHandleId id, JSAccessMode mode,
|
||||
JS::MutableHandle<JS::Value> vp);
|
||||
(* JSCheckAccessOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
JSAccessMode mode, JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
/*
|
||||
* Check whether v is an instance of obj. Return false on error or exception,
|
||||
@ -886,7 +882,8 @@ typedef JSBool
|
||||
* *bp otherwise.
|
||||
*/
|
||||
typedef JSBool
|
||||
(* JSHasInstanceOp)(JSContext *cx, JSHandleObject obj, JS::MutableHandle<JS::Value> vp, JSBool *bp);
|
||||
(* JSHasInstanceOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JS::Value> vp,
|
||||
JSBool *bp);
|
||||
|
||||
/*
|
||||
* Function type for trace operation of the class called to enumerate all
|
||||
@ -1026,13 +1023,15 @@ typedef const JSErrorFormatString *
|
||||
const unsigned errorNumber);
|
||||
|
||||
typedef JSBool
|
||||
(* JSLocaleToUpperCase)(JSContext *cx, JSHandleString src, JS::MutableHandle<JS::Value> rval);
|
||||
(* JSLocaleToUpperCase)(JSContext *cx, JS::Handle<JSString*> src,
|
||||
JS::MutableHandle<JS::Value> rval);
|
||||
|
||||
typedef JSBool
|
||||
(* JSLocaleToLowerCase)(JSContext *cx, JSHandleString src, JS::MutableHandle<JS::Value> rval);
|
||||
(* JSLocaleToLowerCase)(JSContext *cx, JS::Handle<JSString*> src,
|
||||
JS::MutableHandle<JS::Value> rval);
|
||||
|
||||
typedef JSBool
|
||||
(* JSLocaleCompare)(JSContext *cx, JSHandleString src1, JSHandleString src2,
|
||||
(* JSLocaleCompare)(JSContext *cx, JS::Handle<JSString*> src1, JS::Handle<JSString*> src2,
|
||||
JS::MutableHandle<JS::Value> rval);
|
||||
|
||||
typedef JSBool
|
||||
@ -2961,22 +2960,26 @@ extern JS_PUBLIC_API(JSBool)
|
||||
JS_DefaultValue(JSContext *cx, JSObject *obj, JSType hint, jsval *vp);
|
||||
|
||||
extern JS_PUBLIC_API(JSBool)
|
||||
JS_PropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JS::MutableHandle<JS::Value> vp);
|
||||
JS_PropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
extern JS_PUBLIC_API(JSBool)
|
||||
JS_StrictPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JS::MutableHandle<JS::Value> vp);
|
||||
JS_StrictPropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict,
|
||||
JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
extern JS_PUBLIC_API(JSBool)
|
||||
JS_DeletePropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool *succeeded);
|
||||
JS_DeletePropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
JSBool *succeeded);
|
||||
|
||||
extern JS_PUBLIC_API(JSBool)
|
||||
JS_EnumerateStub(JSContext *cx, JSHandleObject obj);
|
||||
JS_EnumerateStub(JSContext *cx, JS::Handle<JSObject*> obj);
|
||||
|
||||
extern JS_PUBLIC_API(JSBool)
|
||||
JS_ResolveStub(JSContext *cx, JSHandleObject obj, JSHandleId id);
|
||||
JS_ResolveStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id);
|
||||
|
||||
extern JS_PUBLIC_API(JSBool)
|
||||
JS_ConvertStub(JSContext *cx, JSHandleObject obj, JSType type, JS::MutableHandle<JS::Value> vp);
|
||||
JS_ConvertStub(JSContext *cx, JS::Handle<JSObject*> obj, JSType type,
|
||||
JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
struct JSConstDoubleSpec {
|
||||
double dval;
|
||||
@ -3915,26 +3918,26 @@ struct JS_PUBLIC_API(CompileOptions) {
|
||||
};
|
||||
|
||||
extern JS_PUBLIC_API(JSScript *)
|
||||
Compile(JSContext *cx, JSHandleObject obj, CompileOptions options,
|
||||
Compile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,
|
||||
const char *bytes, size_t length);
|
||||
|
||||
extern JS_PUBLIC_API(JSScript *)
|
||||
Compile(JSContext *cx, JSHandleObject obj, CompileOptions options,
|
||||
Compile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,
|
||||
const jschar *chars, size_t length);
|
||||
|
||||
extern JS_PUBLIC_API(JSScript *)
|
||||
Compile(JSContext *cx, JSHandleObject obj, CompileOptions options, FILE *file);
|
||||
Compile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options, FILE *file);
|
||||
|
||||
extern JS_PUBLIC_API(JSScript *)
|
||||
Compile(JSContext *cx, JSHandleObject obj, CompileOptions options, const char *filename);
|
||||
Compile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options, const char *filename);
|
||||
|
||||
extern JS_PUBLIC_API(JSFunction *)
|
||||
CompileFunction(JSContext *cx, JSHandleObject obj, CompileOptions options,
|
||||
CompileFunction(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,
|
||||
const char *name, unsigned nargs, const char **argnames,
|
||||
const char *bytes, size_t length);
|
||||
|
||||
extern JS_PUBLIC_API(JSFunction *)
|
||||
CompileFunction(JSContext *cx, JSHandleObject obj, CompileOptions options,
|
||||
CompileFunction(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,
|
||||
const char *name, unsigned nargs, const char **argnames,
|
||||
const jschar *chars, size_t length);
|
||||
|
||||
@ -4062,15 +4065,15 @@ JS_EvaluateUCScriptForPrincipalsVersionOrigin(JSContext *cx, JSObject *obj,
|
||||
namespace JS {
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
Evaluate(JSContext *cx, JSHandleObject obj, CompileOptions options,
|
||||
Evaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,
|
||||
const jschar *chars, size_t length, jsval *rval);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
Evaluate(JSContext *cx, JSHandleObject obj, CompileOptions options,
|
||||
Evaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,
|
||||
const char *bytes, size_t length, jsval *rval);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
Evaluate(JSContext *cx, JSHandleObject obj, CompileOptions options,
|
||||
Evaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,
|
||||
const char *filename, jsval *rval);
|
||||
|
||||
} /* namespace JS */
|
||||
|
@ -1009,17 +1009,17 @@ array_toString(JSContext *cx, unsigned argc, Value *vp)
|
||||
return true;
|
||||
}
|
||||
|
||||
InvokeArgsGuard ag;
|
||||
if (!cx->stack.pushInvokeArgs(cx, 0, &ag))
|
||||
InvokeArgs args2(cx);
|
||||
if (!args2.init(0))
|
||||
return false;
|
||||
|
||||
ag.setCallee(join);
|
||||
ag.setThis(ObjectValue(*obj));
|
||||
args2.setCallee(join);
|
||||
args2.setThis(ObjectValue(*obj));
|
||||
|
||||
/* Do the call. */
|
||||
if (!Invoke(cx, ag))
|
||||
if (!Invoke(cx, args2))
|
||||
return false;
|
||||
args.rval().set(ag.rval());
|
||||
args.rval().set(args2.rval());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1421,20 +1421,20 @@ SortComparatorFunction::operator()(const Value &a, const Value &b, bool *lessOrE
|
||||
if (!JS_CHECK_OPERATION_LIMIT(cx))
|
||||
return false;
|
||||
|
||||
InvokeArgsGuard &ag = fig.args();
|
||||
if (!ag.pushed() && !cx->stack.pushInvokeArgs(cx, 2, &ag))
|
||||
InvokeArgs &args = fig.args();
|
||||
if (!args.init(2))
|
||||
return false;
|
||||
|
||||
ag.setCallee(fval);
|
||||
ag.setThis(UndefinedValue());
|
||||
ag[0] = a;
|
||||
ag[1] = b;
|
||||
args.setCallee(fval);
|
||||
args.setThis(UndefinedValue());
|
||||
args[0] = a;
|
||||
args[1] = b;
|
||||
|
||||
if (!fig.invoke(cx))
|
||||
return false;
|
||||
|
||||
double cmp;
|
||||
if (!ToNumber(cx, ag.rval(), &cmp))
|
||||
if (!ToNumber(cx, args.rval(), &cmp))
|
||||
return false;
|
||||
|
||||
/*
|
||||
@ -2637,7 +2637,7 @@ array_filter(JSContext *cx, unsigned argc, Value *vp)
|
||||
/* Step 9. */
|
||||
JS_ASSERT(!InParallelSection());
|
||||
FastInvokeGuard fig(cx, ObjectValue(*callable));
|
||||
InvokeArgsGuard &ag = fig.args();
|
||||
InvokeArgs &args2 = fig.args();
|
||||
RootedValue kValue(cx);
|
||||
while (k < len) {
|
||||
if (!JS_CHECK_OPERATION_LIMIT(cx))
|
||||
@ -2650,17 +2650,17 @@ array_filter(JSContext *cx, unsigned argc, Value *vp)
|
||||
|
||||
/* Step c.ii-iii. */
|
||||
if (!kNotPresent) {
|
||||
if (!ag.pushed() && !cx->stack.pushInvokeArgs(cx, 3, &ag))
|
||||
if (!args2.init(3))
|
||||
return false;
|
||||
ag.setCallee(ObjectValue(*callable));
|
||||
ag.setThis(thisv);
|
||||
ag[0] = kValue;
|
||||
ag[1] = NumberValue(k);
|
||||
ag[2] = ObjectValue(*obj);
|
||||
args2.setCallee(ObjectValue(*callable));
|
||||
args2.setThis(thisv);
|
||||
args2[0] = kValue;
|
||||
args2[1] = NumberValue(k);
|
||||
args2[2] = ObjectValue(*obj);
|
||||
if (!fig.invoke(cx))
|
||||
return false;
|
||||
|
||||
if (ToBoolean(ag.rval())) {
|
||||
if (ToBoolean(args2.rval())) {
|
||||
if (!SetArrayElement(cx, arr, to, kValue))
|
||||
return false;
|
||||
to++;
|
||||
|
@ -598,7 +598,7 @@ JSStructuredCloneWriter::writeTypedArray(HandleObject arr)
|
||||
}
|
||||
|
||||
bool
|
||||
JSStructuredCloneWriter::writeArrayBuffer(JSHandleObject obj)
|
||||
JSStructuredCloneWriter::writeArrayBuffer(HandleObject obj)
|
||||
{
|
||||
ArrayBufferObject &buffer = obj->as<ArrayBufferObject>();
|
||||
return out.writePair(SCTAG_ARRAY_BUFFER_OBJECT, buffer.byteLength()) &&
|
||||
@ -606,7 +606,7 @@ JSStructuredCloneWriter::writeArrayBuffer(JSHandleObject obj)
|
||||
}
|
||||
|
||||
bool
|
||||
JSStructuredCloneWriter::startObject(JSHandleObject obj, bool *backref)
|
||||
JSStructuredCloneWriter::startObject(HandleObject obj, bool *backref)
|
||||
{
|
||||
/* Handle cycles in the object graph. */
|
||||
CloneMemory::AddPtr p = memory.lookupForAdd(obj);
|
||||
@ -625,7 +625,7 @@ JSStructuredCloneWriter::startObject(JSHandleObject obj, bool *backref)
|
||||
}
|
||||
|
||||
bool
|
||||
JSStructuredCloneWriter::traverseObject(JSHandleObject obj)
|
||||
JSStructuredCloneWriter::traverseObject(HandleObject obj)
|
||||
{
|
||||
/*
|
||||
* Get enumerable property ids and put them in reverse order so that they
|
||||
|
@ -159,11 +159,11 @@ struct JSStructuredCloneWriter {
|
||||
|
||||
bool writeString(uint32_t tag, JSString *str);
|
||||
bool writeId(jsid id);
|
||||
bool writeArrayBuffer(JSHandleObject obj);
|
||||
bool writeTypedArray(JSHandleObject obj);
|
||||
bool startObject(JSHandleObject obj, bool *backref);
|
||||
bool writeArrayBuffer(JS::HandleObject obj);
|
||||
bool writeTypedArray(JS::HandleObject obj);
|
||||
bool startObject(JS::HandleObject obj, bool *backref);
|
||||
bool startWrite(const js::Value &v);
|
||||
bool traverseObject(JSHandleObject obj);
|
||||
bool traverseObject(JS::HandleObject obj);
|
||||
|
||||
bool parseTransferable();
|
||||
void reportErrorTransferable();
|
||||
|
@ -126,7 +126,7 @@ JSRuntime::sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf, JS::RuntimeSizes
|
||||
|
||||
rtSizes->regexpData = bumpAlloc_ ? bumpAlloc_->sizeOfNonHeapData() : 0;
|
||||
|
||||
rtSizes->stack = stackSpace.sizeOf();
|
||||
rtSizes->interpreterStack = interpreterStack_.sizeOfExcludingThis(mallocSizeOf);
|
||||
|
||||
rtSizes->gcMarker = gcMarker.sizeOfExcludingThis(mallocSizeOf);
|
||||
|
||||
@ -560,7 +560,7 @@ checkReportFlags(JSContext *cx, unsigned *flags)
|
||||
* otherwise. We assume that if the top frame is a native, then it is
|
||||
* strict if the nearest scripted frame is strict, see bug 536306.
|
||||
*/
|
||||
JSScript *script = cx->stack.currentScript();
|
||||
JSScript *script = cx->currentScript();
|
||||
if (script && script->strict)
|
||||
*flags &= ~JSREPORT_WARNING;
|
||||
else if (cx->hasExtraWarningsOption())
|
||||
@ -1179,7 +1179,6 @@ JSContext::JSContext(JSRuntime *rt)
|
||||
enterCompartmentDepth_(0),
|
||||
savedFrameChains_(),
|
||||
defaultCompartmentObject_(NULL),
|
||||
stack(thisDuringConstruction()),
|
||||
cycleDetectorSet(thisDuringConstruction()),
|
||||
errorReporter(NULL),
|
||||
operationCallback(NULL),
|
||||
@ -1302,14 +1301,9 @@ JSContext::runningWithTrustedPrincipals() const
|
||||
bool
|
||||
JSContext::saveFrameChain()
|
||||
{
|
||||
if (!stack.saveFrameChain())
|
||||
if (!savedFrameChains_.append(SavedFrameChain(compartment(), enterCompartmentDepth_)))
|
||||
return false;
|
||||
|
||||
if (!savedFrameChains_.append(SavedFrameChain(compartment(), enterCompartmentDepth_))) {
|
||||
stack.restoreFrameChain();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Activation *act = mainThread().activation())
|
||||
act->saveFrameChain();
|
||||
|
||||
@ -1331,8 +1325,6 @@ JSContext::restoreFrameChain()
|
||||
setCompartment(sfc.compartment);
|
||||
enterCompartmentDepth_ = sfc.enterCompartmentCount;
|
||||
|
||||
stack.restoreFrameChain();
|
||||
|
||||
if (Activation *act = mainThread().activation())
|
||||
act->restoreFrameChain();
|
||||
|
||||
@ -1532,7 +1524,7 @@ JSContext::findVersion() const
|
||||
if (hasVersionOverride)
|
||||
return versionOverride;
|
||||
|
||||
if (JSScript *script = stack.currentScript(NULL, js::ContextStack::ALLOW_CROSS_COMPARTMENT))
|
||||
if (JSScript *script = currentScript(NULL, ALLOW_CROSS_COMPARTMENT))
|
||||
return script->getVersion();
|
||||
|
||||
return defaultVersion;
|
||||
|
@ -726,9 +726,6 @@ struct JSRuntime : public JS::shadow::Runtime,
|
||||
void assertValidThread() const {}
|
||||
#endif
|
||||
|
||||
/* Keeper of the contiguous stack used by all contexts in this thread. */
|
||||
js::StackSpace stackSpace;
|
||||
|
||||
/* Temporary arena pool used while compiling and decompiling. */
|
||||
static const size_t TEMP_LIFO_ALLOC_PRIMARY_CHUNK_SIZE = 4 * 1024;
|
||||
js::LifoAlloc tempLifoAlloc;
|
||||
@ -750,6 +747,9 @@ struct JSRuntime : public JS::shadow::Runtime,
|
||||
|
||||
JSObject *selfHostingGlobal_;
|
||||
|
||||
/* Space for interpreter frames. */
|
||||
js::InterpreterStack interpreterStack_;
|
||||
|
||||
JSC::ExecutableAllocator *createExecutableAllocator(JSContext *cx);
|
||||
WTF::BumpPointerAllocator *createBumpPointerAllocator(JSContext *cx);
|
||||
js::ion::IonRuntime *createIonRuntime(JSContext *cx);
|
||||
@ -777,6 +777,9 @@ struct JSRuntime : public JS::shadow::Runtime,
|
||||
bool hasIonRuntime() const {
|
||||
return !!ionRuntime_;
|
||||
}
|
||||
js::InterpreterStack &interpreterStack() {
|
||||
return interpreterStack_;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Self-hosting support
|
||||
@ -1686,9 +1689,6 @@ struct JSContext : js::ThreadSafeContext,
|
||||
inline void setDefaultCompartmentObjectIfUnset(JSObject *obj);
|
||||
JSObject *maybeDefaultCompartmentObject() const { return defaultCompartmentObject_; }
|
||||
|
||||
/* Current execution stack. */
|
||||
js::ContextStack stack;
|
||||
|
||||
/*
|
||||
* Current global. This is only safe to use within the scope of the
|
||||
* AutoCompartment from which it's called.
|
||||
@ -1748,8 +1748,7 @@ struct JSContext : js::ThreadSafeContext,
|
||||
* default version.
|
||||
*/
|
||||
void maybeMigrateVersionOverride() {
|
||||
JS_ASSERT(stack.empty());
|
||||
if (JS_UNLIKELY(isVersionOverridden())) {
|
||||
if (JS_UNLIKELY(isVersionOverridden()) && !currentlyRunning()) {
|
||||
defaultVersion = versionOverride;
|
||||
clearVersionOverride();
|
||||
}
|
||||
@ -1820,6 +1819,19 @@ struct JSContext : js::ThreadSafeContext,
|
||||
return mainThread().activation()->asInterpreter()->regs();
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the topmost script and optional pc on the stack. By default, this
|
||||
* function only returns a JSScript in the current compartment, returning
|
||||
* NULL if the current script is in a different compartment. This behavior
|
||||
* can be overridden by passing ALLOW_CROSS_COMPARTMENT.
|
||||
*/
|
||||
enum MaybeAllowCrossCompartment {
|
||||
DONT_ALLOW_CROSS_COMPARTMENT = false,
|
||||
ALLOW_CROSS_COMPARTMENT = true
|
||||
};
|
||||
inline JSScript *currentScript(jsbytecode **pc = NULL,
|
||||
MaybeAllowCrossCompartment = DONT_ALLOW_CROSS_COMPARTMENT) const;
|
||||
|
||||
#ifdef MOZ_TRACE_JSCALLS
|
||||
/* Function entry/exit debugging callback. */
|
||||
JSFunctionCallback functionCallback;
|
||||
@ -2015,6 +2027,12 @@ class MOZ_STACK_CLASS AutoKeepAtoms
|
||||
~AutoKeepAtoms() { JS_UNKEEP_ATOMS(rt); }
|
||||
};
|
||||
|
||||
// Maximum supported value of arguments.length. This bounds the maximum
|
||||
// number of arguments that can be supplied to Function.prototype.apply.
|
||||
// This value also bounds the number of elements parsed in an array
|
||||
// initialiser.
|
||||
static const unsigned ARGS_LENGTH_MAX = 500 * 1000;
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
class JSAutoResolveFlags
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include "builtin/Object.h" // For js::obj_construct
|
||||
#include "frontend/ParseMaps.h"
|
||||
#include "ion/IonFrames.h" // For GetPcScript
|
||||
#include "vm/Interpreter.h"
|
||||
#include "vm/Probes.h"
|
||||
#include "vm/RegExpObject.h"
|
||||
@ -123,25 +124,6 @@ NewObjectCache::newObjectFromHit(JSContext *cx, EntryIndex entry_, js::gc::Initi
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct PreserveRegsGuard
|
||||
{
|
||||
PreserveRegsGuard(JSContext *cx, FrameRegs ®s)
|
||||
: prevContextRegs(cx->stack.maybeRegs()), cx(cx), regs_(regs) {
|
||||
cx->stack.repointRegs(®s_);
|
||||
}
|
||||
~PreserveRegsGuard() {
|
||||
JS_ASSERT(cx->stack.maybeRegs() == ®s_);
|
||||
*prevContextRegs = regs_;
|
||||
cx->stack.repointRegs(prevContextRegs);
|
||||
}
|
||||
|
||||
FrameRegs *prevContextRegs;
|
||||
|
||||
private:
|
||||
JSContext *cx;
|
||||
FrameRegs ®s_;
|
||||
};
|
||||
|
||||
#ifdef JS_CRASH_DIAGNOSTICS
|
||||
class CompartmentChecker
|
||||
{
|
||||
@ -575,6 +557,48 @@ JSContext::setCompartment(JSCompartment *comp)
|
||||
allocator_ = zone_ ? &zone_->allocator : NULL;
|
||||
}
|
||||
|
||||
inline JSScript *
|
||||
JSContext::currentScript(jsbytecode **ppc,
|
||||
MaybeAllowCrossCompartment allowCrossCompartment) const
|
||||
{
|
||||
if (ppc)
|
||||
*ppc = NULL;
|
||||
|
||||
js::Activation *act = mainThread().activation();
|
||||
while (act && (act->cx() != this || !act->isActive()))
|
||||
act = act->prev();
|
||||
|
||||
if (!act)
|
||||
return NULL;
|
||||
|
||||
JS_ASSERT(act->cx() == this);
|
||||
|
||||
#ifdef JS_ION
|
||||
if (act->isJit()) {
|
||||
JSScript *script = NULL;
|
||||
js::ion::GetPcScript(const_cast<JSContext *>(this), &script, ppc);
|
||||
if (!allowCrossCompartment && script->compartment() != compartment())
|
||||
return NULL;
|
||||
return script;
|
||||
}
|
||||
#endif
|
||||
|
||||
JS_ASSERT(act->isInterpreter());
|
||||
|
||||
js::StackFrame *fp = act->asInterpreter()->current();
|
||||
JS_ASSERT(!fp->runningInJit());
|
||||
|
||||
JSScript *script = fp->script();
|
||||
if (!allowCrossCompartment && script->compartment() != compartment())
|
||||
return NULL;
|
||||
|
||||
if (ppc) {
|
||||
*ppc = act->asInterpreter()->regs().pc;
|
||||
JS_ASSERT(*ppc >= script->code && *ppc < script->code + script->length);
|
||||
}
|
||||
return script;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline bool
|
||||
js::ThreadSafeContext::isInsideCurrentZone(T thing) const
|
||||
|
@ -2590,16 +2590,16 @@ date_toJSON(JSContext *cx, unsigned argc, Value *vp)
|
||||
}
|
||||
|
||||
/* Step 6. */
|
||||
InvokeArgsGuard ag;
|
||||
if (!cx->stack.pushInvokeArgs(cx, 0, &ag))
|
||||
InvokeArgs args2(cx);
|
||||
if (!args2.init(0))
|
||||
return false;
|
||||
|
||||
ag.setCallee(toISO);
|
||||
ag.setThis(ObjectValue(*obj));
|
||||
args2.setCallee(toISO);
|
||||
args2.setThis(ObjectValue(*obj));
|
||||
|
||||
if (!Invoke(cx, ag))
|
||||
if (!Invoke(cx, args2))
|
||||
return false;
|
||||
args.rval().set(ag.rval());
|
||||
args.rval().set(args2.rval());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1238,8 +1238,6 @@ JSObject *
|
||||
JSAbstractFramePtr::scopeChain(JSContext *cx)
|
||||
{
|
||||
AbstractFramePtr frame = Valueify(*this);
|
||||
JS_ASSERT_IF(frame.isStackFrame(),
|
||||
cx->stack.space().containsSlow(frame.asStackFrame()));
|
||||
RootedObject scopeChain(cx, frame.scopeChain());
|
||||
AutoCompartment ac(cx, scopeChain);
|
||||
return GetDebugScopeForFrame(cx, frame);
|
||||
@ -1249,9 +1247,6 @@ JSObject *
|
||||
JSAbstractFramePtr::callObject(JSContext *cx)
|
||||
{
|
||||
AbstractFramePtr frame = Valueify(*this);
|
||||
JS_ASSERT_IF(frame.isStackFrame(),
|
||||
cx->stack.space().containsSlow(frame.asStackFrame()));
|
||||
|
||||
if (!frame.isFunctionFrame())
|
||||
return NULL;
|
||||
|
||||
|
@ -309,7 +309,7 @@ AutoSwitchCompartment::AutoSwitchCompartment(JSContext *cx, JSCompartment *newCo
|
||||
cx->setCompartment(newCompartment);
|
||||
}
|
||||
|
||||
AutoSwitchCompartment::AutoSwitchCompartment(JSContext *cx, JSHandleObject target
|
||||
AutoSwitchCompartment::AutoSwitchCompartment(JSContext *cx, HandleObject target
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
|
||||
: cx(cx), oldCompartment(cx->compartment())
|
||||
{
|
||||
@ -800,7 +800,7 @@ js::SetActivityCallback(JSRuntime *rt, ActivityCallback cb, void *arg)
|
||||
JS_FRIEND_API(bool)
|
||||
js::IsContextRunningJS(JSContext *cx)
|
||||
{
|
||||
return !cx->stack.empty();
|
||||
return cx->currentlyRunning();
|
||||
}
|
||||
|
||||
JS_FRIEND_API(JS::GCSliceCallback)
|
||||
@ -1081,7 +1081,7 @@ js::SetObjectMetadataCallback(JSContext *cx, ObjectMetadataCallback callback)
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
js::SetObjectMetadata(JSContext *cx, JSHandleObject obj, JSHandleObject metadata)
|
||||
js::SetObjectMetadata(JSContext *cx, HandleObject obj, HandleObject metadata)
|
||||
{
|
||||
return JSObject::setMetadata(cx, obj, metadata);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ extern JS_FRIEND_API(JSObject *)
|
||||
JS_NewObjectWithUniqueType(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);
|
||||
|
||||
extern JS_FRIEND_API(uint32_t)
|
||||
JS_ObjectCountDynamicSlots(JSHandleObject obj);
|
||||
JS_ObjectCountDynamicSlots(JS::HandleObject obj);
|
||||
|
||||
extern JS_FRIEND_API(size_t)
|
||||
JS_SetProtoCalled(JSContext *cx);
|
||||
@ -122,10 +122,11 @@ extern JS_FRIEND_API(JSObject *)
|
||||
JS_CloneObject(JSContext *cx, JSObject *obj, JSObject *proto, JSObject *parent);
|
||||
|
||||
extern JS_FRIEND_API(JSString *)
|
||||
JS_BasicObjectToString(JSContext *cx, JSHandleObject obj);
|
||||
JS_BasicObjectToString(JSContext *cx, JS::HandleObject obj);
|
||||
|
||||
extern JS_FRIEND_API(JSBool)
|
||||
js_GetterOnlyPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JS::MutableHandleValue vp);
|
||||
js_GetterOnlyPropertyStub(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JSBool strict,
|
||||
JS::MutableHandleValue vp);
|
||||
|
||||
JS_FRIEND_API(void)
|
||||
js_ReportOverRecursed(JSContext *maybecx);
|
||||
@ -161,7 +162,7 @@ extern JS_FRIEND_API(JSBool)
|
||||
JS_WrapAutoIdVector(JSContext *cx, JS::AutoIdVector &props);
|
||||
|
||||
extern JS_FRIEND_API(JSBool)
|
||||
JS_EnumerateState(JSContext *cx, JSHandleObject obj, JSIterateOp enum_op,
|
||||
JS_EnumerateState(JSContext *cx, JS::HandleObject obj, JSIterateOp enum_op,
|
||||
js::MutableHandleValue statep, js::MutableHandleId idp);
|
||||
|
||||
struct JSFunctionSpecWithHelp {
|
||||
@ -229,7 +230,7 @@ class JS_FRIEND_API(AutoSwitchCompartment) {
|
||||
public:
|
||||
AutoSwitchCompartment(JSContext *cx, JSCompartment *newCompartment
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
|
||||
AutoSwitchCompartment(JSContext *cx, JSHandleObject target
|
||||
AutoSwitchCompartment(JSContext *cx, JS::HandleObject target
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
|
||||
~AutoSwitchCompartment();
|
||||
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
@ -785,7 +786,7 @@ extern JS_FRIEND_API(AnalysisPurgeCallback)
|
||||
SetAnalysisPurgeCallback(JSRuntime *rt, AnalysisPurgeCallback callback);
|
||||
|
||||
typedef JSBool
|
||||
(* DOMInstanceClassMatchesProto)(JSHandleObject protoObject, uint32_t protoID,
|
||||
(* DOMInstanceClassMatchesProto)(JS::HandleObject protoObject, uint32_t protoID,
|
||||
uint32_t depth);
|
||||
struct JSDOMCallbacks {
|
||||
DOMInstanceClassMatchesProto instanceClassMatchesProto;
|
||||
@ -915,7 +916,7 @@ typedef enum DOMProxyShadowsResult {
|
||||
DoesntShadowUnique
|
||||
} DOMProxyShadowsResult;
|
||||
typedef DOMProxyShadowsResult
|
||||
(* DOMProxyShadowsCheck)(JSContext* cx, JSHandleObject object, JSHandleId id);
|
||||
(* DOMProxyShadowsCheck)(JSContext* cx, JS::HandleObject object, JS::HandleId id);
|
||||
JS_FRIEND_API(void)
|
||||
SetDOMProxyInformation(void *domProxyHandlerFamily, uint32_t domProxyExpandoSlot,
|
||||
DOMProxyShadowsCheck domProxyShadowsCheck);
|
||||
@ -1542,13 +1543,13 @@ struct JSJitMethodCallArgsTraits
|
||||
* available to general JSAPI users, but we are not currently ready to do so.
|
||||
*/
|
||||
typedef bool
|
||||
(* JSJitGetterOp)(JSContext *cx, JSHandleObject thisObj,
|
||||
(* JSJitGetterOp)(JSContext *cx, JS::HandleObject thisObj,
|
||||
void *specializedThis, JSJitGetterCallArgs args);
|
||||
typedef bool
|
||||
(* JSJitSetterOp)(JSContext *cx, JSHandleObject thisObj,
|
||||
(* JSJitSetterOp)(JSContext *cx, JS::HandleObject thisObj,
|
||||
void *specializedThis, JSJitSetterCallArgs args);
|
||||
typedef bool
|
||||
(* JSJitMethodOp)(JSContext *cx, JSHandleObject thisObj,
|
||||
(* JSJitMethodOp)(JSContext *cx, JS::HandleObject thisObj,
|
||||
void *specializedThis, const JSJitMethodCallArgs& args);
|
||||
|
||||
struct JSJitInfo {
|
||||
@ -1744,14 +1745,14 @@ SetObjectMetadataCallback(JSContext *cx, ObjectMetadataCallback callback);
|
||||
/* Manipulate the metadata associated with an object. */
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
SetObjectMetadata(JSContext *cx, JSHandleObject obj, JSHandleObject metadata);
|
||||
SetObjectMetadata(JSContext *cx, JS::HandleObject obj, JS::HandleObject metadata);
|
||||
|
||||
JS_FRIEND_API(JSObject *)
|
||||
GetObjectMetadata(JSObject *obj);
|
||||
|
||||
/* ES5 8.12.8. */
|
||||
extern JS_FRIEND_API(JSBool)
|
||||
DefaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp);
|
||||
DefaultValue(JSContext *cx, JS::HandleObject obj, JSType hint, MutableHandleValue vp);
|
||||
|
||||
|
||||
} /* namespace js */
|
||||
|
@ -817,8 +817,8 @@ js_fun_call(JSContext *cx, unsigned argc, Value *vp)
|
||||
}
|
||||
|
||||
/* Allocate stack space for fval, obj, and the args. */
|
||||
InvokeArgsGuard args;
|
||||
if (!cx->stack.pushInvokeArgs(cx, argc, &args))
|
||||
InvokeArgs args(cx);
|
||||
if (!args.init(argc))
|
||||
return JS_FALSE;
|
||||
|
||||
/* Push fval, thisv, and the args. */
|
||||
@ -833,13 +833,13 @@ js_fun_call(JSContext *cx, unsigned argc, Value *vp)
|
||||
|
||||
#ifdef JS_ION
|
||||
static bool
|
||||
PushBaselineFunApplyArguments(JSContext *cx, ion::IonFrameIterator &frame, InvokeArgsGuard &args,
|
||||
PushBaselineFunApplyArguments(JSContext *cx, ion::IonFrameIterator &frame, InvokeArgs &args,
|
||||
Value *vp)
|
||||
{
|
||||
unsigned length = frame.numActualArgs();
|
||||
JS_ASSERT(length <= StackSpace::ARGS_LENGTH_MAX);
|
||||
JS_ASSERT(length <= ARGS_LENGTH_MAX);
|
||||
|
||||
if (!cx->stack.pushInvokeArgs(cx, length, &args))
|
||||
if (!args.init(length))
|
||||
return false;
|
||||
|
||||
/* Push fval, obj, and aobj's elements as args. */
|
||||
@ -867,7 +867,7 @@ js_fun_apply(JSContext *cx, unsigned argc, Value *vp)
|
||||
if (argc < 2 || vp[3].isNullOrUndefined())
|
||||
return js_fun_call(cx, (argc > 0) ? 1 : 0, vp);
|
||||
|
||||
InvokeArgsGuard args;
|
||||
InvokeArgs args(cx);
|
||||
|
||||
/*
|
||||
* GuardFunApplyArgumentsOptimization already called IsOptimizedArguments,
|
||||
@ -895,9 +895,9 @@ js_fun_apply(JSContext *cx, unsigned argc, Value *vp)
|
||||
ion::InlineFrameIterator iter(cx, &frame);
|
||||
|
||||
unsigned length = iter.numActualArgs();
|
||||
JS_ASSERT(length <= StackSpace::ARGS_LENGTH_MAX);
|
||||
JS_ASSERT(length <= ARGS_LENGTH_MAX);
|
||||
|
||||
if (!cx->stack.pushInvokeArgs(cx, length, &args))
|
||||
if (!args.init(length))
|
||||
return false;
|
||||
|
||||
/* Push fval, obj, and aobj's elements as args. */
|
||||
@ -932,9 +932,9 @@ js_fun_apply(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
StackFrame *fp = cx->interpreterFrame();
|
||||
unsigned length = fp->numActualArgs();
|
||||
JS_ASSERT(length <= StackSpace::ARGS_LENGTH_MAX);
|
||||
JS_ASSERT(length <= ARGS_LENGTH_MAX);
|
||||
|
||||
if (!cx->stack.pushInvokeArgs(cx, length, &args))
|
||||
if (!args.init(length))
|
||||
return false;
|
||||
|
||||
/* Push fval, obj, and aobj's elements as args. */
|
||||
@ -961,12 +961,12 @@ js_fun_apply(JSContext *cx, unsigned argc, Value *vp)
|
||||
return false;
|
||||
|
||||
/* Step 6. */
|
||||
if (length > StackSpace::ARGS_LENGTH_MAX) {
|
||||
if (length > ARGS_LENGTH_MAX) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_TOO_MANY_FUN_APPLY_ARGS);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!cx->stack.pushInvokeArgs(cx, length, &args))
|
||||
if (!args.init(length))
|
||||
return false;
|
||||
|
||||
/* Push fval, obj, and aobj's elements as args. */
|
||||
@ -1118,7 +1118,7 @@ js::CallOrConstructBoundFunction(JSContext *cx, unsigned argc, Value *vp)
|
||||
/* 15.3.4.5.1 step 1, 15.3.4.5.2 step 3. */
|
||||
unsigned argslen = fun->getBoundFunctionArgumentCount();
|
||||
|
||||
if (argc + argslen > StackSpace::ARGS_LENGTH_MAX) {
|
||||
if (argc + argslen > ARGS_LENGTH_MAX) {
|
||||
js_ReportAllocationOverflow(cx);
|
||||
return false;
|
||||
}
|
||||
@ -1129,8 +1129,8 @@ js::CallOrConstructBoundFunction(JSContext *cx, unsigned argc, Value *vp)
|
||||
/* 15.3.4.5.1 step 2. */
|
||||
const Value &boundThis = fun->getBoundFunctionThis();
|
||||
|
||||
InvokeArgsGuard args;
|
||||
if (!cx->stack.pushInvokeArgs(cx, argc + argslen, &args))
|
||||
InvokeArgs args(cx);
|
||||
if (!args.init(argc + argslen))
|
||||
return false;
|
||||
|
||||
/* 15.3.4.5.1, 15.3.4.5.2 step 4. */
|
||||
|
@ -2558,6 +2558,7 @@ PurgeRuntime(JSRuntime *rt)
|
||||
comp->purge();
|
||||
|
||||
rt->freeLifoAlloc.transferUnusedFrom(&rt->tempLifoAlloc);
|
||||
rt->interpreterStack().purge(rt);
|
||||
|
||||
rt->gsnCache.purge();
|
||||
rt->newObjectCache.purge();
|
||||
@ -4132,8 +4133,6 @@ AutoGCSlice::AutoGCSlice(JSRuntime *rt)
|
||||
* is set at the beginning of the mark phase. During incremental GC, we also
|
||||
* set it at the start of every phase.
|
||||
*/
|
||||
rt->stackSpace.markActiveCompartments();
|
||||
|
||||
for (ActivationIterator iter(rt); !iter.done(); ++iter)
|
||||
iter.activation()->compartment()->zone()->active = true;
|
||||
|
||||
|
@ -5426,7 +5426,7 @@ types::MarkIteratorUnknownSlow(JSContext *cx)
|
||||
/* Check whether we are actually at an ITER opcode. */
|
||||
|
||||
jsbytecode *pc;
|
||||
RootedScript script(cx, cx->stack.currentScript(&pc));
|
||||
RootedScript script(cx, cx->currentScript(&pc));
|
||||
if (!script || !pc)
|
||||
return;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user