Remove ClassLoader from OatWriter

Change-Id: I75e6c8f7189d478304a5fd273440db126581a75f
diff --git a/src/dex2oat.cc b/src/dex2oat.cc
index a8f42af..bbc07a6 100644
--- a/src/dex2oat.cc
+++ b/src/dex2oat.cc
@@ -269,7 +269,6 @@
     }
 
     if (!OatWriter::Create(oat_file,
-                           class_loader,
                            dex_files,
                            image_file_location_oat_checksum,
                            image_file_location_oat_begin,
diff --git a/src/image_test.cc b/src/image_test.cc
index e2abbac..b72226b 100644
--- a/src/image_test.cc
+++ b/src/image_test.cc
@@ -36,7 +36,7 @@
     ScopedObjectAccess soa(Thread::Current());
     std::vector<const DexFile*> dex_files;
     dex_files.push_back(java_lang_dex_file_);
-    bool success_oat = OatWriter::Create(tmp_oat.GetFile(), NULL, dex_files, 0, 0, "", *compiler_.get());
+    bool success_oat = OatWriter::Create(tmp_oat.GetFile(), dex_files, 0, 0, "", *compiler_.get());
     ASSERT_TRUE(success_oat);
 
     // Force all system classes into memory
diff --git a/src/oat_test.cc b/src/oat_test.cc
index bb6305a..52217b2 100644
--- a/src/oat_test.cc
+++ b/src/oat_test.cc
@@ -80,7 +80,6 @@
   ScopedObjectAccess soa(Thread::Current());
   ScratchFile tmp;
   bool success = OatWriter::Create(tmp.GetFile(),
-                                   class_loader,
                                    class_linker->GetBootClassPath(),
                                    42U,
                                    4096U,
diff --git a/src/oat_writer.cc b/src/oat_writer.cc
index e26e3cc..382139e 100644
--- a/src/oat_writer.cc
+++ b/src/oat_writer.cc
@@ -31,7 +31,6 @@
 namespace art {
 
 bool OatWriter::Create(File* file,
-                       jobject class_loader,
                        const std::vector<const DexFile*>& dex_files,
                        uint32_t image_file_location_oat_checksum,
                        uint32_t image_file_location_oat_begin,
@@ -41,7 +40,6 @@
                        image_file_location_oat_checksum,
                        image_file_location_oat_begin,
                        image_file_location,
-                       class_loader,
                        compiler);
   return oat_writer.Write(file);
 }
@@ -50,10 +48,8 @@
                      uint32_t image_file_location_oat_checksum,
                      uint32_t image_file_location_oat_begin,
                      const std::string& image_file_location,
-                     jobject class_loader,
                      const Compiler& compiler) {
   compiler_ = &compiler;
-  class_loader_ = class_loader;
   image_file_location_oat_checksum_ = image_file_location_oat_checksum;
   image_file_location_oat_begin_ = image_file_location_oat_begin;
   image_file_location_ = image_file_location;
@@ -403,7 +399,7 @@
     // Unchecked as we hold mutator_lock_ on entry.
     ScopedObjectAccessUnchecked soa(Thread::Current());
     AbstractMethod* method = linker->ResolveMethod(*dex_file, method_idx, dex_cache,
-                                           soa.Decode<ClassLoader*>(class_loader_), NULL, type);
+                                                   NULL, NULL, type);
     CHECK(method != NULL);
     method->SetFrameSizeInBytes(frame_size_in_bytes);
     method->SetCoreSpillMask(core_spill_mask);
diff --git a/src/oat_writer.h b/src/oat_writer.h
index 09db96b..c5114fc 100644
--- a/src/oat_writer.h
+++ b/src/oat_writer.h
@@ -64,7 +64,6 @@
  public:
   // Write an oat file. Returns true on success, false on failure.
   static bool Create(File* file,
-                     jobject class_loader,
                      const std::vector<const DexFile*>& dex_files,
                      uint32_t image_file_location_oat_checksum,
                      uint32_t image_file_location_oat_begin,
@@ -77,7 +76,6 @@
             uint32_t image_file_location_oat_checksum,
             uint32_t image_file_location_oat_begin,
             const std::string& image_file_location,
-            jobject class_loader,
             const Compiler& compiler) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
   ~OatWriter();
 
@@ -152,9 +150,6 @@
 
   const Compiler* compiler_;
 
-  // TODO: remove the ClassLoader when the code storage moves out of Method
-  jobject class_loader_;
-
   // note OatFile does not take ownership of the DexFiles
   const std::vector<const DexFile*>* dex_files_;