summaryrefslogtreecommitdiffstats
path: root/Source/JavaScriptCore/runtime/JSArray.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSArray.h')
-rw-r--r--Source/JavaScriptCore/runtime/JSArray.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/Source/JavaScriptCore/runtime/JSArray.h b/Source/JavaScriptCore/runtime/JSArray.h
index de28b65..b5caa47 100644
--- a/Source/JavaScriptCore/runtime/JSArray.h
+++ b/Source/JavaScriptCore/runtime/JSArray.h
@@ -27,7 +27,7 @@
namespace JSC {
- typedef HashMap<unsigned, JSValue> SparseArrayValueMap;
+ typedef HashMap<unsigned, WriteBarrier<Unknown> > SparseArrayValueMap;
// This struct holds the actual data values of an array. A JSArray object points to it's contained ArrayStorage
// struct by pointing to m_vector. To access the contained ArrayStorage struct, use the getStorage() and
@@ -44,7 +44,7 @@ namespace JSC {
#if CHECK_ARRAY_CONSISTENCY
bool m_inCompactInitialization;
#endif
- JSValue m_vector[1];
+ WriteBarrier<Unknown> m_vector[1];
};
// The CreateCompact creation mode is used for fast construction of arrays
@@ -67,7 +67,7 @@ namespace JSC {
explicit JSArray(NonNullPassRefPtr<Structure>);
JSArray(NonNullPassRefPtr<Structure>, unsigned initialLength, ArrayCreationMode);
- JSArray(NonNullPassRefPtr<Structure>, const ArgList& initialValues);
+ JSArray(JSGlobalData&, NonNullPassRefPtr<Structure>, const ArgList& initialValues);
virtual ~JSArray();
virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
@@ -94,32 +94,32 @@ namespace JSC {
JSValue getIndex(unsigned i)
{
ASSERT(canGetIndex(i));
- return m_storage->m_vector[i];
+ return m_storage->m_vector[i].get();
}
bool canSetIndex(unsigned i) { return i < m_vectorLength; }
- void setIndex(unsigned i, JSValue v)
+ void setIndex(JSGlobalData& globalData, unsigned i, JSValue v)
{
ASSERT(canSetIndex(i));
- JSValue& x = m_storage->m_vector[i];
+ WriteBarrier<Unknown>& x = m_storage->m_vector[i];
if (!x) {
ArrayStorage *storage = m_storage;
++storage->m_numValuesInVector;
if (i >= storage->m_length)
storage->m_length = i + 1;
}
- x = v;
+ x.set(globalData, this, v);
}
- void uncheckedSetIndex(unsigned i, JSValue v)
+ void uncheckedSetIndex(JSGlobalData& globalData, unsigned i, JSValue v)
{
ASSERT(canSetIndex(i));
ArrayStorage *storage = m_storage;
#if CHECK_ARRAY_CONSISTENCY
ASSERT(storage->m_inCompactInitialization);
#endif
- storage->m_vector[i] = v;
+ storage->m_vector[i].set(globalData, this, v);
}
void fillArgList(ExecState*, MarkedArgumentBuffer&);
@@ -194,13 +194,13 @@ namespace JSC {
if (SparseArrayValueMap* map = storage->m_sparseValueMap) {
SparseArrayValueMap::iterator end = map->end();
for (SparseArrayValueMap::iterator it = map->begin(); it != end; ++it)
- markStack.append(it->second);
+ markStack.append(&it->second);
}
}
inline void MarkStack::markChildren(JSCell* cell)
{
- ASSERT(Heap::isCellMarked(cell));
+ ASSERT(Heap::isMarked(cell));
if (!cell->structure()->typeInfo().overridesMarkChildren()) {
#ifdef NDEBUG
asObject(cell)->markChildrenDirect(*this);
@@ -240,7 +240,7 @@ namespace JSC {
current.m_values++;
JSCell* cell;
- if (!value || !value.isCell() || Heap::checkMarkCell(cell = value.asCell())) {
+ if (!value || !value.isCell() || Heap::testAndSetMarked(cell = value.asCell())) {
if (current.m_values == end) {
m_markSets.removeLast();
continue;