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

Function fixupMethods

src/compile.cpp:9550–9585  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9548}
9549
9550void fixupMethods(Thread* t,
9551 GcHashMap* map,
9552 BootImage* image UNUSED,
9553 uint8_t* code)
9554{
9555 for (HashMapIterator it(t, map); it.hasMore();) {
9556 GcClass* c = cast<GcClass>(t, it.next()->second());
9557
9558 if (GcArray* mtable = cast<GcArray>(t, c->methodTable())) {
9559 PROTECT(t, mtable);
9560 for (unsigned i = 0; i < mtable->length(); ++i) {
9561 GcMethod* method = cast<GcMethod>(t, mtable->body()[i]);
9562 if (method->code()) {
9563 assertT(t,
9564 methodCompiled(t, method)
9565 <= static_cast<int32_t>(image->codeSize));
9566
9567 method->code()->compiled() = methodCompiled(t, method)
9568 + reinterpret_cast<uintptr_t>(code);
9569
9570 if (DebugCompile) {
9571 logCompile(static_cast<MyThread*>(t),
9572 reinterpret_cast<uint8_t*>(methodCompiled(t, method)),
9573 methodCompiledSize(t, method),
9574 reinterpret_cast<char*>(
9575 method->class_()->name()->body().begin()),
9576 reinterpret_cast<char*>(method->name()->body().begin()),
9577 reinterpret_cast<char*>(method->spec()->body().begin()));
9578 }
9579 }
9580 }
9581 }
9582
9583 t->m->processor->initVtable(t, c);
9584 }
9585}
9586
9587MyProcessor::Thunk thunkToThunk(const BootImage::Thunk& thunk, uint8_t* base)
9588{

Callers 1

bootFunction · 0.85

Calls 10

assertTFunction · 0.85
logCompileFunction · 0.85
bodyMethod · 0.80
compiledMethod · 0.80
nextMethod · 0.65
lengthMethod · 0.65
hasMoreMethod · 0.45
beginMethod · 0.45
nameMethod · 0.45
initVtableMethod · 0.45

Tested by

no test coverage detected