changeset 1105:d8bb6c470778

8065985: Inlining failure of Number.doubleValue() in JSType.toNumeric() causes 15% peak perf regresion on Box2D Reviewed-by: lagergren, hannesw
author vlivanov
date Thu, 27 Nov 2014 17:14:01 +0400
parents 4191f598c8ff
children f39081a16f71
files src/jdk/nashorn/internal/runtime/JSType.java
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk/nashorn/internal/runtime/JSType.java	Wed Nov 26 13:57:43 2014 -0800
+++ b/src/jdk/nashorn/internal/runtime/JSType.java	Thu Nov 27 17:14:01 2014 +0400
@@ -714,6 +714,9 @@
      * @return a number
      */
     public static double toNumber(final Object obj) {
+        if (obj instanceof Double) {
+            return (Double)obj;
+        }
         if (obj instanceof Number) {
             return ((Number)obj).doubleValue();
         }