Rename art-cache to dalvik-cache

Change-Id: I294995066aecc29fbd739c3e9e6f60934f743064
diff --git a/src/class_linker.cc b/src/class_linker.cc
index cfad9d1..85bd9f6 100644
--- a/src/class_linker.cc
+++ b/src/class_linker.cc
@@ -884,9 +884,9 @@
       return dex_file;
     }
   }
-  // Look for an existing file in the art-cache, validating the result if found
-  // not found in /foo/bar/baz.oat? try /data/art-cache/foo@bar@baz.oat
-  std::string cache_location(GetArtCacheFilenameOrDie(oat_filename));
+  // Look for an existing file in the dalvik-cache, validating the result if found
+  // not found in /foo/bar/baz.oat? try /data/dalvik-cache/foo@bar@baz.oat
+  std::string cache_location(GetDalvikCacheFilenameOrDie(oat_filename));
   oat_file = FindOatFileFromOatLocationLocked(cache_location);
   if (oat_file != NULL) {
     uint32_t dex_location_checksum;
@@ -907,7 +907,7 @@
   LOG(INFO) << "Failed to open oat file from " << oat_filename << " or " << cache_location << ".";
 
   // Try to generate oat file if it wasn't found or was obsolete.
-  std::string oat_cache_filename(GetArtCacheFilenameOrDie(oat_filename));
+  std::string oat_cache_filename(GetDalvikCacheFilenameOrDie(oat_filename));
   return FindOrCreateOatFileForDexLocationLocked(dex_location, oat_cache_filename);
 }
 
diff --git a/src/common_test.h b/src/common_test.h
index a40537f..3baa77c 100644
--- a/src/common_test.h
+++ b/src/common_test.h
@@ -265,8 +265,8 @@
       setenv("LD_LIBRARY_PATH", ":", 0);  // Required by java.lang.System.<clinit>.
     }
 
-    // On target, Cannot use /mnt/sdcard because it is mounted noexec, so use subdir of art-cache
-    android_data = (IsHost() ? "/tmp/art-data-XXXXXX" : "/data/art-cache/art-data-XXXXXX");
+    // On target, Cannot use /mnt/sdcard because it is mounted noexec, so use subdir of dalvik-cache
+    android_data = (IsHost() ? "/tmp/art-data-XXXXXX" : "/data/dalvik-cache/art-data-XXXXXX");
     if (mkdtemp(&android_data[0]) == NULL) {
       PLOG(FATAL) << "mkdtemp(\"" << &android_data[0] << "\") failed";
     }
@@ -280,9 +280,9 @@
 
   virtual void SetUp() {
     SetEnvironmentVariables(android_data_);
-    art_cache_.append(android_data_.c_str());
-    art_cache_.append("/art-cache");
-    int mkdir_result = mkdir(art_cache_.c_str(), 0700);
+    dalvik_cache_.append(android_data_.c_str());
+    dalvik_cache_.append("/dalvik-cache");
+    int mkdir_result = mkdir(dalvik_cache_.c_str(), 0700);
     ASSERT_EQ(mkdir_result, 0);
 
     java_lang_dex_file_ = DexFile::Open(GetLibCoreDexFileName(), GetLibCoreDexFileName());
@@ -360,21 +360,21 @@
   virtual void TearDown() {
     const char* android_data = getenv("ANDROID_DATA");
     ASSERT_TRUE(android_data != NULL);
-    DIR* dir = opendir(art_cache_.c_str());
+    DIR* dir = opendir(dalvik_cache_.c_str());
     ASSERT_TRUE(dir != NULL);
     dirent* e;
     while ((e = readdir(dir)) != NULL) {
       if ((strcmp(e->d_name, ".") == 0) || (strcmp(e->d_name, "..") == 0)) {
         continue;
       }
-      std::string filename(art_cache_);
+      std::string filename(dalvik_cache_);
       filename.push_back('/');
       filename.append(e->d_name);
       int unlink_result = unlink(filename.c_str());
       ASSERT_EQ(0, unlink_result);
     }
     closedir(dir);
-    int rmdir_cache_result = rmdir(art_cache_.c_str());
+    int rmdir_cache_result = rmdir(dalvik_cache_.c_str());
     ASSERT_EQ(0, rmdir_cache_result);
     int rmdir_data_result = rmdir(android_data_.c_str());
     ASSERT_EQ(0, rmdir_data_result);
@@ -514,7 +514,7 @@
   }
 
   std::string android_data_;
-  std::string art_cache_;
+  std::string dalvik_cache_;
   const DexFile* java_lang_dex_file_;  // owned by runtime_
   const DexFile* conscrypt_file_;  // owned by runtime_
   std::vector<const DexFile*> boot_class_path_;
diff --git a/src/compiler/llvm/llvm_compilation_unit.cc b/src/compiler/llvm/llvm_compilation_unit.cc
index 8a674c0..dfb5724 100644
--- a/src/compiler/llvm/llvm_compilation_unit.cc
+++ b/src/compiler/llvm/llvm_compilation_unit.cc
@@ -146,7 +146,7 @@
 
 static std::string DumpDirectory() {
   if (kIsTargetBuild) {
-    return GetArtCacheOrDie(GetAndroidData());
+    return GetDalvikCacheOrDie(GetAndroidData());
   }
   return "/tmp";
 }
diff --git a/src/dex2oat.cc b/src/dex2oat.cc
index 6df381e..ad751d0 100644
--- a/src/dex2oat.cc
+++ b/src/dex2oat.cc
@@ -90,7 +90,7 @@
   UsageError("");
   UsageError("  --oat-location=<oat-name>: specifies a symbolic name for the file corresponding");
   UsageError("      to the file descriptor specified by --oat-fd.");
-  UsageError("      Example: --oat-location=/data/art-cache/system@app@Calculator.apk.oat");
+  UsageError("      Example: --oat-location=/data/dalvik-cache/system@app@Calculator.apk.oat");
   UsageError("");
   UsageError("  --oat-symbols=<file.oat>: specifies the oat output destination with full symbols.");
   UsageError("      Example: --oat-symbols=/symbols/system/framework/boot.oat");
diff --git a/src/heap.cc b/src/heap.cc
index e6d3a81..f39c26e 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -211,10 +211,10 @@
       // If the /system file exists, it should be up-to-date, don't try to generate
       image_space = ImageSpace::Create(image_file_name);
     } else {
-      // If the /system file didn't exist, we need to use one from the art-cache.
+      // If the /system file didn't exist, we need to use one from the dalvik-cache.
       // If the cache file exists, try to open, but if it fails, regenerate.
       // If it does not exist, generate.
-      image_file_name = GetArtCacheFilenameOrDie(image_file_name);
+      image_file_name = GetDalvikCacheFilenameOrDie(image_file_name);
       if (OS::FileExists(image_file_name.c_str())) {
         image_space = ImageSpace::Create(image_file_name);
       }
diff --git a/src/native/dalvik_system_DexFile.cc b/src/native/dalvik_system_DexFile.cc
index 32056ca..c49e017 100644
--- a/src/native/dalvik_system_DexFile.cc
+++ b/src/native/dalvik_system_DexFile.cc
@@ -240,7 +240,7 @@
   }
 
   // Check if we have an oat file in the cache
