New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 778996 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Clean-up ScriptWrappable inheritances

Project Member Reported by peria@chromium.org, Oct 27 2017

Issue description

After fixing the  issue 773611 , ScriptWrappable inherits from GarbageCollected and TraceWrapperBase.

So now we can take optimizations like
- ScriptWrappable::ToImpl<T> can be simplified
- Generated V8T::ToImpl won't be needed. (The offset is always zero.)
- WrapperTypeInfo::trace_function/trace_wrappers_function are not needed.

Let's do them.
 

Comment 1 by peria@chromium.org, Oct 27 2017

Cc: w...@chromium.org
Project Member

Comment 2 by bugdroid1@chromium.org, Jan 24 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9622a7aa434461da3ff2684f7186193378077a0a

commit 9622a7aa434461da3ff2684f7186193378077a0a
Author: Hitoshi Yoshida <peria@chromium.org>
Date: Wed Jan 24 05:10:45 2018

bindings: Remove Trace() and TraceWrappers() from WrapperTypeInfo

Now ScriptWrappable inherits from GCFinalized, so we no longer need
the hack to go around with wrapper type info in tracing.
This CL reduces 16 Bytes/WrapperTypeInfo on 64bit platforms.

Bug:  778996 
Change-Id: Ia1a226700693d799f481a64a65b024743d28839b
Reviewed-on: https://chromium-review.googlesource.com/742942
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531437}
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/templates/interface.h.tmpl
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/templates/legacy_callback_interface.cpp.tmpl
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestAttributeGetters.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestAttributeGetters.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestLegacyCallbackInterface.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestVariadicConstructorArguments.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8TestVariadicConstructorArguments.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInheritedLegacyUnenumerableNamedProperties.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInheritedLegacyUnenumerableNamedProperties.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestNotEnumerableNamedGetter.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestNotEnumerableNamedGetter.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestSubObject.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestSubObject.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/platform/bindings/ScriptWrappableMarkingVisitor.cpp
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/platform/bindings/WrapperTypeInfo.h
[modify] https://crrev.com/9622a7aa434461da3ff2684f7186193378077a0a/third_party/WebKit/Source/platform/heap/Visitor.h

Comment 3 by peria@chromium.org, Jan 24 2018

Status: Fixed (was: Available)
WrapperTypeInfo::trace_function/trace_wrappers_function are gone.

I feel we don't need other optimizations because
 - ScriptWrappable::ToImpl<T> is simple enough. It is actually just casting 'this' pointer.
 - Generated V8T::ToImpl are wrappers of ScriptWrappable::ToImpl for most cases. But I don't think it has a great advantage to use reinterpret_cast<T*>(ToScriptWrappable(obj)).

so let met close this.
Please feel free to reopen.

Sign in to add a comment