Reland "Walk up the super chain to find an IMT to share."

This reverts commit ef0b1544519f91fc5663b06d433da474115feb5a.

Bug: 266937358

Reason for revert: Fix wrong assumption: an IMT being shared can be
updated for subclasses, but we need to use the right allocator.

Change-Id: I0055a81d30199e5cba53f21a5b759fe530a0dfa2
7 files changed