-  std::string cache_location(GetArtCacheFilenameOrDie(oat_filename));
+  std::string cache_location(GetDalvikCacheFilenameOrDie(oat_filename));
   oat_file.reset(OatFile::Open(cache_location, oat_filename, NULL));
   if (oat_file.get() == NULL) {
     LOG(INFO) << "DexFile_isDexOptNeeded cache file " << cache_location
diff --git a/src/utils.cc b/src/utils.cc
index 94d812c..bb83802 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -1184,32 +1184,32 @@
   return android_data;
 }
 
-std::string GetArtCacheOrDie(const char* android_data) {
-  std::string art_cache(StringPrintf("%s/art-cache", android_data));
+std::string GetDalvikCacheOrDie(const char* android_data) {
+  std::string dalvik_cache(StringPrintf("%s/dalvik-cache", android_data));
 
-  if (!OS::DirectoryExists(art_cache.c_str())) {
-    if (StartsWith(art_cache, "/tmp/")) {
-      int result = mkdir(art_cache.c_str(), 0700);
+  if (!OS::DirectoryExists(dalvik_cache.c_str())) {
+    if (StartsWith(dalvik_cache, "/tmp/")) {
+      int result = mkdir(dalvik_cache.c_str(), 0700);
       if (result != 0) {
-        LOG(FATAL) << "Failed to create art-cache directory " << art_cache;
+        LOG(FATAL) << "Failed to create dalvik-cache directory " << dalvik_cache;
         return "";
       }
     } else {
-      LOG(FATAL) << "Failed to find art-cache directory " << art_cache;
+      LOG(FATAL) << "Failed to find dalvik-cache directory " << dalvik_cache;
       return "";
     }
   }
-  return art_cache;
+  return dalvik_cache;
 }
 
-std::string GetArtCacheFilenameOrDie(const std::string& location) {
-  std::string art_cache(GetArtCacheOrDie(GetAndroidData()));
+std::string GetDalvikCacheFilenameOrDie(const std::string& location) {
+  std::string dalvik_cache(GetDalvikCacheOrDie(GetAndroidData()));
   if (location[0] != '/') {
     LOG(FATAL) << "Expected path in location to be absolute: "<< location;
   }
   std::string cache_file(location, 1); // skip leading slash
   std::replace(cache_file.begin(), cache_file.end(), '/', '@');
-  return art_cache + "/" + cache_file;
+  return dalvik_cache + "/" + cache_file;
 }
 
 bool IsValidZipFilename(const std::string& filename) {
diff --git a/src/utils.h b/src/utils.h
index d808fc3..e5028ba 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -338,11 +338,11 @@
 // Find $ANDROID_DATA, /data, or abort
 const char* GetAndroidData();
 
-// Returns the art-cache location, or dies trying.
-std::string GetArtCacheOrDie(const char* android_data);
+// Returns the dalvik-cache location, or dies trying.
+std::string GetDalvikCacheOrDie(const char* android_data);
 
-// Returns the art-cache location for a DexFile or OatFile, or dies trying.
-std::string GetArtCacheFilenameOrDie(const std::string& location);
+// Returns the dalvik-cache location for a DexFile or OatFile, or dies trying.
+std::string GetDalvikCacheFilenameOrDie(const std::string& location);
 
 // Check whether the given filename has a valid extension
 bool IsValidZipFilename(const std::string& filename);