diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/compiler/Frontend.cc | 11 | ||||
| -rw-r--r-- | src/dex2oat.cc | 1 | ||||
| -rw-r--r-- | src/gc/atomic_stack.h | 6 | ||||
| -rw-r--r-- | src/gc/card_table.cc | 6 | ||||
| -rw-r--r-- | src/heap.cc | 5 | ||||
| -rw-r--r-- | src/image_test.cc | 16 | ||||
| -rw-r--r-- | src/mem_map.cc | 11 | ||||
| -rw-r--r-- | src/oat/runtime/mips/runtime_support_mips.S | 57 | ||||
| -rw-r--r-- | src/oat_test.cc | 1 | ||||
| -rw-r--r-- | src/oat_writer.cc | 6 | ||||
| -rw-r--r-- | src/oat_writer.h | 5 |
11 files changed, 63 insertions, 62 deletions
diff --git a/src/compiler/Frontend.cc b/src/compiler/Frontend.cc index c5d5c21d43..ffeae4691c 100644 --- a/src/compiler/Frontend.cc +++ b/src/compiler/Frontend.cc @@ -858,14 +858,15 @@ if (PrettyMethod(method_idx, dex_file).find("void com.android.inputmethod.keyboa (1 << kLoadStoreElimination) | (1 << kLoadHoisting) | (1 << kSuppressLoads) | - (1 << kNullCheckElimination) | - (1 << kPromoteRegs) | + //(1 << kNullCheckElimination) | + //(1 << kPromoteRegs) | (1 << kTrackLiveTemps) | - (1 << kSkipLargeMethodOptimization) | - (1 << kSafeOptimizations) | + //(1 << kSkipLargeMethodOptimization) | + //(1 << kSafeOptimizations) | (1 << kBBOpt) | (1 << kMatch) | - (1 << kPromoteCompilerTemps)); + //(1 << kPromoteCompilerTemps) | + 0); } #endif diff --git a/src/dex2oat.cc b/src/dex2oat.cc index a8f42afbd0..bbc07a63b9 100644 --- a/src/dex2oat.cc +++ b/src/dex2oat.cc @@ -269,7 +269,6 @@ class Dex2Oat { } if (!OatWriter::Create(oat_file, - class_loader, dex_files, image_file_location_oat_checksum, image_file_location_oat_begin, diff --git a/src/gc/atomic_stack.h b/src/gc/atomic_stack.h index 349486101d..d67d2f2868 100644 --- a/src/gc/atomic_stack.h +++ b/src/gc/atomic_stack.h @@ -136,11 +136,7 @@ class AtomicStack { // Size in number of elements. void Init() { mem_map_.reset(MemMap::MapAnonymous(name_.c_str(), NULL, capacity_ * sizeof(T), PROT_READ | PROT_WRITE)); - if (mem_map_.get() == NULL) { - std::string maps; - ReadFileToString("/proc/self/maps", &maps); - LOG(FATAL) << "couldn't allocate mark stack\n" << maps; - } + CHECK(mem_map_.get() != NULL) << "couldn't allocate mark stack"; byte* addr = mem_map_->Begin(); CHECK(addr != NULL); begin_ = reinterpret_cast<T*>(addr); diff --git a/src/gc/card_table.cc b/src/gc/card_table.cc index 5a1e9b5ef7..a5531d8fa0 100644 --- a/src/gc/card_table.cc +++ b/src/gc/card_table.cc @@ -54,11 +54,7 @@ CardTable* CardTable::Create(const byte* heap_begin, size_t heap_capacity) { /* Allocate an extra 256 bytes to allow fixed low-byte of base */ UniquePtr<MemMap> mem_map(MemMap::MapAnonymous("dalvik-card-table", NULL, capacity + 256, PROT_READ | PROT_WRITE)); - if (mem_map.get() == NULL) { - std::string maps; - ReadFileToString("/proc/self/maps", &maps); - LOG(FATAL) << "couldn't allocate card table\n" << maps; - } + CHECK(mem_map.get() != NULL) << "couldn't allocate card table"; // All zeros is the correct initial value; all clean. Anonymous mmaps are initialized to zero, we // don't clear the card table to avoid unnecessary pages being allocated COMPILE_ASSERT(kCardClean == 0, card_clean_must_be_0); diff --git a/src/heap.cc b/src/heap.cc index bfc52563e0..cf13eaec9a 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -87,7 +87,8 @@ static bool GenerateImage(const std::string& image_file_name) { const char* oat_file_option = oat_file_option_string.c_str(); arg_vector.push_back(strdup(oat_file_option)); - arg_vector.push_back(strdup("--base=0x60000000")); + std::string base_option_string(StringPrintf("--base=0x%x", ART_BASE_ADDRESS)); + arg_vector.push_back(strdup(base_option_string.c_str())); std::string command_line(Join(arg_vector, ' ')); LOG(INFO) << command_line; @@ -232,8 +233,8 @@ Heap::Heap(size_t initial_size, size_t growth_limit, size_t min_free, size_t max growth_limit, capacity, requested_begin)); alloc_space_ = alloc_space.release(); - alloc_space_->SetFootprintLimit(alloc_space_->Capacity()); CHECK(alloc_space_ != NULL) << "Failed to create alloc space"; + alloc_space_->SetFootprintLimit(alloc_space_->Capacity()); AddSpace(alloc_space_); // Spaces are sorted in order of Begin(). diff --git a/src/image_test.cc b/src/image_test.cc index e2abbaccfa..feb490c651 100644 --- a/src/image_test.cc +++ b/src/image_test.cc @@ -36,7 +36,7 @@ TEST_F(ImageTest, WriteRead) { ScopedObjectAccess soa(Thread::Current()); std::vector<const DexFile*> dex_files; dex_files.push_back(java_lang_dex_file_); - bool success_oat = OatWriter::Create(tmp_oat.GetFile(), NULL, dex_files, 0, 0, "", *compiler_.get()); + bool success_oat = OatWriter::Create(tmp_oat.GetFile(), dex_files, 0, 0, "", *compiler_.get()); ASSERT_TRUE(success_oat); // Force all system classes into memory @@ -48,13 +48,15 @@ TEST_F(ImageTest, WriteRead) { } } - ImageWriter writer(NULL); ScratchFile tmp_image; - const uintptr_t requested_image_base = 0x60000000; - bool success_image = writer.Write(tmp_image.GetFilename(), requested_image_base, - tmp_oat.GetFilename(), tmp_oat.GetFilename(), - *compiler_.get()); - ASSERT_TRUE(success_image); + const uintptr_t requested_image_base = ART_BASE_ADDRESS; + { + ImageWriter writer(NULL); + bool success_image = writer.Write(tmp_image.GetFilename(), requested_image_base, + tmp_oat.GetFilename(), tmp_oat.GetFilename(), + *compiler_.get()); + ASSERT_TRUE(success_image); + } { UniquePtr<File> file(OS::OpenFile(tmp_image.GetFilename().c_str(), false)); diff --git a/src/mem_map.cc b/src/mem_map.cc index 653eb3ffe4..f322773f97 100644 --- a/src/mem_map.cc +++ b/src/mem_map.cc @@ -87,8 +87,11 @@ MemMap* MemMap::MapAnonymous(const char* name, byte* addr, size_t byte_count, in byte* actual = reinterpret_cast<byte*>(mmap(addr, page_aligned_byte_count, prot, flags, fd.get(), 0)); if (actual == MAP_FAILED) { + std::string maps; + ReadFileToString("/proc/self/maps", &maps); PLOG(ERROR) << "mmap(" << reinterpret_cast<void*>(addr) << ", " << page_aligned_byte_count - << ", " << prot << ", " << flags << ", " << fd.get() << ", 0) failed for " << name; + << ", " << prot << ", " << flags << ", " << fd.get() << ", 0) failed for " << name + << "\n" << maps; return NULL; } return new MemMap(name, actual, byte_count, actual, page_aligned_byte_count, prot); @@ -110,7 +113,11 @@ MemMap* MemMap::MapFileAtAddress(byte* addr, size_t byte_count, int prot, int fl fd, page_aligned_offset)); if (actual == MAP_FAILED) { - PLOG(ERROR) << "mmap failed"; + std::string maps; + ReadFileToString("/proc/self/maps", &maps); + PLOG(ERROR) << "mmap(" << reinterpret_cast<void*>(addr) << ", " << page_aligned_byte_count + << ", " << prot << ", " << flags << ", " << fd << ", " << page_aligned_offset + << ") failed\n" << maps; return NULL; } return new MemMap("file", actual + page_offset, byte_count, actual, page_aligned_byte_count, diff --git a/src/oat/runtime/mips/runtime_support_mips.S b/src/oat/runtime/mips/runtime_support_mips.S index 349e802d26..bc0aecfbcd 100644 --- a/src/oat/runtime/mips/runtime_support_mips.S +++ b/src/oat/runtime/mips/runtime_support_mips.S @@ -22,7 +22,7 @@ /* Deliver the given exception */ .extern artDeliverExceptionFromCode /* Deliver an exception pending on a thread */ - .extern artDeliverPendingException + .extern artDeliverPendingExceptionFromCode /* Cache alignment for function entry */ .macro ALIGN_FUNCTION_ENTRY @@ -115,16 +115,17 @@ * exception is Thread::Current()->exception_ */ .macro DELIVER_PENDING_EXCEPTION - SETUP_SAVE_ALL_CALLEE_SAVE_FRAME # save callee saves for throw - move $a0, rSELF # pass Thread::Current - jal artDeliverPendingExceptionFromCode # artDeliverPendingExceptionFromCode(Thread*, $sp) - move $a1, $sp # pass $sp + SETUP_SAVE_ALL_CALLEE_SAVE_FRAME # save callee saves for throw + move $a0, rSELF # pass Thread::Current + la $t9, artDeliverPendingExceptionFromCode + jr $t9 # artDeliverPendingExceptionFromCode(Thread*, $sp) + move $a1, $sp # pass $sp .endm .macro RETURN_IF_NO_EXCEPTION lw $t0, THREAD_EXCEPTION_OFFSET(rSELF) # load Thread::Current()->exception_ RESTORE_REF_ONLY_CALLEE_SAVE_FRAME - bnez $t0, 1f # success if no exception is pending + bnez $t0, 1f # success if no exception is pending nop jr $ra nop @@ -254,9 +255,10 @@ art_do_long_jump: art_deliver_exception_from_code: .cpload $25 SETUP_SAVE_ALL_CALLEE_SAVE_FRAME - move $a1, rSELF # pass Thread::Current - jal artDeliverExceptionFromCode # artDeliverExceptionFromCode(Throwable*, Thread*, $sp) - move $a2, $sp # pass $sp + move $a1, rSELF # pass Thread::Current + la $t9, artDeliverExceptionFromCode + jr $t9 # artDeliverExceptionFromCode(Throwable*, Thread*, $sp) + move $a2, $sp # pass $sp .global art_throw_null_pointer_exception_from_code .extern artThrowNullPointerExceptionFromCode @@ -267,9 +269,10 @@ art_deliver_exception_from_code: art_throw_null_pointer_exception_from_code: .cpload $25 SETUP_SAVE_ALL_CALLEE_SAVE_FRAME - move $a0, rSELF # pass Thread::Current - jal artThrowNullPointerExceptionFromCode # artThrowNullPointerExceptionFromCode(Thread*, $sp) - move $a1, $sp # pass $sp + move $a0, rSELF # pass Thread::Current + la $t9, artThrowNullPointerExceptionFromCode + jr $t9 # artThrowNullPointerExceptionFromCode(Thread*, $sp) + move $a1, $sp # pass $sp .global art_throw_div_zero_from_code .extern artThrowDivZeroFromCode @@ -281,7 +284,8 @@ art_throw_div_zero_from_code: .cpload $25 SETUP_SAVE_ALL_CALLEE_SAVE_FRAME move $a0, rSELF # pass Thread::Current - jal artThrowDivZeroFromCode # artThrowDivZeroFromCode(Thread*, $sp) + la $t9, artThrowDivZeroFromCode + jr $t9 # artThrowDivZeroFromCode(Thread*, $sp) move $a1, $sp # pass $sp .global art_throw_array_bounds_from_code @@ -293,9 +297,10 @@ art_throw_div_zero_from_code: art_throw_array_bounds_from_code: .cpload $25 SETUP_SAVE_ALL_CALLEE_SAVE_FRAME - move $a2, rSELF # pass Thread::Current - jal artThrowArrayBoundsFromCode # artThrowArrayBoundsFromCode(index, limit, Thread*, $sp) - move $a3, $sp # pass $sp + move $a2, rSELF # pass Thread::Current + la $t9, artThrowArrayBoundsFromCode + jr $t9 # artThrowArrayBoundsFromCode(index, limit, Thread*, $sp) + move $a3, $sp # pass $sp .global art_throw_stack_overflow_from_code .extern artThrowStackOverflowFromCode @@ -306,9 +311,10 @@ art_throw_array_bounds_from_code: art_throw_stack_overflow_from_code: .cpload $25 SETUP_SAVE_ALL_CALLEE_SAVE_FRAME - move $a0, rSELF # pass Thread::Current - jal artThrowStackOverflowFromCode # artThrowStackOverflowFromCode(Thread*, $sp) - move $a1, $sp # pass $sp + move $a0, rSELF # pass Thread::Current + la $t9, artThrowStackOverflowFromCode + jr $t9 # artThrowStackOverflowFromCode(Thread*, $sp) + move $a1, $sp # pass $sp .global art_throw_no_such_method_from_code .extern artThrowNoSuchMethodFromCode @@ -319,9 +325,10 @@ art_throw_stack_overflow_from_code: art_throw_no_such_method_from_code: .cpload $25 SETUP_SAVE_ALL_CALLEE_SAVE_FRAME - move $a1, rSELF # pass Thread::Current - jal artThrowNoSuchMethodFromCode # artThrowNoSuchMethodFromCode(method_idx, Thread*, $sp) - move $a2, $sp # pass $sp + move $a1, rSELF # pass Thread::Current + la $t9, artThrowNoSuchMethodFromCode + jr $t9 # artThrowNoSuchMethodFromCode(method_idx, Thread*, $sp) + move $a2, $sp # pass $sp /* * All generated callsites for interface invokes and invocation slow paths will load arguments @@ -349,8 +356,10 @@ art_throw_no_such_method_from_code: move $t0, $sp # save $sp addiu $sp, $sp, -16 # make space for extra args move $a3, rSELF # pass Thread::Current + sw $gp, 12($sp) # save $gp jal \cxx_name # (method_idx, this, caller, Thread*, $sp) sw $t0, 16($sp) # pass $sp + lw $gp, 12($sp) # restore $gp addiu $sp, $sp, 16 # release out args move $a0, $v0 # save target Method* move $t9, $v1 # save $v0->code_ @@ -866,12 +875,12 @@ art_trace_entry_from_code: move $a2, $ra # pass $ra jal artTraceMethodEntryFromCode # (Method*, Thread*, LR) move $a1, rSELF # pass Thread::Current - move $t0, $v0 # $t0 holds reference to code + move $t9, $v0 # $t9 holds reference to code lw $a0, 0($sp) lw $a1, 4($sp) lw $a2, 8($sp) lw $a3, 12($sp) - jalr $t0 # call method + jalr $t9 # call method addiu $sp, $sp, 16 /* intentional fallthrough */ diff --git a/src/oat_test.cc b/src/oat_test.cc index bb6305a08b..52217b2a9d 100644 --- a/src/oat_test.cc +++ b/src/oat_test.cc @@ -80,7 +80,6 @@ TEST_F(OatTest, WriteRead) { ScopedObjectAccess soa(Thread::Current()); ScratchFile tmp; bool success = OatWriter::Create(tmp.GetFile(), - class_loader, class_linker->GetBootClassPath(), 42U, 4096U, diff --git a/src/oat_writer.cc b/src/oat_writer.cc index e26e3cc6ff..382139ea86 100644 --- a/src/oat_writer.cc +++ b/src/oat_writer.cc @@ -31,7 +31,6 @@ namespace art { bool OatWriter::Create(File* file, - jobject class_loader, const std::vector<const DexFile*>& dex_files, uint32_t image_file_location_oat_checksum, uint32_t image_file_location_oat_begin, @@ -41,7 +40,6 @@ bool OatWriter::Create(File* file, image_file_location_oat_checksum, image_file_location_oat_begin, image_file_location, - class_loader, compiler); return oat_writer.Write(file); } @@ -50,10 +48,8 @@ OatWriter::OatWriter(const std::vector<const DexFile*>& dex_files, uint32_t image_file_location_oat_checksum, uint32_t image_file_location_oat_begin, const std::string& image_file_location, - jobject class_loader, const Compiler& compiler) { compiler_ = &compiler; - class_loader_ = class_loader; image_file_location_oat_checksum_ = image_file_location_oat_checksum; image_file_location_oat_begin_ = image_file_location_oat_begin; image_file_location_ = image_file_location; @@ -403,7 +399,7 @@ size_t OatWriter::InitOatCodeMethod(size_t offset, size_t oat_class_index, // Unchecked as we hold mutator_lock_ on entry. ScopedObjectAccessUnchecked soa(Thread::Current()); AbstractMethod* method = linker->ResolveMethod(*dex_file, method_idx, dex_cache, - soa.Decode<ClassLoader*>(class_loader_), NULL, type); + NULL, NULL, type); CHECK(method != NULL); method->SetFrameSizeInBytes(frame_size_in_bytes); method->SetCoreSpillMask(core_spill_mask); diff --git a/src/oat_writer.h b/src/oat_writer.h index 09db96b6c5..c5114fc7b8 100644 --- a/src/oat_writer.h +++ b/src/oat_writer.h @@ -64,7 +64,6 @@ class OatWriter { public: // Write an oat file. Returns true on success, false on failure. static bool Create(File* file, - jobject class_loader, const std::vector<const DexFile*>& dex_files, uint32_t image_file_location_oat_checksum, uint32_t image_file_location_oat_begin, @@ -77,7 +76,6 @@ class OatWriter { uint32_t image_file_location_oat_checksum, uint32_t image_file_location_oat_begin, const std::string& image_file_location, - jobject class_loader, const Compiler& compiler) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); ~OatWriter(); @@ -152,9 +150,6 @@ class OatWriter { const Compiler* compiler_; - // TODO: remove the ClassLoader when the code storage moves out of Method - jobject class_loader_; - // note OatFile does not take ownership of the DexFiles const std::vector<const DexFile*>* dex_files_; |