OSDN Git Service

Refactor and improve GC root handling
authorMathieu Chartier <mathieuc@google.com>
Fri, 3 Apr 2015 18:21:55 +0000 (11:21 -0700)
committerMathieu Chartier <mathieuc@google.com>
Mon, 6 Apr 2015 17:44:37 +0000 (10:44 -0700)
commitbb87e0f1a52de656bc77cb01cb887e51a0e5198b
tree113f014c6e20fab3e936a3ac05f9f738639541f6
parente57fc0f0260fcb1d08cbb720ec95c04c0f394b91
Refactor and improve GC root handling

Changed GcRoot to use compressed references. Changed root visiting to
use virtual functions instead of function pointers. Changed root visting
interface to be an array of roots instead of a single root at a time.
Added buffered root marking helper to avoid dispatch overhead.

Root marking seems a bit faster on EvaluateAndApplyChanges due to batch
marking. Pause times unaffected.

Mips64 is untested but might work, maybe.

Before:
MarkConcurrentRoots: Sum: 67.678ms 99% C.I. 2us-664.999us Avg: 161.138us Max: 671us

After:
MarkConcurrentRoots: Sum: 54.806ms 99% C.I. 2us-499.986us Avg: 136.333us Max: 602us

Bug: 19264997

Change-Id: I0a71ebb5928f205b9b3f7945b25db6489d5657ca
70 files changed:
runtime/arch/arm64/quick_entrypoints_arm64.S
runtime/arch/mips64/quick_entrypoints_mips64.S
runtime/arch/x86_64/quick_entrypoints_x86_64.S
runtime/asm_support.h
runtime/class_linker.cc
runtime/class_linker.h
runtime/class_linker_test.cc
runtime/debugger.cc
runtime/debugger.h
runtime/gc/collector/concurrent_copying.cc
runtime/gc/collector/concurrent_copying.h
runtime/gc/collector/garbage_collector.h
runtime/gc/collector/mark_compact.cc
runtime/gc/collector/mark_compact.h
runtime/gc/collector/mark_sweep.cc
runtime/gc/collector/mark_sweep.h
runtime/gc/collector/semi_space.cc
runtime/gc/collector/semi_space.h
runtime/gc/heap.cc
runtime/gc_root-inl.h
runtime/gc_root.h
runtime/handle.h
runtime/hprof/hprof.cc
runtime/indirect_reference_table.cc
runtime/indirect_reference_table.h
runtime/instrumentation.cc
runtime/instrumentation.h
runtime/intern_table.cc
runtime/intern_table.h
runtime/java_vm_ext.cc
runtime/java_vm_ext.h
runtime/mirror/array-inl.h
runtime/mirror/array.h
runtime/mirror/art_field.cc
runtime/mirror/art_field.h
runtime/mirror/art_method.cc
runtime/mirror/art_method.h
runtime/mirror/class.cc
runtime/mirror/class.h
runtime/mirror/field.cc
runtime/mirror/field.h
runtime/mirror/object_reference.h
runtime/mirror/reference.cc
runtime/mirror/reference.h
runtime/mirror/stack_trace_element.cc
runtime/mirror/stack_trace_element.h
runtime/mirror/string.cc
runtime/mirror/string.h
runtime/mirror/throwable.cc
runtime/mirror/throwable.h
runtime/native/dalvik_system_VMRuntime.cc
runtime/read_barrier-inl.h
runtime/read_barrier.h
runtime/reference_table.cc
runtime/reference_table.h
runtime/runtime.cc
runtime/runtime.h
runtime/stack.h
runtime/thread.cc
runtime/thread.h
runtime/thread_list.cc
runtime/thread_list.h
runtime/transaction.cc
runtime/transaction.h
runtime/verifier/method_verifier.cc
runtime/verifier/method_verifier.h
runtime/verifier/reg_type.cc
runtime/verifier/reg_type.h
runtime/verifier/reg_type_cache.cc
runtime/verifier/reg_type_cache.h