OpenJDK / portola / portola
changeset 27816:c6c53c5adc51
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 | 6ed8e97e8fb6 |
children | 56f6161c3e55 |
files | nashorn/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/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java Thu Nov 27 13:04:46 2014 +0100 +++ b/nashorn/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(); }