src/share/vm/compiler/compileBroker.cpp

changeset 2503
986b2844f7a2
parent 2497
3582bf76420e
child 2567
850b2295a494
     1.1 --- a/src/share/vm/compiler/compileBroker.cpp	Tue Feb 01 10:02:01 2011 -0800
     1.2 +++ b/src/share/vm/compiler/compileBroker.cpp	Tue Feb 01 14:05:46 2011 +0100
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. 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 @@ -1210,7 +1210,17 @@
    1.11  // Should the current thread be blocked until this compilation request
    1.12  // has been fulfilled?
    1.13  bool CompileBroker::is_compile_blocking(methodHandle method, int osr_bci) {
    1.14 -  return !BackgroundCompilation;
    1.15 +  if (!BackgroundCompilation) {
    1.16 +    Symbol* class_name = method->method_holder()->klass_part()->name();
    1.17 +    if (class_name->starts_with("java/lang/ref/Reference", 23)) {
    1.18 +      // The reference handler thread can dead lock with the GC if compilation is blocking,
    1.19 +      // so we avoid blocking compiles for anything in the java.lang.ref.Reference class,
    1.20 +      // including inner classes such as ReferenceHandler.
    1.21 +      return false;
    1.22 +    }
    1.23 +    return true;
    1.24 +  }
    1.25 +  return false;
    1.26  }
    1.27  
    1.28  

mercurial