aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Auto merge of #8286 - eefriedman:no-move, r=noxbors-servo2015-11-081-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unnecessary uses of #[no_move] The patch makes RootCollection a bit safer by making the StackRootTLS hold it in place. RootedVec was doing an extremely delicate dance and just hoping nobody messed it up; switch to a Box to be safe. CodeGenRust seemed to be using no_move for no particularly good reason. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8286) <!-- Reviewable:end -->
| * Clean up some code related to #[no_move].Eli Friedman2015-11-071-1/+0
| | | | | | | | | | | | | | | | The patch makes RootCollection a bit safer by making the StackRootTLS hold it in place. The use of no_move in CodeGenRust was leftover from when roots couldn't be moved.
* | Make DOMString a newtype around String, rather than a typedef.Ms2ger2015-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | This should make it somewhat easier to experiment with alternative representations in the future. To reduce churn, this commit leaves the String field public, though. Also, this will allow us to use the default String type to represent the IDL USVString type, which explicitly forbids unpaired surrogates, ans as such is a better match to the Rust String type.
* | make test-tidy happy + fix some merge errorsrohan.prinja2015-11-031-3/+3
| |
* | merge from masterrohan.prinja2015-11-031-0/+4
|\|
| * Support unions that contain USVStrings.Ms2ger2015-10-301-0/+4
| |
* | more refactoringrohan.prinja2015-10-301-3/+4
|/
* Auto merge of #8226 - froydnj:gc-zeal, r=Ms2gerbors-servo2015-10-281-20/+20
|\ | | | | | | | | | | | | | | | | | | unblock using JS_GC_ZEAL I think these patches move the `JS_SetReservedSlot` call to the right place for #6057. I'm not sure that the interface to `create_dom_global` is the best; passing a `JSVal` or a `*libc::c_void` seemed about equal, so I'd welcome feedback there. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8226) <!-- Reviewable:end -->
| * move reserved slot setting for DOM globalsNathan Froyd2015-10-271-4/+2
| | | | | | | | | | | | | | Moving this slot setting prior to initializing standard classes and other initialization tasks means that we can effectively use JS_GC_ZEAL. Fixes #6057.
| * reduce indentation in CodegenRust.pyNathan Froyd2015-10-271-20/+22
| | | | | | | | | | | | | | We're going to wind up tacking on different pieces of code for the global vs. non-global case once we move the JS_SetReservedSlot call into create_dom_global. We might as well separate the indentation changes into a separate commit.
* | Auto merge of #8040 - froydnj:codegen-arg-info, r=jdmbors-servo2015-10-281-2/+93
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | generate JIT argument type information for methods This enhances `CodegenRust.py` to output `JSTypedMethodJitInfo` structures where appropriate. This brings a notable speedup to tests like Dromaeo's `dom-attr/getAttribute`, which improves by several orders of magnitude with these patches applied. If there are tricks for addressing the XXX comments, I would appreciate hearing them. I think this addresses all of #6904. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8040) <!-- Reviewable:end -->
| * generate JIT argument type information for methodsNathan Froyd2015-10-271-2/+26
| | | | | | | | Fixes #6904.
| * add CGMemberJITInfo.{getJSArgType,getSingleArgType}Nathan Froyd2015-10-271-0/+67
| | | | | | | | | | | | | | | | | | | | These are copied directly from Gecko's Codegen.py, with two changes: - We need to use ArgType:: to qualify the enums rather than plain JSJitInfo:: - Given Rust's stronger notion of enums, we need to treat everything as an i32 so we can bitwise-or things together.
* | Auto merge of #8132 - akiss77:codegen-u8, r=Ms2gerbors-servo2015-10-211-3/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix char types in script binding codegen Use `libc::c_char` instead of `i8` for character data since that's more portable. (Some architectures, e.g. AArch64, have unsigned characters, i.e. `u8`.) <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8132) <!-- Reviewable:end -->
| * | Fix char types in script binding codegenAkos Kiss2015-10-211-3/+3
| | | | | | | | | | | | | | | | | | Use `libc::c_char` instead of `i8` for character data since that's more portable. (Some architectures, e.g. AArch64, have unsigned characters, i.e. `u8`.)
* | | Introduce trait CastableAnthony Ramine2015-10-211-116/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This trait is used to hold onto the downcast and upcast functions of all castable IDL interfaces. A castable IDL interface is one which either derives from or is derived by other interfaces. The deriving relation is represented by implementations of marker trait DerivedFrom<T: Castable> generated in InheritTypes. /^[ ]*use dom::bindings::codegen::InheritTypes::.*(Base|Cast|Derived)/ { /::[a-zA-Z]+(Base|Cast|Derived);/d s/([{ ])[a-zA-Z]+(Base|Cast|Derived), /\1/g s/([{ ])[a-zA-Z]+(Base|Cast|Derived), /\1/g s/, [a-zA-Z]+(Base|Cast|Derived)([},])/\2/g s/, [a-zA-Z]+(Base|Cast|Derived)([},])/\2/g /\{([a-zA-Z]+(Base|Cast|Derived))?\};$/d s/\{([a-zA-Z_]+)\};$/\1;/ } s/([a-zA-Z]+)Cast::from_ref\(\&?\**([a-zA-Z_]+)(\.r\(\))?\)/\2.upcast::<\1>()/g s/([a-zA-Z]+)Cast::from_ref\(\&?\**([a-zA-Z_]+)(\.[a-zA-Z_]+\(\))?\)/\2\3.upcast::<\1>()/g s/\(([a-zA-Z]+)Cast::from_ref\)/\(Castable::upcast::<\1>\)/g s/([a-zA-Z]+)Cast::from_root/Root::upcast::<\1>/g s/([a-zA-Z]+)Cast::from_layout_js\(\&([a-zA-Z_.]+)\)/\2.upcast::<\1>()/g s/([a-zA-Z]+)Cast::to_ref\(\&?\**([a-zA-Z_]+)(\.r\(\))?\)/\2.downcast::<\1>()/g s/([a-zA-Z]+)Cast::to_ref\(\&?\**([a-zA-Z_]+)(\.[a-zA-Z_]+\(\))?\)/\2\3.downcast::<\1>()/g s/\(([a-zA-Z]+)Cast::to_ref\)/\(Castable::downcast::<\1>\)/g s/([a-zA-Z]+)Cast::to_root/Root::downcast::<\1>/g s/([a-zA-Z]+)Cast::to_layout_js\(&?([a-zA-Z_.]+(\(\))?)\)/\2.downcast::<\1>()/g s/\.is_document\(\)/.is::<Document>()/g s/\.is_htmlanchorelement\(\)/.is::<HTMLAnchorElement>()/g s/\.is_htmlappletelement\(\)/.is::<HTMLAppletElement>()/g s/\.is_htmlareaelement\(\)/.is::<HTMLAreaElement>()/g s/\.is_htmlbodyelement\(\)/.is::<HTMLBodyElement>()/g s/\.is_htmlembedelement\(\)/.is::<HTMLEmbedElement>()/g s/\.is_htmlfieldsetelement\(\)/.is::<HTMLFieldSetElement>()/g s/\.is_htmlformelement\(\)/.is::<HTMLFormElement>()/g s/\.is_htmlframesetelement\(\)/.is::<HTMLFrameSetElement>()/g s/\.is_htmlhtmlelement\(\)/.is::<HTMLHtmlElement>()/g s/\.is_htmlimageelement\(\)/.is::<HTMLImageElement>()/g s/\.is_htmllegendelement\(\)/.is::<HTMLLegendElement>()/g s/\.is_htmloptgroupelement\(\)/.is::<HTMLOptGroupElement>()/g s/\.is_htmloptionelement\(\)/.is::<HTMLOptionElement>()/g s/\.is_htmlscriptelement\(\)/.is::<HTMLScriptElement>()/g s/\.is_htmltabledatacellelement\(\)/.is::<HTMLTableDataCellElement>()/g s/\.is_htmltableheadercellelement\(\)/.is::<HTMLTableHeaderCellElement>()/g s/\.is_htmltablerowelement\(\)/.is::<HTMLTableRowElement>()/g s/\.is_htmltablesectionelement\(\)/.is::<HTMLTableSectionElement>()/g s/\.is_htmltitleelement\(\)/.is::<HTMLTitleElement>()/g
* | | Introduce IDLInterface::derives()Anthony Ramine2015-10-211-24/+21
|/ / | | | | | | | | | | | | This method is given a DOMClass value and returns whether it derives from Self. Interfaces with no descendants directly check whether the given DOMClass is the same as their own.
* / Fix formatting for variable in doc-comment within codegenCorey Farwell2015-10-171-2/+2
|/
* Auto merge of #8020 - nox:codegen-derived, r=Ms2gerbors-servo2015-10-151-1/+24
|\ | | | | | | | | | | | | | | | | | | | | | | Generate all Derived implementations in codegen Follow-up of #7873. @Ms2ger r? :) <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8020) <!-- Reviewable:end -->
| * Generate all Derived implementations in codegenAnthony Ramine2015-10-141-1/+24
| |
* | Auto merge of #7972 - nox:codegen-heapsize, r=Ms2gerbors-servo2015-10-151-1/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce DOMClass::heap_size_of It holds a function pointer to the HeapSizeOf::heap_size_of_children() implementation corresponding to that IDL interface. This removes the need for a clumsly TypeId-based match expression in the former heap_size_of_eventtarget() function. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7972) <!-- Reviewable:end -->
| * | Introduce DOMClass::heap_size_ofAnthony Ramine2015-10-141-1/+4
| |/ | | | | | | | | | | | | | | It holds a function pointer to the HeapSizeOf::heap_size_of_children() implementation corresponding to that IDL interface. This removes the need for a clumsly TypeId-based match expression in the former heap_size_of_eventtarget() function.
* / Support the updated spidermonkey bindingsMichael Wu2015-10-141-85/+87
|/
* Generate the TypeId enums in codegenAnthony Ramine2015-10-141-26/+79
|
* Changed dom_class type to Option<&'static DOMClass>Andriy Kunitsin2015-10-091-3/+3
|
* Document RegisterBindings::RegisterProxyHandlers.Ms2ger2015-10-071-1/+2
|
* Add support for documenting CGAbstractMethods.Ms2ger2015-10-071-3/+14
|
* Don't generate useless InheritTypes interfacesAnthony Ramine2015-10-021-51/+78
| | | | | Interfaces with no descendant need neither a Base trait nor upcast functions, and interfaces with no ancestors neither a Derived trait nor downcast functions.
* Remove deprecated 'creator' WebIDL attributeCorey Farwell2015-09-211-4/+0
| | | | According to @Ms2ger, the 'creator' attribute was merged into 'setter'
* Python 'is' operator should not be used to check valueCorey Farwell2015-09-201-3/+3
| | | | 'is' checks reference. '==' checks value
* Remove parens around Python 'assert' statementCorey Farwell2015-09-201-7/+7
| | | | 'assert' is a statement, not a function
* Introduce [Abstract] to mark non-leaf interfacesAnthony Ramine2015-09-131-1/+1
| | | | | | | Some interfaces like Node, CharacterData and HTMLTableCellElement are never instantiated directly, only their descendant interfaces are. Those are marked with [Abstract] to set their type_id to None instead of having dummy values in the TypeId enums.
* Move EventTargetTypeId/NodeTypeId to DOMClassMichael Wu2015-09-121-1/+21
|
* Link to Servo issue instead of Gecko bugCorey Farwell2015-09-101-1/+1
|
* Auto merge of #7455 - nox:rm-unused-warnings, r=jdmbors-servo2015-08-301-23/+27
|\ | | | | | | | | | | | | | | | | | | Do not allow some warnings in codegen anymore This fixes #395. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7455) <!-- Reviewable:end -->
| * Do not allow unreachable_code in codegen anymoreAnthony Ramine2015-08-301-4/+0
| |
| * Do not allow dead_code in codegen anymoreAnthony Ramine2015-08-301-1/+0
| |
| * Do not allow unused_parens in codegen anymoreAnthony Ramine2015-08-301-4/+3
| |
| * Do not allow unused_mut in codegen anymoreAnthony Ramine2015-08-301-7/+8
| |
| * Do not allow unused_unsafe in codegen anymoreAnthony Ramine2015-08-301-7/+16
| |
* | Auto merge of #7432 - jdm:dashedprops, r=noxbors-servo2015-08-301-13/+24
|\ \ | |/ |/| | | | | | | | | | | | | | | Add dashed CSS properties in CSSStyleDeclaration <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7432) <!-- Reviewable:end -->
| * Add infrastructure for supporting dashed CSS property names on ↵Josh Matthews2015-08-281-13/+24
| | | | | | | | CSSStyleDeclaration.
* | Prefer JSTrue/JSFalse to 1/0Corey Farwell2015-08-281-9/+9
|/
* Make the traits for the IDL interfaces take &selfAnthony Ramine2015-08-271-1/+1
|
* Auto merge of #7387 - Yoric:2240-2, r=Ms2gerbors-servo2015-08-271-22/+29
|\ | | | | | | | | | | | | | | | | | | Fixes #2240 - NamedGetter and NamedSetter do not assume that the arg is named `name` I'm not totally sure about how to test this. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7387) <!-- Reviewable:end -->
| * Fixes #2240 - NamedGetter and NamedSetter do not assume that the argument is ↵David Rajchenbach-Teller2015-08-261-22/+29
| | | | | | | | named `name`
* | Auto merge of #7395 - Manishearth:doc-inherit, r=noxbors-servo2015-08-261-3/+11
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Document InheritTypes <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7395) <!-- Reviewable:end -->
| * | Document InheritTypesManish Goregaokar2015-08-271-3/+11
| | |
* | | Auto merge of #7397 - Manishearth:doublepointer-meet-fire, r=noxbors-servo2015-08-261-13/+0
|\| | | |/ |/| | | | | | | | | | | | | | | Remove doublepointer in VirtualMethods, and from_borrowed_ref <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7397) <!-- Reviewable:end -->
| * remove to_borrowed_ref, fix ActivatableManish Goregaokar2015-08-271-8/+0
| |