diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/JavaScriptCore/runtime/JSAPIValueWrapper.h | |
parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSAPIValueWrapper.h')
-rw-r--r-- | Source/JavaScriptCore/runtime/JSAPIValueWrapper.h | 71 |
1 files changed, 35 insertions, 36 deletions
diff --git a/Source/JavaScriptCore/runtime/JSAPIValueWrapper.h b/Source/JavaScriptCore/runtime/JSAPIValueWrapper.h index 66e61c70d..e1f2cd804 100644 --- a/Source/JavaScriptCore/runtime/JSAPIValueWrapper.h +++ b/Source/JavaScriptCore/runtime/JSAPIValueWrapper.h @@ -30,51 +30,50 @@ namespace JSC { -class JSAPIValueWrapper : public JSCell { - friend JSValue jsAPIValueWrapper(ExecState*, JSValue); -public: - typedef JSCell Base; - static const unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal; + class JSAPIValueWrapper : public JSCell { + friend JSValue jsAPIValueWrapper(ExecState*, JSValue); + public: + typedef JSCell Base; - JSValue value() const { return m_value.get(); } + JSValue value() const { return m_value.get(); } - static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) - { - return Structure::create(vm, globalObject, prototype, TypeInfo(APIValueWrapperType, OverridesGetPropertyNames), info()); - } + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(APIValueWrapperType, OverridesVisitChildren | OverridesGetPropertyNames), info()); + } + + DECLARE_EXPORT_INFO; + + static JSAPIValueWrapper* create(ExecState* exec, JSValue value) + { + VM& vm = exec->vm(); + JSAPIValueWrapper* wrapper = new (NotNull, allocateCell<JSAPIValueWrapper>(vm.heap)) JSAPIValueWrapper(exec); + wrapper->finishCreation(vm, value); + return wrapper; + } - DECLARE_EXPORT_INFO; + protected: + void finishCreation(VM& vm, JSValue value) + { + Base::finishCreation(vm); + m_value.set(vm, this, value); + ASSERT(!value.isCell()); + } - static JSAPIValueWrapper* create(ExecState* exec, JSValue value) - { - VM& vm = exec->vm(); - JSAPIValueWrapper* wrapper = new (NotNull, allocateCell<JSAPIValueWrapper>(vm.heap)) JSAPIValueWrapper(exec); - wrapper->finishCreation(vm, value); - return wrapper; - } + private: + JSAPIValueWrapper(ExecState* exec) + : JSCell(exec->vm(), exec->vm().apiWrapperStructure.get()) + { + } -protected: - void finishCreation(VM& vm, JSValue value) - { - Base::finishCreation(vm); - m_value.set(vm, this, value); - ASSERT(!value.isCell()); - } + WriteBarrier<Unknown> m_value; + }; -private: - JSAPIValueWrapper(ExecState* exec) - : JSCell(exec->vm(), exec->vm().apiWrapperStructure.get()) + inline JSValue jsAPIValueWrapper(ExecState* exec, JSValue value) { + return JSAPIValueWrapper::create(exec, value); } - WriteBarrier<Unknown> m_value; -}; - -inline JSValue jsAPIValueWrapper(ExecState* exec, JSValue value) -{ - return JSAPIValueWrapper::create(exec, value); -} - } // namespace JSC #endif // JSAPIValueWrapper_h |