mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a
This commit is contained in:
parent
26045d7fcb
commit
d1b433a3b3
160 changed files with 1427 additions and 1162 deletions
|
@ -8,10 +8,11 @@
|
|||
#![macro_escape]
|
||||
|
||||
use flow_ref::FlowRef;
|
||||
use flow;
|
||||
use serialize::json;
|
||||
use std::cell::RefCell;
|
||||
use std::io::File;
|
||||
use std::sync::atomics::{AtomicUint, SeqCst, INIT_ATOMIC_UINT};
|
||||
use std::sync::atomic::{AtomicUint, SeqCst, INIT_ATOMIC_UINT};
|
||||
|
||||
local_data_key!(state_key: RefCell<State>)
|
||||
|
||||
|
@ -62,7 +63,7 @@ impl Scope {
|
|||
match maybe_refcell {
|
||||
Some(refcell) => {
|
||||
let mut state = refcell.borrow_mut();
|
||||
let flow_trace = json::encode(&state.flow_root.deref());
|
||||
let flow_trace = json::encode(&flow::base(state.flow_root.deref()));
|
||||
let data = box ScopeData::new(name, flow_trace);
|
||||
state.scope_stack.push(data);
|
||||
}
|
||||
|
@ -80,7 +81,7 @@ impl Drop for Scope {
|
|||
Some(refcell) => {
|
||||
let mut state = refcell.borrow_mut();
|
||||
let mut current_scope = state.scope_stack.pop().unwrap();
|
||||
current_scope.post = json::encode(&state.flow_root.deref());
|
||||
current_scope.post = json::encode(&flow::base(state.flow_root.deref()));
|
||||
let previous_scope = state.scope_stack.last_mut().unwrap();
|
||||
previous_scope.children.push(current_scope);
|
||||
}
|
||||
|
@ -101,7 +102,7 @@ pub fn generate_unique_debug_id() -> u16 {
|
|||
pub fn begin_trace(flow_root: FlowRef) {
|
||||
assert!(state_key.get().is_none());
|
||||
|
||||
let flow_trace = json::encode(&flow_root.deref());
|
||||
let flow_trace = json::encode(&flow::base(flow_root.deref()));
|
||||
let state = State {
|
||||
scope_stack: vec![box ScopeData::new("root".to_string(), flow_trace)],
|
||||
flow_root: flow_root,
|
||||
|
@ -117,7 +118,7 @@ pub fn end_trace() {
|
|||
let mut task_state = task_state_cell.borrow_mut();
|
||||
assert!(task_state.scope_stack.len() == 1);
|
||||
let mut root_scope = task_state.scope_stack.pop().unwrap();
|
||||
root_scope.post = json::encode(&task_state.flow_root.deref());
|
||||
root_scope.post = json::encode(&flow::base(task_state.flow_root.deref()));
|
||||
|
||||
let result = json::encode(&root_scope);
|
||||
let path = Path::new("layout_trace.json");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue