[V8] Use v8::V8::AddImplicitReferences instead of SetHiddenValue
authorarv@chromium.org <arv@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Mar 2012 23:56:45 +0000 (23:56 +0000)
committerarv@chromium.org <arv@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Mar 2012 23:56:45 +0000 (23:56 +0000)
commit90e83dd942c93313765d0f528cebea1616e421c3
tree578d6000a9945dd2dcd770a9670f8fd5625fadcb
parentedf8ece33fc614b835eabade19ced672ccc197a2
[V8] Use v8::V8::AddImplicitReferences instead of SetHiddenValue
https://bugs.webkit.org/show_bug.cgi?id=80880

Reviewed by Adam Barth.

Source/WebCore:

We used to add a hidden property in the getter to the returned wrapper.
With this patch we instead handle the liveness of the wrapper in the GC phase by
calling v8::V8::AddHiddenReference.

To reduce the amount of custom code we need, the V8 code generator now supports
GenerateIsReachable (as well as CustomIsReachable) which, even though different
from the JSC attribute, is used in the same cases and takes the same values (even though
at the moment not all JSC values are supported by V8). Interfaces that have *IsReachable
also have a dependent life time (just like if V8DependentLifetime was present).

Second try. This time with an added include in TextTrackList.cpp.

No new tests. Covered by existing tests.

* Target.pri:
* UseV8.cmake:
* WebCore.gypi:
* bindings/scripts/CodeGeneratorJS.pm:
(GetGenerateIsReachable):
(GetCustomIsReachable):
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/CodeGeneratorV8.pm:
(NeedsToVisitDOMWrapper):
(GetGenerateIsReachable):
(GetCustomIsReachable):
(GenerateVisitDOMWrapper):
(GenerateHeader):
(GenerateNamedConstructorCallback):
(GenerateImplementation):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/V8/V8Float64Array.cpp:
(WebCore):
* bindings/scripts/test/V8/V8Float64Array.h:
(V8Float64Array):
* bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
(WebCore):
* bindings/scripts/test/V8/V8TestActiveDOMObject.h:
(V8TestActiveDOMObject):
* bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
(WebCore):
* bindings/scripts/test/V8/V8TestCustomNamedGetter.h:
(V8TestCustomNamedGetter):
* bindings/scripts/test/V8/V8TestEventConstructor.cpp:
(WebCore):
* bindings/scripts/test/V8/V8TestEventConstructor.h:
(V8TestEventConstructor):
* bindings/scripts/test/V8/V8TestEventTarget.cpp:
(WebCore):
* bindings/scripts/test/V8/V8TestEventTarget.h:
(V8TestEventTarget):
* bindings/scripts/test/V8/V8TestInterface.cpp:
(WebCore):
* bindings/scripts/test/V8/V8TestInterface.h:
(V8TestInterface):
* bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
(WebCore):
* bindings/scripts/test/V8/V8TestMediaQueryListListener.h:
(V8TestMediaQueryListListener):
* bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
(WebCore):
* bindings/scripts/test/V8/V8TestNamedConstructor.h:
(V8TestNamedConstructor):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore):
* bindings/scripts/test/V8/V8TestObj.h:
(V8TestObj):
* bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
(WebCore):
* bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h:
(V8TestSerializedScriptValueInterface):
* bindings/v8/NPV8Object.cpp:
(WebCore::npObjectTypeInfo):
* bindings/v8/V8GCController.cpp:
(WebCore::GrouperVisitor::visitDOMWrapper):
* bindings/v8/WrapperTypeInfo.h:
(WebCore):
(WrapperTypeInfo):
* bindings/v8/custom/V8CSSStyleSheetCustom.cpp: Removed.
* bindings/v8/custom/V8DOMStringMapCustom.cpp:
* bindings/v8/custom/V8DOMTokenListCustom.cpp: Removed.
* bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
(WebCore):
* bindings/v8/custom/V8NamedNodeMapCustom.cpp:
* bindings/v8/custom/V8StyleSheetCustom.cpp:
(WebCore::toV8):
* css/CSSStyleSheet.idl:
* css/StyleSheet.idl:
* dom/DOMStringMap.idl:
* dom/NamedNodeMap.idl:
* html/DOMTokenList.idl:
* html/track/TextTrackList.cpp:
* html/track/TextTrackList.idl:

LayoutTests:

* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@110641 268f45cc-cd09-0410-ab3c-d52691b4dbfc
45 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/chromium/test_expectations.txt
Source/WebCore/ChangeLog
Source/WebCore/Target.pri
Source/WebCore/UseV8.cmake
Source/WebCore/WebCore.gypi
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/bindings/scripts/IDLAttributes.txt
Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp
Source/WebCore/bindings/scripts/test/V8/V8Float64Array.h
Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h
Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.h
Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.h
Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h
Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h
Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h
Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.h
Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestObj.h
Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h
Source/WebCore/bindings/v8/NPV8Object.cpp
Source/WebCore/bindings/v8/V8GCController.cpp
Source/WebCore/bindings/v8/WrapperTypeInfo.h
Source/WebCore/bindings/v8/custom/V8CSSStyleSheetCustom.cpp [deleted file]
Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
Source/WebCore/bindings/v8/custom/V8DOMTokenListCustom.cpp [deleted file]
Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
Source/WebCore/bindings/v8/custom/V8NamedNodeMapCustom.cpp
Source/WebCore/bindings/v8/custom/V8StyleSheetCustom.cpp
Source/WebCore/css/CSSStyleSheet.idl
Source/WebCore/css/StyleSheet.idl
Source/WebCore/dom/DOMStringMap.idl
Source/WebCore/dom/NamedNodeMap.idl
Source/WebCore/html/DOMTokenList.idl
Source/WebCore/html/track/TextTrackList.cpp
Source/WebCore/html/track/TextTrackList.idl