Files
sdk/runtime
Erik Corry 0856863355 Fall back to megamorphic stub when dispatching calls to rare classes.
Previously we were converting very polymorphic calls that always end up
in the same implementation into a check-class instruction and a (usually
inlined) direct call.  This works well in artificial benchmarks like
the Megamorphic suite, but tends to cause repeated deopts on large real
programs like dart2js, where new classes arrive after a while, triggering
the check-class instruction to deopt.  After a few deopts, the function
is no longer eligible for optimization, resulting in huge slowdowns.

Instead with this change we can switch to the normal machinery for polymorphic
calls with more than one target.  This has the advantage that we use a
megamorphic stub call to catch rare classes, rather than deopting.
Dart2js is speeded up by a few percent on average and avoids the big
performance potholes described in https://github.com/dart-lang/sdk/issues/29302

Also reverts a less effective workaround for 29302.

R=vegorov@google.com
BUG=29302

Review-Url: https://codereview.chromium.org/2829603002 .
2017-04-19 15:25:24 +02:00
..
2017-03-31 11:19:46 +02:00