js/src/vm/ObjectImpl-inl.h
author Wes Kocher <wkocher@mozilla.com>
Tue, 10 Sep 2013 23:00:06 -0700
changeset 146872 ecfd306e73fc0f22783cdf8d3f0411984c93b292
parent 146861 45975a8112078e3a80c57de34f3bcfebdd2ef031
child 146880 6f22b81ed9b44458fc19951b3a448fd802395cb6
permissions -rw-r--r--
Backed out changeset 45975a811207 (bug 914508) for Android 2.2 NoIon build bustage

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef vm_ObjectImpl_inl_h
#define vm_ObjectImpl_inl_h

#include "vm/ObjectImpl.h"

#include "mozilla/Assertions.h"

#include "jsgc.h"
#include "jsproxy.h"

#include "gc/Marking.h"
#include "vm/ProxyObject.h"

#include "gc/Barrier-inl.h"

/* static */ inline bool
js::ObjectImpl::isExtensible(ExclusiveContext *cx, js::Handle<ObjectImpl*> obj, bool *extensible)
{
    if (obj->asObjectPtr()->is<ProxyObject>()) {
        if (!cx->shouldBeJSContext())
            return false;
        HandleObject h =
            HandleObject::fromMarkedLocation(reinterpret_cast<JSObject* const*>(obj.address()));
        return Proxy::isExtensible(cx->asJSContext(), h, extensible);
    }

    *extensible = obj->nonProxyIsExtensible();
    return true;
}

#endif /* vm_ObjectImpl_inl_h */