58 _a(arena),
59 _table( NEW_ARENA_ARRAY( _a , Node* , _max ) ),
60 _inserts(0), _insert_limit( insert_limit() ),
61 _look_probes(0), _lookup_hits(0), _lookup_misses(0),
62 _delete_probes(0), _delete_hits(0), _delete_misses(0),
63 _total_insert_probes(0), _total_inserts(0),
64 _insert_probes(0), _grows(0) {
65 // _sentinel must be in the current node space
66 _sentinel = new (Compile::current()) ProjNode(NULL, TypeFunc::Control);
67 memset(_table,0,sizeof(Node*)*_max);
68 }
69
70 //------------------------------NodeHash---------------------------------------
71 NodeHash::NodeHash(NodeHash *nh) {
72 debug_only(_table = (Node**)badAddress); // interact correctly w/ operator=
73 // just copy in all the fields
74 *this = *nh;
75 // nh->_sentinel must be in the current node space
76 }
77
78 //------------------------------hash_find--------------------------------------
79 // Find in hash table
80 Node *NodeHash::hash_find( const Node *n ) {
81 // ((Node*)n)->set_hash( n->hash() );
82 uint hash = n->hash();
83 if (hash == Node::NO_HASH) {
84 debug_only( _lookup_misses++ );
85 return NULL;
86 }
87 uint key = hash & (_max-1);
88 uint stride = key | 0x01;
89 debug_only( _look_probes++ );
90 Node *k = _table[key]; // Get hashed value
91 if( !k ) { // ?Miss?
92 debug_only( _lookup_misses++ );
93 return NULL; // Miss!
94 }
95
96 int op = n->Opcode();
97 uint req = n->req();
|
58 _a(arena),
59 _table( NEW_ARENA_ARRAY( _a , Node* , _max ) ),
60 _inserts(0), _insert_limit( insert_limit() ),
61 _look_probes(0), _lookup_hits(0), _lookup_misses(0),
62 _delete_probes(0), _delete_hits(0), _delete_misses(0),
63 _total_insert_probes(0), _total_inserts(0),
64 _insert_probes(0), _grows(0) {
65 // _sentinel must be in the current node space
66 _sentinel = new (Compile::current()) ProjNode(NULL, TypeFunc::Control);
67 memset(_table,0,sizeof(Node*)*_max);
68 }
69
70 //------------------------------NodeHash---------------------------------------
71 NodeHash::NodeHash(NodeHash *nh) {
72 debug_only(_table = (Node**)badAddress); // interact correctly w/ operator=
73 // just copy in all the fields
74 *this = *nh;
75 // nh->_sentinel must be in the current node space
76 }
77
78 void NodeHash::update_with(NodeHash *nh) {
79 debug_only(_table = (Node**)badAddress); // interact correctly w/ operator=
80 // just copy in all the fields
81 *this = *nh;
82 // nh->_sentinel must be in the current node space
83 }
84
85 //------------------------------hash_find--------------------------------------
86 // Find in hash table
87 Node *NodeHash::hash_find( const Node *n ) {
88 // ((Node*)n)->set_hash( n->hash() );
89 uint hash = n->hash();
90 if (hash == Node::NO_HASH) {
91 debug_only( _lookup_misses++ );
92 return NULL;
93 }
94 uint key = hash & (_max-1);
95 uint stride = key | 0x01;
96 debug_only( _look_probes++ );
97 Node *k = _table[key]; // Get hashed value
98 if( !k ) { // ?Miss?
99 debug_only( _lookup_misses++ );
100 return NULL; // Miss!
101 }
102
103 int op = n->Opcode();
104 uint req = n->req();
|