Changeset 87063 in webkit
- Timestamp:
- May 23, 2011 1:48:35 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87062 r87063 1 2011-05-19 Vitaly Repeshko <vitalyr@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 [V8] Explicitly mark objects with complex GC rules. 6 https://bugs.webkit.org/show_bug.cgi?id=61131 7 8 From the GC point view there are two kinds of objects: the ones 9 that may participate in object grouping (i.e. their lifetime 10 depends on other objects) and the ones that never participate in 11 grouping (independent). V8 added support for marking persistent 12 handles as independent so that the GC can process the objects they 13 hold faster. The motivating use case here is typed arrays. 14 15 This patch adds V8-specific inherited IDL attribute 16 V8DependentLifetime to types used in V8GCController, which is 17 exactly the set of types with object lifetimes depending on other 18 objects. The handles for the types that are not marked with the 19 new attribute can be marked as independent and GC-ed faster. 20 21 * bindings/scripts/CodeGeneratorV8.pm: Added proccessing of the new attribute. 22 23 Updated test output: 24 * bindings/scripts/test/V8/V8TestInterface.cpp: 25 (WebCore::V8TestInterface::wrapSlow): 26 * bindings/scripts/test/V8/V8TestInterface.h: 27 * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: 28 (WebCore::V8TestMediaQueryListListener::wrapSlow): 29 * bindings/scripts/test/V8/V8TestMediaQueryListListener.h: 30 * bindings/scripts/test/V8/V8TestObj.cpp: 31 (WebCore::V8TestObj::wrapSlow): 32 * bindings/scripts/test/V8/V8TestObj.h: 33 * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: 34 (WebCore::V8TestSerializedScriptValueInterface::wrapSlow): 35 * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h: 36 37 Added the new attribute: 38 * css/CSSRule.idl: 39 * css/CSSRuleList.idl: 40 * css/CSSStyleDeclaration.idl: 41 * css/CSSValue.idl: 42 * css/StyleSheet.idl: 43 * css/StyleSheetList.idl: 44 * dom/DOMImplementation.idl: 45 * dom/Node.idl: 46 1 47 2011-05-23 Sheriff Bot <webkit.review.bot@gmail.com> 2 48 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
r86765 r87063 233 233 $codeGenerator->AddMethodsConstantsAndAttributesFromParentClasses($dataNode, \@allParents, 1); 234 234 235 my $hasDependentLifetime = $dataNode->extendedAttributes->{"V8DependentLifetime"} || IsActiveDomType($interfaceName) || $className =~ /SVG/; 236 if (!$hasDependentLifetime) { 237 foreach (@{$dataNode->parents}) { 238 my $parent = $codeGenerator->StripModule($_); 239 next if $parent eq "EventTarget"; 240 $headerIncludes{"V8${parent}.h"} = 1; 241 } 242 } 243 235 244 my $hasLegacyParent = $dataNode->extendedAttributes->{"LegacyParent"}; 236 245 … … 269 278 push(@headerContent, "\nclass FloatRect;\n") if $svgPropertyType && $svgPropertyType eq "FloatRect"; 270 279 push(@headerContent, "\nclass $className {\n"); 280 push(@headerContent, "public:\n"); 281 282 push(@headerContent, " static const bool hasDependentLifetime = "); 283 if ($hasDependentLifetime) { 284 push(@headerContent, "true;\n"); 285 } elsif (@{$dataNode->parents}) { 286 # Even if this type doesn't have the V8DependentLifetime attribute its parents may. 287 # Let the compiler statically determine this for us. 288 my $separator = ""; 289 foreach (@{$dataNode->parents}) { 290 my $parent = $codeGenerator->StripModule($_); 291 next if $parent eq "EventTarget"; 292 $headerIncludes{"V8${parent}.h"} = 1; 293 push(@headerContent, "${separator}V8${parent}::hasDependentLifetime"); 294 $separator = " || "; 295 } 296 push(@headerContent, ";\n"); 297 } else { 298 push(@headerContent, "false;\n"); 299 } 271 300 272 301 my $nativeType = GetNativeTypeForConversions($dataNode, $interfaceName); … … 277 306 278 307 push(@headerContent, <<END); 279 280 public:281 308 static bool HasInstance(v8::Handle<v8::Value> value); 282 309 static v8::Persistent<v8::FunctionTemplate> GetRawTemplate(); … … 2527 2554 push(@implContent, <<END); 2528 2555 v8::Persistent<v8::Object> wrapperHandle = v8::Persistent<v8::Object>::New(wrapper); 2556 if (!hasDependentLifetime) 2557 wrapperHandle.MarkIndependent(); 2529 2558 END 2530 2559 if (IsNodeSubType($dataNode)) { -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
r81789 r87063 89 89 impl->ref(); 90 90 v8::Persistent<v8::Object> wrapperHandle = v8::Persistent<v8::Object>::New(wrapper); 91 if (!hasDependentLifetime) 92 wrapperHandle.MarkIndependent(); 91 93 getDOMObjectMap().set(impl, wrapperHandle); 92 94 return wrapper; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h
r80072 r87063 34 34 35 35 class V8TestInterface { 36 37 36 public: 37 static const bool hasDependentLifetime = false; 38 38 static bool HasInstance(v8::Handle<v8::Value> value); 39 39 static v8::Persistent<v8::FunctionTemplate> GetRawTemplate(); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
r81789 r87063 96 96 impl->ref(); 97 97 v8::Persistent<v8::Object> wrapperHandle = v8::Persistent<v8::Object>::New(wrapper); 98 if (!hasDependentLifetime) 99 wrapperHandle.MarkIndependent(); 98 100 getDOMObjectMap().set(impl, wrapperHandle); 99 101 return wrapper; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h
r80072 r87063 32 32 33 33 class V8TestMediaQueryListListener { 34 35 34 public: 35 static const bool hasDependentLifetime = false; 36 36 static bool HasInstance(v8::Handle<v8::Value> value); 37 37 static v8::Persistent<v8::FunctionTemplate> GetRawTemplate(); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
r81789 r87063 1382 1382 impl->ref(); 1383 1383 v8::Persistent<v8::Object> wrapperHandle = v8::Persistent<v8::Object>::New(wrapper); 1384 if (!hasDependentLifetime) 1385 wrapperHandle.MarkIndependent(); 1384 1386 getDOMObjectMap().set(impl, wrapperHandle); 1385 1387 return wrapper; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.h
r80072 r87063 32 32 33 33 class V8TestObj { 34 35 34 public: 35 static const bool hasDependentLifetime = false; 36 36 static bool HasInstance(v8::Handle<v8::Value> value); 37 37 static v8::Persistent<v8::FunctionTemplate> GetRawTemplate(); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
r81789 r87063 85 85 SerializedScriptValue::deserializeAndSetProperty(wrapper, "value", static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly), impl->value()); 86 86 v8::Persistent<v8::Object> wrapperHandle = v8::Persistent<v8::Object>::New(wrapper); 87 if (!hasDependentLifetime) 88 wrapperHandle.MarkIndependent(); 87 89 getDOMObjectMap().set(impl, wrapperHandle); 88 90 return wrapper; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h
r80072 r87063 34 34 35 35 class V8TestSerializedScriptValueInterface { 36 37 36 public: 37 static const bool hasDependentLifetime = false; 38 38 static bool HasInstance(v8::Handle<v8::Value> value); 39 39 static v8::Persistent<v8::FunctionTemplate> GetRawTemplate(); -
trunk/Source/WebCore/css/CSSRule.idl
r84764 r87063 26 26 GenerateIsReachable, 27 27 CustomToJS, 28 Polymorphic 28 Polymorphic, 29 V8DependentLifetime 29 30 ] CSSRule { 30 31 -
trunk/Source/WebCore/css/CSSRuleList.idl
r84699 r87063 29 29 interface [ 30 30 CustomIsReachable, 31 HasIndexGetter 31 HasIndexGetter, 32 V8DependentLifetime 32 33 ] CSSRuleList { 33 34 readonly attribute unsigned long length; -
trunk/Source/WebCore/css/CSSStyleDeclaration.idl
r84764 r87063 27 27 DelegatingPutFunction, 28 28 HasNameGetter, 29 HasIndexGetter 29 HasIndexGetter, 30 V8DependentLifetime 30 31 ] CSSStyleDeclaration { 31 32 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString cssText -
trunk/Source/WebCore/css/CSSValue.idl
r84699 r87063 25 25 CustomIsReachable, 26 26 CustomFinalize, 27 Polymorphic 27 Polymorphic, 28 V8DependentLifetime 28 29 ] CSSValue { 29 30 -
trunk/Source/WebCore/css/StyleSheet.idl
r84764 r87063 26 26 GenerateIsReachable, 27 27 CustomToJS, 28 Polymorphic 28 Polymorphic, 29 V8DependentLifetime 29 30 ] StyleSheet { 30 31 readonly attribute [ConvertNullStringTo=Null] DOMString type; -
trunk/Source/WebCore/css/StyleSheetList.idl
r84764 r87063 25 25 GenerateIsReachable=ImplDocument, 26 26 HasIndexGetter, 27 HasNameGetter 27 HasNameGetter, 28 V8DependentLifetime 28 29 ] StyleSheetList { 29 30 readonly attribute unsigned long length; -
trunk/Source/WebCore/dom/DOMImplementation.idl
r84764 r87063 22 22 23 23 interface [ 24 GenerateIsReachable=ImplDocument 24 GenerateIsReachable=ImplDocument, 25 V8DependentLifetime 25 26 ] DOMImplementation { 26 27 -
trunk/Source/WebCore/dom/Node.idl
r84699 r87063 31 31 GenerateNativeConverter, 32 32 InlineGetOwnPropertySlot, 33 Polymorphic 33 Polymorphic, 34 V8DependentLifetime 34 35 ] Node 35 36 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
Note: See TracChangeset
for help on using the changeset viewer.