Mercurial > hg > truffle
comparison src/share/vm/runtime/stubRoutines.hpp @ 1174:ddb7834449d0
6849984: Value methods for platform dependent math functions constant fold incorrectly
Reviewed-by: kvn, twisti
author | never |
---|---|
date | Fri, 15 Jan 2010 11:53:33 -0800 |
parents | f8236e79048a |
children | c18cbe5936b8 |
comparison
equal
deleted
inserted
replaced
1173:73b22f919c34 | 1174:ddb7834449d0 |
---|---|
1 /* | 1 /* |
2 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
146 // these are recommended but optional: | 146 // these are recommended but optional: |
147 static address _checkcast_arraycopy; | 147 static address _checkcast_arraycopy; |
148 static address _unsafe_arraycopy; | 148 static address _unsafe_arraycopy; |
149 static address _generic_arraycopy; | 149 static address _generic_arraycopy; |
150 | 150 |
151 // These are versions of the java.lang.Math methods which perform | |
152 // the same operations as the intrinsic version. They are used for | |
153 // constant folding in the compiler to ensure equivalence. If the | |
154 // intrinsic version returns the same result as the strict version | |
155 // then they can be set to the appropriate function from | |
156 // SharedRuntime. | |
157 static double (*_intrinsic_log)(double); | |
158 static double (*_intrinsic_log10)(double); | |
159 static double (*_intrinsic_exp)(double); | |
160 static double (*_intrinsic_pow)(double, double); | |
161 static double (*_intrinsic_sin)(double); | |
162 static double (*_intrinsic_cos)(double); | |
163 static double (*_intrinsic_tan)(double); | |
164 | |
151 public: | 165 public: |
152 // Initialization/Testing | 166 // Initialization/Testing |
153 static void initialize1(); // must happen before universe::genesis | 167 static void initialize1(); // must happen before universe::genesis |
154 static void initialize2(); // must happen after universe::genesis | 168 static void initialize2(); // must happen after universe::genesis |
155 | 169 |
243 | 257 |
244 static address checkcast_arraycopy() { return _checkcast_arraycopy; } | 258 static address checkcast_arraycopy() { return _checkcast_arraycopy; } |
245 static address unsafe_arraycopy() { return _unsafe_arraycopy; } | 259 static address unsafe_arraycopy() { return _unsafe_arraycopy; } |
246 static address generic_arraycopy() { return _generic_arraycopy; } | 260 static address generic_arraycopy() { return _generic_arraycopy; } |
247 | 261 |
262 static double intrinsic_log(double d) { | |
263 assert(_intrinsic_log != NULL, "must be defined"); | |
264 return _intrinsic_log(d); | |
265 } | |
266 static double intrinsic_log10(double d) { | |
267 assert(_intrinsic_log != NULL, "must be defined"); | |
268 return _intrinsic_log10(d); | |
269 } | |
270 static double intrinsic_exp(double d) { | |
271 assert(_intrinsic_exp != NULL, "must be defined"); | |
272 return _intrinsic_exp(d); | |
273 } | |
274 static double intrinsic_pow(double d, double d2) { | |
275 assert(_intrinsic_pow != NULL, "must be defined"); | |
276 return _intrinsic_pow(d, d2); | |
277 } | |
278 static double intrinsic_sin(double d) { | |
279 assert(_intrinsic_sin != NULL, "must be defined"); | |
280 return _intrinsic_sin(d); | |
281 } | |
282 static double intrinsic_cos(double d) { | |
283 assert(_intrinsic_cos != NULL, "must be defined"); | |
284 return _intrinsic_cos(d); | |
285 } | |
286 static double intrinsic_tan(double d) { | |
287 assert(_intrinsic_tan != NULL, "must be defined"); | |
288 return _intrinsic_tan(d); | |
289 } | |
290 | |
248 // | 291 // |
249 // Default versions of the above arraycopy functions for platforms which do | 292 // Default versions of the above arraycopy functions for platforms which do |
250 // not have specialized versions | 293 // not have specialized versions |
251 // | 294 // |
252 static void jbyte_copy (jbyte* src, jbyte* dest, size_t count); | 295 static void jbyte_copy (jbyte* src, jbyte* dest, size_t count); |