src/share/vm/interpreter/interpreterRuntime.cpp

changeset 2328
9bc798875b2a
parent 2314
f95d63e2154a
child 2438
dd031b2226de
child 2462
8012aa3ccede
     1.1 --- a/src/share/vm/interpreter/interpreterRuntime.cpp	Thu Dec 02 05:45:54 2010 -0800
     1.2 +++ b/src/share/vm/interpreter/interpreterRuntime.cpp	Sat Dec 04 00:09:05 2010 -0500
     1.3 @@ -1193,9 +1193,20 @@
     1.4        method->set_signature_handler(_handlers->at(handler_index));
     1.5      }
     1.6    }
     1.7 +#ifdef ASSERT
     1.8 +  int handler_index, fingerprint_index;
     1.9 +  {
    1.10 +    // '_handlers' and '_fingerprints' are 'GrowableArray's and are NOT synchronized
    1.11 +    // in any way if accessed from multiple threads. To avoid races with another
    1.12 +    // thread which may change the arrays in the above, mutex protected block, we
    1.13 +    // have to protect this read access here with the same mutex as well!
    1.14 +    MutexLocker mu(SignatureHandlerLibrary_lock);
    1.15 +    handler_index = _handlers->find(method->signature_handler());
    1.16 +    fingerprint_index = _fingerprints->find(Fingerprinter(method).fingerprint());
    1.17 +  }
    1.18    assert(method->signature_handler() == Interpreter::slow_signature_handler() ||
    1.19 -         _handlers->find(method->signature_handler()) == _fingerprints->find(Fingerprinter(method).fingerprint()),
    1.20 -         "sanity check");
    1.21 +         handler_index == fingerprint_index, "sanity check");
    1.22 +#endif
    1.23  }
    1.24  
    1.25  

mercurial