#include <avmplusHashtable.h>
Inheritance diagram for avmplus::WeakKeyHashtable:

Public Member Functions | |
| WeakKeyHashtable (MMgc::GC *gc) | |
| void | add (Atom key, Atom value) |
| Atom | get (Atom key) |
| void | remove (Atom key) |
| bool | contains (Atom key) |
Private Member Functions | |
| Atom | getKey (Atom key) |
| void | prune () |
Definition at line 277 of file avmplusHashtable.h.
|
|
Definition at line 280 of file avmplusHashtable.h. 00280 : Hashtable(gc) { };
|
|
||||||||||||
|
Adds a name/value pair to a hash table. Automatically grows the hash table if it is full. Reimplemented from avmplus::Hashtable. Definition at line 335 of file avmplusHashtable.cpp. References getKey(), avmplus::Hashtable::grow(), avmplus::Hashtable::isFull(), prune(), and avmplus::Hashtable::put(). Referenced by avmplus::MethodClosureClass::create(), and avmplus::DictionaryObject::setAtomProperty(). 00336 { 00337 if(isFull()) { 00338 prune(); 00339 grow(); 00340 } 00341 put(getKey(key), value); 00342 }
|
|
|
Definition at line 284 of file avmplusHashtable.h. References avmplus::Hashtable::contains(), and getKey(). Referenced by avmplus::DictionaryObject::hasAtomProperty(). 00284 { return Hashtable::contains(getKey(key)); }
|
|
|
Definition at line 282 of file avmplusHashtable.h. References avmplus::Hashtable::get(), and getKey(). Referenced by avmplus::MethodClosureClass::create(), and avmplus::DictionaryObject::getAtomProperty(). 00282 { return Hashtable::get(getKey(key)); }
|
|
|
Definition at line 325 of file avmplusHashtable.cpp. References avmplus::AvmCore::gcObjectToAtom(), MMgc::GCFinalizedObject::GetWeakRef(), and avmplus::AvmCore::isPointer(). Referenced by add(), contains(), get(), and remove(). 00326 { 00327 // this gets a weak ref number, ie double keys, okay I guess 00328 if(AvmCore::isPointer(key)) { 00329 GCWeakRef *weakRef = ((GCObject*)(key&~7))->GetWeakRef(); 00330 key = AvmCore::gcObjectToAtom(weakRef); 00331 } 00332 return key; 00333 }
|
|
|
Definition at line 344 of file avmplusHashtable.cpp. References avmplus::Hashtable::atoms, avmplus::Hashtable::DELETED, avmplus::Hashtable::getNumAtoms(), util::threadpool::i, avmplus::AvmCore::isGCObject(), NULL, and avmplus::Hashtable::setHasDeletedItems(). Referenced by add(). 00345 { 00346 for(int i=0, n=getNumAtoms(); i<n; i+=2) { 00347 if(AvmCore::isGCObject(atoms[i])) { 00348 GCWeakRef *ref = (GCWeakRef*)(atoms[i]&~7); 00349 if(ref && ref->get() == NULL) { 00350 // inlined delete 00351 atoms[i] = DELETED; 00352 atoms[i+1] = DELETED; 00353 setHasDeletedItems(true); 00354 } 00355 } 00356 } 00357 }
|
|
|
Reimplemented from avmplus::Hashtable. Definition at line 283 of file avmplusHashtable.h. References getKey(), and avmplus::Hashtable::remove(). Referenced by avmplus::DictionaryObject::deleteAtomProperty(). 00283 { Hashtable::remove(getKey(key)); }
|
1.4.6