summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/JSCell.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-09-14 16:29:47 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-09-14 16:29:47 +0200
commitd0424a769059c84ae20beb3c217812792ea6726b (patch)
tree6f94a5c3db8c52c6694ee56498542a6c35417350 /Source/JavaScriptCore/runtime/JSCell.h
parent88a04ac016f57c2d78e714682445dff2e7db4ade (diff)
downloadqtwebkit-d0424a769059c84ae20beb3c217812792ea6726b.tar.gz
Imported WebKit commit 37c5e5041d39a14ea0d429a77ebd352e4bd26516 (http://svn.webkit.org/repository/webkit/trunk@128608)
New snapshot that enables WebKit2 build on Windows (still some bugs) and allows for WebKit to be built with qmake && make
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSCell.h')
-rw-r--r--Source/JavaScriptCore/runtime/JSCell.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/Source/JavaScriptCore/runtime/JSCell.h b/Source/JavaScriptCore/runtime/JSCell.h
index a63e08e33..94f08f31b 100644
--- a/Source/JavaScriptCore/runtime/JSCell.h
+++ b/Source/JavaScriptCore/runtime/JSCell.h
@@ -64,6 +64,7 @@ namespace JSC {
friend class JSValue;
friend class MarkedBlock;
template<typename T> friend void* allocateCell(Heap&);
+ template<typename T> friend void* allocateCell(Heap&, size_t);
public:
static const unsigned StructureFlags = 0;
@@ -137,7 +138,7 @@ namespace JSC {
{
return &m_structure;
}
-
+
#if ENABLE(GC_VALIDATION)
Structure* unvalidatedStructure() { return m_structure.unvalidatedGet(); }
#endif
@@ -155,6 +156,7 @@ namespace JSC {
// Dummy implementations of override-able static functions for classes to put in their MethodTable
static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType);
static NO_RETURN_DUE_TO_ASSERT void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
+ static NO_RETURN_DUE_TO_ASSERT void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
static NO_RETURN_DUE_TO_ASSERT void getPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
static String className(const JSObject*);
static bool hasInstance(JSObject*, ExecState*, JSValue, JSValue prototypeProperty);
@@ -337,6 +339,25 @@ namespace JSC {
return result;
}
+ template<typename T>
+ void* allocateCell(Heap& heap, size_t size)
+ {
+ ASSERT(size >= sizeof(T));
+#if ENABLE(GC_VALIDATION)
+ ASSERT(!heap.globalData()->isInitializingObject());
+ heap.globalData()->setInitializingObjectClass(&T::s_info);
+#endif
+ JSCell* result = 0;
+ if (NeedsDestructor<T>::value)
+ result = static_cast<JSCell*>(heap.allocateWithDestructor(size));
+ else {
+ ASSERT(T::s_info.methodTable.destroy == JSCell::destroy);
+ result = static_cast<JSCell*>(heap.allocateWithoutDestructor(size));
+ }
+ result->clearStructure();
+ return result;
+ }
+
inline bool isZapped(const JSCell* cell)
{
return cell->isZapped();