Smaller vtbls in RenderObject.

There are 101 different classes in the RenderObject class tree and
they share 150-250 virtual functions each. That scales to 60-200 KB
of vtbls (depending on architecture), which cost space in the
binary and time during startup since they need to be copied 
to RAM and adjusted. In fact, some RenderObject vtbls are the
largest vtbls in Chrome.

There doesn't have to be anything wrong with any of this, but the
use of 60+ virtual isXXX functions which were the same for 100 out of
101 classes could easily be replaced by a single virtual function, saving 20-50 KB of the space mentioned above (again depending on architecture).

When the class is known, the isOfType functions will constant fold, just
like the isFoo methods.

clang x64 space info:
Total change: -47075 bytes
==========================
  78 added, totalling +4731 bytes across 70 sources
  142 removed, totalling -4008 bytes across 70 sources
  397 grown, for a net change of +5064 bytes (296097 bytes before, 301161 bytes after) across 128 sources
  115 shrunk, for a net change of -52862 bytes (209130 bytes before, 156268 bytes after) across 5 sources

gcc x64 space into:
Total change: -49078 bytes
==========================
  141 added, totalling +19000 bytes across 90 sources
  200 removed, totalling -21292 bytes across 90 sources
  371 grown, for a net change of +17491 bytes (387125 bytes before, 404616 bytes after) across 164 sources
  261 shrunk, for a net change of -64277 bytes (387358 bytes before, 323081 bytes after) across 98 sources

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/613783002

git-svn-id: svn://svn.chromium.org/blink/trunk@183832 bbb929c8-8fbe-4397-9dbb-9b2b20218538
65 files changed
tree: 50878c1414e5d9c606d6703864aa1f8f3ff1b3b6
  1. third_party/