summaryrefslogtreecommitdiffstats
path: root/src/oat_file.cc
diff options
context:
space:
mode:
authorjeffhao <jeffhao@google.com>2011-10-20 18:36:32 -0700
committerjeffhao <jeffhao@google.com>2011-10-24 11:23:14 -0700
commit262bf46ddc91e5b4fbd367127ff21a1877d939f2 (patch)
treea8c775ccabe058392fb008bc523605e34ed01bdb /src/oat_file.cc
parentecbce8f17a80ddc8e5d80b075a8e334f1c2daf3c (diff)
downloadart-262bf46ddc91e5b4fbd367127ff21a1877d939f2.zip
art-262bf46ddc91e5b4fbd367127ff21a1877d939f2.tar.gz
art-262bf46ddc91e5b4fbd367127ff21a1877d939f2.tar.bz2
dex2oat invoked by system if it can't find an oat file for a dex file.
This allows the old dalvik tests to be run without ever explicitly running dex2oat on anything. Just upload the jar files and the system will take care of generating the files it needs. Change-Id: Iad553bf6f57e28da4edb8eb0df47e62e08a0be44
Diffstat (limited to 'src/oat_file.cc')
-rw-r--r--src/oat_file.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/oat_file.cc b/src/oat_file.cc
index 6e8c60f..3dcde8e 100644
--- a/src/oat_file.cc
+++ b/src/oat_file.cc
@@ -10,15 +10,12 @@
namespace art {
-std::string OatFile::DexFileToOatFilename(const DexFile& dex_file) {
- std::string location(dex_file.GetLocation());
- CHECK(StringPiece(location).ends_with(".dex")
- || StringPiece(location).ends_with(".zip")
- || StringPiece(location).ends_with(".jar")
- || StringPiece(location).ends_with(".apk"));
- location.erase(location.size()-3);
- location += "oat";
- return location;
+std::string OatFile::DexFilenameToOatFilename(const std::string& location) {
+ LOG(INFO) << "dexfilenametooatfilename " << location;
+ CHECK(IsValidDexFilename(location) || IsValidZipFilename(location));
+ std::string oat_location = location.substr(0, location.size()-3);
+ oat_location += "oat";
+ return oat_location;
}
OatFile* OatFile::Open(const std::string& filename,