FTR: JVM Lang Summit presentation

Paul Sandoz paul.sandoz at
Thu Sep 4 19:27:11 UTC 2014

On Sep 4, 2014, at 7:24 PM, Christian Thalinger <christian.thalinger at> wrote:
>> Do you know the area of hotspot where those optimizations are enforced?
> Search for:
> src/share/vm/runtime/globals.hpp
> 3827:  experimental(bool, TrustFinalNonStaticFields, false,                      \

Many thanks, got it (I should have followed the @Stable trail):

static bool trust_final_non_static_fields(ciInstanceKlass* holder) {
  if (holder == NULL)
    return false;
  if (holder->name() == ciSymbol::java_lang_System())
    // Never trust strangely unstable finals:  System.out, etc.
    return false;
  // Even if general trusting is disabled, trust system-built closures in these packages.
  if (holder->is_in_package("java/lang/invoke") || holder->is_in_package("sun/invoke"))
    return true;
  return TrustFinalNonStaticFields;

I like the first comment :-) "// Never trust strangely unstable finals:  System.out, etc.".


More information about the valhalla-dev mailing list