summaryrefslogtreecommitdiffstats
path: root/runtime/instruction_set.cc
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2014-04-23 20:24:57 +0100
committerNarayan Kamath <narayan@google.com>2014-05-01 11:25:07 +0100
commit11d9f06a96a6909905c248ed684366190140095c (patch)
tree27b02ab216b98ba1656d66072fd46c5adec61242 /runtime/instruction_set.cc
parentb3016551e5f264264dbb633a1ddf03ac97f9c66c (diff)
downloadandroid_art-11d9f06a96a6909905c248ed684366190140095c.tar.gz
android_art-11d9f06a96a6909905c248ed684366190140095c.tar.bz2
android_art-11d9f06a96a6909905c248ed684366190140095c.zip
Use instruction specific dalvik cache dirs.
- All oat & art files are now placed under /data/dalvik-cache/<isa>/. - GetDalvikCacheOrDie now requires a mandatory subdirectory argument, and is implicitly rooted under /data/. - Added helper methods to convert InstructionSet enums into strings and vice versa. (cherry picked from commit 2974bc3d8a5d161d449dd66826d668d87bdc3cbe) Change-Id: Ic7986938e6a7091a2af675ebafec768f7b5fb8cd
Diffstat (limited to 'runtime/instruction_set.cc')
-rw-r--r--runtime/instruction_set.cc42
1 files changed, 42 insertions, 0 deletions
diff --git a/runtime/instruction_set.cc b/runtime/instruction_set.cc
index 73d427985f..cbcd2e063b 100644
--- a/runtime/instruction_set.cc
+++ b/runtime/instruction_set.cc
@@ -21,6 +21,48 @@
namespace art {
+const char* GetInstructionSetString(const InstructionSet isa) {
+ switch (isa) {
+ case kArm:
+ case kThumb2:
+ return "arm";
+ case kArm64:
+ return "arm64";
+ case kX86:
+ return "x86";
+ case kX86_64:
+ return "x86_64";
+ case kMips:
+ return "mips";
+ case kNone:
+ return "none";
+ default:
+ LOG(FATAL) << "Unknown ISA " << isa;
+ return nullptr;
+ }
+}
+
+InstructionSet GetInstructionSetFromString(const char* isa_str) {
+ CHECK(isa_str != nullptr);
+
+ if (!strcmp("arm", isa_str)) {
+ return kArm;
+ } else if (!strcmp("arm64", isa_str)) {
+ return kArm64;
+ } else if (!strcmp("x86", isa_str)) {
+ return kX86;
+ } else if (!strcmp("x86_64", isa_str)) {
+ return kX86_64;
+ } else if (!strcmp("mips", isa_str)) {
+ return kMips;
+ } else if (!strcmp("none", isa_str)) {
+ return kNone;
+ }
+
+ LOG(FATAL) << "Unknown ISA " << isa_str;
+ return kNone;
+}
+
size_t GetInstructionSetPointerSize(InstructionSet isa) {
switch (isa) {
case kArm: