equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2014, 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. |
36 class ResolutionErrorTable : public Hashtable<ConstantPool*, mtClass> { |
36 class ResolutionErrorTable : public Hashtable<ConstantPool*, mtClass> { |
37 |
37 |
38 public: |
38 public: |
39 ResolutionErrorTable(int table_size); |
39 ResolutionErrorTable(int table_size); |
40 |
40 |
41 ResolutionErrorEntry* new_entry(int hash, ConstantPool* pool, int cp_index, Symbol* error); |
41 ResolutionErrorEntry* new_entry(int hash, ConstantPool* pool, int cp_index, |
|
42 Symbol* error, Symbol* message); |
42 void free_entry(ResolutionErrorEntry *entry); |
43 void free_entry(ResolutionErrorEntry *entry); |
43 |
44 |
44 ResolutionErrorEntry* bucket(int i) { |
45 ResolutionErrorEntry* bucket(int i) { |
45 return (ResolutionErrorEntry*)Hashtable<ConstantPool*, mtClass>::bucket(i); |
46 return (ResolutionErrorEntry*)Hashtable<ConstantPool*, mtClass>::bucket(i); |
46 } |
47 } |
53 Hashtable<ConstantPool*, mtClass>::add_entry(index, |
54 Hashtable<ConstantPool*, mtClass>::add_entry(index, |
54 (HashtableEntry<ConstantPool*, mtClass>*)new_entry); |
55 (HashtableEntry<ConstantPool*, mtClass>*)new_entry); |
55 } |
56 } |
56 |
57 |
57 void add_entry(int index, unsigned int hash, |
58 void add_entry(int index, unsigned int hash, |
58 constantPoolHandle pool, int which, Symbol* error); |
59 constantPoolHandle pool, int which, Symbol* error, Symbol* message); |
59 |
60 |
60 |
61 |
61 // find error given the constant pool and constant pool index |
62 // find error given the constant pool and constant pool index |
62 ResolutionErrorEntry* find_entry(int index, unsigned int hash, |
63 ResolutionErrorEntry* find_entry(int index, unsigned int hash, |
63 constantPoolHandle pool, int cp_index); |
64 constantPoolHandle pool, int cp_index); |
77 |
78 |
78 class ResolutionErrorEntry : public HashtableEntry<ConstantPool*, mtClass> { |
79 class ResolutionErrorEntry : public HashtableEntry<ConstantPool*, mtClass> { |
79 private: |
80 private: |
80 int _cp_index; |
81 int _cp_index; |
81 Symbol* _error; |
82 Symbol* _error; |
|
83 Symbol* _message; |
82 |
84 |
83 public: |
85 public: |
84 ConstantPool* pool() const { return (ConstantPool*)literal(); } |
86 ConstantPool* pool() const { return literal(); } |
85 ConstantPool** pool_addr() { return (ConstantPool**)literal_addr(); } |
|
86 |
87 |
87 int cp_index() const { return _cp_index; } |
88 int cp_index() const { return _cp_index; } |
88 void set_cp_index(int cp_index) { _cp_index = cp_index; } |
89 void set_cp_index(int cp_index) { _cp_index = cp_index; } |
89 |
90 |
90 Symbol* error() const { return _error; } |
91 Symbol* error() const { return _error; } |
91 void set_error(Symbol* e); |
92 void set_error(Symbol* e); |
|
93 |
|
94 Symbol* message() const { return _message; } |
|
95 void set_message(Symbol* c); |
92 |
96 |
93 ResolutionErrorEntry* next() const { |
97 ResolutionErrorEntry* next() const { |
94 return (ResolutionErrorEntry*)HashtableEntry<ConstantPool*, mtClass>::next(); |
98 return (ResolutionErrorEntry*)HashtableEntry<ConstantPool*, mtClass>::next(); |
95 } |
99 } |
96 |
100 |