src/share/vm/oops/instanceKlass.cpp

changeset 8497
50e62b688ddc
parent 8185
5cece4584b8e
child 8509
cb4af293fe70
     1.1 --- a/src/share/vm/oops/instanceKlass.cpp	Mon Apr 04 13:58:22 2016 -0700
     1.2 +++ b/src/share/vm/oops/instanceKlass.cpp	Thu Mar 24 21:38:15 2016 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1997, 2016, 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 @@ -25,6 +25,7 @@
    1.11  #include "precompiled.hpp"
    1.12  #include "classfile/javaClasses.hpp"
    1.13  #include "classfile/systemDictionary.hpp"
    1.14 +#include "classfile/systemDictionaryShared.hpp"
    1.15  #include "classfile/verifier.hpp"
    1.16  #include "classfile/vmSymbols.hpp"
    1.17  #include "compiler/compileBroker.hpp"
    1.18 @@ -706,6 +707,16 @@
    1.19  
    1.20          // also sets rewritten
    1.21          this_oop->rewrite_class(CHECK_false);
    1.22 +      } else if (this_oop()->is_shared()) {
    1.23 +        ResourceMark rm(THREAD);
    1.24 +        char* message_buffer; // res-allocated by check_verification_dependencies
    1.25 +        Handle loader = this_oop()->class_loader();
    1.26 +        Handle pd     = this_oop()->protection_domain();
    1.27 +        bool verified = SystemDictionaryShared::check_verification_dependencies(this_oop(),
    1.28 +                        loader, pd, &message_buffer, THREAD);
    1.29 +        if (!verified) {
    1.30 +          THROW_MSG_(vmSymbols::java_lang_VerifyError(), message_buffer, false);
    1.31 +        }
    1.32        }
    1.33  
    1.34        // relocate jsrs and link methods after they are all rewritten

mercurial