| Index: third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
|
| index 56066def09bf5da55179e5ea291031755826cf78..e39e0ed203cb3752c32c8a1b681701d4f99ae8de 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
|
| @@ -164,31 +164,13 @@ private:
|
| scriptWrappable->disposeWrapper(data);
|
|
|
| auto wrapperTypeInfo = reinterpret_cast<WrapperTypeInfo*>(data.GetInternalField(v8DOMWrapperTypeIndex));
|
| - if (wrapperTypeInfo->isGarbageCollected()) {
|
| - // derefObject() for garbage collected objects is very cheap, so
|
| - // we don't delay derefObject to the second pass.
|
| - //
|
| - // More importantly, we've already disposed the wrapper at this
|
| - // moment, so the ScriptWrappable may have already been collected
|
| - // by GC by the second pass. We shouldn't use a pointer to the
|
| - // ScriptWrappable in secondWeakCallback in case of garbage
|
| - // collected objects. Thus calls derefObject right now.
|
| - wrapperTypeInfo->derefObject(scriptWrappable);
|
| - } else {
|
| - // For reference counted objects, let's delay the destruction of
|
| - // the object to the second pass.
|
| - data.SetSecondPassCallback(secondWeakCallback);
|
| - }
|
| - }
|
| -
|
| - static void secondWeakCallback(const v8::WeakCallbackInfo<ScriptWrappable>& data)
|
| - {
|
| - // FIXME: I noticed that 50%~ of minor GC cycle times can be consumed
|
| - // inside data.GetParameter()->deref(), which causes Node destructions. We should
|
| - // make Node destructions incremental.
|
| - auto scriptWrappable = reinterpret_cast<ScriptWrappable*>(data.GetInternalField(v8DOMWrapperObjectIndex));
|
| - auto wrapperTypeInfo = reinterpret_cast<WrapperTypeInfo*>(data.GetInternalField(v8DOMWrapperTypeIndex));
|
| - wrapperTypeInfo->derefObject(scriptWrappable);
|
| + // derefObject() for garbage collected objects is very cheap, so
|
| + // we don't delay derefObject to any second pass.
|
| + //
|
| + // More importantly, we've already disposed the wrapper at this
|
| + // moment, so the ScriptWrappable may have already been collected
|
| + // by GC by the second pass.
|
| + wrapperTypeInfo->derefObject();
|
| }
|
|
|
| v8::Persistent<v8::Object> m_wrapper;
|
|
|