From 81bc750723a18f21cd17d1b173cd2a4dda9cea6e Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Tue, 24 May 2011 11:24:40 +0100 Subject: Merge WebKit at r80534: Intial merge by Git Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61 --- Source/JavaScriptCore/runtime/JSArray.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'Source/JavaScriptCore/runtime/JSArray.cpp') diff --git a/Source/JavaScriptCore/runtime/JSArray.cpp b/Source/JavaScriptCore/runtime/JSArray.cpp index ded6d87..822b84c 100644 --- a/Source/JavaScriptCore/runtime/JSArray.cpp +++ b/Source/JavaScriptCore/runtime/JSArray.cpp @@ -92,7 +92,7 @@ ASSERT_CLASS_FITS_IN_CELL(JSArray); // as long as it is 1/8 full. If more sparse than that, we use a map. static const unsigned minDensityMultiplier = 8; -const ClassInfo JSArray::info = {"Array", 0, 0, 0}; +const ClassInfo JSArray::s_info = {"Array", &JSNonFinalObject::s_info, 0, 0}; // We keep track of the size of the last array after it was grown. We use this // as a simple heuristic for as the value to grow the next array from size 0. @@ -127,8 +127,10 @@ inline void JSArray::checkConsistency(ConsistencyCheckType) #endif JSArray::JSArray(VPtrStealingHackType) - : JSObject(createStructure(jsNull())) + : JSNonFinalObject(createStructure(jsNull())) { + ASSERT(inherits(&s_info)); + unsigned initialCapacity = 0; m_storage = static_cast(fastZeroedMalloc(storageSize(initialCapacity))); @@ -144,8 +146,10 @@ JSArray::JSArray(VPtrStealingHackType) } JSArray::JSArray(NonNullPassRefPtr structure) - : JSObject(structure) + : JSNonFinalObject(structure) { + ASSERT(inherits(&s_info)); + unsigned initialCapacity = 0; m_storage = static_cast(fastZeroedMalloc(storageSize(initialCapacity))); @@ -159,8 +163,10 @@ JSArray::JSArray(NonNullPassRefPtr structure) } JSArray::JSArray(NonNullPassRefPtr structure, unsigned initialLength, ArrayCreationMode creationMode) - : JSObject(structure) + : JSNonFinalObject(structure) { + ASSERT(inherits(&s_info)); + unsigned initialCapacity; if (creationMode == CreateCompact) initialCapacity = initialLength; @@ -199,8 +205,10 @@ JSArray::JSArray(NonNullPassRefPtr structure, unsigned initialLength, } JSArray::JSArray(JSGlobalData& globalData, NonNullPassRefPtr structure, const ArgList& list) - : JSObject(structure) + : JSNonFinalObject(structure) { + ASSERT(inherits(&s_info)); + unsigned initialCapacity = list.size(); unsigned initialStorage; -- cgit v1.1