Chromium Code Reviews
DescriptionFall 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
Committed: https://github.com/dart-lang/sdk/commit/0856863355595088aac6a519a77a2e6987bf26cf
Patch Set 1 #
Total comments: 2
Patch Set 2 : Added comment and used call site deopt history to control #Patch Set 3 : Added comment and used call site deopt history to control #
Messages
Total messages: 9 (2 generated)
|
||||||||||||||||||||||||||||