src/share/vm/runtime/compilationPolicy.cpp

changeset 1609
ddb7834449d0
parent 435
a61af66fc99e
child 1637
5f24d0319e54
equal deleted inserted replaced
1608:73b22f919c34 1609:ddb7834449d0
1 /* 1 /*
2 * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 2000-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.
72 // Returns true if m is allowed to be compiled 72 // Returns true if m is allowed to be compiled
73 bool CompilationPolicy::canBeCompiled(methodHandle m) { 73 bool CompilationPolicy::canBeCompiled(methodHandle m) {
74 if (m->is_abstract()) return false; 74 if (m->is_abstract()) return false;
75 if (DontCompileHugeMethods && m->code_size() > HugeMethodLimit) return false; 75 if (DontCompileHugeMethods && m->code_size() > HugeMethodLimit) return false;
76 76
77 // Math intrinsics should never be compiled as this can lead to
78 // monotonicity problems because the interpreter will prefer the
79 // compiled code to the intrinsic version. This can't happen in
80 // production because the invocation counter can't be incremented
81 // but we shouldn't expose the system to this problem in testing
82 // modes.
83 if (!AbstractInterpreter::can_be_compiled(m)) {
84 return false;
85 }
86
77 return !m->is_not_compilable(); 87 return !m->is_not_compilable();
78 } 88 }
79 89
80 #ifndef PRODUCT 90 #ifndef PRODUCT
81 void CompilationPolicy::print_time() { 91 void CompilationPolicy::print_time() {

mercurial