diff options
| author | 2012-04-03 18:56:08 -0700 | |
|---|---|---|
| committer | 2012-04-04 00:42:30 -0700 | |
| commit | 540a5b768bf5f76bd71ebf66612fb2298899480f (patch) | |
| tree | fcba13f1694e25289f0dc79e6c097c03e65e386e | |
| parent | 4165a83d250165c839850651e1b2a69e06128000 (diff) | |
Compiler_LLVM doesn't use reference map.
Also, for runtime_support_llvm, we fix the throw_exception_from_code bug.
Compiler LLVM haven't done the write barrier, so we need to scan image space.
Change-Id: I2be8b5fb1cf2a677d90f568480e58c10b315f42d
| -rw-r--r-- | src/compiler_llvm/runtime_support_llvm.cc | 6 | ||||
| -rw-r--r-- | src/mark_sweep.cc | 7 | ||||
| -rw-r--r-- | src/thread.cc | 9 |
3 files changed, 21 insertions, 1 deletions
diff --git a/src/compiler_llvm/runtime_support_llvm.cc b/src/compiler_llvm/runtime_support_llvm.cc index ccc8639cb8..6ad80f830b 100644 --- a/src/compiler_llvm/runtime_support_llvm.cc +++ b/src/compiler_llvm/runtime_support_llvm.cc @@ -128,7 +128,11 @@ void art_throw_stack_overflow_from_code() { void art_throw_exception_from_code(Object* exception) { Thread* thread = Thread::Current(); - thread->SetException(static_cast<Throwable*>(exception)); + if (exception == NULL) { + thread->ThrowNewException("Ljava/lang/NullPointerException;", "throw with null exception"); + } else { + thread->SetException(static_cast<Throwable*>(exception)); + } } int32_t art_find_catch_block_from_code(Method* current_method, int32_t dex_pc) { diff --git a/src/mark_sweep.cc b/src/mark_sweep.cc index 381c7f0b98..1553dd8adf 100644 --- a/src/mark_sweep.cc +++ b/src/mark_sweep.cc @@ -139,6 +139,7 @@ void MarkSweep::RecursiveMark() { void* arg = reinterpret_cast<void*>(this); const std::vector<Space*>& spaces = heap_->GetSpaces(); for (size_t i = 0; i < spaces.size(); ++i) { +#if !defined(ART_USE_LLVM_COMPILER) #ifndef NDEBUG uintptr_t begin = reinterpret_cast<uintptr_t>(spaces[i]->Begin()); uintptr_t end = reinterpret_cast<uintptr_t>(spaces[i]->End()); @@ -154,6 +155,12 @@ void MarkSweep::RecursiveMark() { mark_bitmap_->ScanWalk(begin, end, &MarkSweep::ScanBitmapCallback, arg); } #endif +#else + // TODO: Implement card marking. + uintptr_t begin = reinterpret_cast<uintptr_t>(spaces[i]->Begin()); + uintptr_t end = reinterpret_cast<uintptr_t>(spaces[i]->End()); + mark_bitmap_->ScanWalk(begin, end, &MarkSweep::ScanBitmapCallback, arg); +#endif } finger_ = reinterpret_cast<Object*>(~0); // TODO: tune the frequency of emptying the mark stack diff --git a/src/thread.cc b/src/thread.cc index 64f618c9ee..846aa397d3 100644 --- a/src/thread.cc +++ b/src/thread.cc @@ -482,6 +482,7 @@ struct StackDumpVisitor : public Thread::StackVisitor { } const int kMaxRepetition = 3; Method* m = frame.GetMethod(); +#if !defined(ART_USE_LLVM_COMPILER) Class* c = m->GetDeclaringClass(); ClassLinker* class_linker = Runtime::Current()->GetClassLinker(); const DexCache* dex_cache = c->GetDexCache(); @@ -490,6 +491,10 @@ struct StackDumpVisitor : public Thread::StackVisitor { const DexFile& dex_file = class_linker->FindDexFile(dex_cache); line_number = dex_file.GetLineNumFromPC(m, m->ToDexPC(pc)); } +#else + // Compiler_LLVM stores line_number in the ShadowFrame, and passes it to visitor. + int line_number = static_cast<int>(pc); +#endif if (line_number == last_line_number && last_method == m) { repetition_count++; } else { @@ -1705,12 +1710,14 @@ void Thread::VisitRoots(Heap::RootVisitor* visitor, void* arg) { SirtVisitRoots(visitor, arg); ShadowFrameVisitRoots(visitor, arg); +#if !defined(ART_USE_LLVM_COMPILER) // Cheat and steal the long jump context. Assume that we are not doing a GC during exception // delivery. Context* context = GetLongJumpContext(); // Visit roots on this thread's stack ReferenceMapVisitor mapper(context, visitor, arg); WalkStack(&mapper); +#endif } #if VERIFY_OBJECT_ENABLED @@ -1719,9 +1726,11 @@ static void VerifyObject(const Object* obj, void*) { } void Thread::VerifyStack() { +#if !defined(ART_USE_LLVM_COMPILER) UniquePtr<Context> context(Context::Create()); ReferenceMapVisitor mapper(context.get(), VerifyObject, NULL); WalkStack(&mapper); +#endif } #endif |