OSDN Git Service

ART: Clean up arm64 kNumberOfXRegisters usage.
authorVladimir Marko <vmarko@google.com>
Tue, 19 May 2015 17:08:00 +0000 (18:08 +0100)
committerVladimir Marko <vmarko@google.com>
Tue, 26 May 2015 18:33:33 +0000 (19:33 +0100)
commit41b175aba41c9365a1c53b8a1afbd17129c87c14
tree5c82606d39543fb932ddc0674694fc0758b1a866
parent54d65738eecc1fa79ed528ff2f6b9b4f7a4743be
ART: Clean up arm64 kNumberOfXRegisters usage.

Avoid undefined behavior for arm64 stemming from 1u << 32 in
loops with upper bound kNumberOfXRegisters.

Create iterators for enumerating bits in an integer either
from high to low or from low to high and use them for
<arch>Context::FillCalleeSaves() on all architectures.

Refactor runtime/utils.{h,cc} by moving all bit-fiddling
functions to runtime/base/bit_utils.{h,cc} (together with
the new bit iterators) and all time-related functions to
runtime/base/time_utils.{h,cc}. Improve test coverage and
fix some corner cases for the bit-fiddling functions.

Bug: 13925192

(cherry picked from commit 80afd02024d20e60b197d3adfbb43cc303cf29e0)

