1.1 --- a/src/share/vm/runtime/compilationPolicy.cpp Wed Jan 13 23:05:52 2010 -0800 1.2 +++ b/src/share/vm/runtime/compilationPolicy.cpp Fri Jan 15 11:53:33 2010 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -74,6 +74,16 @@ 1.11 if (m->is_abstract()) return false; 1.12 if (DontCompileHugeMethods && m->code_size() > HugeMethodLimit) return false; 1.13 1.14 + // Math intrinsics should never be compiled as this can lead to 1.15 + // monotonicity problems because the interpreter will prefer the 1.16 + // compiled code to the intrinsic version. This can't happen in 1.17 + // production because the invocation counter can't be incremented 1.18 + // but we shouldn't expose the system to this problem in testing 1.19 + // modes. 1.20 + if (!AbstractInterpreter::can_be_compiled(m)) { 1.21 + return false; 1.22 + } 1.23 + 1.24 return !m->is_not_compilable(); 1.25 } 1.26