Files
sdk/pkg/compiler/lib
Asger Feldthaus bbca76a5e2 dart2js cps: More aggressive operator specialization.
Inline more unsafe operator calls, and insert more checks accordingly.

When "num" is the only receiver that does not respond with NSM, insert
a check and use the builtin operator.  Previously we only did this when
the receiver was a number or null. For example:

  if (typeof x !== "number") return x.$lt();
  result = x < 4;

When the argument might have the wrong type, insert an argument check
and use the builtin operator.  Previously we never did this if the
argument might have the wrong type. For example:

  if (typeof x !== "number") return H.iae(x);
  result = 4 < x;

If both receiver and argument need checks, we join the two checks and
use a one-shot interceptor to throw the error:

  if (typeof x !== "number" || typeof y !== "number")
    return J.$lt(x, y);
  result = x < y;

NullCheck has been generalized to a ReceiverCheck instruction to
support "x.$lt()" above, that throws even if x is a non-null value.

BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1668913002 .
2016-02-09 13:34:37 +01:00
..