JIT: stateful local ref counts and weights (#19068)
authorAndy Ayers <andya@microsoft.com>
Sun, 22 Jul 2018 16:12:10 +0000 (09:12 -0700)
committerGitHub <noreply@github.com>
Sun, 22 Jul 2018 16:12:10 +0000 (09:12 -0700)
commit45f1ec9c4d91733c76868870ff85f2beafabdd39
treecdfdd39558154c4e533609fddf7262fe1bba33a1
parente9595bec6df5fbfc9fb8be811f51418c3b9cf945
JIT: stateful local ref counts and weights (#19068)

Introduce a notion of state for local var ref counts and weighted ref counts.
Accesses and current state must agree.

State is invalid initially, enabled for an early period around bits of morph,
invalid again for a time, and then enabled normally once lvaMarkRefs is called.

Accesses normally specify RCS_NORMAL as the desired state, but in the accesses
of selected ref counts in morph, specify RCS_EARLY.

Revise how we decide if normal ref counting is active by changing
`lvaLocalVarRefCounted` into a method.

Update `gtIsLikelyRegVar` to not access ref counts when they're not in a valid
state.

Change weight APIs over to use `weight_t`.
src/jit/assertionprop.cpp
src/jit/compiler.cpp
src/jit/compiler.h
src/jit/compiler.hpp
src/jit/flowgraph.cpp
src/jit/gentree.cpp
src/jit/lclvars.cpp
src/jit/morph.cpp
src/jit/optimizer.cpp