From 74951dfc70b13ec81d2e4170c88692f60eb95cf2 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Mon, 27 Oct 2014 13:39:37 -0700 Subject: [PATCH] Remove GarbageCollected support from the bindings This was the last complicated piece of removing platform/heap, the rest should be trivial to delete after removing :trace overrides and mass-renaming the various WillBe types to their old versions. R=abarth@chromium.org Review URL: https://codereview.chromium.org/683593002 --- engine/bindings/IDLExtendedAttributes.txt | 2 - engine/bindings/core/v8/V8DOMWrapper.h | 70 +----- engine/bindings/core/v8/WrapperTypeInfo.h | 42 +--- .../core/v8/custom/V8ArrayBufferCustom.cpp | 8 - .../core/v8/custom/V8ArrayBufferCustom.h | 1 - .../core/v8/custom/V8TypedArrayCustom.h | 10 - engine/bindings/scripts/code_generator_v8.py | 8 - .../compute_interfaces_info_overall.py | 2 - engine/bindings/scripts/v8_interface.py | 11 +- engine/bindings/scripts/v8_methods.py | 2 +- engine/bindings/scripts/v8_types.py | 48 +---- engine/bindings/scripts/v8_utilities.py | 10 - engine/bindings/templates/interface.cpp | 31 +-- engine/bindings/templates/interface.h | 13 -- engine/bindings/templates/interface_base.cpp | 2 +- .../tests/idls/TestCallbackInterface.idl | 3 - engine/bindings/tests/idls/TestDictionary.idl | 5 - .../idls/TestInterfaceGarbageCollected.idl | 11 - .../TestInterfaceWillBeGarbageCollected.idl | 38 ---- engine/bindings/tests/idls/TestObject.idl | 14 -- engine/core/animation/AnimationEffect.idl | 1 - engine/core/animation/AnimationNode.idl | 1 - engine/core/animation/AnimationPlayer.idl | 1 - engine/core/animation/AnimationTimeline.idl | 1 - engine/core/animation/Timing.idl | 1 - engine/core/css/CSS.idl | 1 - engine/core/css/CSSMatrix.idl | 1 - engine/core/css/CSSRule.idl | 1 - engine/core/css/CSSRuleList.idl | 1 - engine/core/css/CSSStyleDeclaration.idl | 1 - engine/core/css/CSSValue.idl | 1 - engine/core/css/FontFace.idl | 1 - engine/core/css/MediaList.idl | 1 - engine/core/css/MediaQueryList.idl | 1 - engine/core/css/RGBColor.idl | 1 - engine/core/css/Rect.idl | 1 - engine/core/css/StyleMedia.idl | 1 - engine/core/css/StyleSheet.idl | 1 - engine/core/css/StyleSheetList.idl | 1 - engine/core/dom/ClientRect.idl | 1 - engine/core/dom/ClientRectList.idl | 1 - engine/core/dom/DOMError.idl | 1 - engine/core/dom/DOMException.idl | 1 - engine/core/dom/DOMImplementation.idl | 1 - engine/core/dom/DOMStringList.idl | 1 - engine/core/dom/DOMTokenList.idl | 1 - engine/core/dom/MutationObserver.idl | 1 - engine/core/dom/MutationRecord.idl | 1 - engine/core/dom/NamedNodeMap.idl | 1 - engine/core/dom/NodeList.idl | 1 - engine/core/dom/Range.idl | 1 - engine/core/dom/Touch.idl | 1 - engine/core/dom/TouchList.idl | 1 - engine/core/dom/URL.idl | 1 - engine/core/editing/Selection.idl | 1 - engine/core/events/Event.idl | 1 - engine/core/events/EventTarget.idl | 1 - engine/core/frame/ConsoleBase.idl | 1 - engine/core/frame/History.idl | 1 - engine/core/frame/ImageBitmap.idl | 1 - engine/core/frame/Location.idl | 1 - engine/core/frame/Screen.idl | 1 - engine/core/frame/Window.idl | 1 - engine/core/html/ImageData.idl | 1 - engine/core/html/MediaError.idl | 1 - engine/core/html/MediaKeyError.idl | 1 - engine/core/html/TextMetrics.idl | 1 - engine/core/html/TimeRanges.idl | 1 - .../core/html/canvas/ANGLEInstancedArrays.idl | 1 - .../html/canvas/Canvas2DContextAttributes.idl | 1 - engine/core/html/canvas/CanvasGradient.idl | 1 - engine/core/html/canvas/CanvasPattern.idl | 1 - .../html/canvas/CanvasRenderingContext2D.idl | 1 - engine/core/html/canvas/EXTBlendMinMax.idl | 1 - engine/core/html/canvas/EXTFragDepth.idl | 1 - .../core/html/canvas/EXTShaderTextureLOD.idl | 1 - .../canvas/EXTTextureFilterAnisotropic.idl | 1 - .../core/html/canvas/OESElementIndexUint.idl | 1 - .../html/canvas/OESStandardDerivatives.idl | 1 - engine/core/html/canvas/OESTextureFloat.idl | 1 - .../html/canvas/OESTextureFloatLinear.idl | 1 - .../core/html/canvas/OESTextureHalfFloat.idl | 1 - .../html/canvas/OESTextureHalfFloatLinear.idl | 1 - .../core/html/canvas/OESVertexArrayObject.idl | 1 - engine/core/html/canvas/Path2D.idl | 1 - engine/core/html/canvas/WebGLActiveInfo.idl | 1 - engine/core/html/canvas/WebGLBuffer.idl | 1 - .../html/canvas/WebGLCompressedTextureATC.idl | 1 - .../canvas/WebGLCompressedTextureETC1.idl | 1 - .../canvas/WebGLCompressedTexturePVRTC.idl | 1 - .../canvas/WebGLCompressedTextureS3TC.idl | 1 - .../html/canvas/WebGLContextAttributes.idl | 1 - .../html/canvas/WebGLDebugRendererInfo.idl | 1 - engine/core/html/canvas/WebGLDebugShaders.idl | 1 - engine/core/html/canvas/WebGLDepthTexture.idl | 1 - engine/core/html/canvas/WebGLDrawBuffers.idl | 1 - engine/core/html/canvas/WebGLFramebuffer.idl | 1 - engine/core/html/canvas/WebGLLoseContext.idl | 1 - engine/core/html/canvas/WebGLProgram.idl | 1 - engine/core/html/canvas/WebGLRenderbuffer.idl | 1 - .../html/canvas/WebGLRenderingContext.idl | 1 - .../html/canvas/WebGLRenderingContextBase.idl | 1 - engine/core/html/canvas/WebGLShader.idl | 1 - .../canvas/WebGLShaderPrecisionFormat.idl | 1 - engine/core/html/canvas/WebGLTexture.idl | 1 - .../core/html/canvas/WebGLUniformLocation.idl | 1 - .../html/canvas/WebGLVertexArrayObjectOES.idl | 1 - engine/platform/heap/Handle.cpp | 64 ------ engine/platform/heap/Handle.h | 200 ------------------ engine/platform/heap/ThreadState.cpp | 44 ---- engine/platform/heap/ThreadState.h | 12 -- 111 files changed, 14 insertions(+), 724 deletions(-) delete mode 100644 engine/bindings/tests/idls/TestInterfaceGarbageCollected.idl delete mode 100644 engine/bindings/tests/idls/TestInterfaceWillBeGarbageCollected.idl diff --git a/engine/bindings/IDLExtendedAttributes.txt b/engine/bindings/IDLExtendedAttributes.txt index a18c2f5a194..c3e39b4b325 100644 --- a/engine/bindings/IDLExtendedAttributes.txt +++ b/engine/bindings/IDLExtendedAttributes.txt @@ -56,7 +56,6 @@ EnforceRange EventConstructor ExposeJSAccessors Exposed=* -GarbageCollected Global=|* Immutable ImplementedAs=* @@ -95,4 +94,3 @@ TreatUndefinedAs=NullString TypeChecking=Interface|Unrestricted URL Unforgeable -WillBeGarbageCollected diff --git a/engine/bindings/core/v8/V8DOMWrapper.h b/engine/bindings/core/v8/V8DOMWrapper.h index 63f2370caee..91492ba72c2 100644 --- a/engine/bindings/core/v8/V8DOMWrapper.h +++ b/engine/bindings/core/v8/V8DOMWrapper.h @@ -60,7 +60,6 @@ public: static v8::Handle associateObjectWithWrapperNonTemplate(Node*, const WrapperTypeInfo*, v8::Handle, v8::Isolate*); static void setNativeInfo(v8::Handle, const WrapperTypeInfo*, ScriptWrappableBase* internalPointer); static void setNativeInfoForHiddenWrapper(v8::Handle, const WrapperTypeInfo*, ScriptWrappableBase* internalPointer); - static void setNativeInfoWithPersistentHandle(v8::Handle, const WrapperTypeInfo*, ScriptWrappableBase* internalPointer, WrapperPersistentNode*); static void clearNativeInfo(v8::Handle, const WrapperTypeInfo*); static bool isDOMWrapper(v8::Handle); @@ -71,11 +70,6 @@ inline void V8DOMWrapper::setNativeInfo(v8::Handle wrapper, const Wr ASSERT(wrapper->InternalFieldCount() >= 2); ASSERT(internalPointer); ASSERT(wrapperTypeInfo); -#if ENABLE(OILPAN) - ASSERT(wrapperTypeInfo->gcType == WrapperTypeInfo::RefCountedObject); -#else - ASSERT(wrapperTypeInfo->gcType == WrapperTypeInfo::RefCountedObject || wrapperTypeInfo->gcType == WrapperTypeInfo::WillBeGarbageCollectedObject); -#endif wrapper->SetAlignedPointerInInternalField(v8DOMWrapperObjectIndex, internalPointer); wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, const_cast(wrapperTypeInfo)); } @@ -86,46 +80,15 @@ inline void V8DOMWrapper::setNativeInfoForHiddenWrapper(v8::Handle w ASSERT(wrapper->InternalFieldCount() >= 2); ASSERT(internalPointer); ASSERT(wrapperTypeInfo); -#if ENABLE(OILPAN) - ASSERT(wrapperTypeInfo->gcType != WrapperTypeInfo::RefCountedObject); -#else - ASSERT(wrapperTypeInfo->gcType == WrapperTypeInfo::RefCountedObject || wrapperTypeInfo->gcType == WrapperTypeInfo::WillBeGarbageCollectedObject); -#endif - - // Clear out the last internal field, which is assumed to contain a valid persistent pointer value. - if (wrapperTypeInfo->gcType == WrapperTypeInfo::GarbageCollectedObject) { - wrapper->SetAlignedPointerInInternalField(wrapper->InternalFieldCount() - 1, 0); - } else if (wrapperTypeInfo->gcType == WrapperTypeInfo::WillBeGarbageCollectedObject) { -#if ENABLE(OILPAN) - wrapper->SetAlignedPointerInInternalField(wrapper->InternalFieldCount() - 1, 0); -#endif - } wrapper->SetAlignedPointerInInternalField(v8DOMWrapperObjectIndex, internalPointer); wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, const_cast(wrapperTypeInfo)); } -inline void V8DOMWrapper::setNativeInfoWithPersistentHandle(v8::Handle wrapper, const WrapperTypeInfo* wrapperTypeInfo, ScriptWrappableBase* internalPointer, WrapperPersistentNode* handle) -{ - ASSERT(wrapper->InternalFieldCount() >= 3); - ASSERT(internalPointer); - ASSERT(wrapperTypeInfo); -#if ENABLE(OILPAN) - ASSERT(wrapperTypeInfo->gcType == WrapperTypeInfo::WillBeGarbageCollectedObject || wrapperTypeInfo->gcType == WrapperTypeInfo::GarbageCollectedObject); -#else - ASSERT(wrapperTypeInfo->gcType == WrapperTypeInfo::GarbageCollectedObject); -#endif - wrapper->SetAlignedPointerInInternalField(v8DOMWrapperObjectIndex, internalPointer); - wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, const_cast(wrapperTypeInfo)); - // Persistent handle is stored in the last internal field. - wrapper->SetAlignedPointerInInternalField(wrapper->InternalFieldCount() - 1, handle); -} - inline void V8DOMWrapper::clearNativeInfo(v8::Handle wrapper, const WrapperTypeInfo* wrapperTypeInfo) { ASSERT(wrapper->InternalFieldCount() >= 2); ASSERT(wrapperTypeInfo); // clearNativeInfo() is used only by NP objects, which are not garbage collected. - ASSERT(wrapperTypeInfo->gcType == WrapperTypeInfo::RefCountedObject); wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, const_cast(wrapperTypeInfo)); wrapper->SetAlignedPointerInInternalField(v8DOMWrapperObjectIndex, 0); } @@ -139,29 +102,10 @@ inline v8::Handle V8DOMWrapper::associateObjectWithWrapper(PassRefPt return wrapper; } -template -inline v8::Handle V8DOMWrapper::associateObjectWithWrapper(T* object, const WrapperTypeInfo* wrapperTypeInfo, v8::Handle wrapper, v8::Isolate* isolate) -{ - setNativeInfoWithPersistentHandle(wrapper, wrapperTypeInfo, V8T::toScriptWrappableBase(object), new WrapperPersistent(object)); - ASSERT(isDOMWrapper(wrapper)); - DOMDataStore::setWrapper(object, wrapper, isolate, wrapperTypeInfo); - return wrapper; -} - inline v8::Handle V8DOMWrapper::associateObjectWithWrapperNonTemplate(ScriptWrappable* impl, const WrapperTypeInfo* wrapperTypeInfo, v8::Handle wrapper, v8::Isolate* isolate) { wrapperTypeInfo->refObject(impl->toScriptWrappableBase()); -#if ENABLE(OILPAN) - if (wrapperTypeInfo->gcType == WrapperTypeInfo::RefCountedObject) - setNativeInfo(wrapper, wrapperTypeInfo, impl->toScriptWrappableBase()); - else - setNativeInfoWithPersistentHandle(wrapper, wrapperTypeInfo, impl->toScriptWrappableBase(), wrapperTypeInfo->createPersistentHandle(impl)); -#else - if (wrapperTypeInfo->gcType != WrapperTypeInfo::GarbageCollectedObject) - setNativeInfo(wrapper, wrapperTypeInfo, impl->toScriptWrappableBase()); - else - setNativeInfoWithPersistentHandle(wrapper, wrapperTypeInfo, impl->toScriptWrappableBase(), wrapperTypeInfo->createPersistentHandle(impl)); -#endif + setNativeInfo(wrapper, wrapperTypeInfo, impl->toScriptWrappableBase()); ASSERT(isDOMWrapper(wrapper)); DOMDataStore::setWrapperNonTemplate(impl, wrapper, isolate, wrapperTypeInfo); return wrapper; @@ -170,17 +114,7 @@ inline v8::Handle V8DOMWrapper::associateObjectWithWrapperNonTemplat inline v8::Handle V8DOMWrapper::associateObjectWithWrapperNonTemplate(Node* node, const WrapperTypeInfo* wrapperTypeInfo, v8::Handle wrapper, v8::Isolate* isolate) { wrapperTypeInfo->refObject(ScriptWrappable::fromObject(node)->toScriptWrappableBase()); -#if ENABLE(OILPAN) - if (wrapperTypeInfo->gcType == WrapperTypeInfo::RefCountedObject) - setNativeInfo(wrapper, wrapperTypeInfo, ScriptWrappable::fromObject(node)->toScriptWrappableBase()); - else - setNativeInfoWithPersistentHandle(wrapper, wrapperTypeInfo, ScriptWrappable::fromObject(node)->toScriptWrappableBase(), wrapperTypeInfo->createPersistentHandle(ScriptWrappable::fromObject(node))); -#else - if (wrapperTypeInfo->gcType != WrapperTypeInfo::GarbageCollectedObject) - setNativeInfo(wrapper, wrapperTypeInfo, ScriptWrappable::fromObject(node)->toScriptWrappableBase()); - else - setNativeInfoWithPersistentHandle(wrapper, wrapperTypeInfo, ScriptWrappable::fromObject(node)->toScriptWrappableBase(), wrapperTypeInfo->createPersistentHandle(ScriptWrappable::fromObject(node))); -#endif + setNativeInfo(wrapper, wrapperTypeInfo, ScriptWrappable::fromObject(node)->toScriptWrappableBase()); ASSERT(isDOMWrapper(wrapper)); DOMDataStore::setWrapperNonTemplate(node, wrapper, isolate, wrapperTypeInfo); return wrapper; diff --git a/engine/bindings/core/v8/WrapperTypeInfo.h b/engine/bindings/core/v8/WrapperTypeInfo.h index b1ca7b68477..32d499b8493 100644 --- a/engine/bindings/core/v8/WrapperTypeInfo.h +++ b/engine/bindings/core/v8/WrapperTypeInfo.h @@ -52,7 +52,6 @@ static const int v8PrototypeInternalFieldcount = 1; typedef v8::Handle (*DomTemplateFunction)(v8::Isolate*); typedef void (*RefObjectFunction)(ScriptWrappableBase* internalPointer); typedef void (*DerefObjectFunction)(ScriptWrappableBase* internalPointer); -typedef WrapperPersistentNode* (*CreatePersistentHandleFunction)(ScriptWrappableBase* internalPointer); typedef ActiveDOMObject* (*ToActiveDOMObjectFunction)(v8::Handle); typedef EventTarget* (*ToEventTargetFunction)(v8::Handle); typedef void (*ResolveWrapperReachabilityFunction)(ScriptWrappableBase* internalPointer, const v8::Persistent&, v8::Isolate*); @@ -83,12 +82,6 @@ struct WrapperTypeInfo { Independent, }; - enum GCType { - GarbageCollectedObject, - WillBeGarbageCollectedObject, - RefCountedObject, - }; - static const WrapperTypeInfo* unwrap(v8::Handle typeInfoWrapper) { return reinterpret_cast(v8::External::Cast(*typeInfoWrapper)->Value()); @@ -134,12 +127,6 @@ struct WrapperTypeInfo { derefObjectFunction(internalPointer); } - WrapperPersistentNode* createPersistentHandle(ScriptWrappableBase* internalPointer) const - { - ASSERT(createPersistentHandleFunction); - return createPersistentHandleFunction(internalPointer); - } - void installConditionallyEnabledMethods(v8::Handle prototypeTemplate, v8::Isolate* isolate) const { if (installConditionallyEnabledMethodsFunction) @@ -180,7 +167,6 @@ struct WrapperTypeInfo { const DomTemplateFunction domTemplateFunction; const RefObjectFunction refObjectFunction; const DerefObjectFunction derefObjectFunction; - const CreatePersistentHandleFunction createPersistentHandleFunction; const ToActiveDOMObjectFunction toActiveDOMObjectFunction; const ToEventTargetFunction toEventTargetFunction; const ResolveWrapperReachabilityFunction visitDOMWrapperFunction; @@ -190,7 +176,6 @@ struct WrapperTypeInfo { const WrapperTypePrototype wrapperTypePrototype; const WrapperClassId wrapperClassId; const Lifetime lifetime; - const GCType gcType; }; COMPILE_ASSERT(offsetof(struct WrapperTypeInfo, ginEmbedder) == offsetof(struct gin::WrapperInfo, embedder), wrapper_type_info_compatible_to_gin); @@ -226,34 +211,11 @@ inline const WrapperTypeInfo* toWrapperTypeInfo(v8::Handle wrapper) return getInternalField(wrapper); } -inline const WrapperPersistentNode* toPersistentHandle(const v8::Handle& wrapper) -{ - // Persistent handle is stored in the last internal field. - return static_cast(wrapper->GetAlignedPointerFromInternalField(wrapper->InternalFieldCount() - 1)); -} - inline void releaseObject(v8::Handle wrapper) { const WrapperTypeInfo* typeInfo = toWrapperTypeInfo(wrapper); - if (typeInfo->gcType == WrapperTypeInfo::GarbageCollectedObject) { - const WrapperPersistentNode* handle = toPersistentHandle(wrapper); - // This will be null iff a wrapper for a hidden wrapper object, - // see V8DOMWrapper::setNativeInfoForHiddenWrapper(). - delete handle; - } else if (typeInfo->gcType == WrapperTypeInfo::WillBeGarbageCollectedObject) { -#if ENABLE(OILPAN) - const WrapperPersistentNode* handle = toPersistentHandle(wrapper); - // This will be null iff a wrapper for a hidden wrapper object, - // see V8DOMWrapper::setNativeInfoForHiddenWrapper(). - delete handle; -#else - ASSERT(typeInfo->derefObjectFunction); - typeInfo->derefObjectFunction(toScriptWrappableBase(wrapper)); -#endif - } else { - ASSERT(typeInfo->derefObjectFunction); - typeInfo->derefObjectFunction(toScriptWrappableBase(wrapper)); - } + ASSERT(typeInfo->derefObjectFunction); + typeInfo->derefObjectFunction(toScriptWrappableBase(wrapper)); } } // namespace blink diff --git a/engine/bindings/core/v8/custom/V8ArrayBufferCustom.cpp b/engine/bindings/core/v8/custom/V8ArrayBufferCustom.cpp index 0503ece481b..0c9c229e208 100644 --- a/engine/bindings/core/v8/custom/V8ArrayBufferCustom.cpp +++ b/engine/bindings/core/v8/custom/V8ArrayBufferCustom.cpp @@ -50,12 +50,10 @@ const WrapperTypeInfo V8ArrayBuffer::wrapperTypeInfo = { 0, V8ArrayBuffer::refObject, V8ArrayBuffer::derefObject, - V8ArrayBuffer::createPersistentHandle, 0, 0, 0, 0, 0, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::Independent, - WrapperTypeInfo::RefCountedObject }; bool V8ArrayBuffer::hasInstance(v8::Handle value, v8::Isolate*) @@ -73,12 +71,6 @@ void V8ArrayBuffer::derefObject(ScriptWrappableBase* internalPointer) fromInternalPointer(internalPointer)->deref(); } -WrapperPersistentNode* V8ArrayBuffer::createPersistentHandle(ScriptWrappableBase* internalPointer) -{ - ASSERT_NOT_REACHED(); - return 0; -} - v8::Handle V8ArrayBuffer::createWrapper(PassRefPtr impl, v8::Handle creationContext, v8::Isolate* isolate) { ASSERT(impl.get()); diff --git a/engine/bindings/core/v8/custom/V8ArrayBufferCustom.h b/engine/bindings/core/v8/custom/V8ArrayBufferCustom.h index f960337ea1c..f090756b12d 100644 --- a/engine/bindings/core/v8/custom/V8ArrayBufferCustom.h +++ b/engine/bindings/core/v8/custom/V8ArrayBufferCustom.h @@ -56,7 +56,6 @@ public: static ArrayBuffer* toNativeWithTypeCheck(v8::Isolate*, v8::Handle); static void refObject(ScriptWrappableBase* internalPointer); static void derefObject(ScriptWrappableBase* internalPointer); - static WrapperPersistentNode* createPersistentHandle(ScriptWrappableBase* internalPointer); static const WrapperTypeInfo wrapperTypeInfo; static const int internalFieldCount = v8DefaultWrapperInternalFieldCount; diff --git a/engine/bindings/core/v8/custom/V8TypedArrayCustom.h b/engine/bindings/core/v8/custom/V8TypedArrayCustom.h index f024d6e8541..558efe8378e 100644 --- a/engine/bindings/core/v8/custom/V8TypedArrayCustom.h +++ b/engine/bindings/core/v8/custom/V8TypedArrayCustom.h @@ -56,7 +56,6 @@ public: static TypedArray* toNativeWithTypeCheck(v8::Isolate*, v8::Handle); static void refObject(ScriptWrappableBase* internalPointer); static void derefObject(ScriptWrappableBase* internalPointer); - static WrapperPersistentNode* createPersistentHandle(ScriptWrappableBase* internalPointer); static const WrapperTypeInfo wrapperTypeInfo; static const int internalFieldCount = v8DefaultWrapperInternalFieldCount; @@ -189,12 +188,10 @@ const WrapperTypeInfo V8TypedArray::wrapperTypeInfo = { 0, V8TypedArray::refObject, V8TypedArray::derefObject, - V8TypedArray::createPersistentHandle, 0, 0, 0, 0, 0, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::Independent, - WrapperTypeInfo::RefCountedObject }; template @@ -209,13 +206,6 @@ void V8TypedArray::derefObject(ScriptWrappableBase* internalPointer) fromInternalPointer(internalPointer)->deref(); } -template -WrapperPersistentNode* V8TypedArray::createPersistentHandle(ScriptWrappableBase* internalPointer) -{ - ASSERT_NOT_REACHED(); - return 0; -} - } // namespace blink #endif // V8TypedArrayCustom_h diff --git a/engine/bindings/scripts/code_generator_v8.py b/engine/bindings/scripts/code_generator_v8.py index 4677e0d8650..93e730b64e1 100644 --- a/engine/bindings/scripts/code_generator_v8.py +++ b/engine/bindings/scripts/code_generator_v8.py @@ -124,14 +124,6 @@ class CodeGeneratorBase(object): (interface_name, interface_info['implemented_as']) for interface_name, interface_info in interfaces_info.iteritems() if interface_info['implemented_as'])) - IdlType.set_garbage_collected_types(set( - interface_name - for interface_name, interface_info in interfaces_info.iteritems() - if 'GarbageCollected' in interface_info['inherited_extended_attributes'])) - IdlType.set_will_be_garbage_collected_types(set( - interface_name - for interface_name, interface_info in interfaces_info.iteritems() - if 'WillBeGarbageCollected' in interface_info['inherited_extended_attributes'])) v8_types.set_component_dirs(dict( (interface_name, interface_info['component_dir']) for interface_name, interface_info in interfaces_info.iteritems())) diff --git a/engine/bindings/scripts/compute_interfaces_info_overall.py b/engine/bindings/scripts/compute_interfaces_info_overall.py index 51cee60dc8c..0482dddeb3e 100755 --- a/engine/bindings/scripts/compute_interfaces_info_overall.py +++ b/engine/bindings/scripts/compute_interfaces_info_overall.py @@ -86,9 +86,7 @@ from utilities import read_pickle_files, write_pickle_file INHERITED_EXTENDED_ATTRIBUTES = set([ 'ActiveDOMObject', 'DependentLifetime', - 'GarbageCollected', 'NotScriptWrappable', - 'WillBeGarbageCollected', ]) # Main variable (filled in and exported) diff --git a/engine/bindings/scripts/v8_interface.py b/engine/bindings/scripts/v8_interface.py index 7fed1f06644..3638ac4fa6d 100644 --- a/engine/bindings/scripts/v8_interface.py +++ b/engine/bindings/scripts/v8_interface.py @@ -44,9 +44,9 @@ import v8_attributes from v8_globals import includes import v8_methods import v8_types -from v8_types import cpp_ptr_type, cpp_template_type +from v8_types import cpp_template_type import v8_utilities -from v8_utilities import (capitalize, conditional_string, cpp_name, gc_type, +from v8_utilities import (capitalize, conditional_string, cpp_name, has_extended_attribute_value, runtime_enabled_function_name, extended_attribute_value_as_list) @@ -151,14 +151,11 @@ def interface_context(interface): reachable_node_function or set_wrapper_reference_to_list) - this_gc_type = gc_type(interface) - wrapper_class_id = ('NodeClassId' if inherits_interface(interface.name, 'Node') else 'ObjectClassId') context = { 'conditional_string': conditional_string(interface), # [Conditional] 'cpp_class': cpp_name(interface), - 'gc_type': this_gc_type, # FIXME: Remove 'EventTarget' special handling, http://crbug.com/383699 'has_access_check_callbacks': (is_check_security and interface.name != 'Window' and @@ -186,7 +183,7 @@ def interface_context(interface): 'measure_as': v8_utilities.measure_as(interface), # [MeasureAs] 'parent_interface': parent_interface, 'pass_cpp_type': cpp_template_type( - cpp_ptr_type('PassRefPtr', 'RawPtr', this_gc_type), + 'PassRefPtr', cpp_name(interface)), 'reachable_node_function': reachable_node_function, 'runtime_enabled_function': runtime_enabled_function_name(interface), # [RuntimeEnabled] @@ -893,7 +890,7 @@ def constructor_context(interface, constructor): for index, argument in enumerate(constructor.arguments)], 'arguments_need_try_catch': arguments_need_try_catch, 'cpp_type': cpp_template_type( - cpp_ptr_type('RefPtr', 'RawPtr', gc_type(interface)), + 'RefPtr', cpp_name(interface)), 'cpp_value': v8_methods.cpp_value( interface, constructor, len(constructor.arguments)), diff --git a/engine/bindings/scripts/v8_methods.py b/engine/bindings/scripts/v8_methods.py index ae607695696..22a84f54cb2 100644 --- a/engine/bindings/scripts/v8_methods.py +++ b/engine/bindings/scripts/v8_methods.py @@ -259,7 +259,7 @@ def argument_context(interface, method, argument, index): 'v8_set_return_value': v8_set_return_value(interface.name, method, this_cpp_value), 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name, method, this_cpp_value, for_main_world=True), 'v8_value_to_local_cpp_value': v8_value_to_local_cpp_value(argument, index, return_promise=return_promise), - 'vector_type': v8_types.cpp_ptr_type('Vector', 'HeapVector', idl_type.gc_type), + 'vector_type': 'Vector', } diff --git a/engine/bindings/scripts/v8_types.py b/engine/bindings/scripts/v8_types.py index 4569322a9f5..7afc2305a4c 100644 --- a/engine/bindings/scripts/v8_types.py +++ b/engine/bindings/scripts/v8_types.py @@ -151,7 +151,7 @@ def cpp_type(idl_type, extended_attributes=None, raw_type=False, used_as_rvalue_ else: native_array_element_type = idl_type.native_array_element_type if native_array_element_type: - vector_type = cpp_ptr_type('Vector', 'HeapVector', native_array_element_type.gc_type) + vector_type = 'Vector' vector_template_type = cpp_template_type(vector_type, native_array_element_type.cpp_type_args(used_in_cpp_sequence=True)) if used_as_rvalue_type: return 'const %s&' % vector_template_type @@ -183,7 +183,7 @@ def cpp_type(idl_type, extended_attributes=None, raw_type=False, used_as_rvalue_ if raw_type: return implemented_as_class + '*' new_type = 'Member' if used_in_cpp_sequence else 'RawPtr' - ptr_type = cpp_ptr_type(('PassRefPtr' if used_as_rvalue_type else 'RefPtr'), new_type, idl_type.gc_type) + ptr_type = ('PassRefPtr' if used_as_rvalue_type else 'RefPtr') return cpp_template_type(ptr_type, implemented_as_class) # Default, assume native type is a pointer with same type name as idl type return base_idl_type + '*' @@ -245,16 +245,6 @@ def cpp_template_type(template, inner_type): return format_string.format(template=template, inner_type=inner_type) -def cpp_ptr_type(old_type, new_type, gc_type): - if gc_type == 'GarbageCollectedObject': - return new_type - if gc_type == 'WillBeGarbageCollectedObject': - if old_type == 'Vector': - return 'WillBe' + new_type - return old_type + 'WillBe' + new_type - return old_type - - def v8_type(interface_name): return 'V8' + interface_name @@ -284,38 +274,6 @@ IdlType.set_implemented_as_interfaces = classmethod( cls.implemented_as_interfaces.update(new_implemented_as_interfaces)) -# [GarbageCollected] -IdlType.garbage_collected_types = set() - -IdlType.is_garbage_collected = property( - lambda self: self.base_type in IdlType.garbage_collected_types) - -IdlType.set_garbage_collected_types = classmethod( - lambda cls, new_garbage_collected_types: - cls.garbage_collected_types.update(new_garbage_collected_types)) - - -# [WillBeGarbageCollected] -IdlType.will_be_garbage_collected_types = set() - -IdlType.is_will_be_garbage_collected = property( - lambda self: self.base_type in IdlType.will_be_garbage_collected_types) - -IdlType.set_will_be_garbage_collected_types = classmethod( - lambda cls, new_will_be_garbage_collected_types: - cls.will_be_garbage_collected_types.update(new_will_be_garbage_collected_types)) - - -def gc_type(idl_type): - if idl_type.is_garbage_collected: - return 'GarbageCollectedObject' - if idl_type.is_will_be_garbage_collected: - return 'WillBeGarbageCollectedObject' - return 'RefCountedObject' - -IdlTypeBase.gc_type = property(gc_type) - - ################################################################################ # Includes ################################################################################ @@ -507,7 +465,7 @@ def v8_value_to_cpp_value_array_or_sequence(native_array_element_type, v8_value, if (native_array_element_type.is_interface_type and native_array_element_type.name != 'Dictionary'): this_cpp_type = None - ref_ptr_type = cpp_ptr_type('RefPtr', 'Member', native_array_element_type.gc_type) + ref_ptr_type = 'RefPtr' expression_format = '(to{ref_ptr_type}NativeArray<{native_array_element_type}, V8{native_array_element_type}>({v8_value}, {index}, {isolate}))' add_includes_for_type(native_array_element_type) else: diff --git a/engine/bindings/scripts/v8_utilities.py b/engine/bindings/scripts/v8_utilities.py index 53f305819ba..61e144043f0 100644 --- a/engine/bindings/scripts/v8_utilities.py +++ b/engine/bindings/scripts/v8_utilities.py @@ -269,16 +269,6 @@ def expanded_exposure_set_for_interface(interface): return sorted(set(exposure_set)) -# [GarbageCollected], [WillBeGarbageCollected] -def gc_type(definition): - extended_attributes = definition.extended_attributes - if 'GarbageCollected' in extended_attributes: - return 'GarbageCollectedObject' - elif 'WillBeGarbageCollected' in extended_attributes: - return 'WillBeGarbageCollectedObject' - return 'RefCountedObject' - - # [ImplementedAs] def cpp_name(definition_or_member): extended_attributes = definition_or_member.extended_attributes diff --git a/engine/bindings/templates/interface.cpp b/engine/bindings/templates/interface.cpp index f48d54db4e8..3dd28364e55 100644 --- a/engine/bindings/templates/interface.cpp +++ b/engine/bindings/templates/interface.cpp @@ -497,7 +497,7 @@ static void {{cpp_class}}OriginSafeMethodSetterCallback(v8::Local na if is_active_dom_object else '0' %} {% set to_event_target = '%s::toEventTarget' % v8_class if is_event_target else '0' %} -const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedderBlink, {{v8_class}}Constructor::domTemplate, {{v8_class}}::refObject, {{v8_class}}::derefObject, {{v8_class}}::createPersistentHandle, {{to_active_dom_object}}, {{to_event_target}}, 0, {{v8_class}}::installConditionallyEnabledMethods, {{v8_class}}::installConditionallyEnabledProperties, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{lifetime}}, WrapperTypeInfo::{{gc_type}} }; +const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedderBlink, {{v8_class}}Constructor::domTemplate, {{v8_class}}::refObject, {{v8_class}}::derefObject, {{to_active_dom_object}}, {{to_event_target}}, 0, {{v8_class}}::installConditionallyEnabledMethods, {{v8_class}}::installConditionallyEnabledProperties, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{lifetime}} }; {{generate_constructor(named_constructor)}} v8::Handle {{v8_class}}Constructor::domTemplate(v8::Isolate* isolate) @@ -1208,41 +1208,12 @@ v8::Handle {{v8_class}}::createWrapper({{pass_cpp_type}} impl, v8::H void {{v8_class}}::refObject(ScriptWrappableBase* internalPointer) { -{% if gc_type == 'WillBeGarbageCollectedObject' %} -#if !ENABLE(OILPAN) fromInternalPointer(internalPointer)->ref(); -#endif -{% elif gc_type == 'RefCountedObject' %} - fromInternalPointer(internalPointer)->ref(); -{% endif %} } void {{v8_class}}::derefObject(ScriptWrappableBase* internalPointer) { -{% if gc_type == 'WillBeGarbageCollectedObject' %} -#if !ENABLE(OILPAN) fromInternalPointer(internalPointer)->deref(); -#endif -{% elif gc_type == 'RefCountedObject' %} - fromInternalPointer(internalPointer)->deref(); -{% endif %} -} - -WrapperPersistentNode* {{v8_class}}::createPersistentHandle(ScriptWrappableBase* internalPointer) -{ -{% if gc_type == 'GarbageCollectedObject' %} - return new WrapperPersistent<{{cpp_class}}>(fromInternalPointer(internalPointer)); -{% elif gc_type == 'WillBeGarbageCollectedObject' %} -#if ENABLE(OILPAN) - return new WrapperPersistent<{{cpp_class}}>(fromInternalPointer(internalPointer)); -#else - ASSERT_NOT_REACHED(); - return 0; -#endif -{% elif gc_type == 'RefCountedObject' %} - ASSERT_NOT_REACHED(); - return 0; -{% endif %} } template<> diff --git a/engine/bindings/templates/interface.h b/engine/bindings/templates/interface.h index f28c422ab5d..424d9886117 100644 --- a/engine/bindings/templates/interface.h +++ b/engine/bindings/templates/interface.h @@ -53,7 +53,6 @@ public: static const WrapperTypeInfo wrapperTypeInfo; static void refObject(ScriptWrappableBase* internalPointer); static void derefObject(ScriptWrappableBase* internalPointer); - static WrapperPersistentNode* createPersistentHandle(ScriptWrappableBase* internalPointer); {% if has_visit_dom_wrapper %} static void visitDOMWrapper(ScriptWrappableBase* internalPointer, const v8::Persistent&, v8::Isolate*); {% endif %} @@ -134,19 +133,7 @@ public: FIXME: Remove this internal field, and share one field for either: * a persistent handle (if the object is in oilpan) or * a C++ pointer to the DOM object (if the object is not in oilpan) #} - {% if gc_type == 'GarbageCollectedObject' %} - static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}}; - static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}} + 1; - {% elif gc_type == 'WillBeGarbageCollectedObject' %} -#if ENABLE(OILPAN) - static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}}; - static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}} + 1; -#else static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}}; -#endif - {% elif gc_type == 'RefCountedObject' %} - static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}}; - {% endif %} {# End custom internal fields #} static inline ScriptWrappableBase* toScriptWrappableBase({{cpp_class}}* impl) { diff --git a/engine/bindings/templates/interface_base.cpp b/engine/bindings/templates/interface_base.cpp index 747b8eb6483..ac665d6d39f 100644 --- a/engine/bindings/templates/interface_base.cpp +++ b/engine/bindings/templates/interface_base.cpp @@ -24,7 +24,7 @@ namespace blink { {% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception else 'WrapperTypeObjectPrototype' %} -const WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{v8_class}}::domTemplate, {{v8_class}}::refObject, {{v8_class}}::derefObject, {{v8_class}}::createPersistentHandle, {{to_active_dom_object}}, {{to_event_target}}, {{visit_dom_wrapper}}, {{v8_class}}::installConditionallyEnabledMethods, {{v8_class}}::installConditionallyEnabledProperties, {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_prototype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{lifetime}}, WrapperTypeInfo::{{gc_type}} }; +const WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{v8_class}}::domTemplate, {{v8_class}}::refObject, {{v8_class}}::derefObject, {{to_active_dom_object}}, {{to_event_target}}, {{visit_dom_wrapper}}, {{v8_class}}::installConditionallyEnabledMethods, {{v8_class}}::installConditionallyEnabledProperties, {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_prototype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{lifetime}} }; {% if is_script_wrappable %} // This static member must be declared by DEFINE_WRAPPERTYPEINFO in {{cpp_class}}.h. diff --git a/engine/bindings/tests/idls/TestCallbackInterface.idl b/engine/bindings/tests/idls/TestCallbackInterface.idl index cebfa19dfda..283ffb24789 100644 --- a/engine/bindings/tests/idls/TestCallbackInterface.idl +++ b/engine/bindings/tests/idls/TestCallbackInterface.idl @@ -36,7 +36,4 @@ callback interface TestCallbackInterface { void voidMethodTestInterfaceEmptyStringArg(TestInterfaceEmpty testInterfaceEmptyArg, DOMString stringArg); [CallWith=ThisValue] void callbackWithThisValueVoidMethodStringArg(DOMString stringArg); [Custom] void customVoidMethodTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg); - // [WillBeGarbageCollected] - void voidMethodWillBeGarbageCollectedSequenceArg(sequence sequenceArg); - void voidMethodWillBeGarbageCollectedArrayArg(TestInterfaceWillBeGarbageCollected[] arrayArg); }; diff --git a/engine/bindings/tests/idls/TestDictionary.idl b/engine/bindings/tests/idls/TestDictionary.idl index a05f0b8432d..10eff727905 100644 --- a/engine/bindings/tests/idls/TestDictionary.idl +++ b/engine/bindings/tests/idls/TestDictionary.idl @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. [ - GarbageCollected, ] dictionary TestDictionary { boolean booleanMember; long longMember = 1; @@ -11,10 +10,6 @@ double? doubleOrNullMember = null; DOMString? stringOrNullMember = "default string value"; TestInterface? testInterfaceOrNullMember; - TestInterfaceGarbageCollected testInterfaceGarbageCollectedMember; - TestInterfaceGarbageCollected? testInterfaceGarbageCollectedOrNullMember; - TestInterfaceWillBeGarbageCollected testInterfaceWillBeGarbageCollectedMember; - TestInterfaceWillBeGarbageCollected? testInterfaceWillBeGarbageCollectedOrNullMember; DOMString[] stringArrayMember; sequence stringSequenceMember; }; diff --git a/engine/bindings/tests/idls/TestInterfaceGarbageCollected.idl b/engine/bindings/tests/idls/TestInterfaceGarbageCollected.idl deleted file mode 100644 index 55739a3da08..00000000000 --- a/engine/bindings/tests/idls/TestInterfaceGarbageCollected.idl +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -[ - Constructor(DOMString str), - GarbageCollected, -] interface TestInterfaceGarbageCollected : EventTarget { // Inherit from EventTarget to test order of internal fields - attribute TestInterfaceGarbageCollected attr1; - void func(TestInterfaceGarbageCollected arg); -}; diff --git a/engine/bindings/tests/idls/TestInterfaceWillBeGarbageCollected.idl b/engine/bindings/tests/idls/TestInterfaceWillBeGarbageCollected.idl deleted file mode 100644 index be955b036e9..00000000000 --- a/engine/bindings/tests/idls/TestInterfaceWillBeGarbageCollected.idl +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - Constructor(DOMString str), - NamedConstructor=TestInterface(DOMString str), - WillBeGarbageCollected, -] interface TestInterfaceWillBeGarbageCollected : EventTarget { // Inherit from EventTarget to test order of internal fields - attribute TestInterfaceWillBeGarbageCollected attr1; - void func(TestInterfaceWillBeGarbageCollected arg); -}; diff --git a/engine/bindings/tests/idls/TestObject.idl b/engine/bindings/tests/idls/TestObject.idl index e6048cf556f..f387527ea75 100644 --- a/engine/bindings/tests/idls/TestObject.idl +++ b/engine/bindings/tests/idls/TestObject.idl @@ -186,8 +186,6 @@ interface TestObject { [PutForwards=hrefByteString] readonly attribute TestNode locationByteString; [PerWorldBindings, PutForwards=href] readonly attribute TestNode locationWithPerWorldBindings; [TypeChecking=Interface, PutForwards=href] readonly attribute TestNode locationTypeCheckingInterface; - [PutForwards=attr1] readonly attribute TestInterfaceGarbageCollected locationGarbageCollected; - [PutForwards=attr1] readonly attribute TestInterfaceWillBeGarbageCollected locationWillBeGarbageCollected; [RaisesException] attribute long raisesExceptionLongAttribute; [RaisesException=Getter] attribute long raisesExceptionGetterLongAttribute; [RaisesException=Setter] attribute long setterRaisesExceptionLongAttribute; @@ -337,8 +335,6 @@ interface TestObject { TestInterface? nullableTestInterfaceMethod(); sequence? nullableLongSequenceMethod(); // Union types - (TestInterfaceGarbageCollected or DOMString) testInterfaceGarbageCollectedOrDOMStringMethod(); - (TestInterfaceWillBeGarbageCollected or TestDictionary) testInterfaceWillBeGarbageCollectedOrTestDictionaryMethod(); (sequence or DOMString[] or unrestricted double) longSequenceOrDOMStringArrayOrUnrestrictedDoubleMethod(); // Currently only used on interface type arguments void voidMethodTestInterfaceEmptyOrNullArg(TestInterfaceEmpty? nullableTestInterfaceEmptyArg); @@ -395,8 +391,6 @@ interface TestObject { void voidMethodStringArgVariadicStringArg(DOMString stringArg, DOMString... variadicStringArgs); void voidMethodVariadicTestInterfaceEmptyArg(TestInterfaceEmpty... variadicTestInterfaceEmptyArgs); void voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg, TestInterfaceEmpty... variadicTestInterfaceEmptyArgs); - void voidMethodVariadicTestInterfaceGarbageCollectedArg(TestInterfaceGarbageCollected... variadicTestInterfaceGarbageCollectedArg); - void voidMethodVariadicTestInterfaceWillBeGarbageCollectedArg(TestInterfaceWillBeGarbageCollected... variadicTestInterfaceWillBeGarbageCollectedArg); // Overloaded methods void overloadedMethodA(long longArg); @@ -502,18 +496,10 @@ interface TestObject { [TypeChecking=Interface] void typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArg(TestInterfaceEmpty... testInterfaceEmptyArg); [TypeChecking=Unrestricted] void typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg(float floatArg, double doubleArg); [Unforgeable] void unforgeableVoidMethod(); - void voidMethodTestInterfaceGarbageCollectedSequenceArg(sequence testInterfaceGarbageCollectedSequenceArg); - void voidMethodTestInterfaceGarbageCollectedArrayArg(TestInterfaceGarbageCollected[] testInterfaceGarbageCollectedArrayArg); - void voidMethodTestInterfaceWillBeGarbageCollectedSequenceArg(sequence testInterfaceWillBeGarbageCollectedSequenceArg); - void voidMethodTestInterfaceWillBeGarbageCollectedArrayArg(TestInterfaceWillBeGarbageCollected[] testInterfaceWillBeGarbageCollectedArrayArg); // Extended attributes on referenced interfaces // (not self; self-reference tests at interface themselves) attribute TestInterface testInterfaceAttribute; // [ImplementedAs] - attribute TestInterfaceGarbageCollected testInterfaceGarbageCollectedAttribute; // [GarbageCollected] - attribute TestInterfaceGarbageCollected? testInterfaceGarbageCollectedOrNullAttribute; // [GarbageCollected] - attribute TestInterfaceWillBeGarbageCollected testInterfaceWillBeGarbageCollectedAttribute; // [WillBeGarbageCollected] - attribute TestInterfaceWillBeGarbageCollected? testInterfaceWillBeGarbageCollectedOrNullAttribute; // [WillBeGarbageCollected] // Private scripts [ImplementedInPrivateScript] void voidMethodImplementedInPrivateScript(); diff --git a/engine/core/animation/AnimationEffect.idl b/engine/core/animation/AnimationEffect.idl index f5dc6ce2f57..db0fc6ff289 100644 --- a/engine/core/animation/AnimationEffect.idl +++ b/engine/core/animation/AnimationEffect.idl @@ -5,6 +5,5 @@ [ RuntimeEnabled=WebAnimationsAPI, NoInterfaceObject, - WillBeGarbageCollected ] interface AnimationEffect { }; diff --git a/engine/core/animation/AnimationNode.idl b/engine/core/animation/AnimationNode.idl index c04ede67dfc..e9313131cde 100644 --- a/engine/core/animation/AnimationNode.idl +++ b/engine/core/animation/AnimationNode.idl @@ -30,7 +30,6 @@ [ RuntimeEnabled=WebAnimationsAPI, - WillBeGarbageCollected, ] interface AnimationNode { // Playback state readonly attribute double? localTime; diff --git a/engine/core/animation/AnimationPlayer.idl b/engine/core/animation/AnimationPlayer.idl index 2783ce85cd1..38f357e7748 100644 --- a/engine/core/animation/AnimationPlayer.idl +++ b/engine/core/animation/AnimationPlayer.idl @@ -30,7 +30,6 @@ [ NoInterfaceObject, - WillBeGarbageCollected, ActiveDOMObject, ] interface AnimationPlayer : EventTarget { [RuntimeEnabled=WebAnimationsAPI] attribute AnimationNode? source; diff --git a/engine/core/animation/AnimationTimeline.idl b/engine/core/animation/AnimationTimeline.idl index 31b1648da19..1ca2b87ada3 100644 --- a/engine/core/animation/AnimationTimeline.idl +++ b/engine/core/animation/AnimationTimeline.idl @@ -4,7 +4,6 @@ [ RuntimeEnabled=WebAnimationsAPI, - WillBeGarbageCollected, ] interface AnimationTimeline { readonly attribute double? currentTime; AnimationPlayer play(AnimationNode source); diff --git a/engine/core/animation/Timing.idl b/engine/core/animation/Timing.idl index 1bb3198c610..84a0120a1f4 100644 --- a/engine/core/animation/Timing.idl +++ b/engine/core/animation/Timing.idl @@ -5,7 +5,6 @@ [ RuntimeEnabled=WebAnimationsAPI, ImplementedAs=AnimationNodeTiming, - WillBeGarbageCollected, ] interface Timing { attribute double delay; attribute double endDelay; diff --git a/engine/core/css/CSS.idl b/engine/core/css/CSS.idl index 36fe6dacce8..95be79b51af 100644 --- a/engine/core/css/CSS.idl +++ b/engine/core/css/CSS.idl @@ -30,7 +30,6 @@ [ NoInterfaceObject, ImplementedAs=DOMWindowCSS, - WillBeGarbageCollected ] interface CSS { boolean supports(DOMString property, DOMString value); boolean supports(DOMString conditionText); diff --git a/engine/core/css/CSSMatrix.idl b/engine/core/css/CSSMatrix.idl index 8721ece5729..1507a784754 100644 --- a/engine/core/css/CSSMatrix.idl +++ b/engine/core/css/CSSMatrix.idl @@ -28,7 +28,6 @@ Constructor(optional DOMString cssValue = null), ImplementedAs=CSSMatrix, RaisesException=Constructor, - WillBeGarbageCollected ] interface CSSMatrix { // These attributes are simple aliases for certain elements of the 4x4 matrix diff --git a/engine/core/css/CSSRule.idl b/engine/core/css/CSSRule.idl index 15356e0cfa7..09bb91cae60 100644 --- a/engine/core/css/CSSRule.idl +++ b/engine/core/css/CSSRule.idl @@ -23,7 +23,6 @@ Custom=Wrap, DependentLifetime, NotScriptWrappable, - WillBeGarbageCollected, ] interface CSSRule { // RuleType diff --git a/engine/core/css/CSSRuleList.idl b/engine/core/css/CSSRuleList.idl index 35fb40069fe..28a295222b4 100644 --- a/engine/core/css/CSSRuleList.idl +++ b/engine/core/css/CSSRuleList.idl @@ -26,7 +26,6 @@ // Introduced in DOM Level 2: [ DependentLifetime, - WillBeGarbageCollected, ] interface CSSRuleList { readonly attribute unsigned long length; getter CSSRule item(unsigned long index); diff --git a/engine/core/css/CSSStyleDeclaration.idl b/engine/core/css/CSSStyleDeclaration.idl index 0047acfc14b..c36916739c0 100644 --- a/engine/core/css/CSSStyleDeclaration.idl +++ b/engine/core/css/CSSStyleDeclaration.idl @@ -21,7 +21,6 @@ // Introduced in DOM Level 2: [ DependentLifetime, - WillBeGarbageCollected ] interface CSSStyleDeclaration { [RaisesException=Setter] attribute DOMString? cssText; diff --git a/engine/core/css/CSSValue.idl b/engine/core/css/CSSValue.idl index 3f33813ca59..4405aaeac58 100644 --- a/engine/core/css/CSSValue.idl +++ b/engine/core/css/CSSValue.idl @@ -22,7 +22,6 @@ Custom=Wrap, DependentLifetime, NotScriptWrappable, - WillBeGarbageCollected, ] interface CSSValue { // UnitTypes diff --git a/engine/core/css/FontFace.idl b/engine/core/css/FontFace.idl index af6720ffca4..c6714e202fe 100644 --- a/engine/core/css/FontFace.idl +++ b/engine/core/css/FontFace.idl @@ -43,7 +43,6 @@ enum FontFaceLoadStatus { Constructor(DOMString family, ArrayBuffer source, optional Dictionary descriptors), Constructor(DOMString family, ArrayBufferView source, optional Dictionary descriptors), ConstructorCallWith=ExecutionContext, - WillBeGarbageCollected, ] interface FontFace { [RaisesException=Setter, SetterCallWith=ExecutionContext] attribute DOMString family; diff --git a/engine/core/css/MediaList.idl b/engine/core/css/MediaList.idl index cae0768d347..5c52c76d9d4 100644 --- a/engine/core/css/MediaList.idl +++ b/engine/core/css/MediaList.idl @@ -25,7 +25,6 @@ // Introduced in DOM Level 2: [ - WillBeGarbageCollected ] interface MediaList { attribute DOMString? mediaText; diff --git a/engine/core/css/MediaQueryList.idl b/engine/core/css/MediaQueryList.idl index 8bd02419267..8418e4a4443 100644 --- a/engine/core/css/MediaQueryList.idl +++ b/engine/core/css/MediaQueryList.idl @@ -21,7 +21,6 @@ [ ActiveDOMObject, NoInterfaceObject, - WillBeGarbageCollected ] interface MediaQueryList : EventTarget { readonly attribute DOMString media; readonly attribute boolean matches; diff --git a/engine/core/css/RGBColor.idl b/engine/core/css/RGBColor.idl index 81ae393315e..19b22f16d32 100644 --- a/engine/core/css/RGBColor.idl +++ b/engine/core/css/RGBColor.idl @@ -20,7 +20,6 @@ [ NotScriptWrappable, - WillBeGarbageCollected ] interface RGBColor { readonly attribute CSSPrimitiveValue red; readonly attribute CSSPrimitiveValue green; diff --git a/engine/core/css/Rect.idl b/engine/core/css/Rect.idl index dbf1b369799..1076addd190 100644 --- a/engine/core/css/Rect.idl +++ b/engine/core/css/Rect.idl @@ -19,7 +19,6 @@ [ NotScriptWrappable, - WillBeGarbageCollected ] interface Rect { readonly attribute CSSPrimitiveValue top; readonly attribute CSSPrimitiveValue right; diff --git a/engine/core/css/StyleMedia.idl b/engine/core/css/StyleMedia.idl index b897eb0690b..101bce1518f 100644 --- a/engine/core/css/StyleMedia.idl +++ b/engine/core/css/StyleMedia.idl @@ -26,7 +26,6 @@ [ NoInterfaceObject, - WillBeGarbageCollected ] interface StyleMedia { readonly attribute DOMString type; boolean matchMedium([Default=Undefined] optional DOMString mediaquery); diff --git a/engine/core/css/StyleSheet.idl b/engine/core/css/StyleSheet.idl index 5b94241d5b4..4bed8e12907 100644 --- a/engine/core/css/StyleSheet.idl +++ b/engine/core/css/StyleSheet.idl @@ -22,7 +22,6 @@ [ Custom=Wrap, SetWrapperReferenceFrom=ownerNode, - WillBeGarbageCollected ] interface StyleSheet { readonly attribute DOMString? type; readonly attribute Node ownerNode; diff --git a/engine/core/css/StyleSheetList.idl b/engine/core/css/StyleSheetList.idl index 3da2d91e544..104a387625e 100644 --- a/engine/core/css/StyleSheetList.idl +++ b/engine/core/css/StyleSheetList.idl @@ -21,7 +21,6 @@ // Introduced in DOM Level 2: [ SetWrapperReferenceFrom=document, - WillBeGarbageCollected ] interface StyleSheetList { readonly attribute unsigned long length; getter StyleSheet item(unsigned long index); diff --git a/engine/core/dom/ClientRect.idl b/engine/core/dom/ClientRect.idl index 4fae5d7f938..ffdcfdddeb3 100644 --- a/engine/core/dom/ClientRect.idl +++ b/engine/core/dom/ClientRect.idl @@ -25,7 +25,6 @@ */ [ - WillBeGarbageCollected, ] interface ClientRect { readonly attribute float top; readonly attribute float right; diff --git a/engine/core/dom/ClientRectList.idl b/engine/core/dom/ClientRectList.idl index bf1454225c6..7f6b1988c79 100644 --- a/engine/core/dom/ClientRectList.idl +++ b/engine/core/dom/ClientRectList.idl @@ -25,7 +25,6 @@ */ [ - WillBeGarbageCollected, ] interface ClientRectList { readonly attribute unsigned long length; getter ClientRect item(unsigned long index); diff --git a/engine/core/dom/DOMError.idl b/engine/core/dom/DOMError.idl index aba4e7a6c51..48d6caa8910 100644 --- a/engine/core/dom/DOMError.idl +++ b/engine/core/dom/DOMError.idl @@ -27,7 +27,6 @@ */ [ Constructor(DOMString name, optional DOMString message = null), - WillBeGarbageCollected ] interface DOMError { readonly attribute DOMString name; readonly attribute DOMString message; diff --git a/engine/core/dom/DOMException.idl b/engine/core/dom/DOMException.idl index 9b82f33e55d..2fc164919cb 100644 --- a/engine/core/dom/DOMException.idl +++ b/engine/core/dom/DOMException.idl @@ -28,7 +28,6 @@ [ DoNotCheckConstants, - WillBeGarbageCollected, ] exception DOMException { readonly attribute unsigned short code; diff --git a/engine/core/dom/DOMImplementation.idl b/engine/core/dom/DOMImplementation.idl index 2985b29b8ca..4443150e979 100644 --- a/engine/core/dom/DOMImplementation.idl +++ b/engine/core/dom/DOMImplementation.idl @@ -20,7 +20,6 @@ [ SetWrapperReferenceFrom=document, - WillBeGarbageCollected, ] interface DOMImplementation { Document createDocument(); }; diff --git a/engine/core/dom/DOMStringList.idl b/engine/core/dom/DOMStringList.idl index 8a570878796..06e7f3e7df5 100644 --- a/engine/core/dom/DOMStringList.idl +++ b/engine/core/dom/DOMStringList.idl @@ -24,7 +24,6 @@ */ [ - WillBeGarbageCollected, ] interface DOMStringList { readonly attribute unsigned long length; [TreatReturnedNullStringAs=Null] getter DOMString item([Default=Undefined] optional unsigned long index); diff --git a/engine/core/dom/DOMTokenList.idl b/engine/core/dom/DOMTokenList.idl index 19476405d8d..43ecc00d67c 100644 --- a/engine/core/dom/DOMTokenList.idl +++ b/engine/core/dom/DOMTokenList.idl @@ -24,7 +24,6 @@ [ SetWrapperReferenceFrom=element, - WillBeGarbageCollected, ] interface DOMTokenList { readonly attribute unsigned long length; [TreatReturnedNullStringAs=Null] getter DOMString item(unsigned long index); diff --git a/engine/core/dom/MutationObserver.idl b/engine/core/dom/MutationObserver.idl index 2c6d142f8f8..5d300995dd3 100644 --- a/engine/core/dom/MutationObserver.idl +++ b/engine/core/dom/MutationObserver.idl @@ -31,7 +31,6 @@ [ CustomConstructor(MutationCallback callback), Custom=VisitDOMWrapper, - WillBeGarbageCollected, ] interface MutationObserver { [RaisesException] void observe(Node target, Dictionary options); sequence takeRecords(); diff --git a/engine/core/dom/MutationRecord.idl b/engine/core/dom/MutationRecord.idl index 9c32766c33d..67096efcf81 100644 --- a/engine/core/dom/MutationRecord.idl +++ b/engine/core/dom/MutationRecord.idl @@ -29,7 +29,6 @@ */ [ - WillBeGarbageCollected, ] interface MutationRecord { readonly attribute DOMString type; readonly attribute Node target; diff --git a/engine/core/dom/NamedNodeMap.idl b/engine/core/dom/NamedNodeMap.idl index b53d748c3e4..e443b7ebf55 100644 --- a/engine/core/dom/NamedNodeMap.idl +++ b/engine/core/dom/NamedNodeMap.idl @@ -20,7 +20,6 @@ [ SetWrapperReferenceFrom=element, - WillBeGarbageCollected, ] interface NamedNodeMap { [NotEnumerable, ImplementedAs=getNamedItem] getter Attr ([Default=Undefined] optional DOMString name); getter Attr item([Default=Undefined] optional unsigned long index); diff --git a/engine/core/dom/NodeList.idl b/engine/core/dom/NodeList.idl index 66cc82045c8..b6f81a1c299 100644 --- a/engine/core/dom/NodeList.idl +++ b/engine/core/dom/NodeList.idl @@ -21,7 +21,6 @@ [ DependentLifetime, SetWrapperReferenceFrom=virtualOwnerNode, - WillBeGarbageCollected, ] interface NodeList { getter Node item(unsigned long index); readonly attribute unsigned long length; diff --git a/engine/core/dom/Range.idl b/engine/core/dom/Range.idl index b34f8ef9cc0..eaf87dc6162 100644 --- a/engine/core/dom/Range.idl +++ b/engine/core/dom/Range.idl @@ -22,7 +22,6 @@ [ Constructor, ConstructorCallWith=Document, - WillBeGarbageCollected, ] interface Range { readonly attribute Node startContainer; diff --git a/engine/core/dom/Touch.idl b/engine/core/dom/Touch.idl index 68895a950a5..8f359580029 100644 --- a/engine/core/dom/Touch.idl +++ b/engine/core/dom/Touch.idl @@ -24,7 +24,6 @@ */ [ - WillBeGarbageCollected, ] interface Touch { readonly attribute double clientX; readonly attribute double clientY; diff --git a/engine/core/dom/TouchList.idl b/engine/core/dom/TouchList.idl index 516946de775..8ef19cbd7d9 100644 --- a/engine/core/dom/TouchList.idl +++ b/engine/core/dom/TouchList.idl @@ -24,7 +24,6 @@ */ [ - WillBeGarbageCollected, ] interface TouchList { readonly attribute unsigned long length; diff --git a/engine/core/dom/URL.idl b/engine/core/dom/URL.idl index 12ba7cae2b0..bf0edcd884b 100644 --- a/engine/core/dom/URL.idl +++ b/engine/core/dom/URL.idl @@ -32,7 +32,6 @@ Constructor(ScalarValueString url, URL base), ImplementedAs=DOMURL, RaisesException=Constructor, - WillBeGarbageCollected, ] interface URL { }; diff --git a/engine/core/editing/Selection.idl b/engine/core/editing/Selection.idl index 24d324065ac..53bb18bbd2c 100644 --- a/engine/core/editing/Selection.idl +++ b/engine/core/editing/Selection.idl @@ -37,7 +37,6 @@ // http://crbug.com/391673 [ ImplementedAs=DOMSelection, - WillBeGarbageCollected, ] interface Selection { readonly attribute Node anchorNode; readonly attribute long anchorOffset; diff --git a/engine/core/events/Event.idl b/engine/core/events/Event.idl index a829df37386..b29adea94ef 100644 --- a/engine/core/events/Event.idl +++ b/engine/core/events/Event.idl @@ -20,7 +20,6 @@ // Introduced in DOM Level 2: [ - WillBeGarbageCollected, Custom=Wrap, EventConstructor, ] interface Event { diff --git a/engine/core/events/EventTarget.idl b/engine/core/events/EventTarget.idl index eacdc4e30d8..51b10099d72 100644 --- a/engine/core/events/EventTarget.idl +++ b/engine/core/events/EventTarget.idl @@ -21,7 +21,6 @@ [ CheckSecurity=Window, Custom=ToV8, - WillBeGarbageCollected, ] interface EventTarget { // FIXME: first 2 args should be required, but throwing TypeError breaks // legacy content. http://crbug.com/353484 diff --git a/engine/core/frame/ConsoleBase.idl b/engine/core/frame/ConsoleBase.idl index 96441fa7aed..512d25e1c24 100644 --- a/engine/core/frame/ConsoleBase.idl +++ b/engine/core/frame/ConsoleBase.idl @@ -29,7 +29,6 @@ [ NoInterfaceObject, - WillBeGarbageCollected, ] interface ConsoleBase { [CallWith=(ScriptArguments,ScriptState)] void debug(); [CallWith=(ScriptArguments,ScriptState)] void error(); diff --git a/engine/core/frame/History.idl b/engine/core/frame/History.idl index 8d12e48ead3..6d299df1b34 100644 --- a/engine/core/frame/History.idl +++ b/engine/core/frame/History.idl @@ -24,7 +24,6 @@ */ [ - WillBeGarbageCollected, ] interface History { readonly attribute unsigned long length; [Custom=Getter] readonly attribute SerializedScriptValue state; diff --git a/engine/core/frame/ImageBitmap.idl b/engine/core/frame/ImageBitmap.idl index b211d6ec29b..903a2d7421f 100644 --- a/engine/core/frame/ImageBitmap.idl +++ b/engine/core/frame/ImageBitmap.idl @@ -3,7 +3,6 @@ // found in the LICENSE file. [ - WillBeGarbageCollected, ] interface ImageBitmap { readonly attribute long width; readonly attribute long height; diff --git a/engine/core/frame/Location.idl b/engine/core/frame/Location.idl index 99a3ae98706..89953886103 100644 --- a/engine/core/frame/Location.idl +++ b/engine/core/frame/Location.idl @@ -28,7 +28,6 @@ [ CheckSecurity=Frame, - WillBeGarbageCollected, ] interface Location { // |assign|, |replace|, and *writing* |href| do not require a security // check, as they *change* the page, and thus these do not change any diff --git a/engine/core/frame/Screen.idl b/engine/core/frame/Screen.idl index a0b6385676f..f4924338b18 100644 --- a/engine/core/frame/Screen.idl +++ b/engine/core/frame/Screen.idl @@ -28,7 +28,6 @@ [ - WillBeGarbageCollected, ] interface Screen { readonly attribute unsigned long height; readonly attribute unsigned long width; diff --git a/engine/core/frame/Window.idl b/engine/core/frame/Window.idl index cac410bc1bf..5d3e9a11f1a 100644 --- a/engine/core/frame/Window.idl +++ b/engine/core/frame/Window.idl @@ -32,7 +32,6 @@ Custom=ToV8, ImplementedAs=LocalDOMWindow, PrimaryGlobal, - WillBeGarbageCollected, ] interface Window : EventTarget { readonly attribute Screen screen; readonly attribute History history; diff --git a/engine/core/html/ImageData.idl b/engine/core/html/ImageData.idl index 73ff6fcce67..ebd551dd927 100644 --- a/engine/core/html/ImageData.idl +++ b/engine/core/html/ImageData.idl @@ -33,7 +33,6 @@ Constructor(Uint8ClampedArray data, unsigned long width, [Default=Undefined] optional unsigned long height), Custom=Wrap, RaisesException=Constructor, - WillBeGarbageCollected, ] interface ImageData { readonly attribute long width; readonly attribute long height; diff --git a/engine/core/html/MediaError.idl b/engine/core/html/MediaError.idl index aaffbc230d9..727fde5216c 100644 --- a/engine/core/html/MediaError.idl +++ b/engine/core/html/MediaError.idl @@ -25,7 +25,6 @@ [ RuntimeEnabled=Media, - WillBeGarbageCollected, ] interface MediaError { const unsigned short MEDIA_ERR_ABORTED = 1; const unsigned short MEDIA_ERR_NETWORK = 2; diff --git a/engine/core/html/MediaKeyError.idl b/engine/core/html/MediaKeyError.idl index da32f872299..73acc161880 100644 --- a/engine/core/html/MediaKeyError.idl +++ b/engine/core/html/MediaKeyError.idl @@ -25,7 +25,6 @@ [ RuntimeEnabled=EncryptedMediaAnyVersion, - WillBeGarbageCollected, ] interface MediaKeyError { const unsigned short MEDIA_KEYERR_UNKNOWN = 1; const unsigned short MEDIA_KEYERR_CLIENT = 2; diff --git a/engine/core/html/TextMetrics.idl b/engine/core/html/TextMetrics.idl index c7d929a8ffc..747b5c722dd 100644 --- a/engine/core/html/TextMetrics.idl +++ b/engine/core/html/TextMetrics.idl @@ -23,7 +23,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ [ - WillBeGarbageCollected, ] interface TextMetrics { // x-direction readonly attribute float width; diff --git a/engine/core/html/TimeRanges.idl b/engine/core/html/TimeRanges.idl index 5c04549aead..e6e6e95cceb 100644 --- a/engine/core/html/TimeRanges.idl +++ b/engine/core/html/TimeRanges.idl @@ -24,7 +24,6 @@ */ [ - WillBeGarbageCollected, RuntimeEnabled=Media ] interface TimeRanges { readonly attribute unsigned long length; diff --git a/engine/core/html/canvas/ANGLEInstancedArrays.idl b/engine/core/html/canvas/ANGLEInstancedArrays.idl index 06f84e0348b..d4caba051e8 100644 --- a/engine/core/html/canvas/ANGLEInstancedArrays.idl +++ b/engine/core/html/canvas/ANGLEInstancedArrays.idl @@ -32,7 +32,6 @@ DoNotCheckConstants, NoInterfaceObject, TypeChecking=Interface, - WillBeGarbageCollected, ] interface ANGLEInstancedArrays { const unsigned long VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE; diff --git a/engine/core/html/canvas/Canvas2DContextAttributes.idl b/engine/core/html/canvas/Canvas2DContextAttributes.idl index f7dfab1fa37..f44f4034271 100644 --- a/engine/core/html/canvas/Canvas2DContextAttributes.idl +++ b/engine/core/html/canvas/Canvas2DContextAttributes.idl @@ -26,7 +26,6 @@ [ NoInterfaceObject, - WillBeGarbageCollected, ] interface Canvas2DContextAttributes { attribute boolean alpha; [RuntimeEnabled=ExperimentalCanvasFeatures] attribute DOMString storage; diff --git a/engine/core/html/canvas/CanvasGradient.idl b/engine/core/html/canvas/CanvasGradient.idl index c5f56230b4a..69813895474 100644 --- a/engine/core/html/canvas/CanvasGradient.idl +++ b/engine/core/html/canvas/CanvasGradient.idl @@ -25,7 +25,6 @@ */ [ TypeChecking=Unrestricted, - WillBeGarbageCollected, ] interface CanvasGradient { [RaisesException] void addColorStop(float offset, DOMString color); diff --git a/engine/core/html/canvas/CanvasPattern.idl b/engine/core/html/canvas/CanvasPattern.idl index d8e453dd862..6f9520e1172 100644 --- a/engine/core/html/canvas/CanvasPattern.idl +++ b/engine/core/html/canvas/CanvasPattern.idl @@ -23,6 +23,5 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ [ - WillBeGarbageCollected, ] interface CanvasPattern { }; diff --git a/engine/core/html/canvas/CanvasRenderingContext2D.idl b/engine/core/html/canvas/CanvasRenderingContext2D.idl index 44c7e90980d..78cea006892 100644 --- a/engine/core/html/canvas/CanvasRenderingContext2D.idl +++ b/engine/core/html/canvas/CanvasRenderingContext2D.idl @@ -39,7 +39,6 @@ enum CanvasFillRule { "nonzero", "evenodd" }; [ TypeChecking=(Interface,Unrestricted), - WillBeGarbageCollected, ] interface CanvasRenderingContext2D { // back-reference to the canvas readonly attribute HTMLCanvasElement canvas; diff --git a/engine/core/html/canvas/EXTBlendMinMax.idl b/engine/core/html/canvas/EXTBlendMinMax.idl index fbc69bc5cf7..c8f1a74f350 100644 --- a/engine/core/html/canvas/EXTBlendMinMax.idl +++ b/engine/core/html/canvas/EXTBlendMinMax.idl @@ -6,7 +6,6 @@ DoNotCheckConstants, NoInterfaceObject, TypeChecking=Interface, - WillBeGarbageCollected, ] interface EXTBlendMinMax { const unsigned long MIN_EXT = 0x8007; const unsigned long MAX_EXT = 0x8008; diff --git a/engine/core/html/canvas/EXTFragDepth.idl b/engine/core/html/canvas/EXTFragDepth.idl index ab71f123578..ce0af8ce847 100644 --- a/engine/core/html/canvas/EXTFragDepth.idl +++ b/engine/core/html/canvas/EXTFragDepth.idl @@ -25,6 +25,5 @@ [ NoInterfaceObject, - WillBeGarbageCollected, ] interface EXTFragDepth { }; diff --git a/engine/core/html/canvas/EXTShaderTextureLOD.idl b/engine/core/html/canvas/EXTShaderTextureLOD.idl index 975005a6a85..7e70040681b 100644 --- a/engine/core/html/canvas/EXTShaderTextureLOD.idl +++ b/engine/core/html/canvas/EXTShaderTextureLOD.idl @@ -4,6 +4,5 @@ [ NoInterfaceObject, - WillBeGarbageCollected, ] interface EXTShaderTextureLOD { }; diff --git a/engine/core/html/canvas/EXTTextureFilterAnisotropic.idl b/engine/core/html/canvas/EXTTextureFilterAnisotropic.idl index 1588e48d1dc..9078de6699f 100644 --- a/engine/core/html/canvas/EXTTextureFilterAnisotropic.idl +++ b/engine/core/html/canvas/EXTTextureFilterAnisotropic.idl @@ -26,7 +26,6 @@ [ NoInterfaceObject, DoNotCheckConstants, - WillBeGarbageCollected, ] interface EXTTextureFilterAnisotropic { const unsigned long TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE; const unsigned long MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF; diff --git a/engine/core/html/canvas/OESElementIndexUint.idl b/engine/core/html/canvas/OESElementIndexUint.idl index d4d8ea0ce9e..1b9e0f5313b 100644 --- a/engine/core/html/canvas/OESElementIndexUint.idl +++ b/engine/core/html/canvas/OESElementIndexUint.idl @@ -25,6 +25,5 @@ [ NoInterfaceObject, - WillBeGarbageCollected, ] interface OESElementIndexUint { }; diff --git a/engine/core/html/canvas/OESStandardDerivatives.idl b/engine/core/html/canvas/OESStandardDerivatives.idl index a517c7bf8ae..0c4cb17e7f5 100644 --- a/engine/core/html/canvas/OESStandardDerivatives.idl +++ b/engine/core/html/canvas/OESStandardDerivatives.idl @@ -26,7 +26,6 @@ [ NoInterfaceObject, DoNotCheckConstants, - WillBeGarbageCollected, ] interface OESStandardDerivatives { const unsigned long FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B; }; diff --git a/engine/core/html/canvas/OESTextureFloat.idl b/engine/core/html/canvas/OESTextureFloat.idl index 446d0791dbe..108658d3b4c 100644 --- a/engine/core/html/canvas/OESTextureFloat.idl +++ b/engine/core/html/canvas/OESTextureFloat.idl @@ -25,6 +25,5 @@ [ NoInterfaceObject, - WillBeGarbageCollected, ] interface OESTextureFloat { }; diff --git a/engine/core/html/canvas/OESTextureFloatLinear.idl b/engine/core/html/canvas/OESTextureFloatLinear.idl index 8cb531d7410..895243d78a1 100644 --- a/engine/core/html/canvas/OESTextureFloatLinear.idl +++ b/engine/core/html/canvas/OESTextureFloatLinear.idl @@ -25,6 +25,5 @@ [ NoInterfaceObject, - WillBeGarbageCollected, ] interface OESTextureFloatLinear { }; diff --git a/engine/core/html/canvas/OESTextureHalfFloat.idl b/engine/core/html/canvas/OESTextureHalfFloat.idl index b050cfa21d4..15c84145b33 100644 --- a/engine/core/html/canvas/OESTextureHalfFloat.idl +++ b/engine/core/html/canvas/OESTextureHalfFloat.idl @@ -28,7 +28,6 @@ typedef unsigned long GLenum; [ NoInterfaceObject, DoNotCheckConstants, - WillBeGarbageCollected, ] interface OESTextureHalfFloat { const GLenum HALF_FLOAT_OES = 0x8D61; }; diff --git a/engine/core/html/canvas/OESTextureHalfFloatLinear.idl b/engine/core/html/canvas/OESTextureHalfFloatLinear.idl index 201ca4d0eac..f80bc7e6613 100644 --- a/engine/core/html/canvas/OESTextureHalfFloatLinear.idl +++ b/engine/core/html/canvas/OESTextureHalfFloatLinear.idl @@ -25,6 +25,5 @@ [ NoInterfaceObject, - WillBeGarbageCollected, ] interface OESTextureHalfFloatLinear { }; diff --git a/engine/core/html/canvas/OESVertexArrayObject.idl b/engine/core/html/canvas/OESVertexArrayObject.idl index eba1db6fb51..b933c438074 100644 --- a/engine/core/html/canvas/OESVertexArrayObject.idl +++ b/engine/core/html/canvas/OESVertexArrayObject.idl @@ -27,7 +27,6 @@ DoNotCheckConstants, NoInterfaceObject, TypeChecking=Interface, - WillBeGarbageCollected, ] interface OESVertexArrayObject { const unsigned long VERTEX_ARRAY_BINDING_OES = 0x85B5; diff --git a/engine/core/html/canvas/Path2D.idl b/engine/core/html/canvas/Path2D.idl index 6f00586b98c..b418364234e 100644 --- a/engine/core/html/canvas/Path2D.idl +++ b/engine/core/html/canvas/Path2D.idl @@ -31,7 +31,6 @@ [ Constructor, Constructor(Path2D path), - WillBeGarbageCollected, ] interface Path2D { // FIXME(sky): Fix this object. }; diff --git a/engine/core/html/canvas/WebGLActiveInfo.idl b/engine/core/html/canvas/WebGLActiveInfo.idl index f4aa739e872..a518c023960 100644 --- a/engine/core/html/canvas/WebGLActiveInfo.idl +++ b/engine/core/html/canvas/WebGLActiveInfo.idl @@ -24,7 +24,6 @@ */ [ - WillBeGarbageCollected, ] interface WebGLActiveInfo { readonly attribute long size; readonly attribute unsigned long type; diff --git a/engine/core/html/canvas/WebGLBuffer.idl b/engine/core/html/canvas/WebGLBuffer.idl index aecd6b06b86..f234e8675d9 100644 --- a/engine/core/html/canvas/WebGLBuffer.idl +++ b/engine/core/html/canvas/WebGLBuffer.idl @@ -24,6 +24,5 @@ */ [ - WillBeGarbageCollected, ] interface WebGLBuffer { }; diff --git a/engine/core/html/canvas/WebGLCompressedTextureATC.idl b/engine/core/html/canvas/WebGLCompressedTextureATC.idl index a66a32929fc..2bca7502e8d 100644 --- a/engine/core/html/canvas/WebGLCompressedTextureATC.idl +++ b/engine/core/html/canvas/WebGLCompressedTextureATC.idl @@ -26,7 +26,6 @@ [ NoInterfaceObject, DoNotCheckConstants, - WillBeGarbageCollected, ] interface WebGLCompressedTextureATC { /* Compressed Texture Formats */ const unsigned long COMPRESSED_RGB_ATC_WEBGL = 0x8C92; diff --git a/engine/core/html/canvas/WebGLCompressedTextureETC1.idl b/engine/core/html/canvas/WebGLCompressedTextureETC1.idl index fd8759d4010..017863567f9 100644 --- a/engine/core/html/canvas/WebGLCompressedTextureETC1.idl +++ b/engine/core/html/canvas/WebGLCompressedTextureETC1.idl @@ -5,7 +5,6 @@ [ NoInterfaceObject, DoNotCheckConstants, - WillBeGarbageCollected, ] interface WebGLCompressedTextureETC1 { /* Compressed Texture Formats */ const unsigned long COMPRESSED_RGB_ETC1_WEBGL = 0x8D64; diff --git a/engine/core/html/canvas/WebGLCompressedTexturePVRTC.idl b/engine/core/html/canvas/WebGLCompressedTexturePVRTC.idl index 9eaa3a9a390..a33d7d78b2b 100644 --- a/engine/core/html/canvas/WebGLCompressedTexturePVRTC.idl +++ b/engine/core/html/canvas/WebGLCompressedTexturePVRTC.idl @@ -26,7 +26,6 @@ [ NoInterfaceObject, DoNotCheckConstants, - WillBeGarbageCollected, ] interface WebGLCompressedTexturePVRTC { /* Compressed Texture Formats */ const unsigned long COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00; diff --git a/engine/core/html/canvas/WebGLCompressedTextureS3TC.idl b/engine/core/html/canvas/WebGLCompressedTextureS3TC.idl index eef723f9afa..147b9453eee 100644 --- a/engine/core/html/canvas/WebGLCompressedTextureS3TC.idl +++ b/engine/core/html/canvas/WebGLCompressedTextureS3TC.idl @@ -26,7 +26,6 @@ [ NoInterfaceObject, DoNotCheckConstants, - WillBeGarbageCollected, ] interface WebGLCompressedTextureS3TC { /* Compressed Texture Formats */ const unsigned long COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0; diff --git a/engine/core/html/canvas/WebGLContextAttributes.idl b/engine/core/html/canvas/WebGLContextAttributes.idl index ecd211a783a..6a7beba4c4c 100644 --- a/engine/core/html/canvas/WebGLContextAttributes.idl +++ b/engine/core/html/canvas/WebGLContextAttributes.idl @@ -26,7 +26,6 @@ [ NoInterfaceObject, - WillBeGarbageCollected, ] interface WebGLContextAttributes { attribute boolean alpha; attribute boolean depth; diff --git a/engine/core/html/canvas/WebGLDebugRendererInfo.idl b/engine/core/html/canvas/WebGLDebugRendererInfo.idl index bf95c1b185c..fc7717b15fb 100644 --- a/engine/core/html/canvas/WebGLDebugRendererInfo.idl +++ b/engine/core/html/canvas/WebGLDebugRendererInfo.idl @@ -26,7 +26,6 @@ [ NoInterfaceObject, DoNotCheckConstants, - WillBeGarbageCollected, ] interface WebGLDebugRendererInfo { const unsigned long UNMASKED_VENDOR_WEBGL = 0x9245; const unsigned long UNMASKED_RENDERER_WEBGL = 0x9246; diff --git a/engine/core/html/canvas/WebGLDebugShaders.idl b/engine/core/html/canvas/WebGLDebugShaders.idl index 92c36be500c..08066182907 100644 --- a/engine/core/html/canvas/WebGLDebugShaders.idl +++ b/engine/core/html/canvas/WebGLDebugShaders.idl @@ -26,7 +26,6 @@ [ NoInterfaceObject, TypeChecking=Interface, - WillBeGarbageCollected, ] interface WebGLDebugShaders { DOMString? getTranslatedShaderSource(WebGLShader? shader); }; diff --git a/engine/core/html/canvas/WebGLDepthTexture.idl b/engine/core/html/canvas/WebGLDepthTexture.idl index d6a087406a2..1579dacb108 100644 --- a/engine/core/html/canvas/WebGLDepthTexture.idl +++ b/engine/core/html/canvas/WebGLDepthTexture.idl @@ -26,7 +26,6 @@ [ NoInterfaceObject, DoNotCheckConstants, - WillBeGarbageCollected, ] interface WebGLDepthTexture { const unsigned long UNSIGNED_INT_24_8_WEBGL = 0x84FA; }; diff --git a/engine/core/html/canvas/WebGLDrawBuffers.idl b/engine/core/html/canvas/WebGLDrawBuffers.idl index 82fc0596d2c..e0d3ce65913 100644 --- a/engine/core/html/canvas/WebGLDrawBuffers.idl +++ b/engine/core/html/canvas/WebGLDrawBuffers.idl @@ -28,7 +28,6 @@ typedef unsigned long GLenum; [ NoInterfaceObject, DoNotCheckConstants, - WillBeGarbageCollected, ] interface WebGLDrawBuffers { const GLenum COLOR_ATTACHMENT0_WEBGL = 0x8CE0; const GLenum COLOR_ATTACHMENT1_WEBGL = 0x8CE1; diff --git a/engine/core/html/canvas/WebGLFramebuffer.idl b/engine/core/html/canvas/WebGLFramebuffer.idl index 354f82fefdd..9939201bc5f 100644 --- a/engine/core/html/canvas/WebGLFramebuffer.idl +++ b/engine/core/html/canvas/WebGLFramebuffer.idl @@ -24,6 +24,5 @@ */ [ - WillBeGarbageCollected, ] interface WebGLFramebuffer { }; diff --git a/engine/core/html/canvas/WebGLLoseContext.idl b/engine/core/html/canvas/WebGLLoseContext.idl index c2355672c8c..9278c2dc652 100644 --- a/engine/core/html/canvas/WebGLLoseContext.idl +++ b/engine/core/html/canvas/WebGLLoseContext.idl @@ -26,7 +26,6 @@ [ NoInterfaceObject, TypeChecking=Interface, - WillBeGarbageCollected, ] interface WebGLLoseContext { void loseContext(); void restoreContext(); diff --git a/engine/core/html/canvas/WebGLProgram.idl b/engine/core/html/canvas/WebGLProgram.idl index b637b22ed32..79caff5382c 100644 --- a/engine/core/html/canvas/WebGLProgram.idl +++ b/engine/core/html/canvas/WebGLProgram.idl @@ -24,6 +24,5 @@ */ [ - WillBeGarbageCollected, ] interface WebGLProgram { }; diff --git a/engine/core/html/canvas/WebGLRenderbuffer.idl b/engine/core/html/canvas/WebGLRenderbuffer.idl index 2e6792fe6e1..93297e37c70 100644 --- a/engine/core/html/canvas/WebGLRenderbuffer.idl +++ b/engine/core/html/canvas/WebGLRenderbuffer.idl @@ -24,6 +24,5 @@ */ [ - WillBeGarbageCollected, ] interface WebGLRenderbuffer { }; diff --git a/engine/core/html/canvas/WebGLRenderingContext.idl b/engine/core/html/canvas/WebGLRenderingContext.idl index 6c12783be0c..da571799414 100644 --- a/engine/core/html/canvas/WebGLRenderingContext.idl +++ b/engine/core/html/canvas/WebGLRenderingContext.idl @@ -28,6 +28,5 @@ [ DoNotCheckConstants, TypeChecking=Interface, - WillBeGarbageCollected, ] interface WebGLRenderingContext { }; WebGLRenderingContext implements WebGLRenderingContextBase; diff --git a/engine/core/html/canvas/WebGLRenderingContextBase.idl b/engine/core/html/canvas/WebGLRenderingContextBase.idl index ae27ab6b983..d798f7103bd 100644 --- a/engine/core/html/canvas/WebGLRenderingContextBase.idl +++ b/engine/core/html/canvas/WebGLRenderingContextBase.idl @@ -46,7 +46,6 @@ typedef unrestricted float GLclampf; // DoNotCheckConstants, // need to put on implementing interface NoInterfaceObject, // Always used on target of 'implements' // TypeChecking=(Interface,Unrestricted), // need to put on implementing interface - WillBeGarbageCollected, ] interface WebGLRenderingContextBase { readonly attribute HTMLCanvasElement canvas; diff --git a/engine/core/html/canvas/WebGLShader.idl b/engine/core/html/canvas/WebGLShader.idl index 1d48fd67dde..f7d1106dedc 100644 --- a/engine/core/html/canvas/WebGLShader.idl +++ b/engine/core/html/canvas/WebGLShader.idl @@ -24,6 +24,5 @@ */ [ - WillBeGarbageCollected, ] interface WebGLShader { }; diff --git a/engine/core/html/canvas/WebGLShaderPrecisionFormat.idl b/engine/core/html/canvas/WebGLShaderPrecisionFormat.idl index f9531c5dbfd..a5c7d5ceb5f 100644 --- a/engine/core/html/canvas/WebGLShaderPrecisionFormat.idl +++ b/engine/core/html/canvas/WebGLShaderPrecisionFormat.idl @@ -25,7 +25,6 @@ */ [ - WillBeGarbageCollected, ] interface WebGLShaderPrecisionFormat { readonly attribute long rangeMin; readonly attribute long rangeMax; diff --git a/engine/core/html/canvas/WebGLTexture.idl b/engine/core/html/canvas/WebGLTexture.idl index 7a1583cc07d..45b5190b089 100644 --- a/engine/core/html/canvas/WebGLTexture.idl +++ b/engine/core/html/canvas/WebGLTexture.idl @@ -24,6 +24,5 @@ */ [ - WillBeGarbageCollected, ] interface WebGLTexture { }; diff --git a/engine/core/html/canvas/WebGLUniformLocation.idl b/engine/core/html/canvas/WebGLUniformLocation.idl index bac3601a85d..cc474e36228 100644 --- a/engine/core/html/canvas/WebGLUniformLocation.idl +++ b/engine/core/html/canvas/WebGLUniformLocation.idl @@ -25,6 +25,5 @@ */ [ - WillBeGarbageCollected, ] interface WebGLUniformLocation { }; diff --git a/engine/core/html/canvas/WebGLVertexArrayObjectOES.idl b/engine/core/html/canvas/WebGLVertexArrayObjectOES.idl index 2a9e5bcc641..2087f42dee0 100644 --- a/engine/core/html/canvas/WebGLVertexArrayObjectOES.idl +++ b/engine/core/html/canvas/WebGLVertexArrayObjectOES.idl @@ -25,6 +25,5 @@ [ NoInterfaceObject, - WillBeGarbageCollected, ] interface WebGLVertexArrayObjectOES { }; diff --git a/engine/platform/heap/Handle.cpp b/engine/platform/heap/Handle.cpp index e2da7b2893b..6577aeb5973 100644 --- a/engine/platform/heap/Handle.cpp +++ b/engine/platform/heap/Handle.cpp @@ -7,68 +7,4 @@ namespace blink { -bool WrapperPersistentRegion::removeIfNotLast(WrapperPersistentRegion** headPtr) -{ - ASSERT(!m_count); - // We are the last region in the list if both the region's m_prev and - // m_next are 0. - if (!m_prev && !m_next) - return false; - if (m_prev) { - m_prev->m_next = m_next; - } else { - ASSERT(*headPtr == this); - *headPtr = m_next; - } - if (m_next) - m_next->m_prev = m_prev; - m_prev = 0; - m_next = 0; - return true; -} - -void WrapperPersistentRegion::insertHead(WrapperPersistentRegion** headPtr, WrapperPersistentRegion* newHead) -{ - ASSERT(headPtr); - WrapperPersistentRegion* oldHead = *headPtr; - if (oldHead) { - ASSERT(!oldHead->m_prev); - oldHead->m_prev = newHead; - } - newHead->m_prev = 0; - newHead->m_next = oldHead; - *headPtr = newHead; -} - -WrapperPersistentRegion* WrapperPersistentRegion::removeHead(WrapperPersistentRegion** headPtr) -{ - // We only call this if there is at least one element in the list. - ASSERT(headPtr && *headPtr); - WrapperPersistentRegion* oldHead = *headPtr; - ASSERT(!oldHead->m_prev); - *headPtr = oldHead->m_next; - oldHead->m_next = 0; - ASSERT(!(*headPtr) || (*headPtr)->m_prev == oldHead); - if (*headPtr) - (*headPtr)->m_prev = 0; - return oldHead; -} - -void* WrapperPersistentRegion::outOfLineAllocate(ThreadState* state, WrapperPersistentRegion* head) -{ - void* persistent = 0; - // The caller has already tried allocating in the passed-in region, start - // from the next. - for (WrapperPersistentRegion* current = head->m_next; current; current = current->m_next) { - persistent = current->allocate(); - if (persistent) - return persistent; - } - ASSERT(!persistent); - WrapperPersistentRegion* newRegion = state->takeWrapperPersistentRegion(); - persistent = newRegion->allocate(); - ASSERT(persistent); - return persistent; -} - } diff --git a/engine/platform/heap/Handle.h b/engine/platform/heap/Handle.h index 17c05f278fd..7f6a3282905 100644 --- a/engine/platform/heap/Handle.h +++ b/engine/platform/heap/Handle.h @@ -87,206 +87,6 @@ private: }; -const int wrapperPersistentsPerRegion = 256; -const size_t wrapperPersistentOffsetMask = ~static_cast(3); -const size_t wrapperPersistentLiveBitMask = 1; - -class WrapperPersistentNode { - WTF_MAKE_NONCOPYABLE(WrapperPersistentNode); -public: - bool isAlive() { return m_regionOffset & wrapperPersistentLiveBitMask; } - - WrapperPersistentRegion* region() - { - return reinterpret_cast( - reinterpret_cast
(this) - (m_regionOffset & wrapperPersistentOffsetMask)); - } - - virtual ~WrapperPersistentNode() - { - m_regionOffset &= ~wrapperPersistentLiveBitMask; - } - - virtual void trace(Visitor* visitor) { } - -protected: - WrapperPersistentNode() : m_raw(0), m_regionOffset(0) { } - - explicit WrapperPersistentNode(void* raw) - { - // When the constructor is called the slot should have been taken (takeSlot) - // as part of allocating the memory (via operator new). Hence the m_raw - // pointer should be 0. - ASSERT(!m_raw); - m_raw = raw; - // The m_regionOffset should always be set as an offset to the containing - // region. However it should not have the live bit set when the constructor - // is called. - ASSERT(m_regionOffset); - ASSERT(!isAlive()); - m_regionOffset |= wrapperPersistentLiveBitMask; - } - -private: - void initSlot(size_t regionOffset, WrapperPersistentNode* nextFree) - { - ASSERT(!m_raw); - ASSERT(!m_regionOffset); - ASSERT(!(regionOffset & ~wrapperPersistentOffsetMask)); - m_raw = nextFree; - m_regionOffset = regionOffset; - } - - WrapperPersistentNode* takeSlot() - { - // The slot should not be alive at the point where it is allocated. - ASSERT(!isAlive()); - WrapperPersistentNode* nextFree = reinterpret_cast(m_raw); - m_raw = 0; - return nextFree; - } - - WrapperPersistentNode* freeSlot(WrapperPersistentNode* nextFree) - { - // When the slot is freed the destructor should already have cleared the live bit. - ASSERT(!isAlive()); - m_raw = nextFree; - return this; - } - -protected: - // m_raw is used both to point to the object when the WrapperPersistentNode is used/alive - // and to point to the next free wrapperPersistentNode in the region when the node is - // unused/dead. - void* m_raw; - - // The m_regionOffset field is an offset from this node to the base of the containing - // WrapperPersistentRegion. - size_t m_regionOffset; - - friend class WrapperPersistentRegion; -}; - -template -class WrapperPersistent final : public WrapperPersistentNode { -public: - WrapperPersistent() : WrapperPersistentNode(0) { } - WrapperPersistent(std::nullptr_t) : WrapperPersistentNode(0) { } - WrapperPersistent(T* raw) : WrapperPersistentNode(raw) { } - WrapperPersistent(T& raw) : WrapperPersistentNode(&raw) { } - - void* operator new(size_t); - void operator delete(void*); - - virtual void trace(Visitor* visitor) - { - ASSERT(isAlive()); - visitor->mark(static_cast(m_raw)); - } -}; - -class PLATFORM_EXPORT WrapperPersistentRegion { - WTF_MAKE_NONCOPYABLE(WrapperPersistentRegion); -public: - WrapperPersistentRegion() - { - WrapperPersistentNode* nextFree = 0; - for (int i = wrapperPersistentsPerRegion - 1; i >= 0; --i) { - size_t regionOffset = reinterpret_cast
(&m_entries[i]) - reinterpret_cast
(this); - // Setup the free slot with an offset to the containing region's base and a pointer to the next - // free slot in the region. - m_entries[i].initSlot(regionOffset, nextFree); - nextFree = &m_entries[i]; - } - m_prev = 0; - m_next = 0; - m_freeHead = nextFree; - m_count = 0; - } - - void* allocate() - { - if (!m_freeHead) { - ASSERT(m_count == wrapperPersistentsPerRegion); - return 0; - } - // We have a free persistent slot in this region. - WrapperPersistentNode* freeSlot = m_freeHead; - // Take the slot and advance m_freeHead to the next free slot. - m_freeHead = freeSlot->takeSlot(); - ASSERT(m_count < wrapperPersistentsPerRegion); - m_count++; - return reinterpret_cast(freeSlot); - } - - void free(WrapperPersistentNode* object) - { - ASSERT(object); - ASSERT(!object->isAlive()); - m_freeHead = object->freeSlot(m_freeHead); - ASSERT(m_count > 0); - m_count--; - if (!m_count) - ThreadState::current()->freeWrapperPersistentRegion(this); - } - - bool removeIfNotLast(WrapperPersistentRegion** headPtr); - static void insertHead(WrapperPersistentRegion** headPtr, WrapperPersistentRegion* newHead); - static WrapperPersistentRegion* removeHead(WrapperPersistentRegion** headPtr); - static void* outOfLineAllocate(ThreadState*, WrapperPersistentRegion*); - static void trace(WrapperPersistentRegion* head, Visitor* visitor) - { - for (WrapperPersistentRegion* current = head; current; current = current->m_next) - current->traceRegion(visitor); - } - -private: - void traceRegion(Visitor* visitor) - { - size_t live = 0; - -#ifdef NDEBUG - for (int i = 0; i < wrapperPersistentsPerRegion && live < m_count; ++i) { -#else - // In DEBUG mode we scan all entries to validate we only have m_count - // live entries. - for (int i = 0; i < wrapperPersistentsPerRegion; ++i) { -#endif - if (m_entries[i].isAlive()) { - m_entries[i].trace(visitor); - live++; - } - } - ASSERT(live == m_count); - } - - WrapperPersistentRegion* m_prev; - WrapperPersistentRegion* m_next; - WrapperPersistentNode* m_freeHead; - size_t m_count; - WrapperPersistentNode m_entries[wrapperPersistentsPerRegion]; -}; - -template -void* WrapperPersistent::operator new(size_t size) -{ - ASSERT(size == sizeof(WrapperPersistent)); - ThreadState* state = ThreadState::current(); - WrapperPersistentRegion* region = state->wrapperRoots(); - ASSERT(region); - void* persistent = region->allocate(); - if (!persistent) - return WrapperPersistentRegion::outOfLineAllocate(state, region); - return persistent; -} - -template -void WrapperPersistent::operator delete(void* object) -{ - WrapperPersistentNode* persistent = static_cast(object); - persistent->region()->free(persistent); -} - // RootsAccessor for Persistent that provides access to thread-local list // of persistent handles. Can only be used to create handles that // are constructed and destructed on the same thread. diff --git a/engine/platform/heap/ThreadState.cpp b/engine/platform/heap/ThreadState.cpp index a80ff000ad5..39bff37faef 100644 --- a/engine/platform/heap/ThreadState.cpp +++ b/engine/platform/heap/ThreadState.cpp @@ -82,10 +82,6 @@ static void* getStackStart() #endif } -// The maximum number of WrapperPersistentRegions to keep around in the -// m_pooledWrapperPersistentRegions pool. -static const size_t MaxPooledWrapperPersistentRegionCount = 2; - WTF::ThreadSpecific* ThreadState::s_threadSpecific = 0; uint8_t ThreadState::s_mainThreadStateStorage[sizeof(ThreadState)]; SafePointBarrier* ThreadState::s_safePointBarrier = 0; @@ -197,9 +193,6 @@ template<> struct InitializeHeaps<0> { ThreadState::ThreadState() : m_thread(currentThread()) - , m_liveWrapperPersistents(new WrapperPersistentRegion()) - , m_pooledWrapperPersistents(0) - , m_pooledWrapperPersistentRegionCount(0) , m_persistents(adoptPtr(new PersistentAnchor())) , m_startOfStack(reinterpret_cast(getStackStart())) , m_endOfStack(reinterpret_cast(getStackStart())) @@ -235,14 +228,6 @@ ThreadState::~ThreadState() for (int i = 0; i < NumberOfHeaps; i++) delete m_heaps[i]; deleteAllValues(m_interruptors); - while (m_liveWrapperPersistents) { - WrapperPersistentRegion* region = WrapperPersistentRegion::removeHead(&m_liveWrapperPersistents); - delete region; - } - while (m_pooledWrapperPersistents) { - WrapperPersistentRegion* region = WrapperPersistentRegion::removeHead(&m_pooledWrapperPersistents); - delete region; - } **s_threadSpecific = 0; } @@ -410,7 +395,6 @@ void ThreadState::visitStack(Visitor* visitor) void ThreadState::visitPersistents(Visitor* visitor) { m_persistents->trace(visitor); - WrapperPersistentRegion::trace(m_liveWrapperPersistents, visitor); } bool ThreadState::checkAndMarkPointer(Visitor* visitor, Address address) @@ -530,34 +514,6 @@ bool ThreadState::popAndInvokeWeakPointerCallback(Visitor* visitor) return m_weakCallbackStack->popAndInvokeCallback(&m_weakCallbackStack, visitor); } -WrapperPersistentRegion* ThreadState::takeWrapperPersistentRegion() -{ - WrapperPersistentRegion* region; - if (m_pooledWrapperPersistentRegionCount) { - region = WrapperPersistentRegion::removeHead(&m_pooledWrapperPersistents); - m_pooledWrapperPersistentRegionCount--; - } else { - region = new WrapperPersistentRegion(); - } - ASSERT(region); - WrapperPersistentRegion::insertHead(&m_liveWrapperPersistents, region); - return region; -} - -void ThreadState::freeWrapperPersistentRegion(WrapperPersistentRegion* region) -{ - if (!region->removeIfNotLast(&m_liveWrapperPersistents)) - return; - - // Region was removed, ie. it was not the last region in the list. - if (m_pooledWrapperPersistentRegionCount < MaxPooledWrapperPersistentRegionCount) { - WrapperPersistentRegion::insertHead(&m_pooledWrapperPersistents, region); - m_pooledWrapperPersistentRegionCount++; - } else { - delete region; - } -} - PersistentNode* ThreadState::globalRoots() { AtomicallyInitializedStatic(PersistentNode*, anchor = new PersistentAnchor); diff --git a/engine/platform/heap/ThreadState.h b/engine/platform/heap/ThreadState.h index 441f82fc883..63118f92f6b 100644 --- a/engine/platform/heap/ThreadState.h +++ b/engine/platform/heap/ThreadState.h @@ -56,7 +56,6 @@ class HeapContainsCache; class HeapObjectHeader; class PageMemory; class PersistentNode; -class WrapperPersistentRegion; class Visitor; class SafePointBarrier; class SafePointAwareMutexLocker; @@ -539,14 +538,6 @@ public: BaseHeapPage* contains(void* pointer) { return contains(reinterpret_cast
(pointer)); } BaseHeapPage* contains(const void* pointer) { return contains(const_cast(pointer)); } - WrapperPersistentRegion* wrapperRoots() const - { - ASSERT(m_liveWrapperPersistents); - return m_liveWrapperPersistents; - } - WrapperPersistentRegion* takeWrapperPersistentRegion(); - void freeWrapperPersistentRegion(WrapperPersistentRegion*); - // List of persistent roots allocated on the given thread. PersistentNode* roots() const { return m_persistents.get(); } @@ -671,9 +662,6 @@ private: static uint8_t s_mainThreadStateStorage[]; ThreadIdentifier m_thread; - WrapperPersistentRegion* m_liveWrapperPersistents; - WrapperPersistentRegion* m_pooledWrapperPersistents; - size_t m_pooledWrapperPersistentRegionCount; OwnPtr m_persistents; StackState m_stackState; intptr_t* m_startOfStack;