< prev index next >

src/share/vm/classfile/resolutionErrors.hpp

Print this page
rev 11945 : 8023697: failed class resolution reports different class name in detail message for the first and subsequent times
Summary: Cache detail message when we cache exception for constant pool resolution.
Reviewed-by: acorn, twisti, jrose

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -36,11 +36,12 @@
 class ResolutionErrorTable : public Hashtable<ConstantPool*, mtClass> {
 
 public:
   ResolutionErrorTable(int table_size);
 
-  ResolutionErrorEntry* new_entry(int hash, ConstantPool* pool, int cp_index, Symbol* error);
+  ResolutionErrorEntry* new_entry(int hash, ConstantPool* pool, int cp_index,
+                                  Symbol* error, Symbol* message);
   void free_entry(ResolutionErrorEntry *entry);
 
   ResolutionErrorEntry* bucket(int i) {
     return (ResolutionErrorEntry*)Hashtable<ConstantPool*, mtClass>::bucket(i);
   }

@@ -53,11 +54,11 @@
     Hashtable<ConstantPool*, mtClass>::add_entry(index,
       (HashtableEntry<ConstantPool*, mtClass>*)new_entry);
   }
 
   void add_entry(int index, unsigned int hash,
-                 constantPoolHandle pool, int which, Symbol* error);
+                 constantPoolHandle pool, int which, Symbol* error, Symbol* message);
 
 
   // find error given the constant pool and constant pool index
   ResolutionErrorEntry* find_entry(int index, unsigned int hash,
                                    constantPoolHandle pool, int cp_index);

@@ -77,21 +78,24 @@
 
 class ResolutionErrorEntry : public HashtableEntry<ConstantPool*, mtClass> {
  private:
   int               _cp_index;
   Symbol*           _error;
+  Symbol*           _message;
 
  public:
-  ConstantPool*      pool() const               { return (ConstantPool*)literal(); }
-  ConstantPool**   pool_addr()                { return (ConstantPool**)literal_addr(); }
+  ConstantPool*      pool() const               { return literal(); }
 
   int                cp_index() const           { return _cp_index; }
   void               set_cp_index(int cp_index) { _cp_index = cp_index; }
 
   Symbol*            error() const              { return _error; }
   void               set_error(Symbol* e);
 
+  Symbol*            message() const            { return _message; }
+  void               set_message(Symbol* c);
+
   ResolutionErrorEntry* next() const {
     return (ResolutionErrorEntry*)HashtableEntry<ConstantPool*, mtClass>::next();
   }
 
   ResolutionErrorEntry** next_addr() {
< prev index next >