+
+ static const ID invalid_id = 0xffffffff;
+ struct ObjectHdr {
+ ID id;
+ };
+
+ struct Object : public ObjectHdr {
+ Mem::ProcAddrSpace *aspace;
+ };
+
+ struct ObjectPtr : public ObjectHdr {
+ Object *object;
+ };
+
+ typedef Util::RadixTree<Object, ID, 6> LocalIDTable;
+ typedef Util::RadixTree<ObjectPtr, ID, 6> RemoteIDTable;
+ typedef Util::RBPtr<Object *, ObjectPtr *> IDRMap;
+ typedef Util::BitmapTree<ID> IDAlloc;
+
+ class IDSpace {
+ Lock::SpinLock lock; // For add/del only; not needed for lookup
+ LocalIDTable locals; // Objects that live in this address space
+ RemoteIDTable remotes; // Objects that live in other address spaces
+ IDRMap rmap; // Reverse mapping of remote object pointers to local IDs
+ IDAlloc alloc; // Bitmap for allocating IDs
+
+ public:
+ Object *lookup(u32 id);
+ ObjectHdr *get_local(Object *obj);
+ Object *newobj(Mem::ProcAddrSpace *aspace);
+ };
+
+ void invoke_method(System::RunTime::ParamInfoBlock *pib, uintptr_t &stack);
+ uintptr_t return_from_method(uintptr_t &exptr, size_t &exlen);
+ void init();