From af13ad9fd18b6f75fe82e7995224c55654594f93 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Fri, 11 Apr 2014 12:07:48 -0700 Subject: Centralize instruction-set pointer-size, alignment, 64b-width code in instruction_set.h/cc This allows to clean up some places that currently make explicit comparisons. Change-Id: I0dcc924c52fa53306f706aceea93a2d4a655c5df --- compiler/compiled_method.cc | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'compiler/compiled_method.cc') diff --git a/compiler/compiled_method.cc b/compiler/compiled_method.cc index 8e013c1ece..59ed8277d0 100644 --- a/compiler/compiled_method.cc +++ b/compiler/compiled_method.cc @@ -82,21 +82,7 @@ uint32_t CompiledCode::AlignCode(uint32_t offset) const { } uint32_t CompiledCode::AlignCode(uint32_t offset, InstructionSet instruction_set) { - switch (instruction_set) { - case kArm: - case kThumb2: - return RoundUp(offset, kArmAlignment); - case kArm64: - return RoundUp(offset, kArm64Alignment); - case kMips: - return RoundUp(offset, kMipsAlignment); - case kX86: // Fall-through. - case kX86_64: - return RoundUp(offset, kX86Alignment); - default: - LOG(FATAL) << "Unknown InstructionSet: " << instruction_set; - return 0; - } + return RoundUp(offset, GetInstructionSetAlignment(instruction_set)); } size_t CompiledCode::CodeDelta() const { -- cgit v1.2.3-59-g8ed1b