summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-09-20 14:01:09 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-09-20 14:01:09 +0200
commit6dbcd09121fe266c7704a524b5cbd7f2754659c0 (patch)
tree5ae0d16cec0cc61f576d51c57b3a4613c7e91e22 /Source/JavaScriptCore/runtime
parent6bbb7fbbac94d0f511a7bd0cbd50854ab643bfb2 (diff)
downloadqtwebkit-6dbcd09121fe266c7704a524b5cbd7f2754659c0.tar.gz
Imported WebKit commit 080af0beaa6f0ba8ff8f44cb8bd8b5dcf75ac0af (http://svn.webkit.org/repository/webkit/trunk@129119)
New snapshot with prospective build fix for incorrect QtWebKit master module header file creation
Diffstat (limited to 'Source/JavaScriptCore/runtime')
-rw-r--r--Source/JavaScriptCore/runtime/Arguments.h2
-rw-r--r--Source/JavaScriptCore/runtime/IndexingHeaderInlineMethods.h4
-rw-r--r--Source/JavaScriptCore/runtime/JSCell.h11
-rw-r--r--Source/JavaScriptCore/runtime/JSGlobalObject.cpp1
-rw-r--r--Source/JavaScriptCore/runtime/JSNotAnObject.h2
-rw-r--r--Source/JavaScriptCore/runtime/JSObject.h38
-rw-r--r--Source/JavaScriptCore/runtime/JSString.h2
7 files changed, 27 insertions, 33 deletions
diff --git a/Source/JavaScriptCore/runtime/Arguments.h b/Source/JavaScriptCore/runtime/Arguments.h
index ad0e651ea..c9d0d503d 100644
--- a/Source/JavaScriptCore/runtime/Arguments.h
+++ b/Source/JavaScriptCore/runtime/Arguments.h
@@ -89,7 +89,7 @@ namespace JSC {
}
protected:
- static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
+ static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
void finishCreation(CallFrame*);
void finishCreation(CallFrame*, InlineCallFrame*);
diff --git a/Source/JavaScriptCore/runtime/IndexingHeaderInlineMethods.h b/Source/JavaScriptCore/runtime/IndexingHeaderInlineMethods.h
index 8d6e08256..e1d893b0b 100644
--- a/Source/JavaScriptCore/runtime/IndexingHeaderInlineMethods.h
+++ b/Source/JavaScriptCore/runtime/IndexingHeaderInlineMethods.h
@@ -34,7 +34,7 @@ namespace JSC {
inline size_t IndexingHeader::preCapacity(Structure* structure)
{
- if (LIKELY(!(structure->indexingType() & HasArrayStorage)))
+ if (LIKELY(!hasArrayStorage(structure->indexingType())))
return 0;
return arrayStorage()->m_indexBias;
@@ -42,7 +42,7 @@ inline size_t IndexingHeader::preCapacity(Structure* structure)
inline size_t IndexingHeader::indexingPayloadSizeInBytes(Structure* structure)
{
- if (LIKELY(!(structure->indexingType() & HasArrayStorage)))
+ if (LIKELY(!hasArrayStorage(structure->indexingType())))
return 0;
return ArrayStorage::sizeFor(arrayStorage()->vectorLength());
diff --git a/Source/JavaScriptCore/runtime/JSCell.h b/Source/JavaScriptCore/runtime/JSCell.h
index 94f08f31b..d6abcba99 100644
--- a/Source/JavaScriptCore/runtime/JSCell.h
+++ b/Source/JavaScriptCore/runtime/JSCell.h
@@ -33,6 +33,7 @@
#include "SlotVisitorInlineMethods.h"
#include "WriteBarrier.h"
#include <wtf/Noncopyable.h>
+#include <wtf/TypeTraits.h>
namespace JSC {
@@ -308,18 +309,10 @@ namespace JSC {
return isCell() ? asCell()->toObject(exec, globalObject) : toObjectSlowCase(exec, globalObject);
}
-#if COMPILER(CLANG)
template<class T>
struct NeedsDestructor {
- static const bool value = !__has_trivial_destructor(T);
+ static const bool value = !WTF::HasTrivialDestructor<T>::value;
};
-#else
- // Write manual specializations for this struct template if you care about non-clang compilers.
- template<class T>
- struct NeedsDestructor {
- static const bool value = true;
- };
-#endif
template<typename T>
void* allocateCell(Heap& heap)
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
index a6993aabc..27f68e55b 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
@@ -482,6 +482,7 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
visitor.append(&thisObject->m_nameScopeStructure);
visitor.append(&thisObject->m_argumentsStructure);
visitor.append(&thisObject->m_arrayStructure);
+ visitor.append(&thisObject->m_arrayStructureForSlowPut);
visitor.append(&thisObject->m_booleanObjectStructure);
visitor.append(&thisObject->m_callbackConstructorStructure);
visitor.append(&thisObject->m_callbackFunctionStructure);
diff --git a/Source/JavaScriptCore/runtime/JSNotAnObject.h b/Source/JavaScriptCore/runtime/JSNotAnObject.h
index 9980e4aab..3636c9bd4 100644
--- a/Source/JavaScriptCore/runtime/JSNotAnObject.h
+++ b/Source/JavaScriptCore/runtime/JSNotAnObject.h
@@ -62,7 +62,7 @@ namespace JSC {
private:
- static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSObject::StructureFlags;
+ static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | OverridesGetPropertyNames | JSObject::StructureFlags;
// JSValue methods
static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType);
diff --git a/Source/JavaScriptCore/runtime/JSObject.h b/Source/JavaScriptCore/runtime/JSObject.h
index 8b52915b6..bf2dae20d 100644
--- a/Source/JavaScriptCore/runtime/JSObject.h
+++ b/Source/JavaScriptCore/runtime/JSObject.h
@@ -505,6 +505,25 @@ namespace JSC {
// foo->attemptToInterceptPutByIndexOnHole(...);
bool attemptToInterceptPutByIndexOnHoleForPrototype(ExecState*, JSValue thisValue, unsigned propertyName, JSValue, bool shouldThrow);
+ // Ensure that the object is in a mode where it has array storage. Use
+ // this if you're about to perform actions that would have required the
+ // object to be converted to have array storage, if it didn't have it
+ // already.
+ ArrayStorage* ensureArrayStorage(JSGlobalData& globalData)
+ {
+ switch (structure()->indexingType()) {
+ case ALL_ARRAY_STORAGE_INDEXING_TYPES:
+ return m_butterfly->arrayStorage();
+
+ case ALL_BLANK_INDEXING_TYPES:
+ return createInitialArrayStorage(globalData);
+
+ default:
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
+ }
+
static size_t offsetOfInlineStorage();
static ptrdiff_t butterflyOffset()
@@ -565,25 +584,6 @@ namespace JSC {
}
}
- // Ensure that the object is in a mode where it has array storage. Use
- // this if you're about to perform actions that would have required the
- // object to be converted to have array storage, if it didn't have it
- // already.
- ArrayStorage* ensureArrayStorage(JSGlobalData& globalData)
- {
- switch (structure()->indexingType()) {
- case ALL_ARRAY_STORAGE_INDEXING_TYPES:
- return m_butterfly->arrayStorage();
-
- case ALL_BLANK_INDEXING_TYPES:
- return createInitialArrayStorage(globalData);
-
- default:
- ASSERT_NOT_REACHED();
- return 0;
- }
- }
-
ArrayStorage* createArrayStorage(JSGlobalData&, unsigned length, unsigned vectorLength);
ArrayStorage* createInitialArrayStorage(JSGlobalData&);
diff --git a/Source/JavaScriptCore/runtime/JSString.h b/Source/JavaScriptCore/runtime/JSString.h
index 7821b42b8..1500636f2 100644
--- a/Source/JavaScriptCore/runtime/JSString.h
+++ b/Source/JavaScriptCore/runtime/JSString.h
@@ -153,7 +153,7 @@ namespace JSC {
static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto)
{
- return Structure::create(globalData, globalObject, proto, TypeInfo(StringType, OverridesGetOwnPropertySlot), &s_info);
+ return Structure::create(globalData, globalObject, proto, TypeInfo(StringType, OverridesGetOwnPropertySlot | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero), &s_info);
}
static size_t offsetOfLength() { return OBJECT_OFFSETOF(JSString, m_length); }