X-Git-Url: http://git.buserror.net/cgi-bin/gitweb.cgi?p=polintos%2Fscott%2Fpriv.git;a=blobdiff_plain;f=lib%2Fc%2B%2B%2Forb.cc;h=a62e91f6b1f43160764e0439311609e175fc6e22;hp=852919b6b8d8b50ba3be521473fc9423a090f8b4;hb=5adc890ffae4f90536e72bc32ef83e1141689520;hpb=ccbffe7564a94661a4c970ce1241309710a6697e diff --git a/lib/c++/orb.cc b/lib/c++/orb.cc index 852919b..a62e91f 100644 --- a/lib/c++/orb.cc +++ b/lib/c++/orb.cc @@ -7,9 +7,7 @@ namespace RunTime { // This function could be made to do a binary search if we can // manage to somehow sort the IFaceTables... - - uintptr_t downcast(::System::_i_Object *obj, - const unsigned long *new_guid) + uintptr_t downcast(::System::_i_Object *obj, const GUID *new_guid) { if (!obj) return 0; @@ -20,7 +18,7 @@ namespace RunTime { unsupported_long_size(); IFaceTable *tbl = obj->info->concrete_IFaceTable; - unsigned long new_guid_first = *new_guid; + unsigned long new_guid_first = new_guid->l[0]; // This doesn't use guids_equal(), as that would eliminate the // ability to cache the first word of new_guid. The compiler @@ -30,15 +28,15 @@ namespace RunTime { // behaves. while (true) { - if (tbl->guid[0] == new_guid_first && - tbl->guid[1] == new_guid[1] && + if (tbl->info->guid->l[0] == new_guid_first && + tbl->info->guid->l[1] == new_guid->l[1] && (sizeof(long) == 8 || - (tbl->guid[2] == new_guid[2] && - tbl->guid[3] == new_guid[3]))) + (tbl->info->guid->l[2] == new_guid->l[2] && + tbl->info->guid->l[3] == new_guid->l[3]))) break; tbl++; - if (__builtin_expect(!tbl->guid, 0)) + if (__builtin_expect(!tbl->info->guid->l[0], 0)) return 0; } @@ -49,7 +47,6 @@ namespace RunTime { return ptr; }; - namespace Priv { typedef void (*MethodEntry)(ParamInfoBlock *pib); @@ -59,7 +56,7 @@ namespace RunTime { void *ptr; // pointer to the class interface }; - typedef Util::RadixTree ObjTable; + typedef ::Util::RadixTree ObjTable; ObjTable objtable; unsigned long get_pc() @@ -69,9 +66,7 @@ namespace RunTime { void exception_to_array(::System::VStruct *ex, Array *ar) { - // FIXME -// ar->ptr = reinterpret_cast(ex); -// ar->count = ex->_infoptr->structlen; + // FIXME: marshall struct } void handle_message(ParamInfoBlock *pib) @@ -84,9 +79,7 @@ namespace RunTime { throw_idl(ShortMessage, 0, pib->segments[0].len, sizeof(InvokeMethod)); - // ID obj = pib->objlist[0]; - - +// ID obj = pib->objlist[0]; break; } @@ -106,8 +99,8 @@ extern "C" void handle_message(::System::RunTime::ParamInfoBlock *pib, ::System::RunTime::Priv::handle_message(pib); } - catch (::System::Exceptions::Exception *ex) { - ::System::RunTime::Priv::exception_to_array(ex, ex_arr); + catch (::System::Exceptions::Exception &ex) { + ::System::RunTime::Priv::exception_to_array(&ex, ex_arr); } catch (...) {