Performance: hit stack.size() less in agency adoption

On HTML test cases that use adoption, this was causing ~ 23% of CPU
time. Knocks it down to ~ 7%. (Which I found unintuitive, because it's
a simple int getter, and I expected that to get inlined by the JIT.