Specialize $closeResource(Throwable, AutoCloseable) so that desugared code does not depend on AutoCloseable, as it is not available before API 19.

This CL includes the following:
1. A type inference algorithm based on ASM. It relies on the stack map frames to compute type information at the entry of basic blocks.
2. The type inference is used to infer the types of the resources to be closed. Then for each concrete resource type, we specialize the synthetic $closeResource method to $closeResource(Throwable, <concrete resource type>).

RELNOTES: None
PiperOrigin-RevId: 175731437
GitOrigin-RevId: e83f3b1fb010298cbe1e16e5f7f2f39bfb045cef
Change-Id: I347f8e4058a191621fb21bf2e81d7cf8f39ce6aa
12 files changed
tree: 31ba0cfa1fa639cda488ce1c736f15e652b38443
  1. java/
  2. test/