You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #1368 from kunalspathak:typecheck
`CheckIfTypeIsEquivalent` helper is called from JITted code to perform equivalent type check.
It validates if the object's type is present in one of the 8 cached equivalent
types and if yes, updates the guard value and return back to JITted code.
If not, it takes slow path and verifies the prototype of object to that of cached
type. However if guard is not valid, we would just bailout `BailOutFailedEquivalentTypeCheck`.
Today in `PreSweepCallback` we would invalidate the guard if the underline type is not marked.
However we could have invalid guard value but if there are alive types present in equivTypes[], we could
use them to check if `type` in question matches any of them and if yes, update the guard value, so next
time JIT code will be able to take advantage of it next time.
On instrumenting code, noticed that there are high frequency that this happens (at least in acmeair) where
we have valid equivTypes[], but we don'take take its advantage just because guard value is invalid.
This gives approx. 2.5 % win in acmeair. Other benchmarks are flat.
Also, I noticed that the cache eviction policy was kicking out valid caches
despite of having empty slots in types[] where new type could have been
stored. Modified the eviction logic to take advantage of empty slots before
going to existing eviction logic.
I have also added logic to compact the equivTypes by moving non-null types towards front of array.
Test: Internal tools pass
Perf: Standard benchmarks are almost flat with minor improvement in Octane, Kraken. Acme-air shows 2.5% win.
AssertMsg(originalScriptContextValue == reinterpret_cast<intptr_t>(type->GetScriptContext()), "Trying to set guard type from different script context.");
Output::Print(_u("EquivObjTypeSpec: Saving type in used slot of equiv types cache at index = %d. NextEvictionVictim = %d. \n"), index, cache->nextEvictionVictim);
0 commit comments