From a5b09a67034e57a6e10231dd4bd92f4cb50b824c Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Thu, 17 Nov 2016 15:21:22 -0800 Subject: ART: Add dex::TypeIndex Add abstraction for uint16_t type index. Test: m test-art-host Change-Id: I47708741c7c579cbbe59ab723c1e31c5fe71f83a --- compiler/optimizing/instruction_builder.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'compiler/optimizing/instruction_builder.h') diff --git a/compiler/optimizing/instruction_builder.h b/compiler/optimizing/instruction_builder.h index aa34ddd1d1..f29e522040 100644 --- a/compiler/optimizing/instruction_builder.h +++ b/compiler/optimizing/instruction_builder.h @@ -20,6 +20,7 @@ #include "base/arena_containers.h" #include "base/arena_object.h" #include "block_builder.h" +#include "dex_file_types.h" #include "driver/compiler_driver.h" #include "driver/compiler_driver-inl.h" #include "driver/dex_compilation_unit.h" @@ -100,11 +101,11 @@ class HInstructionBuilder : public ValueObject { // Returns whether the current method needs access check for the type. // Output parameter finalizable is set to whether the type is finalizable. - bool NeedsAccessCheck(uint32_t type_index, + bool NeedsAccessCheck(dex::TypeIndex type_index, Handle dex_cache, /*out*/bool* finalizable) const REQUIRES_SHARED(Locks::mutator_lock_); - bool NeedsAccessCheck(uint32_t type_index, /*out*/bool* finalizable) const; + bool NeedsAccessCheck(dex::TypeIndex type_index, /*out*/bool* finalizable) const; template void Unop_12x(const Instruction& instruction, Primitive::Type type, uint32_t dex_pc); @@ -176,7 +177,7 @@ class HInstructionBuilder : public ValueObject { // Builds a new array node and the instructions that fill it. void BuildFilledNewArray(uint32_t dex_pc, - uint32_t type_index, + dex::TypeIndex type_index, uint32_t number_of_vreg_arguments, bool is_range, uint32_t* args, @@ -205,7 +206,7 @@ class HInstructionBuilder : public ValueObject { void BuildTypeCheck(const Instruction& instruction, uint8_t destination, uint8_t reference, - uint16_t type_index, + dex::TypeIndex type_index, uint32_t dex_pc); // Builds an instruction sequence for a switch statement. @@ -218,7 +219,7 @@ class HInstructionBuilder : public ValueObject { mirror::Class* GetCompilingClass() const; // Returns whether `type_index` points to the outer-most compiling method's class. - bool IsOutermostCompilingClass(uint16_t type_index) const; + bool IsOutermostCompilingClass(dex::TypeIndex type_index) const; void PotentiallySimplifyFakeString(uint16_t original_dex_register, uint32_t dex_pc, @@ -258,7 +259,7 @@ class HInstructionBuilder : public ValueObject { REQUIRES_SHARED(Locks::mutator_lock_); // Build a HNewInstance instruction. - bool BuildNewInstance(uint16_t type_index, uint32_t dex_pc); + bool BuildNewInstance(dex::TypeIndex type_index, uint32_t dex_pc); // Return whether the compiler can assume `cls` is initialized. bool IsInitialized(Handle cls) const -- cgit v1.2.3-59-g8ed1b