MCPcopy Create free account
hub / github.com/ReadyTalk/avian / finalizeObject

Function finalizeObject

src/machine.cpp:714–739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

712}
713
714void finalizeObject(Thread* t, object o, const char* name)
715{
716 for (GcClass* c = objectClass(t, o); c; c = c->super()) {
717 GcArray* mtable = cast<GcArray>(t, c->methodTable());
718 for (unsigned i = 0; i < mtable->length(); ++i) {
719 GcMethod* m = cast<GcMethod>(t, mtable->body()[i]);
720
721 if (vm::strcmp(reinterpret_cast<const int8_t*>(name),
722 m->name()->body().begin()) == 0
723 and vm::strcmp(reinterpret_cast<const int8_t*>("()V"),
724 m->spec()->body().begin()) == 0) {
725 PROTECT(t, m);
726 PROTECT(t, o);
727
728 uintptr_t arguments[] = {reinterpret_cast<uintptr_t>(&m),
729 reinterpret_cast<uintptr_t>(&o)};
730
731 run(t, invoke, arguments);
732
733 t->exception = 0;
734 return;
735 }
736 }
737 }
738 abort(t);
739}
740
741unsigned readByte(AbstractStream& s, unsigned* value)
742{

Callers 1

runFinalizeThreadFunction · 0.85

Calls 8

objectClassFunction · 0.85
strcmpFunction · 0.85
bodyMethod · 0.80
lengthMethod · 0.65
runFunction · 0.50
abortFunction · 0.50
beginMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected