servo/components/script
bors-servo 23b6f569d0
Auto merge of #20314 - Xanewok:remove-heap-constructor, r=jdm
Don't use unsafe Heap::new constructor

<!-- Please describe your changes on the following line: -->
Pulls https://github.com/servo/rust-mozjs/pull/398 and aims to close https://github.com/servo/rust-mozjs/issues/343.

We can't convert from `JSVal` to `Heap<JSVal>` safely (due to GC barriers we can't move Heap value after changing its underlying value to something meaningful, e.g. non-null or non-undefined), so I decided to also wrap the Heap values in a Box (and in dictionaries in RootedTraceableBox, see https://github.com/servo/servo/pull/20265#issuecomment-372838379 and the issue for more details) in dictionaries.

Since we allocate more to be safe, I think it'd be good to also do some sort of a JS perf run, if there is any to see if there's any significant overhead.

r? @jdm

---
<!-- 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
- [X] These changes do not require tests because checking for not moving Heap after setting a value would require encoding a lot more info in type system (Heap) and I'm not sure how to do that and end up with an ergonomic and consistent API

<!-- 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/20314)
<!-- Reviewable:end -->
2018-03-18 15:22:23 -04:00
..
docs Rename Root<T> to DomRoot<T> 2017-09-26 09:49:10 +02:00
dom Auto merge of #20314 - Xanewok:remove-heap-constructor, r=jdm 2018-03-18 15:22:23 -04:00
task_source added pipelines to all task sources 2017-10-25 14:25:58 +01:00
body.rs Replace all uses of the heapsize crate with malloc_size_of. 2017-10-18 22:20:37 +11:00
build.rs Use env::var_os to read paths from the environment 2017-10-20 09:03:21 -07:00
Cargo.toml Use mozjs 0.3 fork without Heap::new 2018-03-16 16:53:18 +01:00
clipboard_provider.rs make use of ScriptToConstellationChan 2017-08-15 08:22:09 +02:00
CMakeLists.txt build(cmake): detect python binary for specified version 2018-03-13 09:25:06 -07:00
devtools.rs Add layout RPC query for getting an element's style 2018-01-28 10:59:45 +01:00
document_loader.rs Add a topLevelDomComplete metric. 2017-12-14 16:48:19 -06:00
fetch.rs Add FetchCanceller RAII handle 2017-11-21 16:45:03 -08:00
layout_image.rs Merge request type and destination 2017-10-23 11:19:35 -07:00
lib.rs Switch from servo/angle to the mozangle crate 2018-03-12 14:23:20 +01:00
mem.rs Replace all uses of the heapsize crate with malloc_size_of. 2017-10-18 22:20:37 +11:00
microtask.rs Replace all uses of the heapsize crate with malloc_size_of. 2017-10-18 22:20:37 +11:00
network_listener.rs Introduce TaskOnce 2017-09-20 10:37:09 +02:00
script_runtime.rs Remove js.mem.gc.refresh_frame_slices.enabled pref 2018-01-06 23:11:48 +01:00
script_thread.rs constellation: Make setting up the WebGL state fallible. 2018-03-09 23:27:29 +01:00
serviceworker_manager.rs remove extra spaces after keywords 2017-07-20 00:45:02 +03:00
serviceworkerjob.rs added pipelines to all task sources 2017-10-25 14:25:58 +01:00
stylesheet_loader.rs Split CssUrl from SpecifiedUrl for non-value URLs. 2018-03-08 23:34:34 +11:00
task.rs Make usage of core_intrinsics optional 2017-10-16 20:20:21 +02:00
test.rs Parse srcset attribute 2017-10-03 13:18:01 +02:00
textinput.rs Correct default selectionStart and selectionEnd 2018-02-23 02:37:11 +05:30
timers.rs Replace all uses of the heapsize crate with malloc_size_of. 2017-10-18 22:20:37 +11:00
unpremultiplytable.rs
webdriver_handlers.rs Rename Root<T> to DomRoot<T> 2017-09-26 09:49:10 +02:00