diff options
author | Mathieu Chartier <mathieuc@google.com> | 2015-02-18 14:33:14 -0800 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2015-02-19 09:59:50 -0800 |
commit | b666f4805c8ae707ea6fd7f6c7f375e0b000dba8 (patch) | |
tree | a61439a9bcb555dc575286f3e0bb5e50ce185982 | |
parent | 39109a06015c91188232e59fa9e60e0915d24cd7 (diff) | |
download | art-b666f4805c8ae707ea6fd7f6c7f375e0b000dba8.tar.gz art-b666f4805c8ae707ea6fd7f6c7f375e0b000dba8.tar.bz2 art-b666f4805c8ae707ea6fd7f6c7f375e0b000dba8.zip |
Move arenas into runtime
Moved arena pool into the runtime.
Motivation:
Allow GC to use arena allocators, recycle arena pool for linear alloc.
Bug: 19264997
Change-Id: I8ddbb6d55ee923a980b28fb656c758c5d7697c2f
47 files changed, 81 insertions, 78 deletions
diff --git a/compiler/Android.mk b/compiler/Android.mk index 69b429553..beb34dce3 100644 --- a/compiler/Android.mk +++ b/compiler/Android.mk @@ -119,7 +119,6 @@ LIBART_COMPILER_SRC_FILES := \ optimizing/primitive_type_propagation.cc \ optimizing/reference_type_propagation.cc \ trampolines/trampoline_compiler.cc \ - utils/arena_allocator.cc \ utils/arena_bit_vector.cc \ utils/arm/assembler_arm.cc \ utils/arm/assembler_arm32.cc \ @@ -137,7 +136,6 @@ LIBART_COMPILER_SRC_FILES := \ utils/x86/managed_register_x86.cc \ utils/x86_64/assembler_x86_64.cc \ utils/x86_64/managed_register_x86_64.cc \ - utils/scoped_arena_allocator.cc \ utils/swap_space.cc \ buffered_output_stream.cc \ compiler.cc \ diff --git a/compiler/dex/compiler_ir.h b/compiler/dex/compiler_ir.h index 0c46d4347..dceea240f 100644 --- a/compiler/dex/compiler_ir.h +++ b/compiler/dex/compiler_ir.h @@ -21,11 +21,11 @@ #include <string> #include <vector> +#include "base/arena_allocator.h" +#include "base/scoped_arena_allocator.h" #include "base/timing_logger.h" #include "invoke_type.h" #include "safe_map.h" -#include "utils/arena_allocator.h" -#include "utils/scoped_arena_allocator.h" namespace art { diff --git a/compiler/dex/global_value_numbering.h b/compiler/dex/global_value_numbering.h index c7bca85de..6fa658c0c 100644 --- a/compiler/dex/global_value_numbering.h +++ b/compiler/dex/global_value_numbering.h @@ -17,12 +17,12 @@ #ifndef ART_COMPILER_DEX_GLOBAL_VALUE_NUMBERING_H_ #define ART_COMPILER_DEX_GLOBAL_VALUE_NUMBERING_H_ +#include "base/arena_object.h" #include "base/logging.h" #include "base/macros.h" #include "mir_graph.h" #include "compiler_ir.h" #include "dex_flags.h" -#include "utils/arena_object.h" namespace art { diff --git a/compiler/dex/gvn_dead_code_elimination.h b/compiler/dex/gvn_dead_code_elimination.h index ea28039e4..9a19f2997 100644 --- a/compiler/dex/gvn_dead_code_elimination.h +++ b/compiler/dex/gvn_dead_code_elimination.h @@ -17,9 +17,9 @@ #ifndef ART_COMPILER_DEX_GVN_DEAD_CODE_ELIMINATION_H_ #define ART_COMPILER_DEX_GVN_DEAD_CODE_ELIMINATION_H_ +#include "base/arena_object.h" +#include "base/scoped_arena_containers.h" #include "global_value_numbering.h" -#include "utils/arena_object.h" -#include "utils/scoped_arena_containers.h" namespace art { diff --git a/compiler/dex/local_value_numbering.h b/compiler/dex/local_value_numbering.h index bfacf8ea5..97ea05a91 100644 --- a/compiler/dex/local_value_numbering.h +++ b/compiler/dex/local_value_numbering.h @@ -19,9 +19,9 @@ #include <memory> +#include "base/arena_object.h" #include "base/logging.h" #include "global_value_numbering.h" -#include "utils/arena_object.h" #include "utils/dex_instruction_utils.h" namespace art { diff --git a/compiler/dex/mir_analysis.cc b/compiler/dex/mir_analysis.cc index cc16dc461..31dbc6059 100644 --- a/compiler/dex/mir_analysis.cc +++ b/compiler/dex/mir_analysis.cc @@ -18,6 +18,7 @@ #include <memory> #include "base/logging.h" +#include "base/scoped_arena_containers.h" #include "dataflow_iterator-inl.h" #include "compiler_ir.h" #include "dex_flags.h" @@ -29,7 +30,6 @@ #include "driver/compiler_driver.h" #include "driver/compiler_options.h" #include "driver/dex_compilation_unit.h" -#include "utils/scoped_arena_containers.h" namespace art { diff --git a/compiler/dex/mir_graph.cc b/compiler/dex/mir_graph.cc index 08ca1b288..2afc8c692 100644 --- a/compiler/dex/mir_graph.cc +++ b/compiler/dex/mir_graph.cc @@ -24,6 +24,7 @@ #include "base/logging.h" #include "base/stl_util.h" #include "base/stringprintf.h" +#include "base/scoped_arena_containers.h" #include "compiler_ir.h" #include "dex_file-inl.h" #include "dex_flags.h" @@ -34,7 +35,6 @@ #include "leb128.h" #include "pass_driver_me_post_opt.h" #include "stack.h" -#include "utils/scoped_arena_containers.h" namespace art { diff --git a/compiler/dex/mir_graph.h b/compiler/dex/mir_graph.h index 020136c3d..8e5f6ac90 100644 --- a/compiler/dex/mir_graph.h +++ b/compiler/dex/mir_graph.h @@ -19,17 +19,17 @@ #include <stdint.h> +#include "base/arena_containers.h" +#include "base/scoped_arena_containers.h" #include "dex_file.h" #include "dex_instruction.h" #include "dex_types.h" #include "invoke_type.h" #include "mir_field_info.h" #include "mir_method_info.h" -#include "utils/arena_bit_vector.h" -#include "utils/arena_containers.h" -#include "utils/scoped_arena_containers.h" #include "reg_location.h" #include "reg_storage.h" +#include "utils/arena_bit_vector.h" namespace art { diff --git a/compiler/dex/mir_optimization.cc b/compiler/dex/mir_optimization.cc index 2f547ea45..fd67d4ebe 100644 --- a/compiler/dex/mir_optimization.cc +++ b/compiler/dex/mir_optimization.cc @@ -16,6 +16,7 @@ #include "base/bit_vector-inl.h" #include "base/logging.h" +#include "base/scoped_arena_containers.h" #include "dataflow_iterator-inl.h" #include "dex_flags.h" #include "driver/compiler_driver.h" @@ -27,7 +28,6 @@ #include "quick/dex_file_method_inliner.h" #include "quick/dex_file_to_method_inliner_map.h" #include "stack.h" -#include "utils/scoped_arena_containers.h" namespace art { diff --git a/compiler/dex/quick/arm/codegen_arm.h b/compiler/dex/quick/arm/codegen_arm.h index 025e69f0b..75179bff0 100644 --- a/compiler/dex/quick/arm/codegen_arm.h +++ b/compiler/dex/quick/arm/codegen_arm.h @@ -18,9 +18,9 @@ #define ART_COMPILER_DEX_QUICK_ARM_CODEGEN_ARM_H_ #include "arm_lir.h" +#include "base/arena_containers.h" #include "base/logging.h" #include "dex/quick/mir_to_lir.h" -#include "utils/arena_containers.h" namespace art { diff --git a/compiler/dex/quick/mir_to_lir.h b/compiler/dex/quick/mir_to_lir.h index 88ca91173..8115227c3 100644 --- a/compiler/dex/quick/mir_to_lir.h +++ b/compiler/dex/quick/mir_to_lir.h @@ -17,6 +17,9 @@ #ifndef ART_COMPILER_DEX_QUICK_MIR_TO_LIR_H_ #define ART_COMPILER_DEX_QUICK_MIR_TO_LIR_H_ +#include "base/arena_allocator.h" +#include "base/arena_containers.h" +#include "base/arena_object.h" #include "compiled_method.h" #include "dex/compiler_enums.h" #include "dex/dex_flags.h" @@ -29,9 +32,6 @@ #include "leb128.h" #include "safe_map.h" #include "utils/array_ref.h" -#include "utils/arena_allocator.h" -#include "utils/arena_containers.h" -#include "utils/arena_object.h" #include "utils/stack_checks.h" namespace art { diff --git a/compiler/dex/quick/resource_mask.cc b/compiler/dex/quick/resource_mask.cc index 8a27ecb94..57e8af32a 100644 --- a/compiler/dex/quick/resource_mask.cc +++ b/compiler/dex/quick/resource_mask.cc @@ -18,8 +18,8 @@ #include "resource_mask.h" +#include "base/arena_allocator.h" #include "base/logging.h" -#include "utils/arena_allocator.h" #include "utils.h" namespace art { diff --git a/compiler/dex/ssa_transformation.cc b/compiler/dex/ssa_transformation.cc index fcea77c28..197f66d01 100644 --- a/compiler/dex/ssa_transformation.cc +++ b/compiler/dex/ssa_transformation.cc @@ -16,9 +16,9 @@ #include "base/bit_vector-inl.h" #include "base/logging.h" +#include "base/scoped_arena_containers.h" #include "compiler_ir.h" #include "dataflow_iterator-inl.h" -#include "utils/scoped_arena_containers.h" #define NOTVISITED (-1) diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index 2fca2e52f..b7562442d 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -22,6 +22,7 @@ #include <vector> #include "arch/instruction_set.h" +#include "base/arena_allocator.h" #include "base/mutex.h" #include "base/timing_logger.h" #include "class_reference.h" @@ -38,7 +39,6 @@ #include "runtime.h" #include "safe_map.h" #include "thread_pool.h" -#include "utils/arena_allocator.h" #include "utils/dedupe_set.h" #include "utils/swap_space.h" #include "utils.h" diff --git a/compiler/optimizing/bounds_check_elimination.cc b/compiler/optimizing/bounds_check_elimination.cc index bcee5638f..ae9974d7e 100644 --- a/compiler/optimizing/bounds_check_elimination.cc +++ b/compiler/optimizing/bounds_check_elimination.cc @@ -14,9 +14,9 @@ * limitations under the License. */ +#include "base/arena_containers.h" #include "bounds_check_elimination.h" #include "nodes.h" -#include "utils/arena_containers.h" namespace art { diff --git a/compiler/optimizing/bounds_check_elimination_test.cc b/compiler/optimizing/bounds_check_elimination_test.cc index 662834a91..17cb8f35d 100644 --- a/compiler/optimizing/bounds_check_elimination_test.cc +++ b/compiler/optimizing/bounds_check_elimination_test.cc @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "base/arena_allocator.h" #include "bounds_check_elimination.h" #include "builder.h" #include "gvn.h" @@ -21,7 +22,6 @@ #include "nodes.h" #include "optimizing_unit_test.h" #include "side_effects_analysis.h" -#include "utils/arena_allocator.h" #include "gtest/gtest.h" diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h index c5101363e..3e4a6169d 100644 --- a/compiler/optimizing/builder.h +++ b/compiler/optimizing/builder.h @@ -17,13 +17,13 @@ #ifndef ART_COMPILER_OPTIMIZING_BUILDER_H_ #define ART_COMPILER_OPTIMIZING_BUILDER_H_ +#include "base/arena_object.h" #include "dex_file.h" #include "dex_file-inl.h" #include "driver/compiler_driver.h" #include "driver/dex_compilation_unit.h" #include "optimizing_compiler_stats.h" #include "primitive.h" -#include "utils/arena_object.h" #include "utils/growable_array.h" #include "nodes.h" diff --git a/compiler/optimizing/dominator_test.cc b/compiler/optimizing/dominator_test.cc index b246c6f98..7623e421f 100644 --- a/compiler/optimizing/dominator_test.cc +++ b/compiler/optimizing/dominator_test.cc @@ -14,11 +14,11 @@ * limitations under the License. */ +#include "base/arena_allocator.h" #include "builder.h" #include "dex_instruction.h" #include "nodes.h" #include "optimizing_unit_test.h" -#include "utils/arena_allocator.h" #include "gtest/gtest.h" diff --git a/compiler/optimizing/find_loops_test.cc b/compiler/optimizing/find_loops_test.cc index e05d9b3b0..2bfecc696 100644 --- a/compiler/optimizing/find_loops_test.cc +++ b/compiler/optimizing/find_loops_test.cc @@ -14,13 +14,13 @@ * limitations under the License. */ +#include "base/arena_allocator.h" #include "builder.h" #include "dex_file.h" #include "dex_instruction.h" #include "nodes.h" #include "optimizing_unit_test.h" #include "ssa_liveness_analysis.h" -#include "utils/arena_allocator.h" #include "pretty_printer.h" #include "gtest/gtest.h" diff --git a/compiler/optimizing/graph_test.cc b/compiler/optimizing/graph_test.cc index c59f8366f..4742e4d07 100644 --- a/compiler/optimizing/graph_test.cc +++ b/compiler/optimizing/graph_test.cc @@ -14,12 +14,12 @@ * limitations under the License. */ +#include "base/arena_allocator.h" #include "base/stringprintf.h" #include "builder.h" #include "nodes.h" #include "optimizing_unit_test.h" #include "pretty_printer.h" -#include "utils/arena_allocator.h" #include "gtest/gtest.h" diff --git a/compiler/optimizing/gvn_test.cc b/compiler/optimizing/gvn_test.cc index 4a48fee2f..a81d49aa0 100644 --- a/compiler/optimizing/gvn_test.cc +++ b/compiler/optimizing/gvn_test.cc @@ -14,12 +14,12 @@ * limitations under the License. */ +#include "base/arena_allocator.h" #include "builder.h" #include "gvn.h" #include "nodes.h" #include "optimizing_unit_test.h" #include "side_effects_analysis.h" -#include "utils/arena_allocator.h" #include "gtest/gtest.h" diff --git a/compiler/optimizing/linearize_test.cc b/compiler/optimizing/linearize_test.cc index eb27965c7..f22b7a7e8 100644 --- a/compiler/optimizing/linearize_test.cc +++ b/compiler/optimizing/linearize_test.cc @@ -16,6 +16,7 @@ #include <fstream> +#include "base/arena_allocator.h" #include "base/stringprintf.h" #include "builder.h" #include "code_generator.h" @@ -29,7 +30,6 @@ #include "pretty_printer.h" #include "ssa_builder.h" #include "ssa_liveness_analysis.h" -#include "utils/arena_allocator.h" #include "gtest/gtest.h" diff --git a/compiler/optimizing/live_interval_test.cc b/compiler/optimizing/live_interval_test.cc index ac8759c80..28000c18f 100644 --- a/compiler/optimizing/live_interval_test.cc +++ b/compiler/optimizing/live_interval_test.cc @@ -14,9 +14,9 @@ * limitations under the License. */ +#include "base/arena_allocator.h" #include "optimizing_unit_test.h" #include "ssa_liveness_analysis.h" -#include "utils/arena_allocator.h" #include "gtest/gtest.h" diff --git a/compiler/optimizing/live_ranges_test.cc b/compiler/optimizing/live_ranges_test.cc index 0558b85b4..17914e820 100644 --- a/compiler/optimizing/live_ranges_test.cc +++ b/compiler/optimizing/live_ranges_test.cc @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "base/arena_allocator.h" #include "builder.h" #include "code_generator.h" #include "code_generator_x86.h" @@ -24,7 +25,6 @@ #include "optimizing_unit_test.h" #include "prepare_for_register_allocation.h" #include "ssa_liveness_analysis.h" -#include "utils/arena_allocator.h" #include "gtest/gtest.h" diff --git a/compiler/optimizing/liveness_test.cc b/compiler/optimizing/liveness_test.cc index c9be570c7..907eff162 100644 --- a/compiler/optimizing/liveness_test.cc +++ b/compiler/optimizing/liveness_test.cc @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "base/arena_allocator.h" #include "builder.h" #include "code_generator.h" #include "code_generator_x86.h" @@ -24,7 +25,6 @@ #include "optimizing_unit_test.h" #include "prepare_for_register_allocation.h" #include "ssa_liveness_analysis.h" -#include "utils/arena_allocator.h" #include "gtest/gtest.h" diff --git a/compiler/optimizing/locations.h b/compiler/optimizing/locations.h index ebca1cc4d..198cc15cc 100644 --- a/compiler/optimizing/locations.h +++ b/compiler/optimizing/locations.h @@ -17,10 +17,10 @@ #ifndef ART_COMPILER_OPTIMIZING_LOCATIONS_H_ #define ART_COMPILER_OPTIMIZING_LOCATIONS_H_ +#include "base/arena_object.h" #include "base/bit_field.h" #include "base/bit_vector.h" #include "base/value_object.h" -#include "utils/arena_object.h" #include "utils/growable_array.h" namespace art { diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index cebde3bb5..c221404f3 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -17,12 +17,12 @@ #ifndef ART_COMPILER_OPTIMIZING_NODES_H_ #define ART_COMPILER_OPTIMIZING_NODES_H_ +#include "base/arena_object.h" #include "entrypoints/quick/quick_entrypoints_enum.h" #include "invoke_type.h" #include "locations.h" #include "offsets.h" #include "primitive.h" -#include "utils/arena_object.h" #include "utils/arena_bit_vector.h" #include "utils/growable_array.h" diff --git a/compiler/optimizing/nodes_test.cc b/compiler/optimizing/nodes_test.cc index 5dbdc7492..4cf22d3b2 100644 --- a/compiler/optimizing/nodes_test.cc +++ b/compiler/optimizing/nodes_test.cc @@ -14,8 +14,8 @@ * limitations under the License. */ +#include "base/arena_allocator.h" #include "nodes.h" -#include "utils/arena_allocator.h" #include "gtest/gtest.h" diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 0ece77d2d..080d6e01a 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -19,6 +19,7 @@ #include <fstream> #include <stdint.h> +#include "base/arena_allocator.h" #include "base/dumpable.h" #include "base/timing_logger.h" #include "bounds_check_elimination.h" @@ -47,7 +48,6 @@ #include "ssa_phi_elimination.h" #include "ssa_liveness_analysis.h" #include "reference_type_propagation.h" -#include "utils/arena_allocator.h" namespace art { diff --git a/compiler/optimizing/parallel_move_test.cc b/compiler/optimizing/parallel_move_test.cc index bb7541d99..44a3da281 100644 --- a/compiler/optimizing/parallel_move_test.cc +++ b/compiler/optimizing/parallel_move_test.cc @@ -14,9 +14,9 @@ * limitations under the License. */ +#include "base/arena_allocator.h" #include "nodes.h" #include "parallel_move_resolver.h" -#include "utils/arena_allocator.h" #include "gtest/gtest.h" diff --git a/compiler/optimizing/pretty_printer_test.cc b/compiler/optimizing/pretty_printer_test.cc index 9cf8235d8..293fde978 100644 --- a/compiler/optimizing/pretty_printer_test.cc +++ b/compiler/optimizing/pretty_printer_test.cc @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "base/arena_allocator.h" #include "base/stringprintf.h" #include "builder.h" #include "dex_file.h" @@ -21,7 +22,6 @@ #include "nodes.h" #include "optimizing_unit_test.h" #include "pretty_printer.h" -#include "utils/arena_allocator.h" #include "gtest/gtest.h" diff --git a/compiler/optimizing/register_allocator_test.cc b/compiler/optimizing/register_allocator_test.cc index 0cc00c0fd..e5d06a9f8 100644 --- a/compiler/optimizing/register_allocator_test.cc +++ b/compiler/optimizing/register_allocator_test.cc @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "base/arena_allocator.h" #include "builder.h" #include "code_generator.h" #include "code_generator_x86.h" @@ -25,7 +26,6 @@ #include "register_allocator.h" #include "ssa_liveness_analysis.h" #include "ssa_phi_elimination.h" -#include "utils/arena_allocator.h" #include "gtest/gtest.h" diff --git a/compiler/optimizing/ssa_test.cc b/compiler/optimizing/ssa_test.cc index 7e90b37fe..7fc1ec6dd 100644 --- a/compiler/optimizing/ssa_test.cc +++ b/compiler/optimizing/ssa_test.cc @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "base/arena_allocator.h" #include "base/stringprintf.h" #include "builder.h" #include "dex_file.h" @@ -22,7 +23,6 @@ #include "optimizing_unit_test.h" #include "pretty_printer.h" #include "ssa_builder.h" -#include "utils/arena_allocator.h" #include "gtest/gtest.h" diff --git a/compiler/utils/arena_allocator_test.cc b/compiler/utils/arena_allocator_test.cc index 71565407a..706552739 100644 --- a/compiler/utils/arena_allocator_test.cc +++ b/compiler/utils/arena_allocator_test.cc @@ -14,8 +14,8 @@ * limitations under the License. */ +#include "base/arena_allocator.h" #include "gtest/gtest.h" -#include "utils/arena_allocator.h" #include "utils/arena_bit_vector.h" namespace art { diff --git a/compiler/utils/arena_bit_vector.cc b/compiler/utils/arena_bit_vector.cc index f17e5a92a..ddc0c818c 100644 --- a/compiler/utils/arena_bit_vector.cc +++ b/compiler/utils/arena_bit_vector.cc @@ -14,9 +14,10 @@ * limitations under the License. */ -#include "arena_allocator.h" #include "arena_bit_vector.h" +#include "base/arena_allocator.h" + namespace art { template <typename ArenaAlloc> diff --git a/compiler/utils/arena_bit_vector.h b/compiler/utils/arena_bit_vector.h index e5e1b709e..f2a74527d 100644 --- a/compiler/utils/arena_bit_vector.h +++ b/compiler/utils/arena_bit_vector.h @@ -17,7 +17,7 @@ #ifndef ART_COMPILER_UTILS_ARENA_BIT_VECTOR_H_ #define ART_COMPILER_UTILS_ARENA_BIT_VECTOR_H_ -#include "arena_object.h" +#include "base/arena_object.h" #include "base/bit_vector.h" namespace art { diff --git a/compiler/utils/growable_array.h b/compiler/utils/growable_array.h index fd43ea6e2..821e28b4a 100644 --- a/compiler/utils/growable_array.h +++ b/compiler/utils/growable_array.h @@ -20,7 +20,7 @@ #include <stdint.h> #include <stddef.h> -#include "arena_object.h" +#include "base/arena_object.h" namespace art { diff --git a/compiler/utils/swap_space.h b/compiler/utils/swap_space.h index 2d0d77af7..1f8f5da6c 100644 --- a/compiler/utils/swap_space.h +++ b/compiler/utils/swap_space.h @@ -23,12 +23,12 @@ #include <stdint.h> #include <stddef.h> +#include "base/debug_stack.h" #include "base/logging.h" #include "base/macros.h" #include "base/mutex.h" #include "mem_map.h" #include "utils.h" -#include "utils/debug_stack.h" namespace art { diff --git a/runtime/Android.mk b/runtime/Android.mk index 4714610da..c647cc2a3 100644 --- a/runtime/Android.mk +++ b/runtime/Android.mk @@ -22,10 +22,12 @@ LIBART_COMMON_SRC_FILES := \ atomic.cc.arm \ barrier.cc \ base/allocator.cc \ + base/arena_allocator.cc \ base/bit_vector.cc \ base/hex_dump.cc \ base/logging.cc \ base/mutex.cc \ + base/scoped_arena_allocator.cc \ base/scoped_flock.cc \ base/stringpiece.cc \ base/stringprintf.cc \ diff --git a/compiler/utils/arena_allocator.cc b/runtime/base/arena_allocator.cc index a80ad938a..b3f812e5e 100644 --- a/compiler/utils/arena_allocator.cc +++ b/runtime/base/arena_allocator.cc @@ -19,8 +19,8 @@ #include <numeric> #include "arena_allocator.h" -#include "base/logging.h" -#include "base/mutex.h" +#include "logging.h" +#include "mutex.h" #include "thread-inl.h" #include <memcheck/memcheck.h> diff --git a/compiler/utils/arena_allocator.h b/runtime/base/arena_allocator.h index e730fd798..92373919d 100644 --- a/compiler/utils/arena_allocator.h +++ b/runtime/base/arena_allocator.h @@ -14,17 +14,17 @@ * limitations under the License. */ -#ifndef ART_COMPILER_UTILS_ARENA_ALLOCATOR_H_ -#define ART_COMPILER_UTILS_ARENA_ALLOCATOR_H_ +#ifndef ART_RUNTIME_BASE_ARENA_ALLOCATOR_H_ +#define ART_RUNTIME_BASE_ARENA_ALLOCATOR_H_ #include <stdint.h> #include <stddef.h> -#include "base/macros.h" -#include "base/mutex.h" +#include "debug_stack.h" +#include "macros.h" #include "mem_map.h" +#include "mutex.h" #include "utils.h" -#include "utils/debug_stack.h" namespace art { @@ -180,7 +180,7 @@ class ArenaAllocator : private DebugStackRefCounter, private ArenaAllocatorStats if (UNLIKELY(running_on_valgrind_)) { return AllocValgrind(bytes, kind); } - bytes = RoundUp(bytes, 8); + bytes = RoundUp(bytes, kAlignment); if (UNLIKELY(ptr_ + bytes > end_)) { // Obtain a new block. ObtainNewArenaForAllocation(bytes); @@ -205,6 +205,8 @@ class ArenaAllocator : private DebugStackRefCounter, private ArenaAllocatorStats MemStats GetMemStats() const; private: + static constexpr size_t kAlignment = 8; + void UpdateBytesAllocated(); ArenaPool* pool_; @@ -235,4 +237,4 @@ class MemStats { } // namespace art -#endif // ART_COMPILER_UTILS_ARENA_ALLOCATOR_H_ +#endif // ART_RUNTIME_BASE_ARENA_ALLOCATOR_H_ diff --git a/compiler/utils/arena_containers.h b/runtime/base/arena_containers.h index a7a743884..162eb16d4 100644 --- a/compiler/utils/arena_containers.h +++ b/runtime/base/arena_containers.h @@ -14,15 +14,15 @@ * limitations under the License. */ -#ifndef ART_COMPILER_UTILS_ARENA_CONTAINERS_H_ -#define ART_COMPILER_UTILS_ARENA_CONTAINERS_H_ +#ifndef ART_RUNTIME_BASE_ARENA_CONTAINERS_H_ +#define ART_RUNTIME_BASE_ARENA_CONTAINERS_H_ #include <deque> #include <queue> #include <set> #include <vector> -#include "utils/arena_allocator.h" +#include "arena_allocator.h" #include "safe_map.h" namespace art { @@ -203,4 +203,4 @@ inline ArenaAllocatorAdapter<void> ArenaAllocator::Adapter(ArenaAllocKind kind) } // namespace art -#endif // ART_COMPILER_UTILS_ARENA_CONTAINERS_H_ +#endif // ART_RUNTIME_BASE_ARENA_CONTAINERS_H_ diff --git a/compiler/utils/arena_object.h b/runtime/base/arena_object.h index d64c41995..ab97d0cb6 100644 --- a/compiler/utils/arena_object.h +++ b/runtime/base/arena_object.h @@ -14,10 +14,10 @@ * limitations under the License. */ -#ifndef ART_COMPILER_UTILS_ARENA_OBJECT_H_ -#define ART_COMPILER_UTILS_ARENA_OBJECT_H_ +#ifndef ART_RUNTIME_BASE_ARENA_OBJECT_H_ +#define ART_RUNTIME_BASE_ARENA_OBJECT_H_ -#include "arena_allocator.h" +#include "base/arena_allocator.h" #include "base/logging.h" #include "scoped_arena_allocator.h" @@ -64,4 +64,4 @@ class DeletableArenaObject { } // namespace art -#endif // ART_COMPILER_UTILS_ARENA_OBJECT_H_ +#endif // ART_RUNTIME_BASE_ARENA_OBJECT_H_ diff --git a/compiler/utils/debug_stack.h b/runtime/base/debug_stack.h index 1bb062418..03f457534 100644 --- a/compiler/utils/debug_stack.h +++ b/runtime/base/debug_stack.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ART_COMPILER_UTILS_DEBUG_STACK_H_ -#define ART_COMPILER_UTILS_DEBUG_STACK_H_ +#ifndef ART_RUNTIME_BASE_DEBUG_STACK_H_ +#define ART_RUNTIME_BASE_DEBUG_STACK_H_ #include "base/logging.h" #include "base/macros.h" @@ -135,4 +135,4 @@ class DebugStackIndirectTopRefImpl { } // namespace art -#endif // ART_COMPILER_UTILS_DEBUG_STACK_H_ +#endif // ART_RUNTIME_BASE_DEBUG_STACK_H_ diff --git a/compiler/utils/scoped_arena_allocator.cc b/runtime/base/scoped_arena_allocator.cc index d9e0619de..4a7be384b 100644 --- a/compiler/utils/scoped_arena_allocator.cc +++ b/runtime/base/scoped_arena_allocator.cc @@ -16,7 +16,7 @@ #include "scoped_arena_allocator.h" -#include "utils/arena_allocator.h" +#include "arena_allocator.h" #include <memcheck/memcheck.h> namespace art { diff --git a/compiler/utils/scoped_arena_allocator.h b/runtime/base/scoped_arena_allocator.h index c46acbcef..bbedeac3b 100644 --- a/compiler/utils/scoped_arena_allocator.h +++ b/runtime/base/scoped_arena_allocator.h @@ -14,14 +14,14 @@ * limitations under the License. */ -#ifndef ART_COMPILER_UTILS_SCOPED_ARENA_ALLOCATOR_H_ -#define ART_COMPILER_UTILS_SCOPED_ARENA_ALLOCATOR_H_ +#ifndef ART_RUNTIME_BASE_SCOPED_ARENA_ALLOCATOR_H_ +#define ART_RUNTIME_BASE_SCOPED_ARENA_ALLOCATOR_H_ -#include "base/logging.h" -#include "base/macros.h" -#include "utils/arena_allocator.h" -#include "utils/debug_stack.h" +#include "arena_allocator.h" +#include "debug_stack.h" #include "globals.h" +#include "logging.h" +#include "macros.h" namespace art { @@ -147,4 +147,4 @@ class ScopedArenaAllocator } // namespace art -#endif // ART_COMPILER_UTILS_SCOPED_ARENA_ALLOCATOR_H_ +#endif // ART_RUNTIME_BASE_SCOPED_ARENA_ALLOCATOR_H_ diff --git a/compiler/utils/scoped_arena_containers.h b/runtime/base/scoped_arena_containers.h index df93b273d..664a909e5 100644 --- a/compiler/utils/scoped_arena_containers.h +++ b/runtime/base/scoped_arena_containers.h @@ -14,16 +14,16 @@ * limitations under the License. */ -#ifndef ART_COMPILER_UTILS_SCOPED_ARENA_CONTAINERS_H_ -#define ART_COMPILER_UTILS_SCOPED_ARENA_CONTAINERS_H_ +#ifndef ART_RUNTIME_BASE_SCOPED_ARENA_CONTAINERS_H_ +#define ART_RUNTIME_BASE_SCOPED_ARENA_CONTAINERS_H_ #include <deque> #include <queue> #include <set> #include <vector> -#include "utils/arena_containers.h" // For ArenaAllocatorAdapterKind. -#include "utils/scoped_arena_allocator.h" +#include "arena_containers.h" // For ArenaAllocatorAdapterKind. +#include "scoped_arena_allocator.h" #include "safe_map.h" namespace art { @@ -190,4 +190,4 @@ inline ScopedArenaAllocatorAdapter<void> ScopedArenaAllocator::Adapter(ArenaAllo } // namespace art -#endif // ART_COMPILER_UTILS_SCOPED_ARENA_CONTAINERS_H_ +#endif // ART_RUNTIME_BASE_SCOPED_ARENA_CONTAINERS_H_ |