Remove use of unstable box syntax.

http://www.robohornet.org gives a score of 101.36 on master,
and 102.68 with this PR. The latter is slightly better,
but probably within noise level.
So it looks like this PR does not affect DOM performance.

This is expected since `Box::new` is defined as:

```rust
impl<T> Box<T> {
    #[inline(always)]
    pub fn new(x: T) -> Box<T> {
        box x
    }
}
```

With inlining, it should compile to the same as box syntax.
This commit is contained in:
Simon Sapin 2017-10-16 14:35:30 +02:00
parent a5100e3c78
commit aa15dc269f
270 changed files with 580 additions and 514 deletions

View file

@ -290,7 +290,7 @@ impl ScriptChan for SendableMainThreadScriptChan {
}
fn clone(&self) -> Box<ScriptChan + Send> {
box SendableMainThreadScriptChan((&self.0).clone())
Box::new(SendableMainThreadScriptChan((&self.0).clone()))
}
}
@ -304,7 +304,7 @@ impl ScriptChan for MainThreadScriptChan {
}
fn clone(&self) -> Box<ScriptChan + Send> {
box MainThreadScriptChan((&self.0).clone())
Box::new(MainThreadScriptChan((&self.0).clone()))
}
}
@ -804,7 +804,7 @@ impl ScriptThread {
// Ask the router to proxy IPC messages from the control port to us.
let control_port = ROUTER.route_ipc_receiver_to_new_mpsc_receiver(state.control_port);
let boxed_script_sender = box MainThreadScriptChan(chan.clone());
let boxed_script_sender = Box::new(MainThreadScriptChan(chan.clone()));
let (image_cache_channel, image_cache_port) = channel();