8065985: Inlining failure of Number.doubleValue() in JSType.toNumeric() causes 15% peak perf regresion on Box2D

Thu, 27 Nov 2014 17:14:01 +0400

author
vlivanov
date
Thu, 27 Nov 2014 17:14:01 +0400
changeset 1108
d8bb6c470778
parent 1107
4191f598c8ff
child 1109
f39081a16f71

8065985: Inlining failure of Number.doubleValue() in JSType.toNumeric() causes 15% peak perf regresion on Box2D
Reviewed-by: lagergren, hannesw

src/jdk/nashorn/internal/runtime/JSType.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/jdk/nashorn/internal/runtime/JSType.java	Wed Nov 26 13:57:43 2014 -0800
     1.2 +++ b/src/jdk/nashorn/internal/runtime/JSType.java	Thu Nov 27 17:14:01 2014 +0400
     1.3 @@ -714,6 +714,9 @@
     1.4       * @return a number
     1.5       */
     1.6      public static double toNumber(final Object obj) {
     1.7 +        if (obj instanceof Double) {
     1.8 +            return (Double)obj;
     1.9 +        }
    1.10          if (obj instanceof Number) {
    1.11              return ((Number)obj).doubleValue();
    1.12          }

mercurial