changeset 1115:64962ecb8b85

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 ad912b034639
children e26843ca558b
files src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java	Thu Nov 27 13:04:46 2014 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/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();
         }