Spill possibly reference holding registers for runtime calls.

Live references may be in registers when we crawl a stack for GC during
a runtime call. Whilst an exception won't occur we need to save the
callee save registers into the frame so the stack crawl can find their
values. Create variants of the callee save method to save just the
registers that are necessary.

Change-Id: I6fa479bffcbc333fe846f9bd3ef2e626e0209ed9
diff --git a/src/class_linker_test.cc b/src/class_linker_test.cc
index a646f4e..9ae64a3 100644
--- a/src/class_linker_test.cc
+++ b/src/class_linker_test.cc
@@ -162,7 +162,7 @@
     if (klass->IsInterface()) {
       EXPECT_TRUE(klass->IsAbstract());
       if (klass->NumDirectMethods() == 1) {
-        EXPECT_TRUE(klass->GetDirectMethod(0)->GetName()->Equals("<clinit>"));
+        EXPECT_TRUE(klass->GetDirectMethod(0)->IsClassInitializer());
         EXPECT_TRUE(klass->GetDirectMethod(0)->IsDirect());
       } else {
         EXPECT_EQ(0U, klass->NumDirectMethods());
@@ -949,6 +949,8 @@
   EXPECT_EQ(Aj2, A->FindVirtualMethodForVirtualOrInterface(Jj2));
 }
 
+extern Class* InitializeStaticStorage(uint32_t type_idx, const Method* referrer, Thread* self);
+
 TEST_F(ClassLinkerTest, InitializeStaticStorageFromCode) {
   // pretend we are trying to get the static storage for the StaticsFromCode class.
 
@@ -965,10 +967,10 @@
   uint32_t type_idx = FindTypeIdxByDescriptor(*dex_file, "LStaticsFromCode;");
 
   EXPECT_TRUE(clinit->GetDexCacheInitializedStaticStorage()->Get(type_idx) == NULL);
-  StaticStorageBase* uninit = class_linker_->InitializeStaticStorageFromCode(type_idx, clinit);
+  StaticStorageBase* uninit = InitializeStaticStorage(type_idx, clinit, Thread::Current());
   EXPECT_TRUE(uninit != NULL);
   EXPECT_TRUE(clinit->GetDexCacheInitializedStaticStorage()->Get(type_idx) == NULL);
-  StaticStorageBase* init = class_linker_->InitializeStaticStorageFromCode(type_idx, getS0);
+  StaticStorageBase* init = InitializeStaticStorage(type_idx, getS0, Thread::Current());
   EXPECT_TRUE(init != NULL);
   EXPECT_EQ(init, clinit->GetDexCacheInitializedStaticStorage()->Get(type_idx));
 }