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

Avoid bare *mut JSObject arguments in webidl codegen #26699

Closed
wants to merge 1 commit into from

Conversation

jdm
Copy link
Member

@jdm jdm commented May 28, 2020

The motivation here was fixing a bug where argument type calculation did not treat inner types of sequences correctly. This required updating some logic for when to choose to use *mut JSObject vs. RootedTraceableBox<Heap<*mut JSObject>, which then was a good reason to choose HandleObject when possible instead.


@highfive
Copy link

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/bindings/codegen/CodegenRust.py, components/script/dom/testbinding.rs, components/script/dom/permissions.rs, components/script/dom/imagedata.rs, components/script/dom/bluetooth.rs and 1 more
  • @KiChjang: components/script/dom/bindings/codegen/CodegenRust.py, components/script/dom/testbinding.rs, components/script/dom/permissions.rs, components/script/dom/imagedata.rs, components/script/dom/bluetooth.rs and 1 more

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label May 28, 2020
@jdm
Copy link
Member Author

jdm commented May 28, 2020

r? @nox

@highfive highfive assigned nox and unassigned SimonSapin May 28, 2020
@jdm
Copy link
Member Author

jdm commented May 28, 2020

cc @kunalmohan
This should allow you to update the webidl assertion like we discussed on matrix.

@nox
Copy link
Contributor

nox commented May 29, 2020

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 21f0fde has been approved by nox

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels May 29, 2020
@bors-servo
Copy link
Contributor

⌛ Testing commit 21f0fde with merge 805db8b...

bors-servo added a commit that referenced this pull request May 29, 2020
Avoid bare *mut JSObject arguments in webidl codegen

The motivation here was fixing a bug where argument type calculation did not treat inner types of sequences correctly. This required updating some logic for when to choose to use `*mut JSObject` vs. `RootedTraceableBox<Heap<*mut JSObject>`, which then was a good reason to choose `HandleObject` when possible instead.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #13308
- [x] There are tests for these changes
@bors-servo
Copy link
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels May 29, 2020
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels May 29, 2020
@jdm
Copy link
Member Author

jdm commented May 29, 2020

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 0a35363 has been approved by jdm

@highfive highfive assigned jdm and unassigned nox May 29, 2020
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels May 29, 2020
bors-servo added a commit that referenced this pull request May 29, 2020
Avoid bare *mut JSObject arguments in webidl codegen

The motivation here was fixing a bug where argument type calculation did not treat inner types of sequences correctly. This required updating some logic for when to choose to use `*mut JSObject` vs. `RootedTraceableBox<Heap<*mut JSObject>`, which then was a good reason to choose `HandleObject` when possible instead.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #13308
- [x] There are tests for these changes
@bors-servo
Copy link
Contributor

⌛ Testing commit 0a35363 with merge 41545cf...

@bors-servo
Copy link
Contributor

💔 Test failed - status-taskcluster

@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label May 29, 2020
@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label May 29, 2020
@kunalmohan kunalmohan mentioned this pull request May 29, 2020
5 tasks
@jdm
Copy link
Member Author

jdm commented May 29, 2020

The crashes come from creating Handle values from stack temporary pointers (ie. taking the result of some_jsval_handle.to_object() and calling HandleObject::from_marked_location(&...)). If we want to go through with this, we will need to create stack roots for the result of the conversion, then take a handle from those roots.

bors-servo added a commit that referenced this pull request May 29, 2020
Improve precision of sequence types for WebIDL codegen.

Unlike #26699, this doesn't attempt to improve any of the resulting types and only maintains the status quo.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes
bors-servo added a commit that referenced this pull request May 30, 2020
Improve precision of sequence types for WebIDL codegen.

Unlike #26699, this doesn't attempt to improve any of the resulting types and only maintains the status quo.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes
bors-servo added a commit that referenced this pull request May 30, 2020
Improve precision of sequence types for WebIDL codegen.

Unlike #26699, this doesn't attempt to improve any of the resulting types and only maintains the status quo.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes
@bors-servo
Copy link
Contributor

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

@highfive highfive added the S-needs-rebase There are merge conflict errors. label May 30, 2020
bors-servo added a commit that referenced this pull request May 30, 2020
Implement GPURenderPipeline

<!-- Please describe your changes on the following line: -->
We need to wait for #26699 to merge before this.
A significant amount of validation still needs to be added. I plan on doing that in a follow-up PR.
r?@kvark

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (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. -->
bors-servo added a commit that referenced this pull request May 30, 2020
Implement GPURenderPipeline

<!-- Please describe your changes on the following line: -->
We need to wait for #26699 to merge before this.
A significant amount of validation still needs to be added. I plan on doing that in a follow-up PR.
r?@kvark

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (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. -->
bors-servo added a commit that referenced this pull request May 30, 2020
Implement GPURenderPipeline

<!-- Please describe your changes on the following line: -->
We need to wait for #26699 to merge before this.
A significant amount of validation still needs to be added. I plan on doing that in a follow-up PR.
r?@kvark

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (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. -->
@nox
Copy link
Contributor

nox commented Jun 25, 2020

This still needs a rebase (for once that I see old stuff on which I can ping you and not the reverse… 🤡)

@jdm
Copy link
Member Author

jdm commented Jun 25, 2020

It needs more than a rebase. It needs a fundamental rethink.

@jdm jdm closed this Jun 25, 2020
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. S-tests-failed The changes caused existing tests to fail.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebIDL: Represent optional objects as Option<NonZero<*mut JSObject>> in function arguments.
5 participants