| 9548 | } |
| 9549 | |
| 9550 | void 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 | |
| 9587 | MyProcessor::Thunk thunkToThunk(const BootImage::Thunk& thunk, uint8_t* base) |
| 9588 | { |