Changeset 49835 in webkit
- Timestamp:
- Oct 19, 2009 9:05:05 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r49833 r49835 1 2009-10-19 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 REGRESSION: Dromaeo DOM test is 14% slower 6 https://bugs.webkit.org/show_bug.cgi?id=30273 7 8 Make DOM bindings automatically inherit correct structure 9 flags rather than being needlessly conservative. This is 10 done by making the bindings generator use the same model 11 for TypeInfo flags that we now use in JSC. 12 13 This gains us about 1% of this regression back. 14 15 * bindings/js/JSDOMBinding.h: 16 (WebCore::DOMObjectWithGlobalPointer::createStructure): 17 (WebCore::DOMConstructorObject::createStructure): 18 * bindings/js/JSDOMWindowShell.h: 19 (WebCore::JSDOMWindowShell::createStructure): 20 * bindings/js/JSHTMLAllCollection.h: 21 (WebCore::JSHTMLAllCollection::createStructure): 22 * bindings/js/JSQuarantinedObjectWrapper.h: 23 (WebCore::JSQuarantinedObjectWrapper::createStructure): 24 * bindings/scripts/CodeGeneratorJS.pm: 25 * bridge/objc/objc_runtime.h: 26 (JSC::Bindings::ObjcFallbackObjectImp::createStructure): 27 * bridge/runtime_array.h: 28 (JSC::RuntimeArray::createStructure): 29 * bridge/runtime_method.h: 30 (JSC::RuntimeMethod::createStructure): 31 * bridge/runtime_object.h: 32 (JSC::RuntimeObjectImp::createStructure): 33 1 34 2009-10-19 Robin Qiu <robin.qiu@torchmobile.com.cn> 2 35 -
trunk/WebCore/bindings/js/JSDOMBinding.h
r49649 r49835 77 77 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) 78 78 { 79 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, JSC::OverridesMarkChildren));79 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags)); 80 80 } 81 81 82 82 protected: 83 static const unsigned StructureFlags = JSC::OverridesMarkChildren | DOMObject::StructureFlags; 84 83 85 DOMObjectWithGlobalPointer(NonNullPassRefPtr<JSC::Structure> structure, JSDOMGlobalObject* globalObject) 84 86 : DOMObject(structure) … … 107 109 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) 108 110 { 109 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, JSC::ImplementsHasInstance | JSC::OverridesMarkChildren));111 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags)); 110 112 } 111 113 112 114 protected: 115 static const unsigned StructureFlags = JSC::ImplementsHasInstance | JSC::OverridesMarkChildren | DOMObjectWithGlobalPointer::StructureFlags; 113 116 DOMConstructorObject(NonNullPassRefPtr<JSC::Structure> structure, JSDOMGlobalObject* globalObject) 114 117 : DOMObjectWithGlobalPointer(structure, globalObject) -
trunk/WebCore/bindings/js/JSDOMWindowShell.h
r49694 r49835 61 61 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) 62 62 { 63 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, JSC::OverridesGetOwnPropertySlot | JSC::OverridesMarkChildren | JSC::OverridesGetPropertyNames));63 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags)); 64 64 } 65 65 66 66 private: 67 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesMarkChildren | JSC::OverridesGetPropertyNames | DOMObject::StructureFlags; 68 67 69 virtual void markChildren(JSC::MarkStack&); 68 70 virtual JSC::UString className() const; -
trunk/WebCore/bindings/js/JSHTMLAllCollection.h
r49694 r49835 43 43 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue proto) 44 44 { 45 return JSC::Structure::create(proto, JSC::TypeInfo(JSC::ObjectType, JSC::OverridesGetOwnPropertySlot | JSC::MasqueradesAsUndefined | JSC::OverridesMarkChildren | JSC::OverridesGetPropertyNames));45 return JSC::Structure::create(proto, JSC::TypeInfo(JSC::ObjectType, StructureFlags)); 46 46 } 47 47 48 48 static const JSC::ClassInfo s_info; 49 protected: 50 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::MasqueradesAsUndefined | JSC::OverridesMarkChildren | JSC::OverridesGetPropertyNames | JSHTMLCollection::StructureFlags; 49 51 50 52 private: -
trunk/WebCore/bindings/js/JSQuarantinedObjectWrapper.h
r49694 r49835 48 48 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue proto) 49 49 { 50 return JSC::Structure::create(proto, JSC::TypeInfo(JSC::ObjectType, JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | JSC::OverridesHasInstance | JSC::OverridesMarkChildren | JSC::OverridesGetPropertyNames));50 return JSC::Structure::create(proto, JSC::TypeInfo(JSC::ObjectType, StructureFlags)); 51 51 } 52 52 53 53 protected: 54 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | JSC::OverridesHasInstance | JSC::OverridesMarkChildren | JSC::OverridesGetPropertyNames | JSC::JSObject::StructureFlags; 55 54 56 JSQuarantinedObjectWrapper(JSC::ExecState* unwrappedExec, JSC::JSObject* unwrappedObject, NonNullPassRefPtr<JSC::Structure>); 55 57 -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r49694 r49835 464 464 my $implClassName = $interfaceName; 465 465 my @ancestorInterfaceNames = (); 466 my %structureFlags = (); 466 467 467 468 # We only support multiple parents with SVG (for now). … … 575 576 push(@headerContent, " bool getOwnPropertySlotDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);\n") if $dataNode->extendedAttributes->{"DelegatingGetOwnPropertySlot"}; 576 577 push(@headerContent, " bool getOwnPropertyDescriptorDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);\n") if $dataNode->extendedAttributes->{"DelegatingGetOwnPropertySlot"}; 578 $structureFlags{"JSC::OverridesGetOwnPropertySlot"} = 1; 577 579 } 578 580 … … 603 605 # Structure ID 604 606 if ($interfaceName eq "DOMWindow") { 605 push(@headerContent, 606 " static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)\n" . 607 " {\n" . 608 " return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | JSC::NeedsThisConversion | JSC::OverridesMarkChildren | JSC::OverridesGetPropertyNames));\n" . 609 " }\n\n"); 610 } elsif ($hasGetter) { 611 push(@headerContent, 612 " static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)\n" . 613 " {\n" . 614 " return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, JSC::OverridesGetOwnPropertySlot | JSC::OverridesMarkChildren | JSC::OverridesGetPropertyNames));\n" . 615 " }\n\n"); 616 } 607 $structureFlags{"JSC::ImplementsHasInstance"} = 1; 608 $structureFlags{"JSC::NeedsThisConversion"} = 1; 609 } 610 push(@headerContent, 611 " static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)\n" . 612 " {\n" . 613 " return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags));\n" . 614 " }\n\n"); 617 615 618 616 # markChildren function 619 push(@headerContent, " virtual void markChildren(JSC::MarkStack&);\n\n") if $needsMarkChildren; 617 if ($needsMarkChildren) { 618 push(@headerContent, " virtual void markChildren(JSC::MarkStack&);\n\n"); 619 $structureFlags{"JSC::OverridesMarkChildren"} = 1; 620 } 620 621 621 622 # Custom pushEventHandlerScope function … … 629 630 630 631 # Custom getPropertyNames function exists on DOMWindow 631 push(@headerContent, " virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&);\n") if $interfaceName eq "DOMWindow"; 632 if ($interfaceName eq "DOMWindow") { 633 push(@headerContent, " virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&);\n"); 634 $structureFlags{"JSC::OverridesGetPropertyNames"} = 1; 635 } 632 636 633 637 # Custom defineProperty function exists on DOMWindow … … 635 639 636 640 # Custom getOwnPropertyNames function 637 push(@headerContent, " virtual void getOwnPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&);\n") if ($dataNode->extendedAttributes->{"CustomGetPropertyNames"} || $dataNode->extendedAttributes->{"HasIndexGetter"} || $dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}); 641 if ($dataNode->extendedAttributes->{"CustomGetPropertyNames"} || $dataNode->extendedAttributes->{"HasIndexGetter"} || $dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) { 642 push(@headerContent, " virtual void getOwnPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&);\n"); 643 $structureFlags{"JSC::OverridesGetPropertyNames"} = 1; 644 } 638 645 639 646 # Custom getPropertyAttributes function … … 713 720 push(@headerContent, " }\n"); 714 721 } 722 723 # structure flags 724 push(@headerContent, "protected:\n"); 725 push(@headerContent, " static const unsigned StructureFlags = "); 726 foreach my $structureFlag (keys %structureFlags) { 727 push(@headerContent, $structureFlag . " | "); 728 } 729 push(@headerContent, "Base::StructureFlags;\n"); 715 730 716 731 # Index getter … … 720 735 if ($dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) { 721 736 push(@headerContent, " JSC::JSValue getByIndex(JSC::ExecState*, unsigned index);\n"); 737 722 738 } 723 739 … … 771 787 772 788 # Add prototype declaration. 789 %structureFlags = (); 773 790 push(@headerContent, "class ${className}Prototype : public JSC::JSObject {\n"); 774 791 push(@headerContent, " typedef JSC::JSObject Base;\n"); … … 788 805 push(@headerContent, " bool getOwnPropertySlotDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);\n") if $dataNode->extendedAttributes->{"DelegatingPrototypeGetOwnPropertySlot"}; 789 806 push(@headerContent, " bool getOwnPropertyDescriptorDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);\n") if $dataNode->extendedAttributes->{"DelegatingPrototypeGetOwnPropertySlot"}; 790 791 push(@headerContent, 792 " static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)\n" . 793 " {\n" . 794 " return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, JSC::OverridesGetOwnPropertySlot" . ($needsMarkChildren ? " | JSC::OverridesMarkChildren" : "") . " | JSC::OverridesGetPropertyNames));\n" . 795 " }\n"); 796 } elsif ($dataNode->extendedAttributes->{"CustomMarkFunction"}) { 797 push(@headerContent, 798 " static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)\n" . 799 " {\n" . 800 " return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, JSC::OverridesGetOwnPropertySlot | JSC::OverridesMarkChildren | JSC::OverridesGetPropertyNames));\n" . 801 " }\n"); 802 } 807 $structureFlags{"JSC::OverridesGetOwnPropertySlot"} = 1; 808 } 809 if ($dataNode->extendedAttributes->{"CustomMarkFunction"} or $needsMarkChildren) { 810 $structureFlags{"JSC::OverridesMarkChildren"} = 1; 811 } 812 push(@headerContent, 813 " static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)\n" . 814 " {\n" . 815 " return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, JSC::OverridesGetOwnPropertySlot" . ($needsMarkChildren ? " | JSC::OverridesMarkChildren" : "") . " | JSC::OverridesGetPropertyNames));\n" . 816 " }\n"); 803 817 if ($dataNode->extendedAttributes->{"DelegatingPrototypePutFunction"}) { 804 818 push(@headerContent, " virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);\n"); … … 810 824 811 825 push(@headerContent, " ${className}Prototype(NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObject(structure) { }\n"); 826 827 # structure flags 828 push(@headerContent, "protected:\n"); 829 push(@headerContent, " static const unsigned StructureFlags = "); 830 foreach my $structureFlag (keys %structureFlags) { 831 push(@headerContent, $structureFlag . " | "); 832 } 833 push(@headerContent, "Base::StructureFlags;\n"); 812 834 813 835 push(@headerContent, "};\n\n"); … … 2254 2276 static PassRefPtr<Structure> createStructure(JSValue proto) 2255 2277 { 2256 return Structure::create(proto, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesMarkChildren | OverridesGetPropertyNames)); 2257 } 2278 return Structure::create(proto, TypeInfo(ObjectType, StructureFlags)); 2279 } 2280 2281 protected: 2282 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | DOMConstructorObject::StructureFlags; 2258 2283 EOF 2259 2284 -
trunk/WebCore/bridge/objc/objc_runtime.h
r49607 r49835 105 105 static PassRefPtr<Structure> createStructure(JSValue prototype) 106 106 { 107 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot));107 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 108 108 } 109 109 110 110 private: 111 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags; 111 112 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 112 113 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); -
trunk/WebCore/bridge/runtime_array.h
r49694 r49835 60 60 static PassRefPtr<Structure> createStructure(JSValue prototype) 61 61 { 62 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | OverridesGetPropertyNames));62 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 63 63 } 64 64 65 65 private: 66 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSObject::StructureFlags; 66 67 static JSValue lengthGetter(ExecState*, const Identifier&, const PropertySlot&); 67 68 static JSValue indexGetter(ExecState*, const Identifier&, const PropertySlot&); -
trunk/WebCore/bridge/runtime_method.h
r49649 r49835 48 48 static PassRefPtr<Structure> createStructure(JSValue prototype) 49 49 { 50 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesMarkChildren));50 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 51 51 } 52 52 53 53 private: 54 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesMarkChildren | InternalFunction::StructureFlags; 54 55 static JSValue lengthGetter(ExecState*, const Identifier&, const PropertySlot&); 55 56 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); -
trunk/WebCore/bridge/runtime_object.h
r49694 r49835 63 63 static PassRefPtr<Structure> createStructure(JSValue prototype) 64 64 { 65 return Structure::create(prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | OverridesGetPropertyNames));65 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); 66 66 } 67 67 68 68 protected: 69 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSObject::StructureFlags; 69 70 RuntimeObjectImp(ExecState*, NonNullPassRefPtr<Structure>, PassRefPtr<Bindings::Instance>); 70 71
Note: See TracChangeset
for help on using the changeset viewer.