1 /* |
1 /* |
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. 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. |
1208 // CompileBroker::is_compile_blocking |
1208 // CompileBroker::is_compile_blocking |
1209 // |
1209 // |
1210 // Should the current thread be blocked until this compilation request |
1210 // Should the current thread be blocked until this compilation request |
1211 // has been fulfilled? |
1211 // has been fulfilled? |
1212 bool CompileBroker::is_compile_blocking(methodHandle method, int osr_bci) { |
1212 bool CompileBroker::is_compile_blocking(methodHandle method, int osr_bci) { |
1213 return !BackgroundCompilation; |
1213 if (!BackgroundCompilation) { |
|
1214 Symbol* class_name = method->method_holder()->klass_part()->name(); |
|
1215 if (class_name->starts_with("java/lang/ref/Reference", 23)) { |
|
1216 // The reference handler thread can dead lock with the GC if compilation is blocking, |
|
1217 // so we avoid blocking compiles for anything in the java.lang.ref.Reference class, |
|
1218 // including inner classes such as ReferenceHandler. |
|
1219 return false; |
|
1220 } |
|
1221 return true; |
|
1222 } |
|
1223 return false; |
1214 } |
1224 } |
1215 |
1225 |
1216 |
1226 |
1217 // ------------------------------------------------------------------ |
1227 // ------------------------------------------------------------------ |
1218 // CompileBroker::preload_classes |
1228 // CompileBroker::preload_classes |