Add support for opening classes.dex file from zip, jar, apk
Adding new ZipArchive class and test
src/zip_archive.h
src/zip_archive.cc
src/zip_archive_test.cc
build/Android.common.mk
Change from host only use of build dex file for libcore to using host
and target core.jar containing classes.dex files. This requires
setting up an ANDROID_DATA directory to containing an art-cache file
for the extracted dex files, similar to the dalvik-cache for odex
files. A unique ANDROID_DATA and art-cache is created and cleaned up
for each test run (similar to vogar).
src/common_test.h
Add dependency for libcore jar files to test targets to support
RuntimeTest use of core.jar
Android.mk
Extract common includes to ART_C_INCLUDES when adding zlib dependency
build/Android.common.mk
build/Android.libart.mk
build/Android.test.mk
Adding TODO regarding unordered map for ClassLinker::classes_ table.
src/class_linker.h
Adding DexFile::OpenZip (also changed OpenFile to take
src/dex_file.cc
src/dex_file.h
Adding kPageSize of 4096, validated by Runtime::Init
src/globals.h
src/runtime.cc
Updated to use kPageSize where it seemed appropriate.
src/jni_compiler.cc
src/jni_compiler_test.cc
src/space.cc
src/thread.cc
src/thread_x86.cc
Changed thread_list_ and class_linker_ to be declared in Runtime::Init
initialization order.
src/runtime.h
Change-Id: Id626abe5b6c1990e4f93598256ee0fae000818f6
diff --git a/src/space.cc b/src/space.cc
index a0da45c..217c2ee 100644
--- a/src/space.cc
+++ b/src/space.cc
@@ -46,7 +46,7 @@
if (!(startup_size_ <= maximum_size_)) {
return false;
}
- size_t length = RoundUp(maximum_size_, 4096);
+ size_t length = RoundUp(maximum_size_, kPageSize);
int prot = PROT_READ | PROT_WRITE;
int flags = MAP_PRIVATE | MAP_ANONYMOUS;
void* base = mmap(NULL, length, prot, flags, -1, 0);
@@ -103,8 +103,8 @@
}
void Space::DontNeed(void* start, void* end, void* num_bytes) {
- start = (void*)RoundUp((uintptr_t)start, 4096);
- end = (void*)RoundDown((uintptr_t)end, 4096);
+ start = (void*)RoundUp((uintptr_t)start, kPageSize);
+ end = (void*)RoundDown((uintptr_t)end, kPageSize);
if (start >= end) {
return;
}