return &hdr->frames[++thread->orbstack_top];
}
-
+
ObjectHdr *IDSpace::get_local_hdr(Object *obj)
{
- ObjectHdr *hdr = idrmap.lookup(obj->id);
+ ObjectHdr *hdr = *rmap.lookup(obj->id);
+ if (hdr)
+ return hdr;
- if (!hdr)
- return 0;
+ int id = alloc.alloc();
+ ObjectPtr *ptr = &table.lookup(id, true)->ptr;
+
+ ptr->id = id;
+ ptr->flags = 0;
+ ptr->Pointer = 1;
+ ptr->object = obj;
+
+ *rmap.lookup(id, true) = ptr;
+ return ptr;
+ }
+
+ Object *IDSpace::newobj(Mem::ProcAddrSpace *aspace, uintptr_t entry)
+ {
+ int id = alloc.alloc();
+ Object *obj = &table.lookup(id, true)->obj;
+
+ obj->id = id;
+ obj->flags = 0;
+ obj->aspace = aspace;
+ obj->entry = entry;
- return hdr->id;
+ return obj;
}
}
-extern "C" void invoke_method(u32 objid, u32 methid, ParamInfoBlock *user_pib,
- ulong ret_pc)
+extern "C" void invoke_method(ParamInfoBlock *user_pib, ulong ret_pc)
{
ParamInfoBlock pib = Arch::copyin(user_pib);
CallFrame *frame = new_frame(curthread);
- frame->object = objid;
- frame->method = methid;
+// frame->object = objid;
frame->caller_user_pib = user_pib;
frame->ret_pc = ret_pc;
- printf("invoke_method: frame %p object %x method %x pib %p ret %lx\n",
- frame, frame->object, frame->method, frame->caller_user_pib,
+ printf("invoke_method: frame %p pib %p ret %lx\n",
+ frame, frame->caller_user_pib,
frame->ret_pc);