ad0f14e0ce
Each script has an associated top-level class in which the top-level functions and fields are stored, and the reference to the script. All other fields in the TL class are unused. There are 380 TL classes in corelib alone; eliminating them saves space. This CL eliminates all TL classes but one per library. All TL functions and fields in the library are stored in that TL class. Because scripts are not stored directly in functions and fields, but are accessible via their owner class, the owner of TL entities are now PatchClasses, rather than classes. Before: Size of vm isolate snapshot = 930813 New space (0k of 0k) Old space (1184k of 1624k) VM Isolate: Number of symbols : 14909 Size of isolate snapshot = 261873 New space (0k of 2048k) Old space (987k of 1024k) After: Size of vm isolate snapshot = 931101 New space (0k of 0k) Old space (713k of 1156k) VM Isolate: Number of symbols : 14907 Size of isolate snapshot = 256956 New space (0k of 1024k) Old space (514k of 768k) R=iposva@google.com Review URL: https://codereview.chromium.org/1410383020 .