Refactor the compilers out of libart.
This builds three separate compilers and dynamically links with the right one
at runtime.
Change-Id: I59d22b9884f41de733c09f97e29ee290236d5f4b
diff --git a/src/space.cc b/src/space.cc
index 6d5a31a..78fcdf5 100644
--- a/src/space.cc
+++ b/src/space.cc
@@ -176,13 +176,14 @@
// Callback from dlmalloc when it needs to increase the footprint
extern "C" void* art_heap_morecore(void* mspace, intptr_t increment) {
- AllocSpace* space = Heap::GetAllocSpace();
+ Heap* heap = Runtime::Current()->GetHeap();
+ AllocSpace* space = heap->GetAllocSpace();
if (LIKELY(space->GetMspace() == mspace)) {
return space->MoreCore(increment);
} else {
// Exhaustively search alloc spaces
- const std::vector<Space*>& spaces = Heap::GetSpaces();
- for (size_t i = 0; i < spaces.size(); i++) {
+ const std::vector<Space*>& spaces = heap->GetSpaces();
+ for (size_t i = 0; i < spaces.size(); ++i) {
if (spaces[i]->IsAllocSpace()) {
AllocSpace* space = spaces[i]->AsAllocSpace();
if (mspace == space->GetMspace()) {
@@ -191,7 +192,7 @@
}
}
LOG(FATAL) << "Unexpected call to art_heap_morecore. mspace: " << mspace
- << " increment: " << increment;
+ << " increment: " << increment;
return NULL;
}
}