Change-Id: I905257a21de90b5860ebe1e39563758f721eab82
161 files changed:
build/Android.gtest.mk
cmdline/cmdline_parser.h
cmdline/cmdline_types.h
cmdline/memory_representation.h
compiler/compiled_method.h
compiler/compiler.cc
compiler/dex/compiler_ir.cc
compiler/dex/compiler_ir.h
compiler/dex/local_value_numbering.cc
compiler/dex/local_value_numbering.h
compiler/dex/mir_analysis.cc
compiler/dex/mir_graph.cc
compiler/dex/mir_graph.h
compiler/dex/mir_optimization.cc
compiler/dex/quick/arm/call_arm.cc
compiler/dex/quick/arm/int_arm.cc
compiler/dex/quick/arm64/fp_arm64.cc
compiler/dex/quick/arm64/int_arm64.cc
compiler/dex/quick/gen_common.cc
compiler/dex/quick/mir_to_lir-inl.h
compiler/dex/quick/mir_to_lir.h
compiler/dex/quick/resource_mask.cc
compiler/dex/quick/x86/assemble_x86.cc
compiler/dex/quick/x86/int_x86.cc
compiler/dex/type_inference.cc
compiler/dex/type_inference.h
compiler/driver/compiler_driver.cc
compiler/driver/compiler_driver.h
compiler/dwarf/debug_frame_opcode_writer.h
compiler/dwarf/dwarf_test.h
compiler/dwarf/writer.h
compiler/elf_builder.h
compiler/elf_writer_debug.cc
compiler/gc_map_builder.h
compiler/image_writer.h
compiler/jit/jit_compiler.cc
compiler/jni/quick/arm64/calling_convention_arm64.cc
compiler/jni/quick/calling_convention.cc
compiler/jni/quick/x86/calling_convention_x86.cc
compiler/jni/quick/x86_64/calling_convention_x86_64.cc
compiler/optimizing/code_generator_arm.cc
compiler/optimizing/intrinsics.cc
compiler/optimizing/nodes.cc
compiler/optimizing/parallel_move_resolver.h
compiler/optimizing/register_allocator.h
compiler/utils/arm/assembler_arm.cc
compiler/utils/arm/assembler_arm.h
compiler/utils/arm/assembler_arm32.cc
compiler/utils/arm/assembler_arm32.h
compiler/utils/arm/assembler_thumb2.cc
compiler/utils/arm/assembler_thumb2.h
compiler/utils/arm64/assembler_arm64.cc
compiler/utils/arm64/assembler_arm64.h
compiler/utils/arm64/managed_register_arm64.h
compiler/utils/assembler_test_base.h
compiler/utils/dedupe_set.h
compiler/utils/dex_cache_arrays_layout-inl.h
compiler/utils/mips/assembler_mips.cc
compiler/utils/mips/assembler_mips.h
compiler/utils/mips64/assembler_mips64.cc
compiler/utils/mips64/assembler_mips64.h
compiler/utils/swap_space.h
compiler/utils/test_dex_file_builder.h
compiler/utils/test_dex_file_builder_test.cc
compiler/utils/x86/assembler_x86.h
compiler/utils/x86_64/assembler_x86_64.h
compiler/utils/x86_64/assembler_x86_64_test.cc
dex2oat/dex2oat.cc
patchoat/patchoat.h
runtime/Android.mk
runtime/arch/arm/context_arm.cc
runtime/arch/arm/quick_method_frame_info_arm.h
runtime/arch/arm64/context_arm64.cc
runtime/arch/arm64/quick_method_frame_info_arm64.h
runtime/arch/mips/context_mips.cc
runtime/arch/mips/quick_method_frame_info_mips.h
runtime/arch/mips64/context_mips64.cc
runtime/arch/mips64/quick_method_frame_info_mips64.h
runtime/arch/x86/context_x86.cc
runtime/arch/x86/quick_method_frame_info_x86.h
runtime/arch/x86_64/context_x86_64.cc
runtime/arch/x86_64/quick_method_frame_info_x86_64.h
runtime/barrier.cc
runtime/base/arena_allocator.h
runtime/base/bit_utils.h [new file with mode: 0644]
runtime/base/bit_utils_test.cc [new file with mode: 0644]
runtime/base/bit_vector-inl.h
runtime/base/bit_vector.h
runtime/base/bounded_fifo.h
runtime/base/histogram-inl.h
runtime/base/histogram.h
runtime/base/iteration_range.h [new file with mode: 0644]
runtime/base/mutex-inl.h
runtime/base/mutex.cc
runtime/base/time_utils.cc [new file with mode: 0644]
runtime/base/time_utils.h [new file with mode: 0644]
runtime/base/time_utils_test.cc [new file with mode: 0644]
runtime/base/timing_logger.cc
runtime/class_linker.cc
runtime/debugger.cc
runtime/dex_file-inl.h
runtime/gc/accounting/atomic_stack.h
runtime/gc/accounting/bitmap-inl.h
runtime/gc/accounting/bitmap.cc
runtime/gc/accounting/card_table-inl.h
runtime/gc/accounting/read_barrier_table.h
runtime/gc/accounting/space_bitmap-inl.h
runtime/gc/allocator/dlmalloc.cc
runtime/gc/allocator/rosalloc.h
runtime/gc/collector/garbage_collector.cc
runtime/gc/collector/mark_sweep.cc
runtime/gc/heap-inl.h
runtime/gc/heap.cc
runtime/gc/heap.h
runtime/gc/reference_processor.cc
runtime/gc/space/bump_pointer_space-inl.h
runtime/gc/space/dlmalloc_space.cc
runtime/gc/space/image_space.cc
runtime/gc/space/large_object_space.cc
runtime/gc/space/large_object_space_test.cc
runtime/gc/space/rosalloc_space.cc
runtime/gc/task_processor.cc
runtime/gc/task_processor_test.cc
runtime/handle_scope.h
runtime/hprof/hprof.cc
runtime/image.cc
runtime/image.h
runtime/jdwp/jdwp_handler.cc
runtime/jdwp/jdwp_main.cc
runtime/jit/jit.h
runtime/jit/jit_code_cache_test.cc
runtime/leb128.h
runtime/leb128_test.cc
runtime/lock_word.h
runtime/memory_region.h
runtime/mirror/array-inl.h
runtime/mirror/art_method-inl.h
runtime/mirror/class-inl.h
runtime/mirror/class.h
runtime/mirror/object_array-inl.h
runtime/mirror/string-inl.h
runtime/monitor.cc
runtime/monitor_test.cc
runtime/native/dalvik_system_VMDebug.cc
runtime/native/java_lang_reflect_Field.cc
runtime/oat.cc
runtime/profiler.cc
runtime/read_barrier-inl.h
runtime/signal_catcher.cc
runtime/stack.h
runtime/stack_map.h
runtime/thread.cc
runtime/thread.h
runtime/thread_linux.cc
runtime/thread_list.cc
runtime/thread_pool.cc
runtime/trace.cc
runtime/utils.cc
runtime/utils.h
runtime/utils_test.cc
runtime/verifier/method_verifier.cc