Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Generic script crate #21371

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hrvolapeter
Copy link

@hrvolapeter hrvolapeter commented Aug 9, 2018

Separation is based on adding types to TypeHolderTrait which contains
associated types with traits that script crate actually needs. This allows
using static methods and Sized types.

Affects servo in two ways:

  • generic structs do not compile in script crate but are left for later monomorphization
  • dom_structs itself are moved to separate crate

TODO:

  • tests
  • performance
  • polyshing

Fixes #1799

r? @jdm


  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive
Copy link

highfive commented Aug 9, 2018

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @jdm (or someone else) soon.

@highfive
Copy link

highfive commented Aug 9, 2018

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/test.rs, components/script/dom/textencoder.rs, components/script/dom/htmlbrelement.rs, components/script/dom/audiodestinationnode.rs, components/script/dom/abstractworkerglobalscope.rs and 345 more
  • @wafflespeanut: python/tidy/servo_tidy_tests/ban-domrefcell.rs
  • @edunham: python/tidy/servo_tidy_tests/ban-domrefcell.rs
  • @paulrouget: components/servo/lib.rs, components/servo/Cargo.toml
  • @KiChjang: components/script/test.rs, components/script/dom/textencoder.rs, components/script/dom/htmlbrelement.rs, components/script/dom/audiodestinationnode.rs, components/script/dom/abstractworkerglobalscope.rs and 345 more

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 9, 2018
@highfive
Copy link

highfive commented Aug 9, 2018

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@jdm
Copy link
Member

jdm commented Aug 9, 2018

@bors-servo try

@bors-servo
Copy link
Contributor

⌛ Trying commit e668042 with merge 32f598e...

bors-servo pushed a commit that referenced this pull request Aug 9, 2018
[WIP] Generic script crate

Separation is based on adding types to TypeHolderTrait which contains
associated types with traits that script crate actually needs. This allows
using static methods and Sized types.

Affects servo in two ways:
- generic structs do not compile in script crate but are left for later monomorphization
- dom_structs itself are moved to separate crate

TODO:
- [ ] tests
- [ ] performance
- [ ] polyshing

Fixes #1799

r? @jdm

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #1799 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21371)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - linux-rel-css

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Aug 9, 2018
@jdm
Copy link
Member

jdm commented Aug 9, 2018

Results from local measurements using non-incremental builds:

master:
./mach build -d; touch components/script/dom/servoparser/html.rs && ./mach build -d: 3:49m

PR:
./mach build -d; touch components/script/fetch.rs && ./mach build -d: 4:18m
./mach build -d; touch components/script_servoparser/html.rs && ./mach build -d: 1:59m

@jdm
Copy link
Member

jdm commented Aug 9, 2018

Results from local measurements using incremental builds:

master:
./mach build -d; touch components/script/dom/servoparser/html.rs && ./mach build -d: 3:19m

PR:
./mach build -d; touch components/script/fetch.rs && ./mach build -d: 2:56m
./mach build -d; touch components/script_servoparser/html.rs && ./mach build -d: 1:48m

@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably #20678) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Aug 11, 2018
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Aug 20, 2018
@hrvolapeter hrvolapeter force-pushed the generic-servo branch 3 times, most recently from 540bef5 to 57d5567 Compare August 26, 2018 21:22
@jdm
Copy link
Member

jdm commented Oct 1, 2018

@retep007 Does this PR contain the most recent changes you have been making? I might try to keep investigating this week.

@hrvolapeter
Copy link
Author

@jdm It contains all latest changes, however I can rebase it for you. Also I don't really know how to solve the ICE problem, no response from rust-lang so far. Those const functions are used to generate const variables and one of them can't be replaced so easily.

@jdm
Copy link
Member

jdm commented Oct 1, 2018

Ah, that's good to know. Have you tried making duplicating the function and making a non-const version?

@hrvolapeter
Copy link
Author

Last static fn which I wasn't able to remove is Guard::newwhich I think is beyond manual replacement. But maybe we could try lazy_static?

@jdm
Copy link
Member

jdm commented Oct 3, 2018

I'm not sure I understand - what's the problem with Guard::new, exactly?

Separation is based on adding types to TypeHolderTrait which contains
associated types with traits that script crate actually needs. This allows
using static methods and Sized types.

Affects servo in two ways:
- generic structs does not compile in script crate, but are left for later monomorphization
- dom_structs itself are moved to separate crate

TODO:
- [] tests
- [] performance
- [] polyshing
@hrvolapeter
Copy link
Author

@jdm I solved the const fn issue and rebased I get window is undefined. I guess that it origniates from mozjs which is checking for null pointer provided by servo. Maybe something wrong with initialization?

@jdm jdm removed the S-awaiting-review There is new code that needs to be reviewed. label Jan 31, 2019
@sagudev sagudev mentioned this pull request Dec 15, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-needs-rebase There are merge conflict errors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split up the script crate for build speed
4 participants