Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes clinits from very common core classes Boolean&Throwable.
[Boolean] Earlier TRUE/FALSE fields were created with constructor. The constructor requires to call clinit so TRUE/FALSE field initializations wasn't inlined. As a result it caused TRUE/FALSE fields to be not hoistable via constant hoisting pass; and as the fields were not hoisted; the clinit was still required. Basically it was a chicken-egg problem. This CL uses true/false primitives directly to initialize the fields so they are hoisted and clinit is gone. The Boolean.valueOf is also updated to not use the TRUE/FALSE fields to avoid recursion in GWT (when primitive is assigned to boxed type in TRUE/FALSE fields it would normally call Boolean.valueOf. Note that J2CL takes the shortcut and not generates Boolean.valueOf calls). [Throwable] UNINITIALIZED marker object is upgraded to a compile time constant so clinit is no longer needed. Change-Id: Ic117889a5505f59b0e8c073e1d6523227fd921dd
- Loading branch information