hotspot/src/share/vm/classfile/verifier.cpp
changeset 46271 979ebd346ecf
parent 41542 c705c10c4914
child 46289 1904e7ec236e
equal deleted inserted replaced
46270:2e7898927798 46271:979ebd346ecf
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2017, 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.
   124   }
   124   }
   125   st->print_cr("End class verification for: %s", klassName);
   125   st->print_cr("End class verification for: %s", klassName);
   126 }
   126 }
   127 
   127 
   128 bool Verifier::verify(instanceKlassHandle klass, Verifier::Mode mode, bool should_verify_class, TRAPS) {
   128 bool Verifier::verify(instanceKlassHandle klass, Verifier::Mode mode, bool should_verify_class, TRAPS) {
   129   HandleMark hm;
   129   HandleMark hm(THREAD);
   130   ResourceMark rm(THREAD);
   130   ResourceMark rm(THREAD);
   131 
   131 
   132   // Eagerly allocate the identity hash code for a klass. This is a fallout
   132   // Eagerly allocate the identity hash code for a klass. This is a fallout
   133   // from 6320749 and 8059924: hash code generator is not supposed to be called
   133   // from 6320749 and 8059924: hash code generator is not supposed to be called
   134   // during the safepoint, but it allows to sneak the hashcode in during
   134   // during the safepoint, but it allows to sneak the hashcode in during
  1995   }
  1995   }
  1996   _message = ss.as_string();
  1996   _message = ss.as_string();
  1997 }
  1997 }
  1998 
  1998 
  1999 Klass* ClassVerifier::load_class(Symbol* name, TRAPS) {
  1999 Klass* ClassVerifier::load_class(Symbol* name, TRAPS) {
       
  2000   HandleMark hm(THREAD);
  2000   // Get current loader and protection domain first.
  2001   // Get current loader and protection domain first.
  2001   oop loader = current_class()->class_loader();
  2002   oop loader = current_class()->class_loader();
  2002   oop protection_domain = current_class()->protection_domain();
  2003   oop protection_domain = current_class()->protection_domain();
  2003 
  2004 
  2004   Klass* kls = SystemDictionary::resolve_or_fail(
  2005   Klass* kls = SystemDictionary::resolve_or_fail(