summaryrefslogtreecommitdiff
path: root/src/oat_file.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/oat_file.cc')
-rw-r--r--src/oat_file.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/oat_file.cc b/src/oat_file.cc
index 8a4aa9a6be..23eae7cbe7 100644
--- a/src/oat_file.cc
+++ b/src/oat_file.cc
@@ -10,6 +10,17 @@
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;
+}
+
OatFile* OatFile::Open(const std::string& filename,
const std::string& strip_location_prefix,
byte* requested_base) {