Skip to content

[WIP] Tweak query code for performance #56509

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

Closed
wants to merge 30 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixes
  • Loading branch information
Zoxc committed Dec 7, 2018
commit cc9b91a25cca0228fb73ce67db32710a1413f3be
8 changes: 4 additions & 4 deletions src/librustc/ty/query/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ pub fn may_panic<'tcx>(job: Lrc<QueryJob<'tcx>>) {
}

#[no_mangle]
fn test_moves2<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
fn test_moves2<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
key: &DefId, key_hash: u64,
span: Span,
parent: &Option<Lrc<QueryJob<'tcx>>>,
Expand All @@ -125,7 +125,7 @@ fn test_moves2<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
span,
query: ::ty::query::queries::type_of::query(*key),
};
*Lrc::get_mut(&mut job).unwrap() =
*Lrc::get_mut(&mut job).unwrap() =
MaybeUninit::new(QueryJob::new(info, parent.clone()));
let job: Lrc<QueryJob<'tcx>> = unsafe { std::mem::transmute(job) };
let job_clone = job.clone();
Expand All @@ -141,7 +141,7 @@ fn test_moves2<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
}

#[no_mangle]
fn test_moves<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
fn test_moves<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
key: &::hir::def_id::DefId, key_hash: u64,
span: Span,
mut job_storage: MoveSlot<'a, JobOwner<'a, 'tcx, ::ty::query::queries::type_of<'tcx>>>,
Expand All @@ -154,7 +154,7 @@ fn test_moves<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
query: ::ty::query::queries::type_of::query(*key),
};
let parent = icx.query.map(|q| LrcRef::into(q));
*Lrc::get_mut(&mut job).unwrap() =
*Lrc::get_mut(&mut job).unwrap() =
MaybeUninit::new(QueryJob::new(info, parent));
let job: Lrc<QueryJob<'tcx>> = unsafe { std::mem::transmute(job) };
let job_clone = job.clone();
Expand Down