зеркало из https://github.com/mozilla/gecko-dev.git
Bug 985143 - Comment updates to new ArrayBuffer storage scheme
--HG-- extra : rebase_source : 22cee061dc536d327ae10171578bf60b5ccc1469
This commit is contained in:
Родитель
1780d4c86e
Коммит
3cbbc7a377
|
@ -113,7 +113,6 @@ struct TypeInferenceSizes;
|
|||
|
||||
namespace js {
|
||||
class AutoDebugModeInvalidation;
|
||||
class ArrayBufferObject;
|
||||
class DebugScopes;
|
||||
class WeakMapBase;
|
||||
}
|
||||
|
|
|
@ -3358,9 +3358,10 @@ js::gc::MarkingValidator::nonIncrementalMark()
|
|||
}
|
||||
|
||||
/*
|
||||
* Save the lists of live weakmaps and array buffers for the compartments we
|
||||
* are collecting.
|
||||
* Temporarily clear the lists of live weakmaps and array buffers for the
|
||||
* compartments we are collecting.
|
||||
*/
|
||||
|
||||
WeakMapVector weakmaps;
|
||||
ArrayBufferVector arrayBuffers;
|
||||
for (GCCompartmentsIter c(runtime); !c.done(); c.next()) {
|
||||
|
@ -3377,10 +3378,6 @@ js::gc::MarkingValidator::nonIncrementalMark()
|
|||
*/
|
||||
initialized = true;
|
||||
|
||||
/*
|
||||
* Reset the lists of live weakmaps and array buffers for the compartments we
|
||||
* are collecting.
|
||||
*/
|
||||
for (GCCompartmentsIter c(runtime); !c.done(); c.next()) {
|
||||
WeakMapBase::resetCompartmentWeakMapList(c);
|
||||
ArrayBufferObject::resetArrayBufferList(c);
|
||||
|
@ -3437,7 +3434,6 @@ js::gc::MarkingValidator::nonIncrementalMark()
|
|||
Swap(*entry, *bitmap);
|
||||
}
|
||||
|
||||
/* Restore the weak map and array buffer lists. */
|
||||
for (GCCompartmentsIter c(runtime); !c.done(); c.next()) {
|
||||
WeakMapBase::resetCompartmentWeakMapList(c);
|
||||
ArrayBufferObject::resetArrayBufferList(c);
|
||||
|
|
|
@ -165,7 +165,6 @@ extern const Class IntlClass;
|
|||
extern const Class JSONClass;
|
||||
extern const Class MathClass;
|
||||
|
||||
class ArrayBufferObject;
|
||||
class GlobalObject;
|
||||
class MapObject;
|
||||
class NewObjectCache;
|
||||
|
|
|
@ -545,6 +545,7 @@ ArrayBufferObject::releaseData(FreeOp *fop)
|
|||
void
|
||||
ArrayBufferObject::setDataPointer(void *data, OwnsState ownsData)
|
||||
{
|
||||
MOZ_ASSERT_IF(!is<SharedArrayBufferObject>(), data != nullptr);
|
||||
setSlot(DATA_SLOT, PrivateValue(data));
|
||||
setOwnsData(ownsData);
|
||||
}
|
||||
|
|
|
@ -159,9 +159,7 @@ bool
|
|||
ObjectImpl::canHaveNonEmptyElements()
|
||||
{
|
||||
JSObject *obj = static_cast<JSObject *>(this);
|
||||
if (isNative())
|
||||
return !obj->is<TypedArrayObject>();
|
||||
return obj->is<ArrayBufferObject>() || obj->is<SharedArrayBufferObject>();
|
||||
return isNative() && !obj->is<TypedArrayObject>();
|
||||
}
|
||||
|
||||
#endif // DEBUG
|
||||
|
|
|
@ -193,16 +193,9 @@ class ObjectElements
|
|||
* is <= the length. Memory for elements above the initialized length is
|
||||
* uninitialized, but values between the initialized length and the proper
|
||||
* length are conceptually holes.
|
||||
*
|
||||
* ArrayBufferObject uses this field to store byteLength.
|
||||
*/
|
||||
uint32_t initializedLength;
|
||||
|
||||
/*
|
||||
* Beware, one or both of the following fields is clobbered by
|
||||
* ArrayBufferObject. See GetViewList.
|
||||
*/
|
||||
|
||||
/* Number of allocated slots. */
|
||||
uint32_t capacity;
|
||||
|
||||
|
@ -287,13 +280,15 @@ IsObjectValueInCompartment(js::Value v, JSCompartment *comp);
|
|||
* The |shape_| member stores the shape of the object, which includes the
|
||||
* object's class and the layout of all its properties.
|
||||
*
|
||||
* The type member stores the type of the object, which contains its prototype
|
||||
* object and the possible types of its properties.
|
||||
* The |type_| member stores the type of the object, which contains its
|
||||
* prototype object and the possible types of its properties.
|
||||
*
|
||||
* The rest of the object stores its named properties and indexed elements.
|
||||
* These are stored separately from one another. Objects are followed by an
|
||||
* These are stored separately from one another. Objects are followed by a
|
||||
* variable-sized array of values for inline storage, which may be used by
|
||||
* either properties of native objects (fixed slots) or by elements.
|
||||
* either properties of native objects (fixed slots), by elements (fixed
|
||||
* elements), or by other data for certain kinds of objects, such as
|
||||
* ArrayBufferObjects.
|
||||
*
|
||||
* Two native objects with the same shape are guaranteed to have the same
|
||||
* number of fixed slots.
|
||||
|
@ -315,12 +310,7 @@ IsObjectValueInCompartment(js::Value v, JSCompartment *comp);
|
|||
* slots may be either names or indexes; no indexed property will be in both
|
||||
* the slots and elements.
|
||||
*
|
||||
* - For non-native objects other than typed arrays, properties and elements
|
||||
* are both empty.
|
||||
*
|
||||
* - For typed array buffers, elements are used and properties are not used.
|
||||
* The data indexed by the elements do not represent Values, but primitive
|
||||
* unboxed integers or floating point values.
|
||||
* - For non-native objects, slots and elements are both empty.
|
||||
*
|
||||
* The members of this class are currently protected; in the long run this will
|
||||
* will change so that some members are private, and only certain methods that
|
||||
|
|
Загрузка…
Ссылка в новой задаче